Privacy and Security Notice
pics.txt in linux or
// dir *.jpg > pics.txt in dos - you will need edit this with notepad/vi to clean
// out any extra stuff that dir puts in there and to add the semi colon and description.
//
// *** PLEASE use your own next and back images! i have included links to some on my
// server so you can get up and running quickly... change them once your page is
// working.
//
// EXAMPLE optional pics.txt FILE
//
// greg.jpg;Me
// dog.JPEG;My dog John
// cat;
// tux.Jpg;My friend Tux
//
// NO BLANK LINES either!
// as you can see, not all pics need a description but the ";" is a MUST!
// point your browser at the script and voilla!
//
//////////////////////////////////////////////////////////////////////////////
// variables, modify at will
// please use your own next and back images!
//
$back_image="../pics/arrow_left.gif";
$next_image="../pics/arrow_right.gif";
$pic_info_file="pics.txt";
$header = "";
$title = "$header";
//
//
//////////////////////////////////////////////////////////////////////////////
// html stuff, replace with your sites include() header file e.g.
// include("/home/httpd/html/header.php");
print "
$title";
print "";
print "";
print "$header
";
// this part does the work and should need no editing
//
if ( !file_exists($pic_info_file))
{
$dh = opendir( "." );
while( $file = readdir( $dh ) )
{
if ( ereg("jpg$",$file) || ereg("JPG$",$file) ||
ereg("jpeg$",$file) || ereg("JPEG$",$file) ||
ereg("Jpg$",$file) || ereg("Jpeg$",$file) )
{
$pic_info[] = $file;
}
}
}
else $pic_info=file("pics.txt");
$number_of_pics = count ($pic_info);
if (($phpslideshow > $number_of_pics) || ($phpslideshow == $number_of_pics) || !$phpslideshow)
$phpslideshow = '0';
$item = explode (";", $pic_info[$phpslideshow]);
// print the description
print "$item[1]
";
$next = $phpslideshow + 1;
if ($phpslideshow > 0 ) $back = $phpslideshow - 1;
else $phpslideshow = '0';
// print the next and back links (note < and > to display <> in HTML)
$last = $number_of_pics -1;
if ($phpslideshow == $last)
{
print "
";
// comment out or delete the following line to remove the position message...
print "$next of $number_of_pics";
print "

";
}
elseif ($phpslideshow > 0 )
{
print "
";
// comment out or delete the following line to remove the position message...
print "$next of $number_of_pics ";
print "";
print "
";
}
else
{
// comment out or delete the following line to remove the position message...
print "$next of $number_of_pics ";
print "";
print "
";
}
// print the image link
print "
";
// the following line can be commented out if you want to display the full-size image
// located in a directory called uncut in the same directory as the slideshow...
// print "This picture unscaled
";
// end of "work"
//
// html stuff, replace with your sites include() footer file
// include("/home/httpd/html/footer.inc");
print "";
?>