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

    • Selling Telegram bots with 2024 year old. Strong. Bots clean, without subscribers, without blocking Price list: From 3 bots - 3.5$ for 1sht. From 20 bots - 3$ for 1pc. From 60 bots - 2.8$ for 1pc. From 100 bots - 2.5$ for 1pc. From 400 bots - 2$ for 1pc. Full transfer of owner rights / transfer account. Sell empty channels 2022. Without shadow bans. Not used. Without posts. Write in Telegram - @SMMTG6
    • Hello everyone   We are engaged in search engine optimization bots in Telegram.   - We make ranking bots to order Telegram search bots up to 100,000 premium subscribers.   We work with countries such as: USA, China, Israel, Russia, Uzbekistan, India, Saudi Arabia, Iran, Italy, Turkey and other countries. Clarify with us. Possible output in multi-geo (several countries).   Prices from 10$ from 20$ per 1000 Premium subscribers, depending on the country.   Term of manufacture of bot - 4 days   We are one of the most famous sellers in Telegram. We agree on the guarantor at your expense.   ☆ Our Telegram-channel - https://t.me/+e_DKWnC5AFw0ZDhi   ☆ For questions about buying a bot contact @SMMTG6   ☆ Our panel with the best Premium subscribers - smmtg.pro
    • Opening April 26 at 19:00 (UTC +3)  https://lineage2dex.com/en/sign-in Open Beta Test from April 22 This is pre-announcing of NEW season server, so we want to share some key points of it. Full details with road map, patch notes we will announce a bit latter Main features Modern Classic client (less lags, smoother gameplay, a lot of useful interface features). Anti-bot protection - we use our own system in combine with popular solutions like AAC, so in the end our project have one of the best anti-bot shield exists. Buff book to buff yourself or your summon/pet. With regular buff book you can create only 1 buff profile, if you need more - get the modern buff book and create up to 10 profiles! Daily rewards - login to the game every day and get rewards. Expanded subclass slots - you can have 5 subclasses from the beginning and expand up to 10. Class/Gender change - you can change your main class and gender if you want. Masterwork items (can be obtained by crafting or farming RBs, have better bonuses than regular items). Item Broker Auctions in towns can sell some epic jewelry and other useful goods for adena (3 times per week). Giran Harbor Fair - daily event which allows you to get temporary epic jewelry a lot of other rare items for adena. Talents - special tree with passive skills which will help you to tune your class better. Team vs Team event. Episodes - we open new content step by step to keep you engaged, bring more fun and extend the game. Episodes reveal following features: Hellbound Island Isle of Preyer, with new content, new Dynasty gear PvP item improvement allows you to improve your items with additional bonuses. Charms can be equipped in one of the special slots that open when wearing a bracelet. Each type of charm grants the wearer certain bonuses Instance Zones New Epic Bosses - Freya, Beleth, Tiat, Trasken Cyclic macros (macros restarts when finishes) Why choose Dex? We have destroyed the stereotypes that PvP servers live for a couple of weeks. Our Union x50 server proves it (working from April 2020 with good online). We have enough high-end content that will allow you to maintain interest in the game all the time! And we are always working on improving the game and adding new interesting activities and content. Seasonal servers have a road map with planned list of changes to keep you engaged. When the time comes the server will be merged with the Union server. So if you're new on Dex, you can start from zero like all othe players on NEW (seasonal) server. All your items and characters will be safe, and you can continue play when season over on our main server - UNION. High-end content (unlocked over episodes) Hellbound Island Spoiler Hellbound is an endgame location mostly for parties, but if you will be well geared you can farm most spots solo. You can get to Hellbound with help of gatekeepers. Hellbound contains multiple raid bosses and entrance to new epic boss Beleth. Drop from raid bosses and from entire island in general is very valuable. Monsters at Hellbound can drop special Hellbound Coins which can be exchanged to some useful goods at the Hellbound Trader Joseph. Isle of Prayer Spoiler Isle of Prayer is a high-end location, divided into several areas, each tailored for different classes and playstyles. By completing quests and farming mobs on IoP, you can obtain Dynasty equipment. You can read more about specific features and spots from our wiki: The most popular Lineage 2 classic server waiting for you. Download L2 client and play! You expect grandiose battles and incredible siege. The adrenaline just rolls! The most popular Lineage 2 classic server waiting for you. Download L2 client and play! You expect grandiose battles and incredible siege. The adrenaline just rolls!  lineage2dex.com We will be glad to hear any comments and suggestions on our discord channel, join it we have very friendly community there  - Join discord  
    • rly cool l2off pack...but rly expesive....
  • Topics

×
×
  • Create New...