// //My cool PHPSlideshow // // some formatting options... $top_row_color = "#cccccc"; $image_row_color = "#000000"; $bottom_row_color = "#cccccc"; $page_background_color = "#000000"; $main_table_border_color = "#000000"; $img_border_color = "#000000"; $main_table_width = "50%"; $home_link = "HOME"; $next_alt = "Suivante"; $back_alt = "Précédente"; $your_home_url = "http://www.issahassan.com/"; // set this to true to display the image filename $show_image_name = "false"; // set to true to display navigation icons instead of text... $show_navigation_buttons = "false"; $back_button = "back.gif"; $next_button = "next.gif"; // automated slideshow options // set this to true to enable the auto slideshow feature $auto_slideshow = "false"; // $sec is number of seconds between slides... $sec = "2"; // set standalone to false if you are using this script in an existing php doc // e.g. insert the following line in the page where // you want phpslideshow to appear // include("phpslideshow.php"); // dont forget to remove the comment slashes... $standalone = "true"; // file containing optional image descriptions $pic_info_file="pics.txt"; // name of file containing optional page headings $heading_info_file = "heading.txt"; ################################################################################ // grab the variables we want set for newer php version compatability // the @ supress the error messages if your php.ini error level is too high if(isset($_REQUEST['phpslideshow'])){ $phpslideshow=strip_tags($_REQUEST['phpslideshow']);} if(isset($_GET['currentPic'])){ $currentPic=strip_tags($_GET['currentPic']);} // check for platform dependent path info... (for windows and mac OSX) $path = empty($HTTP_SERVER_VARS['PATH_INFO'])? $HTTP_SERVER_VARS['PHP_SELF']:$HTTP_SERVER_VARS['PATH_INFO']; // a little security - check that the user did not change the path... // the path may not contain .. or : (as in c:) or start with / (root dir) if (preg_match(':(\.\.|^/|\:):', $directory)) { print "ERROR: Your request contains an invalid path.
"; print "For security purposes, you can only access directories "; print "within this one.
"; print "Your dir path may not contain .. or : or start with a /
"; print "
Try again"; exit; } // set directory if (empty($directory)) $directory = "."; // if there is no $heading_info_file (see format above) set page heading here if ( !file_exists("$directory/$heading_info_file")) { $header = "PHP Slideshow"; $browser_title = "$header"; } else { $heading_info = file("$directory/$heading_info_file"); $header = htmlentities($heading_info[0]); } // image / text buttons if ($show_navigation_buttons == "true") { $back_src = "\"$back_alt\""; $next_src = "\"$next_alt\""; } else { $back_src = "$back_alt"; $next_src = "$next_alt"; } if ( !file_exists("$directory/$pic_info_file")) { $dh = opendir( "$directory" ); while( $file = readdir( $dh ) ) { // look for these file types.... if (eregi("(jpg|jpeg|gif|png)$",$file)) { $pic_info[] = $file; sort( $pic_info ); } } } else $pic_info=file("$directory/$pic_info_file"); // begin messing with the array $number_pics = count ($pic_info); if (empty($currentPic)) $currentPic = 0; if (($currentPic > $number_pics)||($currentPic == $number_pics)) $currentPic = '0'; $item = explode (";", $pic_info[$currentPic]); $last = $number_pics - 1; $next = $currentPic + 1; if ($currentPic > 0 ) $back = $currentPic - 1; else $currentPic = "0"; // print the description if it exists $blank = empty($item[1])?' ':htmlentities($item[1]); // a hack so that you can include
tags in the comments... $blank = ereg_replace ("<br>", "
", $blank); $show_name = ($show_image_name=="false")?' ':htmlentities($item[0]); if ($currentPic > 0 ) $nav=$back; else $nav=$last; // meta refresh stuff for auto slideshow... if ($auto_slideshow == "true") { $meta_refresh = ""; } else $meta_refresh = "\n"; ################################################################################ // top of html page stuff // print the page header if in standalone mode if ($standalone == "true") { print <<< HERE $meta_refresh Issa - Album de photos HERE; } include($_SERVER['DOCUMENT_ROOT']."/newmenu.php"); // draw the main table in html print <<< HERE
Image précédente [ $next de $number_pics ] Image suivante

$blank


$show_name
$blank
HERE; // print the page footer if in standalone mode if ($standalone == "true") { print <<< HERE HERE; } ?>