vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Template Conditional for Ad slot after 5th Post in Postbit (https://vborg.vbsupport.ru/showthread.php?t=314199)

punchbowl 09-11-2014 09:12 AM

For some reason this works fine on in ad_showthread_firstpost but doesn't seem to work on ad_showthread_beforeqr or if you do something like

Code:

<if condition="THIS_SCRIPT == 'showthread' and $post[postcount] == 1>hello</if>
in the footer

It only seems to work as vb is producing the posts not in templates calls after. In 3.8 anyway. Sorry yes I'm using 3.8 but the conditionals are almost exactly the same so I didn't think anyone would mind:erm:

ozzy47 09-11-2014 09:48 AM

Possibly this.

Code:

<vb:if condition="THIS_SCRIPT == 'showthread' and $GLOBALS[postcount] == 1>hello</vb:if>

punchbowl 09-11-2014 11:05 AM

Nope. Doesn't seem to know the postcount outside of the postbit template itself. Not a big deal anyway. Thanks for your help.

induslady 09-16-2014 11:09 AM

To display Ad after the 5th post ONLY if the thread has 10 posts, I used the below conditional -

Code:

<vb:if condition="($post['postcount'] % $vboptions['maxposts'] == 5) AND ($post['postcount'] > 9)">
but this is not working. what is happening is that the ad is not getting displayed after 5th post even when there are 10 posts in the thread.
Please help me with the workable conditional.
Thanks.

induslady 09-23-2014 04:40 AM

Hello All,

Hope this might be useful to some one,

To display Ad after the 5th post ONLY if the thread has minimum 6 posts the below conditional works -

Code:

<vb:if condition="($post['postcount'] % $vboptions['maxposts'] == 5) AND ($GLOBALS[threadinfo][replycount] % $vboptions['maxposts'] <> 4)">

ukdalai 11-06-2014 08:04 PM

hi all, this is useful, not sure if it what im looking for but it might be, i need to put an ad underneath the first post just for 2 usergroups and only in one forum.

could this do that for me, if so, in what template and where within the template where would i need to put the conditionals.

i was thinking something like this:

Code:

<vb:if condition="$post['postcount'] % $vboptions['maxposts'] == 1">
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">
<vb:if condition="$GLOBALS['forumid'] == X">
SHOW AD
</vb:if>
</vb:if>
</vb:if>

Would this work, and where do i put the code.

Craig

adpar 07-19-2015 09:13 AM

thank you it works very well

can i ask you what number should i place inside that code

if i want to display

additional banners like this

after post 12 if thread has at least 18 posts
after post 24 if thread has at least 30 posts
or something like that.

i.e. i will be placing many banners on 1 page,
since we have max post number at 40
so there is a lot of space scrolling down.

we put many ngo ads and need the extra space, and since they are not paid ads but ngo messages,
we dont mind showing them to our readers .

thank you in advance to whoever will help !!


All times are GMT. The time now is 11:24 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.00978 seconds
  • Memory Usage 1,725KB
  • 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
  • (5)bbcode_code_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
  • (7)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