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 09-09-2014, 08:04 AM
induslady induslady is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Template Conditional for Ad slot after 5th Post in Postbit

Hello,

Am looking to display ads in showthread page in the below positions -

1)After First Post
2)After 5th Post ONLY IF the thread has 10 posts.

For #1, Have used the template conditional in postbit-
<vb:if condition="THIS_SCRIPT == showthread AND !$GLOBALS['FIRSTPOSTID']">

Similarly for #2, can anyone help me with the template conditional.

Thanks.
Reply With Quote
  #2  
Old 09-09-2014, 09:00 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == ?">
Replace the ? mark with the post number you want the Ads to show after.
Reply With Quote
  #3  
Old 09-10-2014, 07:11 AM
induslady induslady is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes Thanks, that worked good.

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

Hello ozzy47,
Looks like the conditional

Code:
<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == 5">
is displaying the ad after 5th post, that is fine.

But what am looking for is the below -

- Display ad after 5th post ONLY if the thread page has 10 posts.
- Do not display Ad if the thread page has 5 or 6 or 7 or 8 or 9 posts in it.

Let me know how this conditional could be tweaked.

For info, I have the below setting in my forum -
Maximum Displayed Posts Before Page Split - 10
Reply With Quote
  #4  
Old 09-10-2014, 08:44 AM
mokujin's Avatar
mokujin mokujin is offline
 
Join Date: Oct 2005
Location: Czech
Posts: 345
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:
HTML Code:
<vb:if condition="($post['postcount'] % $vboptions['maxposts'] == 5) AND $post['postcount'] > 9">
Reply With Quote
  #5  
Old 09-10-2014, 11:13 AM
induslady induslady is offline
 
Join Date: Jul 2006
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello mokujin,

The above conditional is not working.
Reply With Quote
  #6  
Old 09-10-2014, 08:06 PM
punchbowl punchbowl is offline
 
Join Date: Nov 2006
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by induslady View Post
Hello mokujin,

The above conditional is not working.
try this:
Quote:
Originally Posted by mokujin View Post
Try this:
HTML Code:
<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == 5) AND $post['postcount'] > 9">
(removed stray '(' )

is maxposts about the page or about the thread btw? i.e. say I have 10 posts per page and 11 posts in total is postcount 1 or 11?, what is the conditional for basically saying "if there is only x posts on this page"?
Reply With Quote
  #7  
Old 09-10-2014, 09:07 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by induslady View Post
Hello mokujin,

The above conditional is not working.
Try this one.

HTML Code:
<vb:if condition="post['postcount'] % $vboptions['maxposts'] == 5 AND $GLOBALS[threadinfo][replycount] >= 9">
Reply With Quote
  #8  
Old 09-10-2014, 09:10 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by punchbowl View Post
try this:


(removed stray '(' )

is maxposts about the page or about the thread btw? i.e. say I have 10 posts per page and 11 posts in total is postcount 1 or 11?, what is the conditional for basically saying "if there is only x posts on this page"?
For the "if there is only x posts on this page"

HTML Code:
<vb:if condition="$post[postcount] == X>
Reply With Quote
Благодарность от:
punchbowl
  #9  
Old 09-10-2014, 09:30 PM
punchbowl punchbowl is offline
 
Join Date: Nov 2006
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
For the "if there is only x posts on this page"

HTML Code:
<vb:if condition="$post[postcount] == X>
brilliant thanks...exactly what I wanted.
Reply With Quote
Благодарность от:
ozzy47
  #10  
Old 09-10-2014, 09:31 PM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not a problem, glad to help.
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 07:33 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.04762 seconds
  • Memory Usage 2,264KB
  • 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
  • (1)bbcode_code
  • (6)bbcode_html
  • (5)bbcode_quote
  • (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
  • (10)post_thanks_box
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete