Sådan her - husk at anføre dit kald til javascript funktionen \"popUp\" på dit billede eller link.
-----------------------------------------------------------------------------------------------
<?php
/******
* [thumbnail.php] v1.12
* 2001-09-01
* Author: Anarchos
* URL:
http://anarchos.xs.mw//***/
/* $widthChange will be added to the width of the image to create the width of the popup window. */
$widthChange = 6;
/* $heightChange will be added to the height of the image to create the height of the popup window. */
$heightChange = 50;
$vBlah2 = $HTTP_GET_VARS;
if (!isset($vBlah2[\"src\"]) && !isset($vBlah2[\"image\"])){
Header(\"Content-type: text/javascript\");
?>
function popUp(src,extra, width, height){
strTop = screen.height/2 - height;
strLeft = screen.width/2 - width;
strWidth = width;
strHeight = height;
window.open(\'<?php echo basename($PHP_SELF) ?>?image=\'+src+\'\', \'Image\', \'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=\'+strWidth+\',height=\'+strHeight+\',left=\'+strLeft+\',top=\'+strTop+\');
}
<?php
exit;
}
?>
<html>
<head>
<title><?php if ($src) print basename($src);?></title>
<link rel=\"stylesheet\" href=\"general.php\" type=\"text/css\" />
<?php if (!isset($src)) echo \"<script type=\\\"text/javascript\\\">\\n<!--\\nblur();\\n-->\\n</script>\\n\" ?>
</head>
<body bgcolor=\"#3A6EA5\" text=\"#000000\" alink=\"#3A6EA5\" vlink=\"#222222\" link=\"#222222\" topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">
<?php
if (!isset($src)){
if (!isset($image))
exit(\"No image defined.\");
$size = getimagesize($image);
echo \"<script type=\\\"text/javascript\\\">\\n\";
echo \"<!--\\n\";
$url = basename($PHP_SELF) . \"?src=$image&width=$size[0]&height=$size[1]&extra=\".urlencode($extra);
$width += 20;
$height += 55;
$maxwidth = $size[0]+ $widthChange;
$maxheight = $size[1] + $heightChange;
$scroll = \"\";
if ($width < $maxwidth) {
$maxwidth = $width - 40;
$scroll = \"resizable,scrollbars\";
}
if ($height < $maxheight) {
$maxwidth += 16;
$maxheight = $height - 120;
$scroll = \"resizable,scrollbars\";
}
echo \"open(\\\"$url\\\",\\\"Popup_images\\\",\\\"width=$maxwidth,height=$maxheight$scroll\\\");\\n\";
echo \"close();\\n\";
echo \"//-->\\n\";
echo \"</script>\";
print \"</body>\\n</html>\";
exit;
}
else {
print \"<center><img src=\\\"$src\\\" alt=\\\"$src\\\" width=\\\"$width\\\" height=\\\"$height\\\" valign=\\\"top\\\" vspace=\\\"3\\\" /></center>$extra\";
}
?>
<center>
<a href=\"java script:window.close()\" onMouseover=\"window.status=\'Close\';return true\" onMouseout=\"window.status=\'\';return true\">Close this window</a></center>
</body>
</html>