function KunenaShowcatPagination($catid, $page, $totalpages, $maxpages) { $startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2); $endpage = $startpage + $maxpages; if ($endpage > $totalpages) { $startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages; $endpage = $totalpages; } $output = '<span class="fb_pagination">' . _PAGE; if ($startpage > 1) { if ($endpage < $totalpages) { $endpage--; } $output .= CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel = 'follow'); if ($startpage > 2) { $output .= "..."; } } for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) { if ($page == $i) { $output .= "<strong>{$i}</strong>"; } else { $output .= CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel = 'follow'); } } if ($endpage < $totalpages) { if ($endpage < $totalpages - 1) { $output .= "..."; } $output .= CKunenaLink::GetCategoryPageLink('showcat', $catid, $totalpages, $totalpages, $rel = 'follow'); } $output .= '</span>'; return $output; }
//pagination 2 if (count($messages[0]) > 0) { echo '<div class="jr-pagenav">' . _PAGE; if ($page - 2 > 1) { echo ' ' . CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel = 'follow', $class = 'jr-pagenav-nb'); } for ($i = $page - 2 <= 0 ? 1 : $page - 2; $i <= $page + 2 && $i <= ceil($total / $threads_per_page); $i++) { if ($page == $i) { echo "<div class=\"jr-pagenav-nb-act\"> {$i}</div>"; } else { echo ' ' . CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel = 'follow', $class = 'jr-pagenav-nb'); } } if ($page + 2 < ceil($total / $threads_per_page)) { echo "<div class=\"jr-pagenav-nb\"> ... </div>"; echo ' ' . CKunenaLink::GetCategoryPageLink('showcat', $catid, ceil($total / $threads_per_page), ceil($total / $threads_per_page), $rel = 'follow', $class = 'jr-pagenav-nb'); } echo '</div>'; } ?> </td> </tr> </table> <!-- --> <div class="<?php echo $boardclass; ?> _bt_cvr1"> <div class="<?php echo $boardclass; ?>
* @package Kunena * * @Copyright (C) 2008 - 2011 Kunena Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link http://www.kunena.org **/ defined ( '_JEXEC' ) or die (); ?> <li class="kcategory-row [K=ROW:krow-]"> <table summary="List of all forum categories"> <tbody> <tr> <td class="kcategory-body"> <ul> <li class="kpost-title"> <h3><?php echo CKunenaLink::GetCategoryPageLink('showcat', intval($this->category->id), 1, $this->escape($this->category->name), 'follow' ) ?></h3> <div class="clr"></div> </li> </ul> </td> <td class="kcategory-topics"> <span class="kcategory-views-number"><?php echo $this->formatLargeNumber ( $this->category->numTopics );?></span> <span class="kcategory-views"> <?php echo JText::_('COM_KUNENA_DISCUSSIONS'); ?> </span> </td> <td class="kcategory-posts"> <span class="kcategory-views-number"><?php echo $this->formatLargeNumber ( $this->category->numPosts ); ?></span> <span class="kcategory-views"> <?php echo JText::_('COM_KUNENA_MY_POSTS'); ?> </span> </td> <?php $last = $this->category->getLastPosted();
</td> </tr> <?php } else { $k = 0; } foreach ($this->categories as $leaf) { ?> <tr class="k<?php echo $this->tabclass[$k ^= 1]; ?> "> <td class="kcol-mid kcol-ktopictitle"> <div class="ktopic-title-cover"> <?php echo CKunenaLink::GetCategoryPageLink('showcat', intval($leaf->catid), 1, $this->escape($leaf->catname), 'follow', 'ktopic-title km'); ?> </div> </td> <td class="kcol-mid kcol-ktopicviews"> <!-- Views --> <span class="ktopic-views-number"><?php echo CKunenaTools::formatLargeNumber((int) $leaf->numTopics); ?> </span> <span class="ktopic-views"> <?php echo JText::_('COM_KUNENA_DISCUSSIONS'); ?> </span> <!-- /Views -->
function getPagination($catid, $page, $totalpages, $maxpages) { $startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2); $endpage = $startpage + $maxpages; if ($endpage > $totalpages) { $startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages; $endpage = $totalpages; } $output = '<ul class="kpagination">'; $output .= '<li class="page">' . JText::_('COM_KUNENA_PAGE') . '</li>'; if ($startpage > 1) { if ($endpage < $totalpages) { $endpage--; } $output .= '<li>' . CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel = 'follow') . '</li>'; if ($startpage > 2) { $output .= '<li class="more">...</li>'; } } for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) { if ($page == $i) { $output .= '<li class="active">' . $i . '</li>'; } else { $output .= '<li>' . CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel = 'follow') . '</li>'; } } if ($endpage < $totalpages) { if ($endpage < $totalpages - 1) { $output .= '<li class="more">...</li>'; } $output .= '<li>' . CKunenaLink::GetCategoryPageLink('showcat', $catid, $totalpages, $totalpages, $rel = 'follow') . '</li>'; } $output .= '</ul>'; return $output; }