//include("auth.php");
//**************************************************************************
// Silverfox Client Slideshow
// Author: Ted Roeder // // Copyright (C) 2005 //
//
// This software cannot be redistributed or re-used without prior written consent //
//
//**************************************************************************
//session_start(); // start session
////if (!isset($_SESSION['ses_refer'])) {
$_SESSION['ses_refer'] = $_SERVER['HTTP_REFERER'];
//}
//echo "here is: " . $_SESSION['ses_refer']. "
";
//$returnurl = $_SESSION['ses_refer'];
include("../visitors.php");
//if (!($auth)) {
//echo "here is: " . $returnurl . "
";
//if (!isset($returnurl)) {
// session_register("$returnurl");
// $returnurl = $_SERVER['HTTP_REFERER'];
$page = $_GET['page'];
$mypath = $_GET['directory'];
$directory = $mypath . "/fulls";
$currentPic = $_GET['currentPic'];
// set directory
if (empty($directory)) $directory = ".";
//
//
//
//
//
// next line USES nav AS THE WRITABLE FOLDER
$filenamp = "nav/" . $directory . "_" . $rndcl . "_prints1.txt"; //prints
$filename = "nav/" . $directory . "_slides1.txt"; //slides
if(!isset($_GET['image'])){
$imagest = 1;
} else {
$imagest = $_GET['image'];
}
//$thisimg1=$_POST['thisimg'];
//echo "this is it: " . $thisimg1;
// $returnurl = $_SERVER['HTTP_REFERER'];
// $returnurl = $_SERVER['HTTP_REFERER'];
// file containing optional image descriptions
$pic_info_file="pics.txt";
// name of file containing optional page headings
$heading_info_file = "heading.txt";
// 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";
// some formatting options...
$top_row_color = "#cccccc";
$image_row_color = "#ffffff";
$bottom_row_color = "#cccccc";
//$page_background_color = "#2b2a32";
$page_background_color = "#000000";
//$main_table_border_color = "#2b2a32";
$main_table_border_color = "#000000";
$img_border_color = "#000000";
$main_table_width = "736";
$your_home_url = "/";
$home_link = "HOME";
$next_alt = "Next >>";
$back_alt = "<< Prev";
$standalone = "true";
$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;
}
// if there is no $heading_info_file (see format above) set page heading here
if ( !file_exists("$directory/$heading_info_file")) {
$header = "Viewer";
$browser_title = "$header";
}
else {
$heading_info = file("$directory/$heading_info_file");
$header = "$heading_info[0]";
}
// image / text buttons
if ($show_navigation_buttons == "true") {
$back_src = "";
$next_src = "";
}
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)) {
if (substr($file,0,2) != "th") {
$pic_info[] = $file;
}
// sort( $pic_info );
}
}
}
else $pic_info=file("$directory/$pic_info_file");
sort( $pic_info );
if (isset($_POST['thisimg'])) {
if($_POST['thisimg']== "1") {
$fp = fopen($filename, "a");
$entry_line = ($currentPic + 1) . "\n";
fwrite( $fp, $entry_line);
fclose($fp);
}
}
if (isset($_POST['thisimgp'])) {
if($_POST['thisimgp']== "1") {
$fp = fopen($filenamp, "a");
$entry_line = ($currentPic + 1) . "\n";
fwrite( $fp, $entry_line);
fclose($fp);
}
}
// 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])?' ':$item[1];
$show_name = ($show_image_name=="false")?' ':$item[0];
$max_rows = 5;
$perrow = 4;
$max_results = ($max_rows * $perrow) ;
$currentPag = ceil((($currentPic +1) / $max_results));
$returnurl = "viewer1.php?directory=" . $mypath . "&page=" . $currentPag;
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") {
?>
Return to thumbnails | echo$back_src;?> [ echo $next;?> of echo $number_pics;?> ] echo $next_src;?> |
$fpath = $directory . "/" . $item[0]; $size = getimagesize($fpath); $x = $size[0]; $y = $size[1]; ?> echo "\" vspace=10 >"; ?> |
echo "" . $item[0] . ""; ?> |
"; */ ?> |
Photos by Ted Roeder |