This topic is locked

thumbs for view

11/2/2005 4:34:11 AM
PHPRunner General questions
samsp author

hello,
may be there is no answer for my question: i like to make thumbnails for the view button. anybody there for hints, suggestions or anything.
please give me response. can it be that`s not possible in the moment? should not a problem, but i could not belief.
greetings
sam

admin 11/2/2005

Sam,
what kind of View page thumbnails do you need? Could you point me to any example fo this?

samsp author 11/3/2005

i have found out the following solution:
// show thumbnail

$thumbname=$data["img1"];

$lasti = strrpos($thumbname,".");

if(!($lasti===false))

$thumbname=substr($thumbname,0,$lasti);

$thumbname.=".gif";

$thumbname=$thumbnail_prefixes["img1"].$thumbname;

if(file_exists(GetUploadFolder("img1").$thumbname))

{

echo "<a target=_blank href=\"".htmlspecialchars(AddLinkPrefix("img1",$data["img1"]))."\"><img width=67 height=50 border=0 src=\"".htmlspecialchars(AddLinkPrefix("img1",$thumbname))."\"></a>";

$thumbnailed=true;

}

}

if(!$thumbnailed)

{ ?>

<a href="casas_view.php"

onClick="java script:

document.forms.viewform.editid.value = '<?php echo db_addslashes($data[$strKeyField]);?>';

<?php if($strKeyField2) { ?>

document.forms.viewform.editid2.value = '<?php echo db_addslashes($data[$strKeyField2]);?>';

<?php } ?>

<?php if($strKeyField3) { ?>

document.forms.viewform.editid3.value = '<?php echo db_addslashes($data[$strKeyField3]);?>';

<?php } ?>

document.forms.viewform.submit();

return false;"><img width=67 height=50 border=0 src="<?php echo htmlspecialchars(AddLinkPrefix("img1",$data["img1"]));?>"></a>

<?php }

}

?>

</td>
greeting
sam