vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Constructing Pagenav (https://vborg.vbsupport.ru/showthread.php?t=95670)

Jolten 09-05-2005 02:17 AM

Constructing Pagenav
 
Hi,

I'm trying to incorporate the vbulletin 3.0.x pagenav into a modification of member.php.

I've got a query pulling total results ($results) and even have php to figure out $previous, $i (page num) and $next links. But I can't seem to figure out how to build around these variables, a la.....
PHP Code:

$pagenav construct_page_nav(XX); 

Can anyone explain the two arguments for the page nav variable? everything I try gives me a divide by 0 error in function.php

thanks

deathemperor 09-05-2005 03:06 AM

construct_page_nav($param1, $param2, $param3);

$param1 is the total number of items, $param2 is the basic link of that page, $param 3 is optional for the sub string of that link (in $param2.

for e.g:

construct_page_nav($totalitemsfromquery, "script.php?$session[sessionurl]id=$id", "&cmd=sort&sort=$sort&order=$order&amp ;pp=$perpage&daysprune=$da ysprune");

hope this help.

Jolten 09-05-2005 04:22 PM

Thanks deathsemporer.

I'm still getting a divide by zero error though.

PHP Code:

// Define the number of results per pg 
$max_results =20
$from = (($pg $max_results) - $max_results);

$full1 $DB_site->query("SELECT * FROM _table_ WHERE _username_ = '".$userinfo['username']."'");
$full=$DB_site->num_rows($full1);
print 
$full;
$pagenav construct_page_nav($full"member.php?$session[sessionurl]u=$userinfo[userid]","&pg=$pg"

The print command is just there for debugging. It prints the proper total results. I'm thinking it may have something to do with my hard coding the per page results at 20. $from is used to limit the queries.


All times are GMT. The time now is 10:31 AM.

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.01329 seconds
  • Memory Usage 1,716KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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