loadXml($picasaweb_xml);
$picasaweb_xpath = new domxpath($picasaweb_dom);
$picasa_nodes = $picasaweb_xpath->query('//entry');
$img_files = array();
$img_thumbs = array();
$img_keywords = array();
$img_titles = array();
foreach ($picasa_nodes as $picasa_node) {
//original $picasa_keywords = $picasaweb_xpath->query('.//media:keywords', $picasa_node)->item(0)->firstChild->data;
$picasa_imageUrl = $picasaweb_xpath->query('.//media:content/@url', $picasa_node)->item(0)->textContent;
$picasa_thumbUrl = $picasaweb_xpath->query('.//media:thumbnail/@url', $picasa_node)->item(0)->textContent;
$picasa_keywords = $picasaweb_xpath->query('.//media:keywords', $picasa_node)->item(0)->nodeValue;
$picasa_mediatitle = $picasaweb_xpath->query('.//media:title', $picasa_node)->item(0)->nodeValue;
array_push($img_files, htmlentities($picasa_imageUrl));
array_push($img_thumbs, htmlentities($picasa_thumbUrl));
array_push($img_keywords, htmlentities($picasa_keywords));
array_push($img_titles, htmlentities($picasa_mediatitle));
}
} else {
$img_files = $_SESSION[$img_anchor."_files"];
$img_thumbs = $_SESSION[$img_anchor."_thumbs"];
$img_keywords = $_SESSION[$img_anchor."_keywords"] = $img_keywords;
$img_titles = $_SESSION[$img_anchor."_titles"];
}
$env_script = $_SERVER["REQUEST_URI"];
$slideshow = 0;
if (isset($_GET['imgindex'])) {
$imgindex = $_GET['imgindex'];
if (isset($_GET['slideshow'])) {
$slideshow = $_GET['slideshow'];
if (is_numeric($slideshow)) {
$slideshow = intval($slideshow);
if ($slideshow > 60) $slideshow = 60;
} else {
$slideshow = 0;
}
}
$env_script = ereg_replace("[\?\&]imgindex=(.*)", "", $env_script);
$env_script = ereg_replace("[\?\&]slideshow=(.*)", "", $env_script);
} else {
$imgindex = 0;
}
if (isset($_GET['imgpage'])) {
$imgpage = $_GET['imgpage'];
$env_script = ereg_replace("[\?\&]imgpage=(.*)", "", $env_script);
} else {
$imgpage = 1;
}
$appender = "?";
if (preg_match('/\?/', $env_script) > 0) $appender = "&";
echo "There are currently ".count($img_files).' images in this photoset.
'."\n";
$imgpages = ceil(count($img_files) / $img_perpage);
if ($imgindex < 0 || $imgindex > count($img_files)) $imgindex = 0;
if ($imgpage < 1 || $imgpage > $imgpages) $imgpage = 1;
if ($img_perline < 1) $img_perline = 1;
if ($img_perpage < $img_perline) $img_perpage = $img_perline;
while ($img_perpage % $img_perline != 0) $img_perpage++;
if ($imgindex == 0) {
$startindex = ($imgpage-1) * $img_perpage + 1;
slideshowformation($startindex, $sscolor, $slideshow_default, $slideshow, $env_script, $imgindex);
echo "You are viewing thumbnails page $imgpage of $imgpages.\n";
}
while (list($xxxkeyxxx, $xxxvaluexxx) = each($img_files)) {
$xxxkeyindexxxx = $xxxkeyxxx + 1;
$xxxkeyindexpreviousxxx = $xxxkeyindexxxx - 1;
$xxxkeypreviousxxx = $xxxkeyxxx - 1;
$xxxkeyindexnextxxx = $xxxkeyindexxxx + 1;
if ($imgindex > 0) {
if ($imgindex == $xxxkeyindexxxx) {
slideshowformation($imgindex, $sscolor, $slideshow_default, $slideshow, $env_script, $imgindex);
echo "\n";
echo "You are viewing image number $imgindex. ".$img_titles[$xxxkeyxxx]."
\n";
echo "\n";
if (count($img_files) > 1) {
echo "
| Previous "; echo " "; echo "$xxxkeyindexpreviousxxx. ".$img_titles[$xxxkeypreviousxxx]." | \n";
}
$imgpage = ceil($imgindex / $img_perpage);
echo "Return to thumbnails index \n"; echo "Go to thumbnails page"; $i = 1; while ($i <= $imgpages) { echo " $i"; $i++; } echo " | \n";
if ($imgindex < count($img_files)) {
echo "Next "; echo " "; echo "$xxxkeyindexnextxxx. ".$img_titles[$xxxkeyindexxxx]." | \n";
}
echo "
| ";
echo " "; echo "$xxxkeyindexxxx. ".$img_titles[$xxxkeyxxx]." | \n";
if ($xxxkeyindexxxx % $img_perline == 0 || $xxxkeyindexxxx == count($img_files)) {
echo "
| Previous page of thumbnails group | \n"; echo "Go to thumbnails page"; $i = 1; while ($i <= $imgpages) { echo " $i"; $i++; } echo " | \n"; if ($imgpage < $imgpages) echo "Next page of thumbnails group | \n"; echo "