Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2011, 07:16 PM
Diablotic Diablotic is offline
 
Join Date: Feb 2010
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Conditional for minimum posts per page

I am looking for a condtional that will show an ad only if there is "x" posts on the page.
At the moment I am using:
Code:
<vb:if condition="$GLOBALS[threadinfo][replycount] >= x">AD</vb:if>
to display this ad only if there is minimum "x" posts posted in the thread but I would like to extend it to display it on only if there are "x" posts displayed on the page.

Anyone?
Reply With Quote
  #2  
Old 03-30-2011, 07:29 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Diablotic View Post
I am looking for a condtional that will show an ad only if there is "x" posts on the page.
At the moment I am using:
Code:
<vb:if condition="$GLOBALS[threadinfo][replycount] >= x">AD</vb:if>
to display this ad only if there is minimum "x" posts posted in the thread but I would like to extend it to display it on only if there are "x" posts displayed on the page.

Anyone?
I've answered this before... see if this info helps .

[QUOTE=TheLastSuperman]
Quote:
Originally Posted by karlm View Post
Good stuffs, Clark. Can it be set so as you can choose which post # the ads go to? i.e. atm, they're forced after post #1... but What if I wanted it to be on post #9 instead?
Quote:
Originally Posted by TheLastSuperman View Post
Hmm you should be able to, open the template postbit_legacy_ads_after_firstpost and find:

Code:
<vb:if condition="!$GLOBALS['FIRSTPOSTID']">
Replace with:

Code:
<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == ?">
Replace the ? mark with the post number you want the Ads to show after and DO NOT include a trailing </vb:if> as it's already near the bottom .

Let me know if that works .
Quote:
Originally Posted by karlm View Post
Oooooor, I might want it so it's always the 'last but one' post..?
Quote:
Originally Posted by TheLastSuperman View Post
Well that depends on your post per page settings:

AdminCP > settings > Options > Thread Display Options (showthread) > Maximum Displayed Posts Before Page Split



So if you have that set to 20 posts per page before the split simply use the code I just posted above and change the ? mark to 19 .

Example:

Code:
<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == 19">
So naturally ignore my references of opening that modifications template and simply note the code being used .
Reply With Quote
  #3  
Old 03-30-2011, 07:41 PM
Diablotic Diablotic is offline
 
Join Date: Feb 2010
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is good idea but there is another problem with this conditional, because I want to place this ad after first post it would need to be set like that:

Code:
<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == 1">
And with this condition it will always show after first page but I want it to show after first post only if there are 2 or more replies on a page.

--------------- Added [DATE]1301593255[/DATE] at [TIME]1301593255[/TIME] ---------------

Anyone please?
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 01:53 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.03622 seconds
  • Memory Usage 2,188KB
  • Queries Executed 11 (?)
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
  • (6)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete