public function displayTrips($trips, $trip_data, $page = 1) { $pages = PFunctions::paginate($trips, $page); $trips = $pages[0]; $maxPage = $pages[2]; $pages = $pages[1]; $currentPage = $page; require 'templates/alltrips.php'; $request = PRequest::get()->request; $requestStr = implode('/', $request); $requestStr = str_replace('/page' . $page, '', $requestStr); $this->pages($pages, $currentPage, $maxPage, $requestStr . '/page%d'); }
echo $words->get('posts_tagged_with'); ?> : <em><?php echo htmlentities($tag, ENT_COMPAT, 'utf-8'); ?> </em></h3> <?php $request = PRequest::get()->request; $requestStr = implode('/', $request); $matches = array(); if (preg_match('%/page(\\d+)%', $requestStr, $matches)) { $page = $matches[1]; } else { $page = 1; } $requestStr = preg_replace('%[/]page\\d+%', '', $requestStr); // display matching tags and matching posts. $postIt = $Blog->getTaggedPostsIt($tag, true); $pages = PFunctions::paginate($postIt, $page); $postIt = $pages[0]; $maxPage = $pages[2]; $pages = $pages[1]; $currentPage = $page; foreach ($postIt as $blog) { require 'blogitem.php'; } $BlogView->pages($pages, $currentPage, $maxPage, $requestStr . '/page%d'); } ?> </div>
<span class="float_right profile-edit-link"> <a href="/gallery/manage"><?php echo $words->get('Edit'); ?> </a> </span> <?php } ?> <h3><?php echo $words->get('GalleryTitleLatest'); ?> </h3> <?php // if the gallery is NOT empty, go show it $p = PFunctions::paginate($statement, 1, $itemsPerPage = 8); $statement = $p[0]; echo '<div class="floatbox">'; foreach ($statement as $d) { echo '<a href="gallery/show/image/' . $d->id . '">' . '<img src="gallery/thumbimg?id=' . $d->id . '"' . ' alt="image"' . ' style="height: 50px; width: 50px; padding:2px;"/>' . '</a>'; } echo '</div>'; ?> <p class="float_right"> <a href="gallery/show/user/<?php echo $member->Username; ?> /images" title="<?php echo $words->getSilent('GalleryTitleLatest'); ?> ">
$layoutbits = new MOD_layoutbits(); $thumbsize = $this->thumbsize; if ($statement) { $request = PRequest::get()->request; $requestStr = implode('/', $request); $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 = 12; } $p = PFunctions::paginate($statement, $page, $itemsPerPage); $statement = $p[0]; echo '<div class="floatbox thumb_wrapper">'; foreach ($statement as $d) { echo ' <div class="img thumb float_left size' . $thumbsize . '"> <a href="gallery/show/image/' . $d->id . '" id="image_link_' . $d->id . '"><img class="framed" src="gallery/thumbimg?id=' . $d->id . ($thumbsize ? '&t=' . $thumbsize : '') . '" alt="image" style="margin: 5px 0; float:none;" /></a>'; echo '<h4>'; $loggedmember = isset($this->model) ? $this->model->getLoggedInMember : $this->loggedInMember; if ($loggedmember && $loggedmember->Username == $d->user_handle) { echo '<input type="checkbox" class="input_check" name="imageId[]" onchange="highlightMe($(\'image_link_' . $d->id . '\'),this.checked);" value="' . $d->id . '"> '; } ?> <a href="gallery/show/image/<?php echo $d->id; ?>
/** * Displays blog posts in a given category. */ public function PostsByCategory($categoryId, $page = 1) { $catIt = $this->_model->getCategoryFromUserIt(false, $categoryId); $cat = $catIt->fetch(PDB::FETCH_OBJ); if (!$cat) { echo '<p class="error">Category doesn`t exist</p>'; return false; } $title = $cat->name; $blogIt = $this->_model->getRecentPostIt('', $categoryId); $pages = PFunctions::paginate($blogIt, $page); $blogIt = $pages[0]; $maxPage = $pages[2]; $pages = $pages[1]; $currentPage = $page; require 'templates/allblogs.php'; $this->pages($pages, $currentPage, $maxPage, 'blog/page%d'); }
$Gallery = new GalleryModel(); // Show the galleries/photosets if ($galleries) { $request = PRequest::get()->request; $requestStr = implode('/', $request); $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;
$User = new APP_User(); $words = new MOD_words(); // This was quicly duplicated from the memberslist.php template, this imply om redudancies if (!$volunteers) { return $text['no_volunteers_yet']; } else { $request = PRequest::get()->request; $requestStr = implode('/', $request); $matches = array(); if (preg_match('%/=page(\\d+)%', $requestStr, $matches)) { $page = $matches[1]; $requestStr = preg_replace('%/=page(\\d+)%', '', $requestStr); } else { $page = 1; } $p = PFunctions::paginate($volunteers, $page, $itemsPerPage = 15); $volunteers = $p[0]; ?> <ul class="floatbox"> <?php foreach ($volunteers as $member) { $image = new MOD_images_Image('', $member->username); echo '<a href="#"><li class="userpicbox float_left" style="cursor:pointer;" onclick="javascript: window.location.href = \'bw/member.php?cid=' . $member->username . '\'; return false"><a href="bw/member.php?cid=' . $member->username . '">' . MOD_layoutbits::PIC_50_50($member->username, '', $style = 'float_left framed') . '</a><p><a href="bw/member.php?cid=' . $member->username . '">' . $member->username . '</a>'; echo '<br /><span class="small">' . $member->city . '</span>'; echo $words->mTrad($member->VolComment, true); echo "</p></li></a>"; } ?> </ul> <?php $pages = $p[1];