session->username)) {
/* Get the cached version if possible */
$cache_file = "cache.html";
if (!getRequestVar('gallery_nocache')) {
$cache_now = time();
foreach (array(sprintf("cache-%s.html", $_SERVER['HTTP_HOST']), "cache.html")
as $cache_file_basename) {
$cache_file = dirname(__FILE__) . '/' . $cache_file_basename;
if (fs_file_exists($cache_file)) {
$cache_stat = @stat($cache_file);
if ($cache_now - $cache_stat[9] < (20 * 60)) {
if ($fp = fopen($cache_file, "rb")) {
while (!feof($fp)) {
print fread($fp, 4096);
}
fclose($fp);
printf("",
$cache_file_basename,
strftime("%D %T", $cache_stat[9]));
return;
}
}
}
}
}
}
$gallery->session->offlineAlbums["albums.php"]=true;
/* Read the album list */
$albumDB = new AlbumDB(FALSE);
$gallery->session->albumName = "";
$page = 1;
/* If there are albums in our list, display them in the table */
list ($numPhotos, $numAccess, $numAlbums) = $albumDB->numAccessibleItems($gallery->user);
if (empty($gallery->session->albumListPage)) {
$gallery->session->albumListPage = 1;
}
$perPage = $gallery->app->albumsPerPage;
$maxPages = max(ceil($numAlbums / $perPage), 1);
if ($gallery->session->albumListPage > $maxPages) {
$gallery->session->albumListPage = $maxPages;
}
$pixelImage = '
';
$borderColor = $gallery->app->default["bordercolor"];
$navigator["page"] = $gallery->session->albumListPage;
$navigator["pageVar"] = "set_albumListPage";
$navigator["url"] = makeGalleryUrl("albums.php");
$navigator["maxPages"] = $maxPages;
$navigator["spread"] = 6;
$navigator["fullWidth"] = 100;
$navigator["widthUnits"] = "%";
$navigator["bordercolor"] = $borderColor;
$displayCommentLegend = 0; // this determines if we display "* Item contains a comment" at end of page
/*
** when direction is ltr(left to right) everything is fine)
** when rtl(right to left), like in hebrew, we have to switch the alignment at some places.
*/
if ($gallery->direction == 'ltr') {
$left="left";
$right="right";
}
else {
$left="right";
$right="left";
}
if (!$GALLERY_EMBEDDED_INSIDE) {
doctype();
?>
| '; echo makeFormIntro('search.php', array( 'name' => 'search_form', 'method' => 'post')); echo ''. _("Search") .': '; echo ''; echo ' | '; } ?>
". _("Attention Gallery Administrator!") ."
"; if (sizeof($albumDB->brokenAlbums)) { echo sprintf(_("%s has detected the following %d invalid album(s) in your albums directory";
foreach ($albumDB->brokenAlbums as $tmpAlbumName) {
echo "
$tmpAlbumName\n";
}
echo "\n
". _("Attention!") ."
"; echo sprintf(_('The album or photo that you were attempting to view either does not exist, or requires user privileges that you do not posess. %s'), ($gallery->user->isLoggedIn() && !$GALLERY_EMBEDDED_INSIDE ? '' : sprintf(_("%s and try again."), popup_link(_("Log in"), "login.php", false, true, 500, 500)))); echo "\n
html_wrap['borderColor'] = $borderColor;
$gallery->html_wrap['borderWidth'] = 1;
$gallery->html_wrap['pixelImage'] = getImagePath('pixel_trans.gif');
$scaleTo = $gallery->app->highlight_size;
list($iWidth, $iHeight) = $gallery->album->getHighlightDimensions($scaleTo);
if (!$iWidth) {
$iWidth = $gallery->app->highlight_size;
$iHeight = 100;
}
$gallery->html_wrap['imageWidth'] = $iWidth;
$gallery->html_wrap['imageHeight'] = $iHeight;
$gallery->html_wrap['imageTag'] = $gallery->album->getHighlightTag($scaleTo,'', _("Highlight for Album:") ." ". $gallery->album->fields["title"]);
$gallery->html_wrap['imageHref'] = $albumURL;
$gallery->html_wrap['frame'] = $gallery->app->gallery_thumb_frame_style;
includeHtmlWrap('inline_gallerythumb.frame');
?>
";
echo "\n\t$description";
echo "\n ";
}
if (strcmp($gallery->app->showOwners, "no")) {
echo "\n";
echo _("Owner:") . ' '. showOwner($owner);
echo ' ';
}
if ($gallery->user->isAdmin() || $gallery->user->isOwnerOfAlbum($gallery->album)) {
echo _("url:") . '';
if (!$gallery->session->offline) {
echo breakString(urldecode($albumURL), 60, '&', 5);
} else {
echo $tmpAlbumName;
}
echo '';
if (ereg("album[[:digit:]]+$", $albumURL)) {
if (!$gallery->session->offline) {
echo ''. _("Hey!") . sprintf(_("%s so that the URL is not so generic!"), popup_link(_("Rename this album"), "rename_album.php?set_albumName={$tmpAlbumName}&index=$i",0,0,500,500,"error")); echo ''; } } } ?> album->getLastModificationDate() ); $visibleItems=array_sum($gallery->album->numVisibleItems($gallery->user)); echo " "; // Need a space between these two text blocks echo pluralize_n2(ngettext("This album contains 1 item.", "This album contains %d items.", $visibleItems), $visibleItems); if (!($gallery->album->fields["display_clicks"] == "no") && !$gallery->session->offline) { ?> album->getClicks(); echo sprintf(_("This album has been viewed %s since %s."), pluralize_n2(ngettext("1 time", "%d times", $clickCount), $clickCount, _("0 times")), $gallery->album->getClicksDate()); } $albumName=$gallery->album->fields["name"]; if ($gallery->user->canWriteToAlbum($gallery->album) && (!($gallery->album->fields["display_clicks"] == "no"))) { echo " ".popup_link("[" . _("reset counter") ."]", doCommand("reset-album-clicks", array("set_albumName" => $albumName), "albums.php"), 1); } if($gallery->app->comments_enabled == 'yes') { // if comments_indication are "albums" or "both" switch ($gallery->app->comments_indication) { case "albums": case "both": $lastCommentDate = $gallery->album->lastCommentDate($gallery->app->comments_indication_verbose); print lastCommentString($lastCommentDate, $displayCommentLegend); } // end switch } ?> |
||||||