Image browser ..) // example: image file sunrise.jpg would use the caption // file sunrise.jpg.txt with the default captionext // caption : default caption to place under files if no caption file // exists // stylesheet : enter the path to your stylesheet here // you may enter just '' to use the default(will embed it in the html) // you may also enter 'none' to have no style sheet // the stylesheet should have these classes: // // .imag { border-style : solid; // border-color: blue; // border-width : 1px;} // .thumb { border-style : solid; // border-color: #999999; // border-width : 2px;} // A:link { color: #999999; // text-decoration : none; } // A:visited { color: #999999; // text-decoration : none; } // A:hover { color:blue; } // any of these classses can be adjusted to your needs // // // USAGE: // to browse through the images use the back and forward images // click on one of the thumbnails // or use one of the pagelinks to go directly to another set of images // clicking on the large image will give you the full image //---Variables--- $scale = 0; $maxwidth = 640; $maxheight = 480; $thumbmaxw = 50; $thumbmaxh = 50; $imgperpage = 10; $imgperrow = 5; $pgperrow = 10; $currentdir = getcwd (); $typelist = array("jpg","jpeg","gif","png","JPG"); $imagelist = array(); $title = "Pics"; $stylesheet = '' ; $home = "{$_SERVER['PHP_SELF']}"; $this_page = "{$_SERVER['PHP_SELF']}"; $caption = ""; $captionext = "txt"; //--- ind is put to zero when the script is first called uppon--- if(!isset($_GET['ind'])) $_GET['ind'] = 0; $index = $_GET['ind']; //---the following code iterates through the directory and puts any image found in the imagelist array--- $dp=opendir($currentdir); while ( false != ( $file=readdir($dp) ) ) { if (is_file($file) && $file!="." && $file!=".."){ $extention = explode(".",$file); $extfield = count($extention)-1; $extention = $extention[$extfield]; if( in_array($extention,$typelist) ){ array_push ($imagelist,$file); } } } ?> <?= $title ?> ' .'.imag { border-style : solid;' .'border-color: blue;' .'border-width : 1px;}' .'.thumb { border-style : solid;' .'border-color: #999999;' .'border-width : 2px;}' .'A:link { color: #999999;' .'text-decoration : none; }' .'A:visited { color: #999999;' .'text-decoration : none; }' .'A:hover { color:blue; }' .''; } elseif ($stylesheet == 'none') { //--no style sheet if that is what you want } else { echo ""; } ?>
= 0) {?> [ prev ] $maxwidth || $imgheight > $maxheight) { // decide if img needs to be scaled $newwidth = $imgwidth/($imgheight/$maxheight); $newheight = $imgheight/($imgwidth/$maxwidth); if ($imgwidth < $imgheight) { if ($newwidth > $maxwidth) { ?> $maxheight) { ?> [ next ]
= ($j*$imgperpage) && ($index < (($j+1) * $imgperpage)) ) { for($i=($j*$imgperpage);$i<(($j+1) * $imgperpage);$i++) { if(($i%$imgperrow == 0) && ($i > 0)) { ?>
$thumbmaxw) { ?> $thumbmaxh) { ?>

0)) { ?>
[page ]
[ home ]