The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
pagination displaying same results for all links
I have pagination code working properly for count and no of pages and limit. When I click on 2nd 3rd and 4rth pages same results are displayed. Can anybody please explain what am I missing
I really appreciate any help. Code starts here..... $limit = 2 ; $count = $db->query_first("select count(*) count query"); $count['count'] = vb_number_format($count['count']); $totalrows = $count['count']; if(empty($page)) { $page = 1; } $limitvalue = $page * $limit - ($limit); $query = "My query"; $getusercats = $db->query_read($query); while($cats = mysql_fetch_array($getcats)){ eval('$cats .= "' . fetch_template('mainforum_navpage') . '";'); } //Start pagination code here // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } if(!isset($_GET['page'])){ $page = 1; } else { $page = $_GET['page']; } $pagenum = intval($page); if (!isset($pagenum)) { $pagenum = 1; } // counting the offset $offset = ($pageNum - 1) * $limit; $numrows = $count['count']; // how many pages we have when using paging? $maxPage = ceil($numrows/$limit); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " <a href=\"$self?page=$page\">$page</a> "; } } if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page\">[Prev]</a> "; $first = " <a href=\"$self?page=1\">[First Page]</a> "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page\">[Next]</a> "; $last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|