user->canReadAlbum($gallery->album)) { header("Location: " . makeAlbumUrl()); return; } if (!$gallery->album->isLoaded()) { header("Location: " . makeAlbumUrl()); return; } if (!$page) { $page = $gallery->session->albumPage[$gallery->album->fields["name"]]; if (!$page) { $page = 1; } } else { $gallery->session->albumPage[$gallery->album->fields["name"]] = $page; } $albumName = $gallery->session->albumName; if (!$gallery->session->viewedAlbum[$albumName]) { $gallery->session->viewedAlbum[$albumName] = 1; $gallery->album->incrementClicks(); } $rows = $gallery->album->fields["rows"]; $cols = $gallery->album->fields["cols"]; $numPhotos = $gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album)); $perPage = $rows * $cols; $maxPages = max(ceil($numPhotos / $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; } $bordercolor = $gallery->album->fields["bordercolor"]; $imageCellWidth = floor(100 / $cols) . "%"; $fullWidth="100%"; $navigator["page"] = $page; $navigator["pageVar"] = "page"; $navigator["maxPages"] = $maxPages; $navigator["fullWidth"] = $fullWidth; $navigator["url"] = makeAlbumUrl($gallery->session->albumName); $navigator["spread"] = 5; $navigator["bordercolor"] = $bordercolor; $breadCount = 0; $breadtext = array(); $pAlbum = $gallery->album; do { if (!strcmp($pAlbum->fields["returnto"], "no")) { break; } $pAlbumName = $pAlbum->fields['parentAlbumName']; if ($pAlbumName) { $pAlbum = new Album(); $pAlbum->load($pAlbumName); $breadtext[$breadCount] = "Album: " . $pAlbum->fields['title'] . ""; } else { //-- we're at the top! --- $breadtext[$breadCount] = "Gallery: " . $gallery->app->galleryTitle . ""; } $breadCount++; } while ($pAlbumName); //-- we built the array backwards, so reverse it now --- for ($i = count($breadtext) - 1; $i >= 0; $i--) { $breadcrumb["text"][] = $breadtext[$i]; } $breadcrumb["bordercolor"] = $bordercolor; ?> <?= $gallery->app->galleryTitle ?> :: <?= $gallery->album->fields["title"] ?> $label"; } $adminText = ""; if ($numPhotos == 1) { $adminText .= "1 photo in this album"; } else { $adminText .= "$numPhotos items in this album"; if ($maxPages > 1) { $adminText .= " on " . pluralize($maxPages, "page"); } } if ($gallery->user->canWriteToAlbum($gallery->album)) { $hidden = $gallery->album->numHidden(); $verb = "are"; if ($hidden == 1) { $verb = "is"; } if ($hidden) { $adminText .= " ($hidden $verb hidden)"; } } $adminText .=""; $adminCommands = ""; if ($gallery->user->canAddToAlbum($gallery->album)) { $adminCommands .= '[add photos] '; } if ($gallery->user->canCreateSubAlbum($gallery->album)) { $adminCommands .= ' $gallery->session->albumName), "view_album.php") . '">[new nested album] 
'; } if ($gallery->user->canChangeTextOfAlbum($gallery->album)) { $adminCommands .= '[captions] '; } if ($gallery->user->canWriteToAlbum($gallery->album)) { if ($gallery->album->numPhotos(1)) { $adminCommands .= '[sort] '; $adminCommands .= '[resize all] '; $adminCommands .= 'session->albumName . "&index=all"). '">[rebuild thumbs]  
'; } $adminCommands .= '[properties] '; } if ($gallery->user->isAdmin() || $gallery->user->isOwnerOfAlbum($gallery->album)) { $adminCommands .= '[permissions] '; } if (($gallery->user->isAdmin() || $gallery->user->isOwnerOfAlbum($gallery->album)) && !strcmp($gallery->album->fields["public_comments"],"yes")) { $adminCommands .= '[view all comments] '; } $adminCommands .= '[slideshow] '; if (!$GALLERY_EMBEDDED_INSIDE) { if ($gallery->user->isLoggedIn()) { $adminCommands .= " $page)) . ">[logout]"; } else { $adminCommands .= '[login]'; } } $adminCommands .= "
"; $adminbox["text"] = $adminText; $adminbox["commands"] = $adminCommands; $adminbox["bordercolor"] = $bordercolor; $adminbox["top"] = true; include ($GALLERY_BASEDIR . "layout/adminbox.inc"); ?> album->fields["returnto"], "no") || ($gallery->album->fields["parentAlbumName"])) { include($GALLERY_BASEDIR . "layout/breadcrumb.inc"); } include($GALLERY_BASEDIR . "layout/navigator.inc"); #-- if borders are off, just make them the bgcolor ---- $borderwidth = $gallery->album->fields["border"]; if (!strcmp($borderwidth, "off")) { $bordercolor = $gallery->album->fields["bgcolor"]; $borderwidth = 1; } ?>
border=0 cellspacing=0 cellpadding=3> album->numPhotos(1); $displayCommentLegend = 0; // this determines if we display "* Item contains a comment" at end of page if ($numPhotos) { $rowCount = 0; // Find the correct starting point, accounting for hidden photos $rowStart = 0; $cnt = 0; while ($cnt < $start) { $rowStart = getNextPhoto($rowStart); $cnt++; } while ($rowCount < $rows) { /* Do the inline_albumthumb header row */ echo(""); $i = $rowStart; $j = 1; while ($j <= $cols && $i <= $numPhotos) { echo(""); $j++; $i = getNextPhoto($i); } echo(""); /* Do the picture row */ echo(""); $i = $rowStart; $j = 1; while ($j <= $cols && $i <= $numPhotos) { echo(""); $j++; $i = getNextPhoto($i); } echo(""); /* Now do the caption row */ echo(""); $i = $rowStart; $j = 1; while ($j <= $cols && $i <= $numPhotos) { if ($gallery->album->isAlbumName($i)) { $iWidth = $gallery->album->fields['thumb_size']; } else { list($iWidth, $iHeight) = $gallery->album->getThumbDimensions($i); } echo("'); $j++; $i = getNextPhoto($i); } echo ""; /* Now do the inline_albumthumb footer row */ echo(""); $i = $rowStart; $j = 1; while ($j <= $cols && $i <= $numPhotos) { echo(""); $j++; $i = getNextPhoto($i); } echo(""); $rowCount++; $rowStart = $i; } } else { ?>
"); includeHtmlWrap("inline_albumthumb.header"); echo("
"); //-- put some parameters for the wrap files in the global object --- $gallery->html_wrap['borderColor'] = $bordercolor; $gallery->html_wrap['borderWidth'] = $borderwidth; $gallery->html_wrap['pixelImage'] = $imageDir . "/pixel_trans.gif"; $scaleTo = $gallery->album->fields["thumb_size"]; 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['thumbWidth'] = $iWidth; $gallery->html_wrap['thumbHeight'] = $iHeight; $id = $gallery->album->getPhotoId($i); if ($gallery->album->isMovie($id)) { $gallery->html_wrap['thumbTag'] = $gallery->album->getThumbnailTag($i); $gallery->html_wrap['thumbHref'] = $gallery->album->getPhotoPath($i); includeHtmlWrap('inline_moviethumb.frame'); } elseif ($gallery->album->isAlbumName($i)) { $myAlbumName = $gallery->album->isAlbumName($i); $myAlbum = new Album(); $myAlbum->load($myAlbumName); $gallery->html_wrap['thumbTag'] = $myAlbum->getHighlightAsThumbnailTag($scaleTo); $gallery->html_wrap['thumbHref'] = makeAlbumUrl($myAlbumName); includeHtmlWrap('inline_albumthumb.frame'); } else { $gallery->html_wrap['thumbTag'] = $gallery->album->getThumbnailTag($i); $gallery->html_wrap['thumbHref'] = makeAlbumUrl($gallery->session->albumName, $id); includeHtmlWrap('inline_photothumb.frame'); } echo("
"); // put form outside caption to compress lines if (($gallery->user->canDeleteFromAlbum($gallery->album)) || ($gallery->user->canWriteToAlbum($gallery->album)) || ($gallery->user->canChangeTextOfAlbum($gallery->album))) { $showAdminForm = 1; } else { $showAdminForm = 0; } if ($showAdminForm) { echo makeFormIntro("view_album.php", array("name" => "image_form_$i")); } echo "
"; $id = $gallery->album->getPhotoId($i); if ($gallery->album->isHidden($i)) { echo "(hidden)
"; } if ($gallery->album->isAlbumName($i)) { $myAlbum = new Album(); $myAlbum->load($gallery->album->isAlbumName($i)); $myDescription = $myAlbum->fields[description]; $buf = ""; $buf = $buf."Album: ".$myAlbum->fields[title].""; if ($myDescription != "No description") { $buf = $buf."
".$myDescription.""; } echo($buf."
"); ?>
album->getCaption($i)); // indicate with * if we have a comment for a given photo if ((!strcmp($gallery->album->fields["public_comments"], "yes")) && ($gallery->album->numComments($i) > 0)) { echo("*"); $displayCommentLegend = 1; } echo("
"); if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && ($gallery->album->getItemClicks($i) > 0)) { echo("Viewed: ".pluralize($gallery->album->getItemClicks($i), "time", "0").".
"); } } echo "

 
"; if ($showAdminForm) { if ($gallery->album->isMovie($id)) { $label = "Movie"; } elseif ($gallery->album->isAlbumName($i)) { $label = "Album"; } else { $label = "Photo"; } echo("'); } echo('
"); includeHtmlWrap("inline_albumthumb.footer"); echo("
user->canAddToAlbum($gallery->album)) { ?> Hey! Add some photos. This album is empty.
album->fields["public_comments"], "yes") && $displayCommentLegend) { //display legend for comments ?> * Comments available for this item.

album->fields["returnto"], "no")) { $breadcrumb["top"] = false; include($GALLERY_BASEDIR . "layout/breadcrumb.inc"); } includeHtmlWrap("album.footer"); ?>