i want to shorten the src

Started on the old forum in November 2009 · view the original in the archive · old links redirect here

24 replies · 879 views · started 17 years ago · 1 min read

TL;DR · summary of 24 replies
  • what i mean if this is legal? the script was shared as a free script.
  • change 50 and other variables in phpThumb.php to kei_ki7.php, or use thumb.php for image resizing.
  • No need to have getimagesize function in core code.
  • The issue with images not appearing might be related to URL structure or directory access.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
kei_ki7 Senior · 431 posts #1

i used

echo "<img src=\"http://coding-talk.com/images/phpThumb.php?src=$avlink&wp=100&hp=100&wl=100&hl=100\" alt=\"avatar\"/>";

how can i remove this code? or can i remove this code?

&wp=100&hp=100&wl=100&hl=100

or

how can make this URL

http://coding-talk.com/images/phpThumb.php?src=$avlink&wp=100&hp=100&wl=100&hl=100

to

http://coding-talk.com/images/phpThumb.php?id=userid

i want to change phpThumb.php to kei_ki7.php <- is this legal?

Did I help you? You can help me too Your donations will help me finance my studies.

riderz Lead · 975 posts #2

u can rename the file tho what ever u want it to be so it will work


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

subzero Super moderator Fellow · 3,954 posts #3

Save as kei_ki7.php

Look for 50 and change it how you like it

w_i = width h_i = height

<?php 
$taille = getimagesize("$_GET[src]");  
$h_i = $taille[1];  
$w_i = $taille[0];  
if($h_i >50)  
{  
$convert=50/$h_i;  
$h_i=50;  
$w_i=ceil($w_i*$convert);  
}  
if($w_i >50)  
{  
$convert=50/$w_i;  
$w_i=50;  
$h_i=ceil($h_i*$convert);  
};  

$largeur = "$w_i"; 
$hauteur ="$h_i"; 

header("Content-Type: image/jpeg"); 
list($width, $height, $type, $attr) = getimagesize("$_GET[src]"); 

if($type == "1") 
{ 
$img_in = imagecreatefromgif($_GET[src]); 
} 

if($type == "2") 
{ 
$img_in = imagecreatefromjpeg($_GET[src]); 
} 

if($type == "3") 
{ 
$img_in = imagecreatefrompng($_GET[src]); 
} 

$img_out = imagecreatetruecolor($largeur, $hauteur); 
imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, imagesx($img_out), imagesy($img_out), imagesx($img_in), imagesy($img_in)); 
$t = imagejpeg($img_out); 
echo $t; 
?>

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

kei_ki7 Senior · 431 posts #4

riderz wrote: u can rename the file tho what ever u want it to be so it will work

what i mean if this is legal? 🙂 i dont want to jailed LoL

subzero wrote: Save as kei_ki7.php

Look for 50 and change it how you like it

w_i = width h_i = height

<?php 
$taille = getimagesize("$_GET[src]");  
$h_i = $taille[1];  
$w_i = $taille[0];  
if($h_i >50)  
{  
$convert=50/$h_i;  
$h_i=50;  
$w_i=ceil($w_i*$convert);  
}  
if($w_i >50)  
{  
$convert=50/$w_i;  
$w_i=50;  
$h_i=ceil($h_i*$convert);  
};  

$largeur = "$w_i"; 
$hauteur ="$h_i"; 

header("Content-Type: image/jpeg"); 
list($width, $height, $type, $attr) = getimagesize("$_GET[src]"); 

if($type == "1") 
{ 
$img_in = imagecreatefromgif($_GET[src]); 
} 

if($type == "2") 
{ 
$img_in = imagecreatefromjpeg($_GET[src]); 
} 

if($type == "3") 
{ 
$img_in = imagecreatefrompng($_GET[src]); 
} 

$img_out = imagecreatetruecolor($largeur, $hauteur); 
imagecopyresampled($img_out, $img_in, 0, 0, 0, 0, imagesx($img_out), imagesy($img_out), imagesx($img_in), imagesy($img_in)); 
$t = imagejpeg($img_out); 
echo $t; 
?>

thanks for this i will try this 🙂

Did I help you? You can help me too Your donations will help me finance my studies.

kei_ki7 Senior · 431 posts #5

do i need to have a function for getimagesize?

if yes, i dont have it in my core. 🙂

Did I help you? You can help me too Your donations will help me finance my studies.

subzero Super moderator Fellow · 3,954 posts #6

