ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ phpThumb :: sample photo gallery demo This is a demo of how you can use phpThumb() in an image gallery.

// // available at http://phpthumb.sourceforge.net /// ////////////////////////////////////////////////////////////// /// // // phpThumb.demo.gallery.php // // James Heinrich // // // // Demo showing basic usage of phpThumb in a photo gallery // // // ////////////////////////////////////////////////////////////// die('For security reasons, this demo is disabled by default. Please comment out line '.__LINE__.' in '.basename(__FILE__)); $docroot = realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__)))); $basedir = '/demo/images/'; // webroot-relative path to main images directory (only this and subdirectories of this will be displayed) $thumb = '/demo/phpThumb.php'; // webroot-relative path to "phpThumb.php" $popup = '/demo/demo/phpThumb.demo.showpic.php'; // webroot-relative path to "phpThumb.demo.showpic.php" (only used if $use_popup == true) $thumbnailsize = 120; // size of thumbnails in pixels when browsing gallery $displaysize = 480; // size of large image display (popup or plain image) after clicking on thumbnail $use_popup = true; // if true, open large image in self-resizing popup window; if false, display larger image in main window ////////////////////////////////////////////////////////////// $dirlimit = realpath($docroot.'/'.$basedir); $captionfile = $docroot.'/'.$basedir.(@$_REQUEST['dir'] ? $_REQUEST['dir'].'/' : '').'captions.txt'; if (file_exists($captionfile)) { $filecontents = file($captionfile); foreach ($filecontents as $key => $value) { @list($photo, $caption) = explode("\t", $value); $CAPTIONS[$photo] = $caption; } } if (!empty($_REQUEST['pic'])) { $alt = @$CAPTIONS[$_REQUEST['pic']] ? $CAPTIONS[$_REQUEST['pic']] : $_REQUEST['pic']; echo ''.htmlentities($alt).'
'; echo '
'.htmlentities(@$CAPTIONS[$_REQUEST['pic']]).'
'; } else { $currentdir = realpath($docroot.'/'.$basedir.@$_REQUEST['dir']); if (!preg_match('#^'.preg_quote($dirlimit).'#', $currentdir)) { echo 'Cannot browse to "'.htmlentities($currentdir).'"
'; } elseif ($dh = @opendir($currentdir)) { $folders = array(); $pictures = array(); while ($file = readdir($dh)) { if (is_dir($currentdir.'/'.$file) && ($file{0} != '.')) { $folders[] = $file; } elseif (preg_match('#\\.(jpe?g|gif|png|bmp|tiff?)$#i', $file)) { $pictures[] = $file; } } closedir($dh); if (preg_match('#^'.preg_quote($dirlimit).'#', realpath($currentdir.'/..'))) { echo 'Parent directory
'; } if (!empty($folders)) { echo ''; } if (!empty($pictures)) { foreach ($pictures as $file) { $alt = (@$CAPTIONS[$file] ? $CAPTIONS[$file] : $file); echo ''.(!empty($CAPTIONS[$file]) ? '' : '').'
'.htmlentities($CAPTIONS[$file]).'
'; if ($use_popup) { echo ''; } else { echo ''; } echo ''.htmlentities($alt).''; echo '
'; } echo '
'; } else { echo 'No pictures in "'.htmlentities(str_replace(realpath($docroot), '', realpath($docroot.'/'.$basedir.@$_REQUEST['dir']))).'"'; } } else { echo 'failed to open "'.htmlentities($basedir).'"'; } } ?>