vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with vBulletins Pagination (https://vborg.vbsupport.ru/showthread.php?t=71005)

AlienSector 10-26-2004 08:55 AM

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') . '");');

Any help is appreciated as I would like to get this working as soon as possible :).

AlienSector 10-26-2004 07:24 PM

1 Attachment(s)
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");

The below attachment is what the pagenav bar looks like and the page it is starting on with the above.

AlienSector 10-27-2004 03:12 PM

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.

AlienSector 10-28-2004 04:53 PM

Quote:

Originally Posted by AlienSector
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.

Still looking for a bit of assistence of anyone can lend it :).


All times are GMT. The time now is 04:16 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02009 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete