I’ve been working on an image slideshow script for my website and I’m having problems with the actual progression of the slideshow…I can’t figure out how to get it to navigate to the Next and Previous images…I’ve looked at the source of other slideshow scripts and I can’t seem to get it @_@ I don’t want to use another script, I want to build off what i have if possible…this is what i have so far:
[code] $img = 1;
$dirr = "../images/WP/";
$dir = opendir($dirr);
$i = 1;
$filearray = array( 0 => "0");
while( false != ($filename = readdir($dir)))
{
if( strlen($filename) > 3 )
{
$tot = array_push($filearray, $filename);
$i++;
}
}
closedir($dir);
$num = count($filearray) - 1;
$image = $dirr.$filearray[$img];[/code]
It reads the dir, gets the files in the directory (except for files under 3 characters because of my directory structure in my images dir), and adds those files to an array(which I thought would be useful o_O;…)
Thanks in advance for any help ^^;
I should add that $image at the bottom is used for the link and $num is just there to get the number of items in the array (minus the first item).