PDA

View Full Version : Ad after every X posts


Morgan
02-05-2008, 03:21 AM
Add a plugin to the postbit_display_complete hook with the following code:
global $GAB_ads;

Add the following to the end of the postbit template, changing X to the number of posts before an
ad appears and changing Y to 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9 depending on what you have set in GAB:
<if condition="$post[postcount] % X == 0">
<div style="padding-top:5px">
$GAB_ads[Y]
</div>
</if>

If you want the ad to be random, not the same ad every single time, do the following instead.

Add a plugin to the postbit_display_complete hook with the following code:
global $GAB_ads;
$GAB_random_key = 0;
if (is_array($GAB_ads))
{
$GAB_random_key = array_rand($GAB_ads);
}

Add the following to the end of the postbit template, changing X to the number of posts before an
ad appears:
<if condition="$post[postcount] % X == 0">
<div style="padding-top:5px">
$GAB_ads[$GAB_random_key]
</div>
</if>
Note that the latter method assumes you have set at least two $GAB_ads[X] variables in scripts.

dsurban
02-09-2008, 08:27 AM
where do I fhind this?

"Add a plugin to the postbit_display_complete hook with the following code:"

thanks

Morgan
02-09-2008, 08:29 AM
See http://www.vbulletin.com/docs/html/main/add_plugin for how to add a plugin.

dsurban
02-09-2008, 02:43 PM
cheers, got it working now

KenDude
02-10-2008, 05:11 AM
See http://www.vbulletin.com/docs/html/main/add_plugin for how to add a plugin.


This link is not working for me... :(

Morgan
02-11-2008, 04:34 PM
Try http://www.vbulletin.com/docs/html/main/add_plugin?manualversion=30506500 instead.

mushrom
03-12-2008, 03:01 PM
with this tutorial can we make that ads appear ONLY after the 1st post and not every X posts?

Morgan
03-12-2008, 04:58 PM
http://www.thevbgeek.com/showthread.php?t=2952

ichatfilipina
03-10-2009, 09:45 AM
<if condition="$post[postcount] % X == 0">
<div style="padding-top:5px">
$GAB_ads[$GAB_random_key]
</div>
</if>

--
<if condition="$post[postcount] % X == 0"> is this really capital X? or small case?

Morgan
03-11-2009, 10:12 PM
The account you used to post your message is showing as unlicensed. Please use the account with a license to obtain support. Thank you.