vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Putting ad spot beween say 20th and 21st posts in thread? (https://vborg.vbsupport.ru/showthread.php?t=223911)

ForrestBlack 09-24-2009 11:31 PM

Putting ad spot beween say 20th and 21st posts in thread?
 
I searched around and didn't find a current way to do this to the templates (partly because 'ad' is only two letters), so forgive me if I missed it, but what I am looking for is a way to insert an ad banner spot between say the 20th and 21st posts in a thread, for all threads. Something like if thread has 25+ posts showing on this page, put an ad spot between number 20 and 21, or whatever.

Can anyone point me in the right direction? I looked at some of the ad management plugins/mods and the current ones don't seem to have ads between specified posts as an option.

sparklywater 09-25-2009 07:43 AM

I would like to know this too.

Lynne 09-25-2009 02:22 PM

I think the variable you would look at is $post['postcount']. So at the top of your postbit (or postbit_legacy) template, you would put something like:

HTML Code:

<if condition="$post['postcount'] == 21">
an ad
<if>


sparklywater 09-25-2009 03:03 PM

Quote:

Originally Posted by Lynne (Post 1890451)
I think the variable you would look at is $post['postcount']. So at the top of your postbit (or postbit_legacy) template, you would put something like:

HTML Code:

<if condition="$post['postcount'] == 21">
an ad
<if>


Is there a way to count posts as a multiple of a number? Such as multiples of 10, ie. 10, 20, 30, 40... So the conditional would only apply if the post count is a multiple of 10...?

Lynne 09-25-2009 03:27 PM

What you do is something like ...

HTML Code:

<if condition="$post['postcount'] % 10 == 0">
do something
</if>

That may not be exact... look up php operators. You want to see what the remainder is after dividing by 10 - I think it's called the modulus or something like that. So, if 10/10 has a remainder of 0, then you do something.


All times are GMT. The time now is 07:09 PM.

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.06069 seconds
  • Memory Usage 1,720KB
  • 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
  • (3)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete