");
array_push($itemarray,"
".$attrs['TITLE']."");
array_push($itemarray,"". $THIS_URL .$attrs['IMG']."");
array_push($itemarray,"".$imgdate."");
array_push($itemarray,"". $THIS_URL .$attrs['IMG']."");
array_push($itemarray,"");
array_push($itemarray,"<a href=\"".$THIS_URL.$attrs['IMG']. "\"><img style=\"padding:5px;border:1px solid #666666;background:#eeeeee; \" src=\"". $THIS_URL .$attrs['THMB']. "\" width=\"" .$attrs['THUMBW']. "\" height=\"" .$attrs['THUMBH']. "\"></a><br>");
array_push($itemarray,"Date:".$imgdate."<br>");
if ($albumpath == "") {
$category = "root";
}
else {
$category = $albumpath;
}
array_push($itemarray,"Album Category:".$category."<br>");
if ( strpos($attrs['IMG'],"slides") == 0) { $slideremoved= substr($attrs['IMG'],7);}
else { $slideremoved =$attrs['IMG'];}
array_push($itemarray,"<a href=\"".$BASE_URL."index.html?openfolder=".$albumpath."&openfile=".$slideremoved."\">Click here</a> to view album containing this image.<br>");
};
if ($name == "DESCRIPTION") {
if (isset($itemarray)) {
array_push($itemarray,"");
array_push($mainsort,$itemarray);
}
};
if ($name == "DESCRIPTION") {
if (isset($itemarray)) {
array_push($itemarray,"]]>");
}
};
}
//****************************************************************************************************************
function characterData($parser, $data)
{
global $currentTag, $itemarray;
switch ($currentTag) {
case "DESCRIPTION":
array_push($itemarray,$data);
break;
default:
break;
}
}
//****************************************************************************************************************
function processalbum($file,$folpath) {
global $depth, $mainsort,$itemcounts,$albumpath;
$albumpath = $folpath ;
$depth = array();
$fp = "";$data ="";$mainsort= array();
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!($fp = fopen($file, "r"))) {
die("could not open XML input");
}
while ($data = fread($fp, 4096)) {
$data = urldecode($data);
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
usort($mainsort, 'compare');
$tempcount=count($mainsort);
if ($itemcounts < $tempcount) {
$tempcount=$itemcounts;
};
for ( $row = 0; $row < $tempcount; $row++ ) {
for ( $column = 1; $column < count($mainsort[$row]); $column++ ) {
echo $mainsort[$row][$column];
};
};
fclose($fp);
xml_parser_free($xml_parser);
} //processalbum function ends here
//****************************************************************************************************************
function compare($x, $y)
{
if ( $x[0] == $y[0] )
return 0;
else if ( $x[0] < $y[0] )
return 1;
else
return -1;
}
//****************************************************************************************************************
$URL_IMG = 'http://' . $_SERVER['SERVER_NAME'];
$URL_IMG.= dirname($_SERVER['PHP_SELF']);
$tm=time(); $tm=date("D, d M Y H:i:s",$tm);
$tm=$tm. " GMT"; // you can add your format
header("Content-Type: text/xml; charset=utf-8");
echo "\n";
echo("");
echo("");
echo("Zooblum.be RSS feeder");
echo("http://www.zooblum.be");
echo("2005 zooblum.be Allrights reserved. Photos may not be copied without author's permission");
echo("cmarq@zooblum.be");
echo("cmarq@zooblum.be");
echo("RSS feed");
echo("Photo album");
echo("".$tm."");
echo("FP_RSS 0.1");
echo("60");
echo("");
echo("FP_RSS 0.1");
echo("".$URL_IMG."/res/fotoplayer.gif"."");
echo("http://www.zooblum.be/link>");
echo("");
global $mainsort;
$mainsort = array();
if ($albumpath != "" && $albumpath != "all/") {
$xmlpath = $albumpath."photos.xml";
if (file_exists($xmlpath)) {
processalbum($xmlpath,$albumpath);
}
}
if ($albumpath == "" ) {
$xmlpath = "photos.xml";
if (file_exists($xmlpath)) {
processalbum($xmlpath,$albumpath);
}
}
if ($albumpath == "all/") {
$albumpath =""; $xmlpath = "photos.xml";
if (file_exists($xmlpath)) {
processalbum($xmlpath,$albumpath);
}
map_dirs(".");
}
function map_dirs($path) {
if(is_dir($path)) {
if($contents = opendir($path)) {
while(($node = readdir($contents)) !== false) {
if( (!strpos($node,".")) && $node!="res" && $node !="images" && $node != "slides" && $node !="thumbs" && $node !="rss_styles" && $node!= "." && $node!= ".." ) {
if ($path==".") {
$folpath = $node."/";
if (file_exists($folpath."photos.xml")) {
processalbum($folpath."photos.xml",$folpath);
}
}
else {
$folpath = $path."/".$node."/";
$folpath = ltrim($folpath,'./');
if (file_exists($folpath."photos.xml")) {
processalbum($folpath."photos.xml",$folpath);
}
}
map_dirs("$path/$node");
}
}
}
}
}
echo("");
echo("");
?>