I have found a slide show that is called intelligent due to it using php to look into a folder and collect all the images in that folder and then create an xml file with a list of all the images which is in turn passed to Flash.
This application is from web site I did try and comment on there web site but no respons
http://www.thetechlabs.com/tutorials/xml/create-an-intelligent-xml-image-gallery-slideshow-in-flash-cs4-php-part-iii/
I am having some trouble getting part of the php script to work. A short break down of the project. This is a Flash slideshow that is using two php files that find and list the images into an xml file then Flash retrieves these files dynamically. Yes this is using Flash and PHP, the Flash part is fine it is just the PHP script is causing an error. This error is not allowing the imagehandler.php to create the xml file with a list of the images in the particular folder.
When I test these php codes I am getting an error:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/soatman/public_html/gallery/imageHandler.php on line 4
The web address for this project is:
The full gallery
http://www.steveoatman.me/gallery
Which is not working of course
This is a link to the imagehandler.php were the error is located
http://www.steveoatman.me/gallery/imageHandler.php
The other file dscover.php which is throwing the same error refereeing to the imagehandler.phph file
http://www.steveoatman.me/gallery/discover.php
The script to both of these files is below:
discover.php
<?php
include_once("imageHandler.php");
$tm=new imageHandler();
$data=$tm->getImageList("./");
echo($tm->ary2xml($data,0,'',"images.xml"));
?>
The second one is
Imagehandler.php
<?php
class imageHandler {
public function getImageList($path="") {
if(file_exists($path))
{
$i1="jpg";
$i2="png";
$i3="jpeg";
foreach(array_diff(scandir($path),array('.','..')) as $f) {
if(is_file($path.'/'.$f) && (($i1)?ereg($i1.'$',$f):1) ||
(($i2)?ereg($i2.'$',$f):1) || (($i3)?ereg($i3.'$',$f):1) ) $l[]=$f;
}
return $l;
}
else return "Path do not Exists!";
}
public function ary2xml($arr, $d=0, $forcetag='', $file_name='') {
$data="<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n";
$data.="<images>\r\n";
for($h=0; $h<count($arr); $h++) {
$data.="<image nameI=\"".$arr[$h]."\" thumb=\"".$arr[$h]."\" />\r\n";
}
$data.="</images>";
if($file_name!='') {
@unlink($file_name);
$myFile = $file_name;
$fh = fopen($myFile, 'w');
fwrite($fh, $data);
fclose($fh);
return $file_name;
}
else return $data;
}
}
?>
Any and all help will be greatly appreciated!
Thank you!