The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with vBulletins Pagination
Before making this post, I searched around and came across the following code (modified to fit my data) and I am not exactly sure where to place it to make it function as it needs to.
Coding Snippet: https://vborg.vbsupport.ru/showthrea...ght=pagination Code:
$rescount= $DB_site->query_first("SELECT COUNT(*) AS id FROM resources WHERE isstuck='no'"); $perpage= 6; if(empty($page)) { $page= 1; } $start= (($page * $perpage) - $perpage); $pagenavigation = construct_page_nav($rescount[id], "resources.php?", "pp=$perpage"); I am trying to make it so that the data I am pulling from the database below is paginated accordingly, though it does not seem to be working as it should be (or as I had thought). While the limit function above does work and show only 6 of the 7 entries, no links are presented on the page for me to get to the next. Code:
$getresources = $DB_site->query("SELECT * FROM resources WHERE type='vbulletin' AND isstuck='no' ORDER BY id DESC LIMIT $start,$perpage"); while($resource = $DB_site->fetch_array($getresources)) { eval('$resources .= "' . fetch_template('index_resourcedata') . '";'); } eval('print_output("' . fetch_template('index_resourcedisplay') . '");'); |
#2
|
|||
|
|||
The navigation bar is showing now, though the links in the navigation bar are not working as they should, nor is it set on the correct page, though the coding has been changed since it didn't work with the above either:
Code:
$rescount= $DB_site->query_first("SELECT COUNT(*) AS id FROM resources WHERE isstuck='no' AND softwaretype='vbulletin'"); $perpage= 2; if(empty($page)) { $page= 1; } $pagenumber = $page+1; if ($pagenumber < 1) { $pagenumber = 1; } else if ($pagenumber > $rescount['id']) { $pagenumber = $rescount['id']; } $start= (($page * $perpage) - $perpage); $pagenav = construct_page_nav($rescount[id], "resources.php?", "pp=$perpage"); |
#3
|
|||
|
|||
I am not sure what else there is to do, nothing seems to be working and I have checked online.php, memberlist.php and so forth and I can't seem to get it to work correctly. While it displays the correct number of pages as it should, it always seems to start on the wrong page and the links never work.
I would appreciate any help that could be offered and would be more than happy to give credit where credit is due once the hack/modification is completed. |
#4
|
|||
|
|||
Quote:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|