* Description System contributed by Matt, from switch9.net. Thanks! * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program [see the file 'LICENSE']; if not, write * to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * The license is also available online at * http://www.gnu.org/licenses/gpl.html . */ // Feel free to edit these------------------------------------------------------------------------------------- $pagename="index.php"; // change this if you change the name of the page $title="SimplePhotos Gallery"; // change to your page title, e.g John Smith's Photos $defaultthumbwidth=67; // change the default width of thumbnails $commentenable="y"; // change this to "n" if you'd like to disable the ability to display and enter comments $exifenable="y"; // change this to "n" if you are having problems with EXIF reading //$frontpageimage="photos/gallery/image.jpg"; // change this to be the image you have on the front page (if commented, no image is shown) // Do not edit below this line -------------------------------------------------------------------------------- // Register Global Variables $action = $_GET['action']; $gallery = $_GET['gallery']; $dir = $_GET['dir']; $filename = $_GET['filename']; // Change thumbnail size and set cookie if needed if ($newthumbsize=="small") { setcookie ("thumb_width_cookie", "67",time()+864000, "/", "", 0); $thumb_width_cookie="67"; } elseif ($newthumbsize=="medium") { setcookie ("thumb_width_cookie", "98",time()+864000, "/", "", 0); $thumb_width_cookie="98"; } elseif ($newthumbsize=="large") { setcookie ("thumb_width_cookie", "175",time()+864000, "/", "", 0); $thumb_width_cookie="175"; } else { $thumb_width="$defaultthumbwidth"; } // Change thumbnail size if ($thumb_width_cookie=="67") { $thumb_width="67"; } elseif ($thumb_width_cookie=="98") { $thumb_width="98"; } elseif ($thumb_width_cookie=="175") { $thumb_width="175"; } else { $thumb_width="$defaultthumbwidth"; } function CountFiles ($dir, $pat) { $result = 0; $dirhandle = opendir($dir); while ( $entity = readdir($dirhandle) ) { if ( $entity == "." || $entity == ".." ) { } // ignore current and parent directory dot entries elseif ( is_dir ($dir . '/' . $entity) ) { $result = $result + CountFiles($dir.'/'.$entity, $pat); } elseif ( is_file($dir . '/' . $entity) && eregi( $pat, "$entity" ) ) { $result++; } } closedir($dirhandle); return $result; } $totalnooffiles=CountFiles("photos/","\.jpg$"); ?> <? echo $title; ?>
Back'; } elseif ($action=="image") { echo ' : '.$gallery.' : View Image (Back)'; }; ?>
<? echo $frontpageimage; ?> '; // List Galleries on the Home Page echo ''; $count=0; echo ""; // cycles through directories and prints the name, in three columns $BASEDIR="photos"; $hndl=opendir($BASEDIR); while($file=readdir($hndl)) { if ($file=='.' || $file=='..') continue; $completepath="$BASEDIR/$file"; if (is_dir($completepath)) { if ($count==4) { // change if you want extra/fewer columns echo " "; $count=1; } else { $count=$count+1; } echo ''; } else { } } echo "
'.$file.'

"; echo '
'; } elseif ($action=="gallery") { // List Images in the Gallery (on a Gallery Page) $image = array("jpg", "png", "jpeg", "gif"); $directory='photos/'; $directory.=$gallery; $mydir = dir($directory); // *** added support for subdirectories ?>
'; $count=0; echo ""; while(($file = $mydir->read()) !== false) { for ($i = 0; $i < count($image); $i++) { if (eregi("\.". $image[$i] ."$", $file)) { // 10, 7 or 4 if ($thumb_width=="67") { if ($count==10) { echo " "; $count=1; } else { $count=$count+1; } } elseif ($thumb_width=="98") { if ($count==7) { echo " "; $count=1; } else { $count=$count+1; } } elseif ($thumb_width=="175") { if ($count==4) { echo " "; $count=1; } else { $count=$count+1; } } echo ' '.$file.' '; $previous=$file; } } } echo " "; ?>

700) { $msie = eregi("MSIE" , $HTTP_USER_AGENT); if ($msie == true) { echo '
'.$filename.'
'; } else {echo '
'.$filename.'
';}; } // If it is smaller, show the original image else { echo ''.$filename.''; } if ($commentenable=="y") { // Look for the comments file, and show it if availiable $comments_filename = "$dir/$filename.txt"; if (file_exists($comments_filename)) { echo '
'; include $comments_filename; echo '
'; } else { echo '
No Comments Available
'; } ?>
Add comment

> Name


Comment