unkonwn issue with script: fixed
Posted: Sun Feb 01, 2004 2:02 pm
for some reason a script is NOT returning on one section.
http://www.findyourdesire.com/new.php?gen=all
shows the issue i'm having. the following script returns the unavailabl pic for ALL the other cases EXCEPT the ltn case. the ltn case is the only one called in the link. here's the script. if you see the issue, could youlet me know? i can't see any difference from the working ones aside from the size.
http://www.findyourdesire.com/new.php?gen=all
shows the issue i'm having. the following script returns the unavailabl pic for ALL the other cases EXCEPT the ltn case. the ltn case is the only one called in the link. here's the script. if you see the issue, could youlet me know? i can't see any difference from the working ones aside from the size.
Code: Select all
<?php
include("/home/dcfydllc/includes/fyd.altincs.php");
// get the function type and picture
$fn=$_GET['fn'];
$pic=$faup . $_GET['pic'];
if(isset($fn)){ // act on the function
if($fn==='main'){ // this is the main pic's thumb
if(is_file($pic)){ // the user uploaded a pic
$src=ImageCreateFromJPEG($pic);
$width=ImageSx($src); $height=ImageSy($src);
$x=250; $y=250; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}else{ // we need to fill it with something
$src=ImageCreateFromPNG('sitepics/uona.png');
$width=ImageSx($src); $height=ImageSy($src);
$x=250; $y=250; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}
}elseif($fn==='thumb'){ // this is the profile page thumbs
if(is_file($pic)){ // the user uploaded a pic
$src=ImageCreateFromJPEG($pic);
$width=ImageSx($src); $height=ImageSy($src);
$x=125; $y=125; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}else{
$src=ImageCreateFromPNG('sitepics/uona.png');
$width=ImageSx($src); $height=ImageSy($src);
$x=125; $y=125; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}
}elseif($fn==='ltn'){ // this is the lust list/top users/newest users/forums thumb
if(is_file($pic)){ // the user uploaded a pic
$src=ImageCreateFromJPEG($pic);
$width=ImageSx($src); $height=ImageSy($src);
$x=75; $y=75; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}else{
$src=ImageCreateFromPNG('sitepics/unoa.png');
$width=ImageSx($src); $height=ImageSy($src);
$x=75; $y=75; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}
}elseif($fn==='full'){ # we're making the tagged full size pic (should only be called if it exists & is approved)
$tag='sitepics/imgtag.png'; # the tag
$tagimg=ImageCreateFromPNG($tag);
$tw=ImageSx($tagimg); $th=ImageSy($tagimg);
$mem=ImageCreateFromJPEG($pic);
imageCopy($mem, $tagimg, 0, 0, 0, 0, $tw, $th);
header('Content-Type: image/png'); ImagePNG($mem);
imageDestroy($mem); imageDestroy($tagimg);
}else { // there was an error (or we're calling the spacer)
$src=ImageCreateFromPNG('sitepics/unoa.png');
$width=ImageSx($src); $height=ImageSy($src);
$x=75; $y=75; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}
}else{ // no function, something is wrong
$src=ImageCreateFromPNG('sitepics/unoa.png');
$width=ImageSx($src); $height=ImageSy($src);
$x=75; $y=75; $dst=ImageCreate($x,$y);
ImageCopyResized($dst,$src,0,0,0,0,$x,$y,$width,$height);
header('Content-Type: image/png'); ImagePNG($dst);
}
?>