vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   i should know this but don't (https://vborg.vbsupport.ru/showthread.php?t=65551)

sabret00the 05-26-2004 02:30 PM

i should know this but don't
 
how do i select the number of posts on a page in a thread? (rather than all posts in the thread?

Tony G 05-27-2004 05:42 AM

Is there even a variable that defines that number?

sabret00the 05-27-2004 10:24 AM

i hope so as the $bbuerinfo[maxpost] variable seems to be set at -1 for most of my users, although i suppose that i could user

PHP Code:

if ($bbuserinfo[maxpost] < 15)
 {
 
$bbuserinfo[maxpost] = $vboptions[maxpost];
 }
 
 if (
$thread[replycount] > $bbuserinfo[maxpost])
 {
 
$postsonthispage $thread[replycount] - $perpage $pages;
 }
 else
 {
 
$postsonthispage $thread[replycount];
 } 

i think that should give you the data :o feel free to correct me.

Xenon 05-27-2004 11:11 AM

hmm, doesn'T $perpage already give you the ammount of posts per page?

sabret00the 05-27-2004 11:15 AM

thinking about it $perpage should be the same as $bbuserinfo[maxposts]

Xenon 05-27-2004 11:44 AM

it's a bit more complicated ^^

example from showthread.php:
PHP Code:

// set $perpage

if (!$perpage)
{
    
$perpage $bbuserinfo['maxposts'];
}

$checkmax explode(','$vboptions['usermaxposts'] . ',' $vboptions['maxposts']);
if (
$perpage OR $perpage max($checkmax))
{
    
$perpage $vboptions['maxposts'];


so $perpage can be defined in several ways, as parameter of the url, as a user setting, as $vboptions[mx] aso.

sabret00the 05-27-2004 12:12 PM

so you trying to tell me that my code is wrong and $postsonthispage wouldn't return anything?

Xenon 05-27-2004 05:14 PM

well, it would return something, but not what you want to get.

sabret00the 05-27-2004 05:49 PM

lol :( any help on how to aquire the data i'm trying to get?

i thought maybe the errors in this line?
PHP Code:

$postsonthispage $thread[replycount] - $perpage $pages

as it should be something like
PHP Code:

$postsonthispage $thread[replycount] - ($perpage $pages); 

get the sum of $perpage dived $pages then subtract that total from the $thread[replycount] and you should have your total?

Xenon 05-27-2004 06:11 PM

hmm, try to use $counter, iirc it already stores the ammount of actual shown posts.


All times are GMT. The time now is 08:37 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.03310 seconds
  • Memory Usage 1,732KB
  • 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
  • (4)bbcode_php_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