* Last Updated: January 2, 2004 * */ /* Authored in the Gallery coding style, because * I think it makes hacking quite easy. */ /* Hack prevention. */ if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) || !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) { print _("Security violation") ."\n"; exit; } if (!isset($GALLERY_BASEDIR)) { $GALLERY_BASEDIR = './'; } require($GALLERY_BASEDIR . 'init.php'); $gallery->session->offlineAlbums["albums.php"] = true; /* Read the album list */ $albumDB = new AlbumDB(FALSE); $gallery->session->albumName = ""; $page = 1; $noDCDate = FALSE; /* If there are albums in our list, display them in the table */ $numAlbums = 0; $albumList = array(); if (method_exists($albumDB, "getCachedNumPhotos")) { $numPhotos = $albumDB->getCachedNumPhotos($gallery->user); } else { $numPhotos = $albumDB->numPhotos($gallery->user); } foreach ($albumDB->albumList as $album) { if (! $gallery->user->canReadAlbum($album)) { continue; } $numAlbums++; $albumInfo = array( "name" => $album->fields["name"], "last_mod_time" => $album->getLastModificationDate(), "title" => $album->fields["title"], "description" => $album->fields["description"], "comments" => (method_exists($album, "canViewComments")) ? $album->canViewComments($gallery->user->uid) : FALSE); array_push($albumList, $albumInfo); } $displayCommentLegend = 0; if (is_callable('pluralize_n')) { $total_str = pluralize_n($numAlbums, _("1 album"), _("albums"), _("no albums")); $image_str = pluralize_n($numPhotos, _("1 photo"), _("photos"), _("no photos")); } else { /* Probably older version of Gallery */ $total_str = pluralize($numAlbums, "album", "no"); $image_str = pluralize($numPhotos, "photo", "no"); } function albumSort($a, $b) { $aTime = strtotime($a["last_mod_time"]); $bTime = strtotime($b["last_mod_time"]); if ($aTime < $bTime) { return 1; } else { return -1; } } $description = sprintf(_("%s in %s"), $image_str, $total_str); @header("Content-Type: text/xml"); echo '<' . '?' . 'xml version="1.0"' . '?' . '>'; ?> <?= htmlspecialchars($gallery->app->galleryTitle) ?> app->photoAlbumURL ?> app->default_language)) { ?> app->default_language ?> app->adminEmail)) { ?> app->adminEmail ?> app->adminEmail ?> Gallery Generator v0.2 http://blogs.law.harvard.edu/tech/rss 40 <?= htmlspecialchars($album["title"]) ?> $tmpAlbumName)); ?>