<< Back\\n');\n"; echo "// here ${id}\n"; if (preg_match("/^[0-9]*$/",$id)) { echo "// Loading ID=${id}\n"; // caching if(!file_exists("cache/".$id.".php") or (time()-filemtime("cache/".$id.".php"))>86400) { $handle = fopen($url, "rb"); if ($handle) { $fp = fopen("cache/".$id.".php","w"); fwrite($fp,"\n"); fclose($fp); fclose($handle); } } include 'cache/'.$id.'.php'; $xml = new SimpleXMLElement($xmlstr); /* For each node. */ foreach ($xml->channel->item as $item) { //print_r($item); $title = $item->title; $desc = $item->description; $link = $item->link; $enclosure = $item->enclosure; // Process desc $desc = urldecode($desc); //$desc = str_replace("http://picasaweb.google.com/AcidumIrae/",$enclosure["url"]."\">View Photo",$desc); //$desc = str_replace(">$title\n"; echo "document.write('

".str_replace("'","\\'",$desc)."

\\n');\n"; } } } if (!$loaded) { // Load the list of galleries $url = "http://picasaweb.google.com/data/feed/base/user/AcidumIrae?kind=album&alt=rss&hl=en"; // caching if(!file_exists("cache/picassa.php") or (time()-filemtime("cache/picassa.php"))>86400) { $handle = fopen($url, "rb"); if ($handle) { $fp = fopen("cache/picassa.php","w"); fwrite($fp,"\n"); fclose($fp); fclose($handle); } } include 'cache/picassa.php'; $xml = new SimpleXMLElement($xmlstr); /* For each node. */ foreach ($xml->channel->item as $item) { $title = $item->title; if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/",$title)) continue; $guid = $item->guid; $link = $item->link; $desc = $item->description; // process guid $guid = strtok($guid,"?"); $guid = str_replace("/entry/","/feed/",$guid); $guid.= "?kind=photo&alt=rss&hl=en"; $part = "?go=".urlencode(substr($guid,78)); // process description $desc = urldecode($desc); $desc = str_replace($link,$part,$desc); //print_r($item); echo "document.write('

".str_replace("'","\\'",$title)."

\\n');\n"; //echo "\n"; //echo "\n"; echo "document.write('
".str_replace("'","\\'",$desc)."
\\n');\n"; } } ?>