/** * controls the thumbnail layout of themes. * * Uses the theme options: * albums_per_row * albums_per_page * images_per_row * images_per_page * * Computes a normalized images/albums per page and computes the number of * images that will fit on the "transitional" page between album thumbs and * image thumbs. This function is "internal" and is called from the root * index.php script before the theme script is loaded. */ function setThemeColumns() { global $_zp_current_album, $_firstPageImages; $_firstPageImages = false; if (($albumColumns = getOption('albums_per_row')) <= 1) { $albumColumns = false; } if (($imageColumns = getOption('images_per_row')) <= 1) { $imageColumns = false; } $albcount = max(1, getOption('albums_per_page')); if ($albumColumns && $albcount % $albumColumns != 0) { setOption('albums_per_page', $albcount = (floor($albcount / $albumColumns) + 1) * $albumColumns, false); } $imgcount = max(1, getOption('images_per_page')); if ($imageColumns && $imgcount % $imageColumns != 0) { setOption('images_per_page', $imgcount = (floor($imgcount / $imageColumns) + 1) * $imageColumns, false); } if (getOption('thumb_transition') && in_context(ZP_ALBUM | ZP_SEARCH) && $albumColumns && $imageColumns) { $count = getNumAlbums(); if ($count == 0) { $_firstPageImages = 0; } $rowssused = ceil($count % $albcount / $albumColumns); /* number of album rows unused */ $leftover = floor(max(1, getOption('images_per_page')) / $imageColumns) - $rowssused; $_firstPageImages = max(0, $leftover * $imageColumns); /* number of images that fill the leftover rows */ if ($_firstPageImages == $imgcount) { $_firstPageImages = 0; } } }
/** * Prints the image/subalbum count for the album loop */ function jqm_printImageAlbumCount() { $numalb = getNumAlbums(); $numimg = getNumImages(); if ($numalb != 0) { printf(ngettext("%d album", "%d albums", $numalb), $numalb); } if ($numalb != 0 && $numimg != 0) { echo ' / '; } if ($numimg != 0) { printf(ngettext("%d image", "%d images", $numimg), $numimg); } }
?> " title="<?php if (getAlbumDesc() == "") { echo getAlbumTitle(); } else { echo getAlbumTitle() . ' - ' . getAlbumDesc(); } ?> "><img src="<?php echo getCustomAlbumThumb(0, 100, 100); ?> " alt="<?php echo 'Album ' . ($count + ($currentPage - 1) * $albumsPerPage) . ' of ' . getNumAlbums(); ?> " width="100" height="100"<?php if ($pc_AjaxFx) { echo ' onLoad="new Effect.Fade(this, {from: 1 , to: .5, queue: \'parallel\', duration: .3});" onMouseOver="new Effect.Appear(this, {from: .5 , to: 1, queue: \'parallel\', duration: .3});" onMouseOut="new Effect.Fade(this, {from: 1 , to: .5, queue: \'parallel\', duration: .3});" '; } ?> /></a> </div> <?php if (!($count % $pc_AlbumsPerRow) && $pc_RowBreak) {
<ul class="taglist"> <li class="meta-date"><?php printAlbumDate(""); ?> </li> <li class="meta-contents"> <?php if (getNumAlbums() > 0 && getNumImages() > 0) { $divider = '- '; } else { $divider = ''; } ?> <?php if (getNumAlbums() > 0) { echo getNumAlbums() . ' ' . gettext("subalbums"); } ?> <?php echo $divider; ?> <?php if (getNumImages() > 0) { echo getNumImages() . ' ' . gettext("images"); } ?> </li> </ul> </div> <p class="albumdesc"><?php echo strip_tags(truncate_string(getAlbumDesc(), 80, '...'));
<div id="main"<?php if ($zpmin_switch) { echo ' class="switch"'; } ?> > <div id="albums-wrap"> <?php while (next_album()) { ?> <div class="album-maxspace"> <a class="thumb-link" href="<?php echo html_encode(getAlbumURL()); ?> " title="<?php echo getNumAlbums() . ' ' . gettext('subalbums') . ' / ' . getNumImages() . ' ' . gettext('images') . ' - ' . strip_tags(shortenContent(getBareAlbumDesc(), 300, '...')); ?> "> <?php if ($zpmin_thumb_crop) { printCustomAlbumThumbImage(getAnnotatedAlbumTitle(), null, $zpmin_album_thumb_size, $zpmin_album_thumb_size, $zpmin_album_thumb_size, $zpmin_album_thumb_size); } else { printCustomAlbumThumbImage(getAnnotatedAlbumTitle(), $zpmin_album_thumb_size); } ?> <span class="album-title"><?php echo shortenContent(getBareAlbumTitle(), 25, '...'); ?> </span> </a> </div>
</div> <p class="description"><?php printAlbumDesc(true, '', gettext('Edit Description...')); ?> </p> <?php if (isAlbumPage()) { ?> <div class="subalbum-wrap"> <h4 class="blockhead"><span><?php echo gettext('SubAlbums in '); echo getBareAlbumTitle(); ?> (<?php echo getNumAlbums(); ?> )</span></h4> <ul> <?php $x = 1; while (next_album()) { if ($odd = $x % 2) { $css = 'goleft'; } else { $css = 'goright'; } ?> <li class="<?php echo $css; ?>
<div class="module"> <h2><?php echo gettext("Gallery data"); ?> </h2> <table cellspacing="0" class="gallerydata"> <tr> <th><a href="<?php echo $archivepageURL; ?> "><?php echo gettext('Galleries'); ?> </a></th> <td><?php $albumNumber = getNumAlbums(); echo $albumNumber; ?> </td> <td></td> </tr> <tr> <th><?php echo gettext('Photos'); ?> </th> <td><?php $photosArray = query_single_row("SELECT count(*) FROM " . prefix('images')); $photosNumber = array_shift($photosArray); echo $photosNumber; ?>
function printFooter($admin = true) { global $_zp_themeroot, $_zp_gallery, $_zp_gallery_page, $_zp_current_zenpage_news, $_zp_current_zenpage_page; $h = NULL; ?> <!-- Footer --> <div class="footlinks"> <?php $h = @call_user_func('getHitcounter'); if (!is_null($h)) { ?> <p> <?php printf(ngettext('%1$u hit on this %2$s', '%1$u hits on this %2$s', $h), $h, gettext('page')); ?> </p> <?php } if ($_zp_gallery_page == 'gallery.php') { ?> <p> <small> <?php $albumNumber = getNumAlbums(); echo sprintf(ngettext("%u Album", "%u Albums", $albumNumber), $albumNumber); ?> · <?php $c = get_subalbum_count(); echo sprintf(ngettext("%u Subalbum", "%u Subalbums", $c), $c); ?> · <?php $photosNumber = db_count('images'); echo sprintf(ngettext("%u Image", "%u Images", $photosNumber), $photosNumber); ?> <?php if (function_exists('printCommentForm')) { ?> · <?php $commentsNumber = db_count('comments', " WHERE inmoderation = 0"); echo sprintf(ngettext("%u Comment", "%u Comments", $commentsNumber), $commentsNumber); } ?> </small> </p> <?php } ?> <?php printThemeInfo(); ?> <?php printZenphotoLink(); ?> <br /> <?php if (function_exists('printFavoritesURL') && $_zp_gallery_page != 'password.php' && $_zp_gallery_page != 'favorites.php') { printFavoritesURL(NULL, '', ' | ', '<br />'); } ?> <?php if ($_zp_gallery_page == 'gallery.php') { if (class_exists('RSS')) { printRSSLink('Gallery', '', 'Gallery RSS', ''); } echo '<br />'; } ?> <?php @call_user_func('printUserLogin_out', '', '<br />'); ?> <?php if ($_zp_gallery_page != 'contact.php' && extensionEnabled('contact_form') && ($_zp_gallery_page != 'password.php' || $_zp_gallery->isUnprotectedPage('contact'))) { printCustomPageURL(gettext('Contact us'), 'contact', '', ''); echo '<br />'; } ?> <?php if ($_zp_gallery_page != 'register.php' && function_exists('printRegisterURL') && !zp_loggedin() && ($_zp_gallery_page != 'password.php' || $_zp_gallery->isUnprotectedPage('register'))) { printRegisterURL(gettext('Register for this site'), ''); echo '<br />'; } ?> <?php @call_user_func('mobileTheme::controlLink'); ?> <?php @call_user_func('printLanguageSelector'); ?> <br class="clearall" /> </div> <!-- Administration Toolbox --> <?php }
<a href="<?php echo html_encode(getAlbumLinkURL()); ?> " title="<?php echo gettext('View album:') . ' '; echo getAnnotatedAlbumTitle(); ?> " class="img"><?php printCustomAlbumThumbImage(getAnnotatedAlbumTitle(), null, ALBUM_THUMB_WIDTH, ALBUM_THUMB_HEIGHT, ALBUM_THUMB_WIDTH, ALBUM_THUMB_HEIGHT); ?> </a> <p> <?php $anumber = getNumAlbums(); $inumber = getNumImages(); if ($anumber > 0 || $inumber > 0) { echo '<p><em>('; if ($anumber == 0) { if ($inumber != 0) { printf(ngettext('%u image', '%u images', $inumber), $inumber); } } else { if ($anumber == 1) { if ($inumber > 0) { printf(ngettext('1 album, %u image', '1 album, %u images', $inumber), $inumber); } else { printf(gettext('1 album')); } } else {
printSlideShowLink(gettext('Slideshow')); ?> </div> </div> <?php } ?> <div class="pagination-nogal clearfix"> <?php printPageListWithNav(' « ', ' » ', false, true, 'clearfix', NULL, true, 7); ?> </div> <?php if (getNumAlbums() > 0) { include 'inc_print_album_thumb.php'; } if (getNumImages() > 0) { include 'inc_print_image_thumb.php'; } ?> <div class="pagination-nogal clearfix"> <?php printPageListWithNav(' « ', ' » ', false, true, 'clearfix', NULL, true, 7); ?> </div> </div>
function printFooter($admin = true) { global $_zp_themeroot, $_zp_gallery_page, $_zp_current_zenpage_news, $_zp_current_zenpage_page; $h = NULL; ?> <!-- Footer --> <div class="footlinks"> <?php $h = getHitcounter(); if (!is_null($h)) { ?> <p> <?php printf(ngettext('%1$u hit on this %2$s', '%1$u hits on this %2$s', $h), $h, gettext('page')); ?> </p> <?php } if ($_zp_gallery_page == 'gallery') { ?> <p> <small> <?php $albumNumber = getNumAlbums(); echo sprintf(ngettext("%u Album", "%u Albums", $albumNumber), $albumNumber); ?> · <?php $c = get_subalbum_count(); echo sprintf(ngettext("%u Subalbum", "%u Subalbums", $c), $c); ?> · <?php $photosArray = query_single_row("SELECT count(*) FROM " . prefix('images')); $photosNumber = array_shift($photosArray); echo sprintf(ngettext("%u Image", "%u Images", $photosNumber), $photosNumber); ?> <?php if (function_exists('printCommentForm')) { ?> · <?php $commentsArray = query_single_row("SELECT count(*) FROM " . prefix('comments') . " WHERE inmoderation = 0"); $commentsNumber = array_shift($commentsArray); echo sprintf(ngettext("%u Comment", "%u Comments", $commentsNumber), $commentsNumber); ?> <?php } ?> </small> </p> <?php } ?> <?php printThemeInfo(); ?> <?php printZenphotoLink(); ?> <?php if ($_zp_gallery_page == 'gallery') { printRSSLink('Gallery', '<br />', 'Gallery RSS', ''); } ?> <?php if (function_exists('printUserLogin_out') && $_zp_gallery_page != 'password') { printUserLogin_out('<br />', '', true); } ?> <?php if (getOption('zp_plugin_contactform') && ($_zp_gallery_page != 'password' || $_zp_gallery->isUnprotectedPage('contact'))) { printCustomPageURL(gettext('Contact us'), 'contact', '', '<br />'); } ?> <?php if (!zp_loggedin() && function_exists('printRegistrationForm') && ($_zp_gallery_page != 'password' || $_zp_gallery->isUnprotectedPage('unprotected_register'))) { printCustomPageURL(gettext('Register for this site'), 'register', '', '<br />'); } ?> <?php if (function_exists('printLanguageSelector')) { printLanguageSelector(); } ?> <br clear="all" /> </div> <!-- Administration Toolbox --> <?php if ($admin) { printAdminToolbox(); } }
<?php global $_zp_themeroot, $_zp_current_album, $_zp_gallery; $isAlbumPage = true; AlbumUtil::setAlbumPage($isAlbumPage); ThemeUtil::$script .= "var images = [], initialImageThumbSelection = 0;\n"; $cls = 'album-page'; $albumCount = getNumAlbums(false, true); ?> <div id="album-nav" class="left opa60"> <div class="nav-cell filler"><span> </span></div> <?php $prevText = "<div id='image-nav-prev' class='image-nav-scroll opa60'><img src='{$_zp_themeroot}/resources/images/arrow_up.png' width='16' height='16'/></div>"; $nextText = "<div id='image-nav-next' class='image-nav-scroll opa60 {$cls}'><img src='{$_zp_themeroot}/resources/images/arrow_down.png' width='16' height='16'/></div>"; $prevNext = AlbumUtil::printNavigation($prevText, $nextText, false, 7, true); ?> <div class="nav-cell filler end"><span> </span></div> </div> <div style="padding-left: 1px;"> <div id="album-menu" class="opa60"> <div id="album-thumb"> <img src="<?php echo getRandomImages()->getCustomImage(NULL, 192, 48, 192, 48, NULL, null, false); ?> " width="195" height="48"/> </div> </div> <div id="album-count" class="opa60"> <?php
printf(gettext('Sorry, no matches for <em>%s</em>. Try refining your search.'), $searchwords); } ?> </p> </div> </div> <!-- main3 --> <?php } } ?> <!-- Page Numbers --> <div id="pagenumbers"> <?php if (getNumAlbums() != 0 || $_noFlash) { printPageListWithNav("« prev", "next »", !$_noFlash); } ?> </div> <!-- pagenumbers --> </div> <!-- subcontent --> <!-- Footer --> <div class="footlinks"> <?php if (getOption('Use_Simpleviewer') && !getOption('mod_rewrite')) { /* display missing css file error */ echo '<div class="errorbox" id="message">'; echo "<h2>" . gettext('Simpleviewer requires <em>mod_rewrite</em> to be set. Simpleviewer is disabled.') . "</h2>"; echo '</div>';
/** * @deprecated */ function getNumSubalbums() { deprecated_function_notify(gettext('Use getNumAlbums().')); return getNumAlbums(); }
static function pageCount($count, $gallery_page, $page) { global $_firstPageImages, $_oneImagePage; if (stripSuffix($gallery_page) == 'favorites') { $albums_per_page = max(1, getOption('albums_per_page')); $pageCount = (int) ceil(getNumAlbums() / $albums_per_page); $imageCount = getNumImages(); if ($_oneImagePage) { if ($_oneImagePage === true) { $imageCount = min(1, $imageCount); } else { $imageCount = 0; } } $images_per_page = max(1, getOption('images_per_page')); $count = $pageCount + (int) ceil(($imageCount - $_firstPageImages) / $images_per_page); if ($count < $page && isset($_POST['addToFavorites']) && !$_POST['addToFavorites']) { //We've deleted last item on page, need a place to land when we return global $_zp_page; header('location: ' . FULLWEBPATH . '/' . $this->getLink($_zp_page - 1)); exitZP(); } } return $count; }
/** * Checks for URL page out-of-bounds for "standard" themes * Note: This function assumes that an "index" page will display albums * and the pagination be determined by them. Any other "index" page strategy needs to be * handled by the theme itself. * * @param boolean $request * @param string $gallery_page * @param int $page * @return boolean will be true if all is well, false if a 404 error should occur */ function checkPageValidity($request, $gallery_page, $page) { global $_zp_gallery, $_firstPageImages, $_oneImagePage, $_zp_zenpage, $_zp_current_category; $count = NULL; switch ($gallery_page) { case 'album.php': case 'search.php': $albums_per_page = max(1, getOption('albums_per_page')); $pageCount = (int) ceil(getNumAlbums() / $albums_per_page); $imageCount = getNumImages(); if ($_oneImagePage) { if ($_oneImagePage === true) { $imageCount = min(1, $imageCount); } else { $imageCount = 0; } } $images_per_page = max(1, getOption('images_per_page')); $count = $pageCount + (int) ceil(($imageCount - $_firstPageImages) / $images_per_page); break; case 'index.php': if (galleryAlbumsPerPage() != 0) { $count = (int) ceil($_zp_gallery->getNumAlbums() / galleryAlbumsPerPage()); } break; case 'news.php': if (in_context(ZP_ZENPAGE_NEWS_CATEGORY)) { $count = count($_zp_current_category->getArticles()); } else { $count = count($_zp_zenpage->getArticles()); } $count = (int) ceil($count / ZP_ARTICLES_PER_PAGE); break; default: $count = zp_apply_filter('checkPageValidity', NULL, $gallery_page, $page); break; } if ($page > $count) { $request = false; // page is out of range } return $request; }
?> </div> <?php } ?> <div> <?php printParentBreadcrumb('', ' » ', ' » ', 30, '...'); ?> <?php echo shortenContent(printAlbumTitle(true), 30, '...'); ?> <small>( <?php if (getNumAlbums() > 0) { echo getNumAlbums() . gettext(' Subalbums, '); } ?> <?php echo getTotalImagesIn($_zp_current_album) . gettext(' Total Images'); ?> )</small> </div> </div> </div> </div> <?php if (isAlbumPage()) { ?> <div class="wrapper">
?> "> <?php echo getGalleryTitle(); ?> </a> | <?php echo "<em>" . gettext("Search") . "</em>"; ?> </span></h2> </div> <hr /> <?php if (($total = getNumImages() + getNumAlbums()) > 0) { if (isset($_REQUEST['date'])) { $searchwords = getSearchDate(); } else { $searchwords = getSearchWords(); } echo "<p>" . sprintf(gettext('Total matches for <em>%1$s</em>: %2$u'), $searchwords, $total) . '</p>'; } $c = 0; ?> <div id="albums"> <?php while (next_album()) { $c++; ?> <div class="album">
if ($c == 0) { echo '{' . "\n"; } else { echo ',{' . "\n"; } echo 'thumb: \'' . getAlbumThumb() . '\',' . "\n"; echo 'image: \'' . getCustomAlbumThumb(getOption('image_size')) . '\',' . "\n"; echo 'big: \'' . getCustomAlbumThumb(getOption('zpbase_galbigsize')) . '\',' . "\n"; echo 'title: \'' . html_encode(getBareAlbumTitle()) . '\',' . "\n"; if (getNumAlbums() > 0 && getNumImages() > 0) { $divider = '/ '; } else { $divider = ''; } if (getNumAlbums() > 0) { $albumcount = getNumAlbums() . ' ' . gettext('albums'); } else { $albumcount = ''; } if (getNumImages() > 0) { $imagecount = getNumImages() . ' ' . gettext('images'); } else { $imagecount = ''; } $desc1 = $albumcount . $divider . $imagecount . ' ... <a href="' . html_encode(getAlbumURL()) . '">' . gettext('Goto Album') . ' →</a>'; $desc2 = '<p>' . getBareAlbumDesc() . '</p>'; $desc2 = str_replace("\r\n", '<br />', $desc2); $desc2 = str_replace("\r", '<br />', $desc2); $desc = $desc1 . $desc2; echo 'description: \'' . js_encode($desc) . '\',' . "\n"; echo 'link: \'' . html_encode(getAlbumURL()) . '\'' . "\n";
} else { printf(gettext('Sorry, no matches for <em>%s</em>. Try refining your search.'), html_encode($searchwords)); } ?> </p> </div> </div> <!-- main3 --> <?php } ?> <!-- Page Numbers --> <div id="pagenumbers"> <?php if (getNumAlbums() != 0 || !$_oneImagePage) { printPageListWithNav("« " . gettext('prev'), gettext('next') . " »", $_oneImagePage); } ?> </div> <!-- pagenumbers --> </div> <!-- subcontent --> <!-- Footer --> <br style="clear:all" /> <?php printFooter(); zp_apply_filter('theme_body_close'); ?> </body> </html>
<?php include "inc-header.php"; $numimages = getNumImages(); $numalbums = getNumAlbums(); $total = $numimages + $numalbums; if ($zenpage && !isArchive()) { $numpages = getNumPages(); if ($numpages > $zpmin_zpsearchcount) { $numpages = $zpmin_zpsearchcount; } $numnews = getNumNews(); if ($numnews > $zpmin_zpsearchcount) { $numnews = $zpmin_zpsearchcount; } $total = $total + $numnews + $numpages; } else { $numpages = $numnews = 0; } $searchwords = getSearchWords(); $searchdate = getSearchDate(); if (!empty($searchdate)) { if (!empty($searchwords)) { $searchwords .= ": "; } $searchwords .= $searchdate; } ?> <div id="breadcrumbs"> <h2><a href="<?php
?> " title="<?php echo $annotate; ?> "><?php printAlbumTitle(); ?> </a></h4> </li> <?php } ?> </ul> <div class="clearage"></div> <?php printNofM('Album', $firstAlbum, $lastAlbum, getNumAlbums()); ?> </div> <!-- main --> <!-- Page Numbers --> <div id="pagenumbers"> <?php printPageListWithNav("« " . gettext('prev'), gettext('next') . " »"); ?> </div> </div> <!-- content --> <br style="clear:all" /> <?php printFooter();
?> <?php if (getOption('Allow_search')) { printSearchForm(); } ?> <div id="content"> <div class="galleryinfo"> <?php echo "<h1><em>" . gettext('Search') . "</em></h1>"; ?> </div> <?php $results = getNumAlbums() + getNumImages(); ?> <?php $first = true; while (next_album()) { if ($first) { echo '<div class="galleries">'; echo "\n<h2></h2>\n<ul>\n"; $first = false; } ?> <li class="gal"> <a href="<?php echo htmlspecialchars(getAlbumLinkURL()); ?> " title="<?php
function printFooter($page) { global $_zp_themeroot; ?> <!-- Footer --> <div class="footlinks"> <?php switch ($page) { case 'image': case 'album': $h = getHitcounter(); if ($h == 1) { echo "<p>" . sprintf(gettext('1 hit on this %s'), $page) . "</p>"; } else { echo "<p>" . sprintf(gettext('%1$u hits on this %2$s'), $h, $page) . "</p>"; } break; case 'gallery': ?> <small> <p><?php $albumNumber = getNumAlbums(); echo sprintf(gettext("Albums: %u"), $albumNumber); ?> · <?php echo sprintf(gettext("Subalbums: %u"), get_subalbum_count()); ?> · <?php $photosArray = query_single_row("SELECT count(*) FROM " . prefix('images')); $photosNumber = array_shift($photosArray); echo sprintf(gettext("Images: %u"), $photosNumber); ?> <?php if (getOption('Allow_comments')) { ?> · <?php $commentsArray = query_single_row("SELECT count(*) FROM " . prefix('comments') . " WHERE inmoderation = 0"); $commentsNumber = array_shift($commentsArray); echo sprintf(gettext("Comments: %u"), $commentsNumber); ?> <?php } ?> </p> </small> <?php break; } ?> <small><?php printThemeInfo(); ?> </small> <?php printZenphotoLink(); ?> <?php if ($page == 'gallery') { echo '<br />'; printRSSLink('Gallery', '', 'Gallery RSS', ''); } ?> <?php if (function_exists('printUserLogout')) { printUserLogout('<br />', '', true); } ?> <?php if (function_exists('printContactForm')) { printCustomPageURL(gettext('Contact us'), 'contact', '', '<br />'); } ?> <?php if (!zp_loggedin() && function_exists('printRegistrationForm')) { printCustomPageURL(gettext('Register for this site'), 'request', '', '<br />'); } ?> <?php if (function_exists('printLanguageSelector')) { printLanguageSelector(); } ?> </div> <!-- Administration Toolbox --> <?php printAdminToolbox(); }
</a> </div> <?php $singletag = getTags(); $tagstring = implode(', ', $singletag); ?> <ul class="album-info"> <li class="counts <?php if ($zpmas_thumbsize == 'small' && getNumAlbums() > 0) { echo 'smallthumbs'; } ?> "> <?php if (getNumAlbums() > 0) { echo getNumAlbums() . ' ' . gettext('subalbums'); } ?> <?php if (getNumImages() > 0) { echo getNumImages() . ' ' . gettext('images'); } ?> </li> <?php if (strlen(getAlbumDate()) > 0) { ?> <li class="date"><?php printAlbumDate(''); ?> </li><?php
if (!getOption('search_no_images') && $numpages + $numnews > 0) { printf(gettext('Images (%s)'), $numimages); } } else { if (getOption('search_no_images')) { if ($numpages + $numnews > 0) { printf(gettext('Albums (%s)'), $numalbums); } } else { printf(gettext('Albums (%1$s) & Images (%2$s)'), $numalbums, $numimages); } } ?> </h3> <?php if (getNumAlbums() != 0) { ?> <div id="albums"> <?php while (next_album()) { ?> <div class="album"> <div class="thumb"> <a href="<?php echo html_encode(getAlbumURL()); ?> " title="<?php echo gettext('View album:'); ?> <?php printBareAlbumTitle();
/** * Passed # of album columns, # of image columns of the theme. * * NOTE: The values for these numbers of columns are determined by the theme * CSS. They should be set to how many images or albums are displayed in a row. * If you get this wrong, your theme will not behave as you expect. * * Updates (non-persistent) images_per_page and albums_per_page so that the rows are filled. * * This means that the value you set for the images per page and albums per page options may * not be the same as what actually gets shown. First, they will be rounded to be an even multiple * rows. So, if you have 6 columns of album thumbs your albums per page shown will be a multiple of * six (assuming that there are enough albums.) Second, there may be a page where both image and * album thumbs are shown--the "transition" page. Fewer than images_per_page will appear * on this page. * * The "non-persistent" update means that the actual values for these options are not changed. Just * the values that will be used for the display of the particular page. * * Returns # of images that will go on the album/image transition page. * * When you have albums containing both subalbums and images there may be a page where the album * thumbnails do not fill the page. This function returns a count of the images that can be used to * fill out this transition page. The return value should be passed as the second parameter to * next_image() so that the page is filled out with the proper number of images. If you do not * pass this parameter it is assumed that album thumbs and image thumbs are not to be placed on * the same (transition) page. (If you do not wish to have an album/image transition page you need * not use this function at all.) * * This function (combined with the parameter to next_image) impacts the pagination computations * zenphoto makes. For this reason, it is important to make identical calls to the function from * your theme's index.php, albums.php and image.php pages. Otherwise page and breadcrumb navigation * may not be correct. * * @param int $albumColumns number of album columns on the page * @param int $imageColumns number of image columns on the page * @return int * @since 1.1 */ function normalizeColumns($albumColumns, $imageColumns) { global $_zp_current_album, $firstPageImages; $albcount = max(1, getOption('albums_per_page')); if ($albcount % $albumColumns != 0) { setOption('albums_per_page', $albcount = (floor($albcount / $albumColumns) + 1) * $albumColumns, false); } $imgcount = max(1, getOption('images_per_page')); if ($imgcount % $imageColumns != 0) { setOption('images_per_page', $imgcount = (floor($imgcount / $imageColumns) + 1) * $imageColumns, false); } if (in_context(ZP_ALBUM | ZP_SEARCH)) { if (in_context(ZP_SEARCH)) { $count = getNumAlbums(); } else { $count = GetNumSubalbums(); } if ($count == 0) { return 0; } $rowssused = ceil($count % $albcount / $albumColumns); /* number of album rows unused */ $leftover = floor(max(1, getOption('images_per_page')) / $imageColumns) - $rowssused; $firstPageImages = max(0, $leftover * $imageColumns); /* number of images that fill the leftover rows */ if ($firstPageImages == $imgcount) { return 0; } else { return $firstPageImages; } } return false; }