The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to displaying advert after first post, 15th post and 29th post?
How do I identify the first, 15th and 29th post on the page please?
And then in the conditional in postbit_legacy, do I just eval the similar templates for each advert? |
#2
|
||||
|
||||
im not 100% on this sombody correct me if im wrong, i know for a fact to get it to display after the first post you would go into postbit / postbit legacy and at the very bottom add
Code:
<if condition="$post[postcount] == 1"> your ad code here </if> Code:
<if condition="$post[postcount] == 1,15,29"> ad code </if> |
#3
|
|||
|
|||
Quote:
Quote:
|
#4
|
||||
|
||||
Thanks. Default for our forums is 30 posts per page.
In each of those locations I want to display an advert. I'm guessing the best option is to eval a template? But a different one each time? |
#5
|
|||
|
|||
Well, I guess it depends on what your advert code is like. I guess what you want to do is have a plugin somehow get the html for each ad location and put it in variables that can be used in the postbit template, but how you get the html is up to you. If you want to make a template for formatting an ad you could od that, or you could just put the html in your plugin (if the ad is just an image, that might be the easiest way).
|
#6
|
||||
|
||||
why wouldn't my recomendation of if condition postcount work for this?
|
#7
|
|||
|
|||
Quote:
Code:
<if condition="$post[postcount] == 1,15,29"> ad code </if> but maybe you were thinking of using in_array(), like: Code:
<if condition="in_array($post[postcount], array(1,15,29))"> ad code </if> even so, I think $post[postcount] is the count of the post within the entire thread, and I think the OP asked about the posts on each page (so I think the condition above wouldn't show anything after the first page). |
#8
|
||||
|
||||
i will test this really quick and post the results
ok OP this is what you should use, it just requires a simple code into postbit legacy no plugins required, kh was right i had the condition wrong but the idea was correct i used <if condition="in_array($post[postcount], array(1,15,23))"> <center><h1>ad code</h1></center> </if> at the very bottom of postbit legacy, with threads set to display 10 per page, so each post 1 15 and 23 were on seperate pages, the adcode displayed correctly under each post i specified, no matter the page it was on this method works great and i will be using it myself now too. |
#9
|
|||
|
|||
Well, I think spinball has 30 posts per page and wanted the ads to show up on each page. But now that I think about it, you could use ($post[postcount] % 30). And I think that is a better solution especially since it looks like the 'counter' variable isn't used if you're using threaded or hybrid mode to view the thread.
|
#10
|
||||
|
||||
Thanks, all.
Nearly there. Is there a GLOBALS variable which stores the number of posts being displayed? I.e. visible posts? I ask because I only want the system to 'prepare' the banners for the actual number which will be displayed. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|