$matches = array(); if (preg_match('%/=page(\\d+)%', $requestStr, $matches)) { $page = $matches[1]; $requestStr = preg_replace('%/=page(\\d+)%', '', $requestStr); } else { $page = 1; } if (!isset($itemsPerPage)) { $itemsPerPage = 6; } $p = PFunctions::paginate($galleries, $page, $itemsPerPage); $galleriesonpage = $p[0]; echo '<div class="floatbox">'; foreach ($galleriesonpage as $g) { static $ii = 0; $d = $Gallery->getLatestGalleryItem($g->id); $s = $Gallery->getGalleryItems($g->id, 1); $username = MOD_member::getUserHandle($g->user_id_foreign); $this->myself = $this->loggedInMember && $username == $this->loggedInMember->Username; $num_rows = $s ? $s : 0; // Only show the galleries with pictures. The belonging user might see them anyway. if ($d || $this->myself) { ?> <div class="gallery_container float_left"> <a href="gallery/show/sets/<?php echo $g->id; ?> "> <img class="framed" src="<?php echo $d ? 'gallery/thumbimg?id=' . $d : 'images/lightview/blank.gif'; ?>