Need help solving the last piece to my slideshow puzzle. When I read from the
directory where my photos stored it generates my slideshow array, everything
is working in regards to the photos, it is the text that comes with each photo
that i am having a problem with.
Here is the section I am having problems with:
$photo_text_file = '/www/photos/'.$gallery_id.'/photos.txt';
$directory = '/www/photos/'.$gallery_id';
if (file_exists($photo_text_file))
{
include ($photo_text_file);
}
if (is_dir($directory))
{
$get_photos = @opendir($directory);
while (($part = @readdir($get_photos)) == true)
{
clearstatcache();
if ($part != "." && $part != "..")
{
$count++;
$img_count = $count - 1;
print "ImageList[".$img_count."]=new imageObjects(\"/photos/".$gallery_id."/".$part."\",\"\",\"still\")\n";
}
}
}
The above code produces the following javascript:
ImageList[0]=new imageObjects("/photos/tp001-972206/photo1.jpg","","still")
ImageList[1]=new imageObjects("/photos/tp001-972206/photo2.jpg","","still")
ImageList[2]=new imageObjects("/photos/tp001-972206/photo3.jpg","","still")
ImageList[3]=new imageObjects("/photos/tp001-972206/photo4.jpg","","still")
ImageList[4]=new imageObjects("/photos/tp001-972206/photo5.jpg","","still")
and so on ...
imageObjects("IMAGE","IMAGE TEXT","IMAGE TYPE")
The 2nd one in is where I am having problems IMAGE TEXT, the file that is included is the text for each image.
$photo1 = "This is the first photo";
$photo2 = "This is the second photo";
$photo3 = "This is the third photo";
$photo4 = "This is the fourth photo";
I am having problems getting the text portion of the script into the following line
ImageList[".$img_count."]=new imageObjects(\"/photos/".$gallery_id."/".$part."\",\"".$photo1."\",\"still\")