Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 09-11-2012, 02:48 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think 'perpage' should work. Edit: well, it will tell you the page size being used, but I don't think it will tell you if the current page is full. I don't see any way to do that offhand.
Reply With Quote
  #12  
Old 09-12-2012, 09:06 AM
Spinball's Avatar
Spinball Spinball is offline
 
Join Date: Feb 2002
Location: Telford, England
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No perpage is 30 whatever number of replies there are.
Perhaps there isn't a value for the number of visible posts in a SHOWTHREAD page.
Reply With Quote
  #13  
Old 09-12-2012, 02:37 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There doesn't seem to be, but there is a global $posts that is the result of the post query, so you could do something like:

Code:
global $db, $posts;
$rows = $db->num_rows($posts);

in a plugin, of course. There are other checks before posts are displayed so I guess there might be situations where there are more rows than posts, but I suppose if it works sometimes, that's better than not checking at all.
Reply With Quote
  #14  
Old 09-14-2012, 08:42 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is out of one of my ad mods
PHP Code:
if ($this->registry->options['google_ads_onoff'] && ($this->registry->options['advert_postbit_ad'] || $this->registry->options['advert_postbit_ad_rand']))
{


    
$this_script_off explode('|',$this->registry->options['advert_this_script_off']);
    if (!
$this->registry->options['advert_this_script_off'] || !in_array(THIS_SCRIPT$this_script_off))
    {
        
$post[posts] = str_replace('|'''$post[posts]);
        if (!
$this->registry->options['advert_maxuserpostcount'] || $post[posts] < $this->registry->options['advert_maxuserpostcount'])  
        {    
            
$adtitle $this->registry->options['advert_adtitle'];
        
            if (
$this->registry->options['advert_removeadstext'] && $this->registry->options['advert_removeadslink'])
            {
                
$removeadstext $this->registry->options['advert_removeadstext'];
                
$removeadslink $this->registry->options['advert_removeadslink'];
                
$removeads '<span style="float:' $stylevar[right] . ';font-weight:normal;"><a href="' $removeadslink '">' $removeadstext '</a></span>';
            }
            
            if (
$this->registry->options['advert_postbit_ad'])
            {
                
$postbit_ad $this->registry->options['advert_postbit_ad'];
            }
            else if (
$this->registry->options['advert_postbit_ad_rand'])
            {
                
$postbit_ad explode('|',$this->registry->options['advert_postbit_ad_rand']);
                
$postbit_rand array_rand($postbit_ad);
                
$postbit_ad $postbit_ad[$postbit_rand];
            }    
            
            if (
$this->registry->options['advert_avatar'])
            {
                
$advert_avatar '<img src="' $this->registry->options['advert_avatar'] . '" border="0" class="inlineimg" alt="" />';
            }    
            
            if (
$this->registry->options['legacypostbit'])
            {
                
$advert_postbit_template ad_postbit_legacy_end;
                if (
$this->registry->options['advert_postbitasuser'])
                {
                    
$postbit_advert_asuser '<td class="alt2" width="175px"><div><a class="bigusername" href="javascript:;" rel="nofollow">' $this->registry->options['bbtitle'] . '</a></div><div class="smallfont">Advertisement</div><div>&nbsp;<br />' $advert_avatar '</div></td>';
                }
            }
            else
            {    
                
$advert_postbit_template ad_postbit_below;
                
                if (
$this->registry->options['advert_postbitasuser'])
                {
                    
$postbit_advert_asuser '<tr><td class="alt2" style="padding:0;"><table cellpadding="' $stylevar[cellpadding] . '" cellspacing="' $stylevar[cellpadding] . '" border="0" width="100%"><tr><td style="padding:0;">' $advert_avatar '</td><td nowrap="nowrap" width="100%"  style="padding:0;"><div><a class="bigusername" href="javascript:;" rel="nofollow">' $this->registry->options['bbtitle'] . '</a></div><div class="smallfont">Advertisement</div></td></tr></table></td></tr>';
                }
            }
            
            
$adusergroupinfo_on explode('|',$this->registry->options['advert_Postbit_usergroups_on']);
            
$adusergroupinfo_off explode('|',$this->registry->options['advert_Postbit_usergroups_off']);
            if ((!
$this->registry->options['advert_Postbit_usergroups_on'] || is_member_of($this->registry->userinfo$adusergroupinfo_on)) && !is_member_of($this->registry->userinfo$adusergroupinfo_off))
            {
                
$aduserinfo_on explode('|',$this->registry->options['advert_userids_on']);
                
$aduserinfo_off explode('|',$this->registry->options['advert_userids_off']);
                if ((!
$this->registry->options['advert_userids_on'] || !in_array($userinfo[userid], $aduserinfo_on)) && in_array($userinfo[userid], $aduserinfo_off))
                {
                    
                    if (
$this->registry->options['advert_pms_onoff'] && THIS_SCRIPT == 'private')
                    {
                        eval(
'$ad_postbit_below = "' fetch_template('' $advert_postbit_template '') . '";');
                    }
                    
                    else if (
$this->registry->options['advert_announcements_onoff'] && THIS_SCRIPT == 'announcement')
                    {
                        
                        
$adforuminfo_on explode('|',$this->registry->options['advert_forumids_on']);
                        
$adforuminfo_off explode('|',$this->registry->options['advert_forumids_off']);
                        if ((!
$this->registry->options['advert_forumids_on'] || !in_array($foruminfo[forumid], $adforuminfo_on)) && in_array($foruminfo[forumid], $adforuminfo_off))
                        {
                            
$adannouncementinfo_on explode('|',$this->registry->options['advert_announcementids_on']);
                            
$adannouncementinfo_off explode('|',$this->registry->options['advert_announcementids_off']);
                            if ((!
$this->registry->options['advert_announcementids_on'] || in_array($post[postid], $adannouncementinfo_on)) && !in_array($post[postid], $adannouncementinfo_off))
                            {    
                                eval(
'$ad_postbit_below = "' fetch_template('' $advert_postbit_template '') . '";');
                            }
                        }
                    }
                    
                    else if (
$this->registry->options['advert_posts_onoff'] && (THIS_SCRIPT == 'showthread' || THIS_SCRIPT == 'showpost'))
                    {
                        
$adforuminfo_on explode('|',$this->registry->options['advert_forumids_on']);
                        
$adforuminfo_off explode('|',$this->registry->options['advert_forumids_off']);
                        if ((!
$this->registry->options['advert_forumids_on'] || in_array($thread[forumid], $adforuminfo_on)) && !in_array($thread[forumid], $adforuminfo_off))
                        {
                            
$adthreadinfo_on explode('|',$this->registry->options['advert_threadids_on']);
                            
$adthreadinfo_off explode('|',$this->registry->options['advert_threadids_off']);
                            if ((!
$this->registry->options['advert_threadids_on'] || in_array($thread[threadid], $adthreadinfo_on)) && !in_array($thread[threadid], $adthreadinfo_off))
                            {
                                
$post[posts] = str_replace('|'''$post[posts]);
                                if ((!
$this->registry->options['advert_minpostcount'] || $GLOBALS[threadinfo][replycount] >= ($this->registry->options['advert_minpostcount'] - 1)) && (!$this->registry->options['advert_maxuserpostcount'] || $post[posts] < $this->registry->options['advert_maxuserpostcount']))  
                                {    
                                    
$adxpostonly explode('|',$this->registry->options['advert_xpostonly']);
                                    if ((
$this->registry->options['advert_firstpost'] && $post[postcount] % $this->registry->options[maxposts] == 1) || ($this->registry->options['advert_lastpost'] && $post['islastshown']) || ($this->registry->options['advert_postcountrepeat'] && $post[postcount] % $this->registry->options['advert_postcountrepeat'] == 0) || ($this->registry->options['advert_xpostonly'] && $post[postcount] == in_array($post[postcount], $adxpostonly)))
                                    {                    
                                        eval(
'$ad_postbit_below = "' fetch_template('' $advert_postbit_template '') . '";');
                                    }
                                }
                            }
                        }
                    }
                }
            }    
        }
    }

It may help you figure stuff out
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05649 seconds
  • Memory Usage 2,319KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete