Jump to content

[1$]To someone that will adapt a code from an imagehost to another[1$]


Recommended Posts

Posted

Alright, i was using an image host script but i found a better one which is more reliable and faster, also doesnt have a ton of shit code which slows down all the images and the site streaming.

 

The cons of the new script is that it doesnt have a function from the old one; it had an image shortener link since you upload the image.

 

For example when you were uploading a new image you get this link even when the images were uploaded in a folder(PS: Even without the .png/jpg or whatever format it could still be shown in html and bbcode tags) :

http://yoursite.com/?di=1013081552314

 

and the new one is:

http://yoursite.com/image/imagename.png

 

I want someone to adapt the code from the old to the new, or to create a new one for me. And because coders doesn't discriminate, i've added a small price as gift to the coder, its 5 minutes job for a good coder so its 1$ free :3

Else, if you dont want the 1$ i can give ya +1 karma. Simple and plain.

The money will be paid in paypal only.

Regards.

Posted

so you want to change

http://yoursite.com/?di=1013081552314

to

http://yoursite.com/image/imagename.png

 

if so,

 

i dont think its a good practise because others can upload an image with the same name so which one you will be serving to each one?

 

i would go with http://domain.com/images/image_id/image_name

 

if you wanna do it as this, reply and ill code it as soon as possible.

Posted

so you want to change

http://yoursite.com/?di=1013081552314

to

http://yoursite.com/image/imagename.png

 

if so,

 

i dont think its a good practise because others can upload an image with the same name so which one you will be serving to each one?

 

i would go with http://domain.com/images/image_id/image_name

 

if you wanna do it as this, reply and ill code it as soon as possible.

no, i want the opposite. My image host is supposed to have small links, the first one was calculated with MD5 hash, i really wanted a smaller link :)
Posted

so you have image/imagename.png and want it to go to ?id=image_id?

Posted

so you have image/imagename.png and want it to go to ?id=image_id?

yeah, and generate a small code so the links will be short. But i want em to work in bbcode and html tags.

 

I was using another premium script in the past, i can give you both scripts to check them and if you can make it working i'll give you access on my ftp to do it or via teamviewer.

Posted

yeah, and generate a small code so the links will be short. But i want em to work in bbcode and html tags.

 

I was using another premium script in the past, i can give you both scripts to check them and if you can make it working i'll give you access on my ftp to do it or via teamviewer.

 

if your link is for example

domain.com/image/imagename.jpg

 

you can change it to domain.com/?id=image_id

 

image_id can be the ID that you have assigned into your database as imagename.jpg

 

you have to show us your code in order to change it.

Posted

if your link is for example

domain.com/image/imagename.jpg

 

you can change it to domain.com/?id=image_id

 

image_id can be the ID that you have assigned into your database as imagename.jpg

 

you have to show us your code in order to change it.

Can you pm me to do it? ;D

It would be really helpful.

Posted

I dont see why not to post here, since its a script not made by you.

Posted

http://chevereto.googlecode.com/files/chevereto_nb1.91.zip

 

If you manage to do it then tell me your changes cause my script is changed simultaneous times and if i replace any file it will ruin all my work ;D

Posted

as i can see from the code which in no way well documented... this script does not store your images in your database so you dont have any ID atm for any image uploaded via this script.

 

So what i would suggest is on file upload connect to your database and store an ID with its filename in a table.

 

Then when a user goes to ?id=image_id you will check against the db and show if there is any image with this ID

 

--------------------------------------

 

So this is how you do it:

 

create a table called images with 3 fields(if you want to track your users you can add other aswell which i dont cover here)

-id INT 11 primary auto increment

-image_id INT 11

-image_name TEXT

 

then

 

search for

 

$URLvim = URL_SCRIPT.'?v='.$name;

and replace with

 

$URLvim = URL_SCRIPT.'?id='.$image_id;

 

search for

 

} // La funcion

 

and add after it

 

			//check if the image id exists
		$img_id = rand(1000000000, 9999999999);
		$flag = FALSE;
		while ($flag==FALSE){
			$query = mysql_query("SELECT * FROM images WHERE image_id='$img_id'");
			$rows = mysql_num_rows($query);
			if ($rows==0){
				$flag = TRUE;
			}else{
				$img_id = $userf->rand(1000000000, 9999999999);
				$flag = FALSE;
			}
		}
		if ($flag == true){
			mysql_query("INSERT INTO images VALUES ('', '$img_id', '$name')");
$image_id = $img_id;		}

 

search for

if ($_GET['v']) {

 

and replace with

 

if ($_GET['id']) {

 

below this line change

 

$id = $_GET['v'];

 

to

 

$id = $_GET['id'];

 

search for

 

$v = $_GET['v'];  if ($v=='.htaccess') { unset($v); $v=''; }

 

and change it to

 

$v = $_GET['id'];  if ($v=='.htaccess') { unset($v); $v=''; }

 

 

search for

 

if (file_exists($imagen)==true) {

 

till else last bracket and comment the whole if...else... clause

 

and add after

		//check if ID exists in DB and if it exsits get the name and continue
		$query = mysql_query("SELECT * FROM images WHERE image_id='$id'");
		if (mysql_num_rows($query)){ //image exist
			$rows = mysql_fetch_array($query);
			$image_id = $rows["image_id"];
			$image_name = $rows["image_name"];
			$imagen = DIR_IM.$image_name;
			$name = $image_name;
			$titulo = SEEING.' '.$id.' '.AT.' ';
			$info = getimagesize($imagen); //Obtenemos la informacion
			$statinfo = @stat($imagen);
			$ancho = $info[0];
			$alto = $info[1];	
			$mime = $info['mime']; 
			$tamano = $statinfo['size']; //Bytes
			$tamano_kb = round($tamano*0.0009765625, 2);
			$canales = $info['channels'];
		}else{
			unset($modo);
			$modo = 1;
			$spit = true;
			$errormsg = NOT_EXISTS;
			$titulo = NOT_EXISTS_TITLE.ESP_TITULO;
		}

 

 

 

or if you cant make it... send me your engine.php file

Posted

Wouldn't it just be easier + less code to just have it rename the file depending on the time it was uploaded? or even better, have it name the file depending on a random length string. Or you could always just have the user input the name they want.

Posted

fdlp did it but my server at before had a software crash and I was trying to restore my files with rescue mode with no success.. so, no reason for this topic to be on since I've lost my files And im open up to new suggestions for my site..

Guest
This topic is now closed to further replies.


  • Posts

    • L2 DEVS - HTML DESIGN (ALL NPC'S)    
    • I only share for free what they are reselling 🙂 You keep crying in all the publications, and if you are looking for h5 or gd wait for 5 or 6 years... cheers.... GENERAL Cached Extended to 8192kb IOBuffer Hair2SlotCache ItemBidAuctioner Clan Hall Current Olympiad Season Rank pages System (Shows Points/Games - Fully Configurable) Automatic Flag Around Raidboss System Offline Shop & Buffers Restore After Restart (Fixed location) Offline Buffer System PvP Auto Announce System Rebuilt with Extra Addons (Fully Configurable, Name, Zones, Rewards) Automatic Announce System Rebuilt with Extra Addons (Fully Configurable) ALT+B Augmentation House Shift+Click Droplist/Spoil List Epic Items Rank RB points Rank ChangeColorName ChangeColorTitle Change Skin (Race) Change Gender Custom Subclass (Acumulative) Achievements Item Delivery System  Augmentations/Enchants Automatic Announce System Auto Learn Skills PvP Reward Pk Reward War Reward Scheme buffer GlobalChatTrade Trade Augment Items Castle Announce Time Castle Standby Time Fix Spiritshots delay SpellbooksDrop Enable/Disable Drop custom Fully configurable, lvl min max allmobs, allrb, individual New cancel effect min,max BlessedarmorEnchantRate BlessedmagicWeaponEnchantRate BlessednormalWeaponEnchantRate MaxSlosChars MaxSlotsDwarfs Enable or disable all commands Fix fast loading npc OlympiadRestoreStatsOnFightStart OlympiadSystemSecondTimeEnabled OlympiadEnterLast10Minute OlympiadThirdClassSummons MinLevelTrade AnnounceSubClassMsg1 AnnounceSubClassMsg2 AnnounceSubClassMsg3 LimitedSubClassRace NoSellItems Change ID SealStones for AA NoPrivateBuyItems NoDropPlayerOnDie DisableSkillEnchantData Show Level Mobs Show npc clan flag DespawnSummonEnBattle SummonPetEnBattle RideSummonPetEnBattle DitanceToTargetMove EnterWorld_Undying EnterWorld_UnHide BlockWhispMessagePlayerToGM UseItemsWithHide CriticalSkillDamageBonusPer=4.0 Disable SSQSystem OnCastle Siege End Use any dyes Buy halls directly in auctioneer without waiting for the auction, configuration to change the item you consume MensajeEnterWorldServer Command .hero enable/disable hero aura Config vip global chat character, chat by systemsg Soulshots: NoSendSystemMessageUse Panel //admin Global vote reward Agathions system Anti Interface, control all patch files by md5 Command .menu configurable, last restart, name, maxusers, privatestores Spawn protection activate deactivate consume items to activate  Activate or deactivate autoloot for vip characters EVENTS Happy Hour Event reworked Configurable by announcements or systemsg Team VS Team Capture The Flag Death Match Last Man Standing Destroy The Base Korean Style Castle Siege Check if the player is inside the tvt event due to disconnection/critical error Top 1/5 killer reward/announce TimeAfk ResetReuseSkills ResetBuffsOnFinish Firework effect Reward win/lost Add Team Location Title custom Red/blue Open Door/Wall System BalanceBishops Show kills in title Invest positions Show Death To Top Delete Non-Subclass Skills     RELOADS Reload Enterworld Html Option Reload Faction System Reload Donate Shop Reload OfflineBuffer Reload Champion NPC Reload CliExt Reload AntiBot Reload Vip System Reload Auction Reload AutoLoot Reload CastleSiegeManager Reload CharacterLock Reload ClanPvPStatus Reload AutoLearn Reload ClanReputationRank Reload ClanSystem Reload CreatureAction Reload Customs.ini Reload L2server.ini Reload SkillData.txt Reload doordata.txt Reload decodata.txt Reload Multisell Reload DropList   Extender tested for more than 3 years. Assured stability. Possibility of adding MOD's upon request. (Not included, consult).
    • some peoples trash is another mans treasure, is that your treasure?   people might like the content but you are still the rat in the room     thats the community judging you.  
    • Keep reselling what I publish here for free!!! 🙂 GG  
  • Topics

×
×
  • Create New...