");
array_push($itemarray,"
");
array_push($itemarray,"". $THIS_URL .$attrs['IMG']."");
array_push($itemarray,"".$imgdate."");
array_push($itemarray,"". $THIS_URL .$attrs['IMG']."");
if ($albumpath == "") {
$category = "root";
}
else {
$category = $albumpath;
}
array_push($itemarray,"".$category."");
array_push($itemarray,"");
//*********************************************//
if ($slidenavigation == "Y") {
//Use Slide image navigator
array_push($itemarray,"<a title=\"". $attrs['IMG'] ." ". $attrs['TAGS'] ." ". strip_tags(trim($attrs['TITLE'])) . "\" href=\"".$BASE_URL."slidenav.php?folder=".$albumpath."&file=".$attrs['IMG']. "\"><img alt=\"". $attrs['IMG'] ." ". $attrs['TAGS'] ." ". strip_tags(trim($attrs['TITLE'])) . "\" src=\"". $THIS_URL .$attrs['THMB']. "\" width=\"" .$attrs['THUMBW']. "\" height=\"" .$attrs['THUMBH']. "\"></a><br>");
}
else {
//Link directly to slide
array_push($itemarray,"<a title=\"". $attrs['IMG'] ." ". $attrs['TAGS'] ." ". strip_tags(trim($attrs['TITLE'])) . "\" href=\"".$THIS_URL.$attrs['IMG']. "\"><img alt=\"". $attrs['IMG'] ." ". $attrs['TAGS'] ." ". strip_tags(trim($attrs['TITLE'])) . "\" src=\"". $THIS_URL .$attrs['THMB']. "\" width=\"" .$attrs['THUMBW']. "\" height=\"" .$attrs['THUMBH']. "\"></a><br>");
}
//*********************************************//
array_push($itemarray,"Date:".$imgdate."<br>");
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)) {
$descstart="y";
array_push($itemarray,"");
array_push($mainsort,$itemarray);
}
};
if ($name == "DESCRIPTION" && $writeind=="Y") {
if (isset($itemarray)) {
array_push($itemarray,"]]>");
}
};
}
//****************************************************************************************************************
function characterData($parser, $data)
{
global $currentTag, $itemarray,$writeind,$imagetag,$descstart;
switch ($currentTag) {
case "DESCRIPTION":
if ($writeind=="Y") {
if ($descstart=="y") {
array_push($itemarray, "Tags: ".$imagetag."
Description: ".strip_tags($data) );
$descstart="n";
}
else {
array_push($itemarray, strip_tags($data) );
}
}
break;
default:
break;
}
}
//****************************************************************************************************************
function processalbum($file,$folpath) {
global $depth, $mainsort,$itemcounts,$albumpath,$sortresults;
$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))) {
echo "File: ".$file. " ";
die('XML error '. 'String :'.xml_error_string(xml_get_error_code($xml_parser)) . ' at line '. xml_get_current_line_number($xml_parser) .' column: '. xml_get_current_column_number($xml_parser). ' Data: ' . htmlentities($data));
}
}
if ($sortresults=="Y") 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++ ) {
if (function_exists('iconv')) echo iconv( "iso-8859-1", "utf-8", $mainsort[$row][$column] );
else echo utf8_encode($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'];
if (strlen(dirname($_SERVER['PHP_SELF'])) != 1)
$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
if (isset($_REQUEST["debug"]))
header("Content-Type: text/txt; charset=UTF-8");
else
{
header("Content-Type: text/xml; charset=utf-8");
echo "\n";
echo("");
echo("");
echo("FotoPlayer.com RSS feeder");
echo("http://www.fotoplayer.com");
echo("2005 fotoplayer.com Allrights reserved. Photos may not be copied without author's permission");
echo("dhinakar.com@gmail.com");
echo("dhinakar.com@gmail.com");
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.fotoplayer.com");
echo("");
}
global $mainsort;
$mainsort = array();
if ($albumpath != "" && $albumpath != "all/") {
$xmlpath = $albumpath."photos.xml";
if (file_exists($xmlpath)) {
processalbum($xmlpath,$albumpath);
if ($includesubfolders=="Y") map_dirs($albumpath);
}
}
if ($albumpath == "" ) {
$xmlpath = "photos.xml";
if (file_exists($xmlpath)) {
if (isset($_REQUEST["debug"])) echo "\r\n". "processing folder: root \r\n";
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) {
$subalbumfound="n";
if ($path==".") {
$folpath = $node."/";
if (isset($_REQUEST["debug"])) echo "\r\n processing path " . $path . " Node: " . $node;
if ( file_exists($folpath."res/") ) $subalbumfound="y";
}
else {
$folpath = $path."/".$node."/";
$folpath = ltrim($folpath,'./');
if ( file_exists($folpath."res/") ) $subalbumfound="y";
}
if( substr($node,0,1)!="." && substr($node,0,4)!="_vti" && $node!="res" && file_exists($folpath."photos.xml") && $subalbumfound=="n" && $node !="images" && $node != "slides" && $node !="thumbs" && $node !="rss_styles" && $node!= "." && $node!= ".." ) {
if (isset($_REQUEST["debug"])) echo "\r\n". "processing folder: ".$folpath. "\r\n";
processalbum($folpath."photos.xml",$folpath);
map_dirs("$path/$node");
}
}
}
}
}
echo("");
echo("");
?>