I'm having what I think is a similar problem. I've got a couple of Audrey touch screens running through a bunch of picture files during the day. After upgrading to OS X 10.3 Panther, the images no longer rotate. I'm pretty much a newbie when it comes to php. I found this code on the web a few years ago and haven't messed with it since.
The problem seems to be with the "$nextURL="http://192.168.1.100$SCRIPT_NAME?index=$nextIndex";" the next picture tries to open at 192.168.1.100?index=1/
Any help would be greatly appreciated!
Thanks!
<?
/****************************************************
Slideshow.php -
Simple script that will generate a slideshow -- a series
of automatically-reloading web pages -- from a directory
of images. To use, simply place this script in the same
directory as your images, and enter the url of the script
in your browser.
For example, if you put your images in ~/public_html/my_images,
and the URL
http://www.yourhost.com/my_images would normally then
show the directory of your images, then you can put this
script in that directory, and visit the URL
http://www.yourhost.com/my_images/slideshow.php
and you should get the self-loading slideshow. (If your
web server is set up appropriately, you can also rename the script
to index.php (and probably get rid of any index.html),
and
http://www.yourhose.com/my_images should also get you a slide show.
No changes to the script are necessary as the contents of the
directory change - you can add or remove image files at will.
Options:
(If specifying more than one option, separate them with "&")
refresh:
By default, the next image will be loaded every 60 seconds.
To override this, add the "refresh" param, e.g.
http://www.yourhost.com/my_images/slide ... refresh=10
to make it reload every 10 seconds.
The special value of refresh=0 will prevent the pages from
refreshing themselves. In any case, though, you can go to
the next page by clicking on the image.
bgcolor:
You can also override the default background color with the
bgcolor parameter. The following example would give a black
background:
http://www.yourhost.com/my_images/slide ... olor=black
Bug fixes? Comments? mail jamison at graystuff dot com.
****************************************************/
###############
# Constants
###############
# default number of seconds between automatic reload of the page
define("DEFAULT_REFRESH", "60");
define("DEFAULT_BGCOLOR", "black");
# acceptable file extensions for images. The comparison
# will ignore case. The "." should not be included.
# Go ahead and add any that I've missed.
$image_extensions = array('jpg', 'jpeg', 'gif', 'bmp');
#################
# Prepare information for rendering the page
#################
# page refresh: see if there's a defined refresh duration
# (in seconds), defined by the parameter "refresh".
# If so, override the default. The value "0" is a special
# value, indicating that automatic refresh is turned off.
if ($refresh == "") {
$refresh = DEFAULT_REFRESH;
}
# check for background color param
if ($bgcolor == "") {
$bgcolor = DEFAULT_BGCOLOR;
}
# Read in the list of filenames that have any of the
# accepted extensions
$handle=opendir(getcwd());
while (false !== ($file = readdir($handle))) {
# get the file extension
$parts = explode(".", $file);
$extension = end($parts);
# add file to fileArray if it has a matching extension
foreach ($image_extensions as $img_ext) {
if (!strcasecmp($extension, $img_ext)) {
$fileArray[count($fileArray)] = $file;
break;
}
}
}
closedir($handle);
sort($fileArray);
# Which image to display?
# if no index specified, default to first page
if ($index == "") {
$index = 0;
} elseif ($index >= count($fileArray)) {
$index = 0; # loop back to beginning
}
# assemble URL of current image
$imageURL = "./$fileArray[$index]";
#
# assemble URL for next page, to be automatically loaded
#
$nextIndex = ($index+1);
$nextURL="http://192.168.1.100$SCRIPT_NAME?index=$nextIndex";
# append the refresh rate, if not the default
if (strcmp($refresh, DEFAULT_REFRESH)) {
$nextURL = "$nextURL&refresh=$refresh";
}
if (strcmp($bgcolor, DEFAULT_BGCOLOR)) {
$nextURL = "$nextURL&bgcolor=$bgcolor";
}
##########################################################
# Generate the page
##########################################################
?>
<html>
<head>
<script>
function breakout_of_frame()
{
// see
http://www.thesitewizard.com/archive/framebreak.shtml
// for an explanation of this script and how to use it on your
// own website
if (top.location != location) {
top.location.href = document.location.href ;
}
}
</script>
<title>Image Slideshow: <? echo $fileArray[$index] ?> </title>
<? # only include the refresh tag if refresh is not 0
if ($refresh != "0") {
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"$refresh;URL=$nextURL\">";
}
?>
</head>
<body onload="breakout_of_frame()" bgcolor="black">
<center>
<a href="
http://192.168.1.100/~hammer32/LCARSindex2.html">
<img border=0 hspace=0 vspace=0
src="<? echo $imageURL ?>" alt="<? echo $fileArray[$index] ?>">
</a>
</center>
</body>