Nah its only file i use and works fine for me

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #7

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #8

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

kei_ki7 Senior · 431 posts #9

i cant make my usage work, i tried kei_ki7.php?src= and kei_ki7.php?pic=

wanna try this?

Did I help you? You can help me too Your donations will help me finance my studies.

Attachments: thumb_1.1.zip
subzero Super moderator Fellow · 3,954 posts #10

What error you getting with mine ?

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

kei_ki7 Senior · 431 posts #11

i just cant see the image, i use kei_ki7.php?src=http://imageurl and kei_ki7.php?pic=http://imageurl

and no pic appeared

Did I help you? You can help me too Your donations will help me finance my studies.

subzero Super moderator Fellow · 3,954 posts #12

show me ?

inbox me with the image resize

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #13

lol look at my pics i resize i also added copyrights lmao

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #14

Now there images you can see

Before and after

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Attachments: before.jpg now.jpeg
Navjot_Saini Junior · 15 posts #15

subzero wrote: lol look at my pics i resize i also added copyrights lmao

can i get a code to add watermark in same file ..??

  1. Saini : Devloping The web...😳:(😠
subzero Super moderator Fellow · 3,954 posts #16
<?
$percent="30";
if($_GET['pic']){
    $image = $_GET['pic'];

    if($_GET['type']=="jpg"){
        header("Content-type: image/jpeg");
    }elseif($_GET['type']=="gif"){
        header("Content-type: image/gif");
    }elseif($_GET['type']=="png"){
        header("Content-type: image/png");
    }else{
        if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){header("Content-type: image/jpeg");}
        elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){header("Content-type: image/gif");}
        elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){header("Content-type: image/png");}
    }

    if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){$im = imagecreatefromjpeg($image);}
    elseif(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){$im = imagecreatefromgif($image);}
    elseif(substr($image, -3)=="png" || substr($image, -3)=="PNG"){$im = imagecreatefrompng($image);}

    
        $x = round((imagesx($im)*$percent)/100);
        $y = round((imagesy($im)*$percent)/100);
        $yyy=0;
        $xxx=0;
        $imw = imagecreatetruecolor($x,$y);
  

    imagecopyresampled($imw, $im, $xxx,$yyy,0,0,$x,$y,imagesx($im), imagesy($im));

   
        
        $watermark_color="fffff";
        $text = "Grim-Reaper.ws";
        $red=hexdec(substr($watermark_color,0,2));
        $green=hexdec(substr($watermark_color,2,2));
        $blue=hexdec(substr($watermark_color,4,2));

        $text_col = imagecolorallocate($imw, $red,$green,$blue);
        $font = "font/georgia.ttf"; 
        $font_size = 7;
        $angle = 90;
        $box = imagettfbbox($font_size, $angle, $font, $text);
        
        $x = round((imagesx($im)*30)/100);
        $y = round((imagesy($im)*30)/100);
        imagettftext($imw, $font_size, $angle, $x, $y, $text_col, $font, $text );

    

if($_GET['type']=="jpg")
{
imagejpeg($imw);
}
else
if($_GET['type']=="gif")
{
imagegif($imw);
}
else
if($_GET['type']=="png")
{
imagepng($imw);
}else{
        if(substr($image, -3)=="jpg" || substr($image, -3)=="JPG"){imagejpeg($imw);
}else
if(substr($image, -3)=="gif" || substr($image, -3)=="GIF"){imagegif($imw);
}
else
if(substr($image, -3)=="png" || substr($image, -3)=="PNG"){imagepng($imw);
}
}
imagedestroy($imw);
}
?>

Name it thumb.php

edit the text to your site 🙂

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

kei_ki7 Senior · 431 posts #17

but what is the product URL of your image?

Did I help you? You can help me too Your donations will help me finance my studies.

subzero Super moderator Fellow · 3,954 posts #18

there still there lol u can test the images if you like...

My product script is unique script 🙂

well you can use this anytime bro why not use it and have fun with it???

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

kei_ki7 Senior · 431 posts #19

subzero wrote: there still there lol u can test the images if you like...

My product script is unique script 🙂

well you can use this anytime bro why not use it and have fun with it???

then thanks for sharing this script for FREE! 🙂

btw is this script can do

http://coding-talk.com/images/thumb.php?id=userid then the image is the avatar of the user?

Did I help you? You can help me too Your donations will help me finance my studies.

subzero Super moderator Fellow · 3,954 posts #20

its

?pic= URL FOR IMAGE

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close