to appear in between x amount of posts is simple and easy.
This tutorial assumes that you have
set up and configured (including the
you want to show).
1. Create a plug in.
Since posts are created in a private function within vB, you must scope $GAB_ads. That way, your $GAB_ads[x] variable will be available in your postbits. We will also scope $counter which increases by one for each visible post on that page.
go to admincp->Plugins & Products->Add new plugin
: vBulletin (or
ad between posts
Plugin PHP code
global $GAB_ads, $counter;
Plugin is active: Yes
2. Modify your postbit template
(this is the postbit or postbit_legacy template, whichever one you are using).
We need to stick a conditional at the end of the postbit that says 'if this is the first post, then show $GAB_ads[x]. Note that you will need to change the x in $GAB_ads[x] to denote the billboard you are using
->scripts->MASTER script to see which billboard is assigned). Also note that you can change the $counter == 1 in the statement below to denote where to show the
. For instance if it were change to 3, then a
would appear after the third post on the page.
Place the following HTML at the very end of your postbit:
<if condition="$counter == 1"><if condition="THIS_SCRIPT!='private'"><div style="padding-top:5px">$GAB_ads[x]</div></if></if>
Note that I have put in a provision so that the
will NOT appear after a private message. Depending on your style and the size of the banners, the sidebar in the usercp can whack out the look.