vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vb's page nav (https://vborg.vbsupport.ru/showthread.php?t=67017)

AN-net 07-09-2004 11:34 PM

vb's page nav
 
hi, well im sort of confused on how to correctly use this feature and exactly what function to do, i have used it before and it did not work correctly for me.

can someone show me how to use it:)

Jolten 07-09-2004 11:45 PM

What are you talking about?

Zachery 07-09-2004 11:51 PM

Quote:

Originally Posted by Jolten
What are you talking about?

Im with Jolten on this one

AN-net 07-09-2004 11:54 PM

vb's pagination function:) i hope you know zac cause its a built in vb feature;)

Zachery 07-09-2004 11:55 PM

Quote:

Originally Posted by AN-net
vb's pagination function:) i hope you know zac cause its a built in vb feature;)

Oh that thing, it runs a query on the table, whichever it may be and finds out how many pages there should be links to, i think :)

AN-net 07-10-2004 12:03 AM

could you post an example code:), i always mess this up:D

Jolten 07-10-2004 12:04 AM

ooo.. okay.. yeah.. that thing.. :)

AN-net 07-10-2004 01:57 AM

im getting division by zero on 1707 in /includes/functions.php

my code is:
PHP Code:

            $countj$DB_site->query_first("SELECT COUNT(*) AS journals FROM ".TABLE_PREFIX."journals WHERE active='1'");
            
$pgnavconstruct_page_nav($countj[journals], journal.php); 

i think did it right and for the page nav being displayed it says "Page of 0"

AN-net 07-10-2004 07:01 PM

ok i fixed the division by zero part but im still experiencing alot of problems, first off it doesnt say which page i am on currently it just says page blank of 2. secondly if it goes past 3 page it doesnt show the 3rd one and if your on page 2 the next arrow leads you back to page 1. what did i do wrong:(

my code:
PHP Code:

            $countj$DB_site->query_first("SELECT COUNT(*) AS journals FROM ".TABLE_PREFIX."journals WHERE active='1'");
            
$perpage1;
            if(empty(
$page))
            {
                
$page1;
            }
            
$start= (($page $perpage) - $perpage);
            
$pgnavconstruct_page_nav($countj[journals], "journal.php?""pp=$perpage");
            
$fjournals$DB_site->query("SELECT
             journals.journal_id,journals.journalname,journals.journaldesc,
            journals.journalist,journals.journalist_id,journals.lastentry,
            journals.lastentry_date,journals.lastentry_id,journals.journalviews,
            journals.journal_totalrating AS totalrating,journals.journal_totalvotes AS totalvotes,COUNT(journal_entries.entry_id) AS entries
             FROM "
.TABLE_PREFIX."journals
            LEFT JOIN journal_entries 
            ON (journals.journal_id=journal_entries.journal_id AND entry_active=1) 
            WHERE journals.active='1'  
            GROUP BY journals.journal_id 
            LIMIT 
$start,$perpage
            "
); 


AN-net 07-10-2004 10:17 PM

i am still experiencing problems i need help:)

here is my updated code:
PHP Code:

            $countj$DB_site->query_first("SELECT COUNT(*) AS journals FROM ".TABLE_PREFIX."journals WHERE active='1'");
            
$perpage2;
            if(empty(
$page))
            {
                
$page1;
            }
            
$pagenumber $page+1;
            if (
$pagenumber 1)
            {
                
$pagenumber 1;
            }
            else if (
$pagenumber $countj['journals'])
            {
                
$pagenumber $countj['journals'];
            }
            
$start= (($page $perpage) - $perpage);
            
$pgnavconstruct_page_nav($countj['journals'], "journal.php?""&pp=$perpage");
            
$fjournals$DB_site->query("SELECT
             journals.journal_id,journals.journalname,journals.journaldesc,
            journals.journalist,journals.journalist_id,journals.lastentry,
            journals.lastentry_date,journals.lastentry_id,journals.journalviews,
            journals.journal_totalrating AS totalrating,journals.journal_totalvotes AS totalvotes,COUNT(journal_entries.entry_id) AS entries
             FROM "
.TABLE_PREFIX."journals
            LEFT JOIN journal_entries 
            ON (journals.journal_id=journal_entries.journal_id AND entry_active=1) 
            WHERE journals.active='1'  
            GROUP BY journals.journal_id 
            LIMIT 
$start,$perpage
            "
); 

it seems as though my page is messing me up, it seems as though it affects my $start variable when i use ++ or +1 in the defining of $pagenumber. can someone help me define $pagenumber correctly ;)


All times are GMT. The time now is 09:30 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.01276 seconds
  • Memory Usage 1,756KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete