session->username)) { /* Get the cached version if possible */ $cache_file = "cache.html"; if (!getRequestVar('gallery_nocache')) { $cache_now = time(); $cacheFileBaseNames = array(sprintf("cache-%s.html", $_SERVER['HTTP_HOST']), "cache.html"); foreach ($cacheFileBaseNames 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); if(! $albumDB->isInitialized()) { exit; } $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) { $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 = false; // this determines if we display "* Item contains a comment" at end of page $currentUrl = makeGalleryUrl("albums.php", array("page" => $gallery->session->albumListPage)); if (!$GALLERY_EMBEDDED_INSIDE) { $title = htmlspecialchars($gallery->app->galleryTitle); doctype(); ?>
'. addSearchForm('', 'right') .' | '; } ?>
". gTranslate('core', "Attention Gallery administrator!") ."
"; if (sizeof($albumDB->brokenAlbums)) { echo sprintf(gTranslate('core', "%s has detected the following %d invalid album(s) in your albums directory";
foreach ($albumDB->brokenAlbums as $tmpAlbumName) {
echo "
$tmpAlbumName\n";
}
echo "\n
". gTranslate('core', "Attention!") ."
"; printf(gTranslate('core', 'The album or photo that you were attempting to view either does not exist, or requires user privileges that you do not possess. %s'), ($gallery->user->isLoggedIn() && !$GALLERY_EMBEDDED_INSIDE ? '' : sprintf(gTranslate('core', "%s and try again."), popup_link(gTranslate('core', "Log in"), "login.php", false, true, 500, 500))) ); echo "\napp->albumTreeDepth) && $gallery->app->albumTreeDepth > 0) { ?> | ||||||||
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 (empty($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, array('alt' => gTranslate('core', "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 ";
}
/*
* Owner
*/
if (strcmp($gallery->app->showOwners, "no")) {
echo "\n";
echo sprintf(gTranslate('core', "Owner: %s"),showOwner($owner));
echo ' ';
}
/*
* Url (only for admins and owner)
*/
if ($gallery->user->isAdmin() || $gallery->user->isOwnerOfAlbum($gallery->album)) {
echo gTranslate('core', "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 ''. gTranslate('core', "Hey!") . sprintf(gTranslate('core', "%s so that the URL is not so generic!"), popup_link(gTranslate('core', "Rename this album"), "rename_album.php?set_albumName={$tmpAlbumName}&index=$i",0,0,500,500,"error")); echo ''; } } } echo "\n "; /* * Created / Last Changed */ $creationDate = $gallery->album->getCreationDate(); $lastModifiedDate = $gallery->album->getLastModificationDate(); if($creationDate) { printf(gTranslate('core', "Created on %s, last changed on %s."), $creationDate, $lastModifiedDate); } else { printf(gTranslate('core', "Last changed on %s."), $lastModifiedDate); } /* * Amount of items */ echo ' '; // Need a space between these two text blocks list($visibleItems) = $gallery->album->numItems($gallery->user, true); echo gTranslate('core', "This album contains 1 item.", "This album contains %d items.", $visibleItems, gTranslate('core', "This album is empty."), true ); /* * Click counter + reset for it */ if (!($gallery->album->fields["display_clicks"] == "no") && !$gallery->session->offline) { $clickCount = $gallery->album->getClicks(); $resetDate = $gallery->album->getClicksDate(); echo "\n "; printf(gTranslate('core', "This album has been viewed %d time since %s.", "This album has been viewed %d times since %s.", $clickCount, sprintf(gTranslate('core', "This album has never been viewed since %s."), $resetDate) ), $clickCount, $resetDate ); } $albumName = $gallery->album->fields["name"]; if ($gallery->user->canWriteToAlbum($gallery->album) && (!($gallery->album->fields["display_clicks"] == "no"))) { echo " ".popup_link(gTranslate('core', "reset counter"), doCommand("reset-album-clicks", array("set_albumName" => $albumName, "type" => "popup"), "albums.php"), 1); } /* * Comment Indicator */ 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); break; } } echo "\n"; // End Album Infos // Start tree if ( isset($gallery->app->albumTreeDepth) && $gallery->app->albumTreeDepth > 0) if (isset($gallery->app->microTree) && $gallery->app->microTree == 'yes') { ?> |