session->albumName) || !$gallery->user->canReadAlbum($gallery->album) || !$gallery->album->isLoaded()) { $gallery->session->gRedirDone = false; header("Location: " . makeAlbumHeaderUrl('', '', array('gRedir' => 1))); return; } $gallery->session->offlineAlbums[$gallery->album->fields["name"]]=true; $page = intval($page); if (empty($page) || $page < 0) { if (isset($gallery->session->albumPage[$gallery->album->fields['name']])) { $page = $gallery->session->albumPage[$gallery->album->fields["name"]]; } else { $page = 1; } } else { $gallery->session->albumPage[$gallery->album->fields["name"]] = $page; } $albumName = $gallery->session->albumName; $noCount = getRequestVar('noCount'); if ($noCount != 1 && !isset($gallery->session->viewedAlbum[$albumName]) && !$gallery->session->offline) { $gallery->session->viewedAlbum[$albumName] = 1; $gallery->album->incrementClicks(); } $rows = $gallery->album->fields["rows"]; $cols = $gallery->album->fields["cols"]; list ($numPhotos, $numAlbums, $visibleItems) = $gallery->album->numVisibleItems($gallery->user, 1); $numVisibleItems = $numPhotos + $numAlbums; $perPage = $rows * $cols; $maxPages = max(ceil(($numPhotos + $numAlbums) / $perPage), 1); if ($page > $maxPages) { $page = $maxPages; } $start = ($page - 1) * $perPage + 1; $end = $start + $perPage; $nextPage = $page + 1; if ($nextPage > $maxPages) { $nextPage = 1; $last = 1; } $previousPage = $page - 1; if ($previousPage == 0) { $previousPage = $maxPages; $first = 1; } if (!empty($Vote)) { if ($gallery->album->getPollScale() == 1 && $gallery->album->getPollType() != "rank") { for ($index=$start; $index < $start+$perPage; $index ++) { $id=$gallery->album->getPhotoId($index); if (!$votes[$id]) { $votes[$id]=null; } } } saveResults($votes); } $bordercolor = $gallery->album->fields["bordercolor"]; $imageCellWidth = floor(100 / $cols) . "%"; $navigator["page"] = $page; $navigator["pageVar"] = "page"; $navigator["maxPages"] = $maxPages; $navigator["fullWidth"] = "100"; $navigator["widthUnits"] = "%"; $navigator["url"] = makeAlbumUrl($gallery->session->albumName); $navigator["spread"] = 5; $navigator["bordercolor"] = $bordercolor; $fullWidth = $navigator["fullWidth"] . $navigator["widthUnits"]; $upArrowURL = gImage('nav_home.gif', gTranslate('core', "navigate UP")); if ($gallery->album->fields['returnto'] != 'no') { foreach ($gallery->album->getParentAlbums() as $navAlbum) { $breadcrumb["text"][] = $navAlbum['prefixText'] .': '. $navAlbum['title'] . " " . $upArrowURL . ""; } } $breadcrumb["bordercolor"] = $bordercolor; global $GALLERY_EMBEDDED_INSIDE; if (!$GALLERY_EMBEDDED_INSIDE) { $title = sprintf( htmlspecialchars($gallery->app->galleryTitle) . " :: " . htmlspecialchars($gallery->album->fields["title"]) ); doctype(); ?>
'. $gallery->album->fields["summary"] . '
| \n");
//-- put some parameters for the wrap files in the global object ---
$gallery->html_wrap['borderColor'] = $bordercolor;
$borderwidth= $gallery->html_wrap['borderWidth'] = $borderwidth;
$gallery->html_wrap['pixelImage'] = getImagePath('pixel_trans.gif');
if ($gallery->album->isAlbum($i)) {
$scaleTo = 0; //$gallery->album->fields["thumb_size"];
$myAlbum = $gallery->album->getNestedAlbum($i);
list($iWidth, $iHeight) = $myAlbum->getHighlightDimensions($scaleTo);
} else {
unset($myAlbum);
$scaleTo=0; // thumbs already the right
// size for this album
list($iWidth, $iHeight) = $gallery->album->getThumbDimensions($i, $scaleTo);
}
if ($iWidth == 0) {
$iWidth = $gallery->album->fields["thumb_size"];
}
if ($iHeight == 0) {
$iHeight = 100;
}
$gallery->html_wrap['imageWidth'] = $iWidth;
$gallery->html_wrap['imageHeight'] = $iHeight;
$id = $gallery->album->getPhotoId($i);
if ($gallery->album->isMovieByIndex($i)) {
$gallery->html_wrap['imageTag'] = $gallery->album->getThumbnailTag($i);
$gallery->html_wrap['imageHref'] = makeAlbumUrl($gallery->session->albumName, $id);
$frame= $gallery->html_wrap['frame'] = $gallery->album->fields['thumb_frame'];
/*begin backwards compatibility */
$gallery->html_wrap['thumbTag'] = $gallery->html_wrap['imageTag'];
$gallery->html_wrap['thumbHref'] = $gallery->html_wrap['imageHref'];
/*end backwards compatibility*/
list($divCellWidth, $divCellHeight, $padding) = calcVAdivDimension($frame, $iHeight, $iWidth, $borderwidth);
// If there is only one column, we don't need to try and match row heights
if ($cols == 1) {
$padding = 0;
}
echo " \n";
includeHtmlWrap('inline_moviethumb.frame');
} elseif (isset($myAlbum)) {
// We already loaded this album - don't do it again, for performance reasons.
$gallery->html_wrap['imageTag'] = $myAlbum->getHighlightTag($scaleTo,'',gTranslate('core', "Highlight for Album:"). " ". gallery_htmlentities(strip_tags($myAlbum->fields['title'])));
$gallery->html_wrap['imageHref'] = makeAlbumUrl($gallery->album->getAlbumName($i));
$frame= $gallery->html_wrap['frame'] = $gallery->album->fields['album_frame'];
/*begin backwards compatibility */
$gallery->html_wrap['thumbWidth'] = $gallery->html_wrap['imageWidth'];
$gallery->html_wrap['thumbHeight'] = $gallery->html_wrap['imageHeight'];
$gallery->html_wrap['thumbTag'] = $gallery->html_wrap['imageTag'];
$gallery->html_wrap['thumbHref'] = $gallery->html_wrap['imageHref'];
/*end backwards compatibility*/
list($divCellWidth,$divCellHeight, $padding) = calcVAdivDimension($frame, $iHeight, $iWidth, $borderwidth);
echo " \n";
includeHtmlWrap('inline_albumthumb.frame');
} else {
$gallery->html_wrap['imageTag'] = $gallery->album->getThumbnailTag($i);
$gallery->html_wrap['imageHref'] = makeAlbumUrl($gallery->session->albumName, $id);
$frame= $gallery->html_wrap['frame'] = $gallery->album->fields['thumb_frame'];
/*begin backwards compatibility */
$gallery->html_wrap['thumbTag'] = $gallery->html_wrap['imageTag'];
$gallery->html_wrap['thumbHref'] = $gallery->html_wrap['imageHref'];
/*end backwards compatibility*/
list($divCellWidth,$divCellHeight, $padding) = calcVAdivDimension($frame, $iHeight, $iWidth, $borderwidth);
echo " \n";
includeHtmlWrap('inline_photothumb.frame');
}
echo "\n";
echo " \n";
if (canVote()){
if ($gallery->album->fields["poll_type"] == 'rank' && $divCellWidth < 200) {
$divCellWidth=200;
}
}
echo "\n";
/* Do the clickable-dimensions row */
if (!strcmp($gallery->album->fields['showDimensions'], 'yes')) {
echo '';
$photo = $gallery->album->getPhoto($i);
$image = $photo->image;
if (!empty($image) && !$photo->isMovie()) {
$viewFull = $gallery->user->canViewFullImages($gallery->album);
$fullOnly = (isset($gallery->session->fullOnly) &&
!strcmp($gallery->session->fullOnly, 'on') &&
!strcmp($gallery->album->fields['use_fullOnly'], 'yes'));
list($wr, $hr) = $image->getDimensions();
list($wf, $hf) = $image->getRawDimensions();
/* display file sizes if dimensions are identical */
if ($wr == $wf && $hr == $hf && $viewFull && $photo->isResized()) {
$fsr = ' ' . sprintf(gTranslate('core', '%dkB'), (int) $photo->getFileSize(0) >> 10);
$fsf = ' ' . sprintf(gTranslate('core', '%dkB'), (int) $photo->getFileSize(1) >> 10);
} else {
$fsr = '';
$fsf = '';
}
if (($photo->isResized() && !$fullOnly) || !$viewFull) {
echo '[${wr}x{$hr}${fsr}] ";
}
if ($viewFull) {
echo '[${wf}x${hf}${fsf}]";
}
} else {
echo " ";
}
echo '';
}
/* Now do the caption row */
if ($gallery->album->isAlbum($i)) {
$myAlbum = new Album;
$myAlbum->load($gallery->album->getAlbumName($i));
}
else {
$myAlbum = NULL;
}
if ($gallery->album->isAlbum($i)) {
$iWidth = $gallery->album->fields['thumb_size'];
} else {
list($iWidth, $iHeight) = $gallery->album->getThumbDimensions($i);
}
// Caption itself
echo "\n ");
echo "\n";
echo("\n";
$id = $gallery->album->getPhotoId($i);
if ($gallery->album->isHidden($i) && !$gallery->session->offline) {
echo "(" . gTranslate('core', "hidden") .") "; } $photo = $gallery->album->getPhoto($i); if ($gallery->user->canWriteToAlbum($gallery->album) && $photo->isHighlight() && !$gallery->session->offline) { echo "(" . gTranslate('core', "highlight") .") "; } if (isset($myAlbum)) { $myDescription = $myAlbum->fields['description']; $buf = ''; $link = ''; if ($gallery->user->canDownloadAlbum($myAlbum) && $myAlbum->numPhotos(1)) { $iconText = getIconText('compressed.png', gTranslate('core', "Download entire album as archive"), 'yes'); $link = popup_link($iconText, 'download.php?set_albumName='. $gallery->album->getAlbumName($i),false,false,500,500); } $buf .=" ".$myDescription.""; } echo $buf; echo ' ';
printf (gTranslate('core', "Last change: %s"), $myAlbum->getLastModificationDate());
echo "\n ';
if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && !$gallery->session->offline && ($myAlbum->getClicks() > 0)) {
echo '"; $visItems = array_sum($myAlbum->numVisibleItems($gallery->user)); printf(gTranslate('core', "Contains: %s."), gTranslate('core', "1 item", "%d items", $visItems)); // If comments indication for either albums or both switch ($gallery->app->comments_indication) { case "albums": case "both": $lastCommentDate = $myAlbum->lastCommentDate( $gallery->app->comments_indication_verbose); if ($lastCommentDate > 0) { print lastCommentString($lastCommentDate, $displayCommentLegend); } break; } echo ' ';
printf (gTranslate('core', "Viewed: %s"), gTranslate('core', "1 time", "%d times", $myAlbum->getClicks()));
echo ". ";
}
}
else {
echo "\n";
echo nl2br($gallery->album->getCaption($i));
echo $gallery->album->getCaptionName($i) . ' ';
// indicate with * if we have a comment for a given photo
if ($gallery->user->canViewComments($gallery->album)
&& $gallery->app->comments_enabled == 'yes') {
// If comments indication for either photos or both
switch ($gallery->app->comments_indication) {
case "photos":
case "both":
$lastCommentDate = $gallery->album->itemLastCommentDate($i);
print lastCommentString($lastCommentDate, $displayCommentLegend);
break;
}
}
echo " \n";
if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && !$gallery->session->offline && ($gallery->album->getItemClicks($i) > 0)) {
echo '';
echo gTranslate('core', "Viewed: 1 time.", "Viewed: %d times.", $gallery->album->getItemClicks($i));
echo " \n";
}
}
echo "\n"; // End Caption if (canVote()) { echo(" \n");
addPolling($gallery->album->getVotingIdByIndex($i), $form_pos, false);
$form_pos++;
}
$albumItemOptions = getItemActions($i, false);
if (sizeof($albumItemOptions) > 2 ||
(sizeof($albumItemOptions) == 2 && !isset($albumItemOptions['showExif']))) {
echo drawSelect2("s$i", $albumItemOptions, array(
'onChange' => "imageEditChoice(document.vote_form.s$i)",
'class' => 'adminform'));
}
if (canVote()) {
print ' ';
}
echo(" | ");
echo "\n";
$j++;
$visibleItemIndex++;
$i = $visibleItemIndex<=$numVisibleItems ? $visibleItems[$visibleItemIndex] : $numPhotos+1;
}
if ($printTableRow) {
echo('user->canAddToAlbum($gallery->album) && !$gallery->session->offline) { $url = makeGalleryUrl('add_photos_frame.php', array('set_albumName' => $gallery->session->albumName, 'type' => 'popup')); echo popup_link('['. gTranslate('core', "Hey! Add some photos.") .']', $url, 1, true, 500, 600, 'admin'); } else { echo gTranslate('core', "This album is empty."); } ?> |
">
user->isLoggedIn() && $gallery->user->getEmail() && !$gallery->session->offline && $gallery->app->emailOn == "yes") { if (getRequestVar('submitEmailMe')) { if (getRequestVar('comments')) { $gallery->album->setEmailMe('comments', $gallery->user); } else { $gallery->album->unsetEmailMe('comments', $gallery->user); } if (getRequestVar('other')) { $gallery->album->setEmailMe('other', $gallery->user); } else { $gallery->album->unsetEmailMe('other', $gallery->user); } } echo makeFormIntro("view_album.php", array("name" => "email_me", "style" => "margin-bottom: 0px;")); echo gTranslate('core', "Email me when one of the following actions are done to this album:")." "; $checked_com = ($gallery->album->getEmailMe('comments', $gallery->user)) ? "checked" : "" ; $checked_other = ($gallery->album->getEmailMe('other', $gallery->user)) ? "checked" : ""; ?>