Log in

View Full Version : A Simple PHP Banner Rotator?


Ian555
08-24-2006, 10:32 PM
I have searched high and low for a simple banner rotator... and have found quite a few options on script sites. I got a few of them working outside of vBulletin without any trouble.

But PLEASE can someone tell me why whenever I place any php code in the header template the board refuses to show anything... when perfectly simple php page in the same directory works fine?

I don't want phpadsnew, I don't want to count clicks or anything, I don't want to use javascript, I just need to integrate stuff that's simple outside of vBulletin into the templates... I followed this to the letter http://www.vbulletin.com/forum/showthread.php?t=170826 and it doesn't work.

I am running the latest version 3.6.0 and I just need to rotate 3 or 4 banners on page refresh... nothing complicated at all outside of vBulletin... but there must be something you guys are not telling about. :)

ANY help appreciated, thanks :)

Ntfu2
08-24-2006, 11:18 PM
because you cant parse php in the templates without a modification. Search for the let php live modification if you wish to use php in templates.

And you didnt follow that to the letter or else it would have worked just fine

Kirk Y
08-25-2006, 12:13 AM
Just make a plugin using hook global_start. I do the same for header rotations on my forums. Don't know why people insist on working against vBulletin's templating system when it's easy enough to work with it... but that's just my daily rant. :)

Ian555
08-25-2006, 12:18 AM
Obviously I am not setting up plugins properly.

I honestly cannot see what I missed
http://www.vbulletin.com/forum/showthread.php?t=170826

So please tell me what is the most simple and efficient way of making banners rotate working with the template system?

Thanks :)

Hook Location = ?
Title = ?
Execution Order = ?

Then how do you call it? Using the title?

I don't understand what a Plugin is... I guess it ain't an include then. :)

Kirk Y
08-25-2006, 12:27 AM
Okay, let me see if I can explain it better:

Add a New Plugin using Hook Location "global_start".
$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';

Remember to change all the Image Paths to the location of the banners you want to display.

Then edit whatever template you'd like to display the random banner in and stick this code wherever you'd like it to show:
$random_banner[$random_number]

Ian555
08-25-2006, 12:33 AM
Ok thanks :)

The other thread I linked to says I need a different type of Hook location, and that doesn't work, so I guess I'll try it using the global_start instead.

Cheers

Kirk Y
08-25-2006, 12:37 AM
Well global_start allows you to use it anywhere on the forum -- in my case, I use it on the Header for a Logo Rotation. It all depends on the template you're trying to put the banner in - the header template's only hook is global_start.

zooki
09-03-2006, 10:48 PM
Hi, can i ask, how could i also get Google Adsense in there

$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';

Could i do Random_banner[3] = ' adsense code here.... ' ??

Right now i have adsense ads on my page, but i had requests from people for adding some seperate banners..... was wondering good and effective way to rotate that all in one space........ i am so tired, i hope someone can help..

thank you

Kirk Y
09-04-2006, 12:15 AM
Yep, you could do that too.

furst
09-04-2006, 02:24 AM
Good stuff there, acidburn. That helped me a whole lot.

If I want to run 10 random banners, do I just replace rand(1, 5); with $random_number = rand(1, 10);?

Also, how could I create a few different plug-ins like this so that I can run different banners in different areas?

Kirk Y
09-04-2006, 02:53 AM
Yep, just change the variable like you've got it there.

Using this plugin at hook location global_start enables the $random_banner variable to be used anywhere on the forum.

twobob
09-04-2006, 10:36 AM
acidburn - thanks for the tip about using global_start as the hook location. When I followed the instructions from the .com post, the hook location that was automatically selected was ajax_start ... probably because that is the first of the hooks in the drop down menu.

global_start clearly works well for this MOD, but what other hook locations would also be appropriate to select?

Thanks again, twobob

Kirk Y
09-04-2006, 09:23 PM
It all depends on what template you're trying to add the variable to.

For example, if you wanted to place the ads on your Forumhome (Index), you'd place the variable in the forumhome template and set the hook location to forumhome_start.

But like I said, using global_start let's you use it anywhere.

furst
09-05-2006, 09:30 PM
Hey acidburn, pray tell, how can I do this:

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';

and have different images appear for random_banner[1]? For instance, I want to rotate /images/banners/banner[1-20].jpg but use the same link each time. Do I have to place them all in different $random_banner lines or is there a shortcut?

Kirk Y
09-05-2006, 10:52 PM
In your case, it's simpler just to set them all on seperate lines.

zooki
09-06-2006, 10:10 PM
Hi guys,


One Question is How do i get it to display on the VB CMPS?


you might wanna check this page out for future reference:
Rotating Banners in NavBar
https://vborg.vbsupport.ru/showthread.php?t=120707

Crazace2006
10-11-2006, 01:35 PM
What would the Plugin Hook Location for the footer be?

Kirk Y
10-11-2006, 08:45 PM
Just use global_start.

Tammy05
10-14-2006, 04:15 AM
Does this work for the new vb 3.6?

Kirk Y
10-14-2006, 05:51 PM
It will work on any version of vBulletin that supports the Plugin System. At the moment, anything 3.5.x and up.

Tammy05
10-14-2006, 07:01 PM
It will work on any version of vBulletin that supports the Plugin System. At the moment, anything 3.5.x and up.

thast odd because i did everyting correctly however the header area showed up empty.

Kirk Y
10-14-2006, 07:23 PM
I'm using it on my 3.6.2 forum, so I can assure you that it works. Recheck all the steps and be sure you didn't miss something.

bada_bing
10-15-2006, 01:54 AM
subscribes

Shazz
10-15-2006, 02:00 AM
Thats the most easiest plugin and cleanest to install
If there was reputation stats I would add one to you acidburn0520
/me props*

Kirk Y
10-15-2006, 02:07 AM
lol, thanks Shazz. Happy to help. :)

Criticize
02-07-2007, 01:07 PM
My banners are not rotating, I have 5 that are currently setup but two of the same banners keep showing. Please help me.

www.club246.com is the site

Thank you!

Kirk Y
02-07-2007, 04:15 PM
It's all random, each banner has a 1/5 chance of being displayed... assuming you've installed it right, you'll eventually see them all. Post up the Plugin code you're using just be sure, though.

double_d
01-06-2008, 06:14 AM
Okay, let me see if I can explain it better:

Add a New Plugin using Hook Location "global_start".
$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';

Remember to change all the Image Paths to the location of the banners you want to display.

Then edit whatever template you'd like to display the random banner in and stick this code wherever you'd like it to show:
$random_banner[$random_number]

what does this mean
i would like this
do i have to write a php script and call it global_start ???
only new at this
please help me

daniel d

MoT3rror
01-06-2008, 06:49 AM
Hook Location: global_start (Makes it available on anypage)
Title: Random Banner (You can make your own name)
Execution Order: 1
PHP Code:
$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';

Plugin is Active: Yes

Then you put $random_banner[$random_number] in a template.

Kirk Y
01-06-2008, 04:11 PM
AdminCP -> Products & Plugins -> Add New Plugin

buurman
01-08-2008, 08:47 AM
Thanks Kirk, works great!! also made a rotating header logo.

happy I found your replys :)

kronnos
02-04-2008, 01:28 PM
Okay, let me see if I can explain it better:

Add a New Plugin using Hook Location "global_start".
$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';

Remember to change all the Image Paths to the location of the banners you want to display.

Then edit whatever template you'd like to display the random banner in and stick this code wherever you'd like it to show:
$random_banner[$random_number]

What if I would want to have just 2 banner options but not show them randomly, instead if its forum home, then show one ad if its something else show another?

Kirk Y
02-04-2008, 02:18 PM
Then you don't need to use this plugin.

Instead use template conditionals to output a header based on what page the user is viewing.

Example:
<if condition="THIS_SCRIPT == 'index">Show this only on the Index<else />Show this on pages other than the Index</if>

That's a very basic example, if you'd like some more information: http://www.vbulletin.com/docs/html/template_conditionals

kronnos
02-04-2008, 05:51 PM
Then you don't need to use this plugin.

Instead use template conditionals to output a header based on what page the user is viewing.

Example:
<if condition="THIS_SCRIPT == 'index">Show this only on the Index<else />Show this on pages other than the Index</if>

That's a very basic example, if you'd like some more information: http://www.vbulletin.com/docs/html/template_conditionals

Tried it but it still doesn't work. It just shows both in one ad block. Could it be that the ad block does not allow php code?

--------------- Added 1202145412 at 1202145412 ---------------

This is the code i tried but it shows the ad code and the text:

<if condition="THIS_SCRIPT == 'index'">

<center><script type="text/javascript"><!--
google_ad_client = "pub-8336492106717154";
//120x60, created 1/25/08
google_ad_slot = "4645103244";
google_ad_width = 120;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<center/>


<else />


This text


</if>

Ranger269
02-04-2008, 07:37 PM
Execution Order: 1


I was wondering about that. The default setting I had was "5" so I left it that way and the banner works fine.

I didn't understand just what that was for?

Should I change it to "1"?

Kirk Y
02-04-2008, 09:45 PM
Tried it but it still doesn't work. It just shows both in one ad block. Could it be that the ad block does not allow php code?

What template are you using this in; and on what version of vBulletin? I tested the code you supplied above and it worked perfectly for me.

I was wondering about that. The default setting I had was "5" so I left it that way and the banner works fine.

I didn't understand just what that was for?

Should I change it to "1"?

Execution orders allow Plugins within a modification which utilize the same hook to be run in a specific order. ie. Plugin A gathers the UserID, Plugin B executes a query based on the userid, and Plugin C displays something based on the query. Thus Plugin A must be run before Plugin B and Plugin B must be run before Plugin C. This can be achieved by setting the Execution Orders of the three plugins to 1, 2, and 3 (respectively).

Ranger269
02-05-2008, 01:41 AM
Execution orders allow Plugins within a modification which utilize the same hook to be run in a specific order. ie. Plugin A gathers the UserID, Plugin B executes a query based on the userid, and Plugin C displays something based on the query. Thus Plugin A must be run before Plugin B and Plugin B must be run before Plugin C. This can be achieved by setting the Execution Orders of the three plugins to 1, 2, and 3 (respectively).

Thanks!

I'm having trouble with two rotating banners on the same forum...

https://vborg.vbsupport.ru/showthread.php?t=169672

I had both plugins set at 5 which was the default, so I changed them to 1 & 2.

But it still didn't fix the problem. :confused:

Kirk Y
02-05-2008, 03:41 AM
Well execution orders wouldn't matter in that instance. I'm going to bet your problem is that you're not using different variable names for each banner.

ie: $random_banner and then $random_banner2

Ranger269
02-05-2008, 04:13 AM
Well execution orders wouldn't matter in that instance. I'm going to bet your problem is that you're not using different variable names for each banner.

ie: $random_banner and then $random_banner2

That's what I figured the problem was but I didn't know how to do it.

<div align="center">$random_banner[$random_number]</div>

When I tried adding a "2" between "number" and "]", it made the bottom banner disapear.

Can you tell me what code I need and if both of them need to be changed or only the bottom one?

kronnos
02-05-2008, 06:06 AM
What template are you using this in; and on what version of vBulletin? I tested the code you supplied above and it worked perfectly for me.


I'm Using Ultimate Side Columns (https://vborg.vbsupport.ru/showthread.php?t=141870) and trying to paste this code into one of the left column blocks.

Kirk Y
02-05-2008, 09:53 AM
That's what I figured the problem was but I didn't know how to do it.

<div align="center">$random_banner[$random_number]</div>When I tried adding a "2" between "number" and "]", it made the bottom banner disapear.

Can you tell me what code I need and if both of them need to be changed or only the bottom one?
The variable names need to be unique for each rotation instance.

So for Banner Rotation A, you'd have:
$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';And use: $random_banner[$random_number];And then for Rotation B, you'd have:
$random_number2 = rand(1, 5);

$random_banner2[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner2[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner2[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner2[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner2[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';And use: $random_banner2[$random_number2];
Each rotation instance *doesn't* have to be put in a separate plugin; you can store each in the same plugin.

kronnos
02-05-2008, 12:56 PM
I'm Using Ultimate Side Columns (https://vborg.vbsupport.ru/showthread.php?t=141870) and trying to paste this code into one of the left column blocks.

Ohh and the vb version Im using is 3.6.7

Ranger269
02-05-2008, 03:26 PM
The variable names need to be unique for each rotation instance......



Thanks a lot, Kirk! That worked.

One more question...

I need to know how to move the banner up per the following...


http://www.image4u.org/avianquest/BottomBanner.jpg


<div align="center">$random_banner2[$random_number2]</div>

<br />
<!-- 100 Top Sites Code Start : Do not modify -->
<A HREF="http://www.hitsunlimited.com/cgi-bin/100topbirds/100top.cgi?ID=565" target="_blank">
<img SRC="http://www.hitsunlimited.com/cgi-bin/100topbirds/100top.cgi?IDimg=565" BORDER=0 height=28 width=98 alt="image linking to 100 Top Birds and Waterfowl Sites"></A>
<!-- 100 Top Sites Code End -->

<br />
<div class="smallfont" align="center">$vbphrase[all_times_are_gmt_x_time_now_is_y]</div>
<br />

$spacer_close
<!-- /content area table -->

<form action="$vboptions[forumhome].php" method="get">

<table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="$stylevar[outertablewidth]" class="page" align="center">
<tr>
<if condition="$show['quickchooser']">
<td class="tfoot">
<select name="styleid" onchange="switch_id(this, 'style')">
<optgroup label="$vbphrase[quick_style_chooser]">
$quickchooserbits
</optgroup>
</select>
</td>
</if>
<if condition="$show['languagechooser']">
<td class="tfoot">
<select name="langid" onchange="switch_id(this, 'lang')">
<optgroup label="$vbphrase[quick_language_chooser]">
$languagechooserbits
</optgroup>
</select>
</td>
</if>
<td class="tfoot" align="$stylevar[right]" width="100%">
<div class="smallfont">
<strong>
<if condition="$show['contactus']"><a href="$vboptions[contactuslink]" rel="nofollow" accesskey="9">$vbphrase[contact_us]</a> -</if>
<if condition="$vboptions['hometitle']"><a href="$vboptions[homeurl]">$vboptions[hometitle]</a> -</if>
<if condition="$show['admincplink']"><a href="$admincpdir/index.php$session[sessionurl_q]">$vbphrase[admin]</a> -</if>
<if condition="$show['modcplink']"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>
<if condition="$vboptions['archiveenabled']"><a href="archive/index.php">$vbphrase[archive]</a> -</if>
<if condition="$vboptions[privacyurl]"><a href="$vboptions[privacyurl]">$vbphrase[privacy_statement]</a> -</if>
<a href="#top" onclick="self.scrollTo(0, 0); return false;">$vbphrase[top]</a>
</strong>
</div>
</td>
</tr>
</table>

<br />

<div align="center">
<div class="smallfont" align="center">
<!-- Do not remove this copyright notice -->
$vbphrase[powered_by_vbulletin]
<!-- Do not remove this copyright notice -->
</div>

<div class="smallfont" align="center">
<!-- Do not remove $cronimage or your scheduled tasks will cease to function -->
$cronimage
<!-- Do not remove $cronimage or your scheduled tasks will cease to function -->

$vboptions[copyrighttext]
</div>
</div>

</form>

<if condition="$show['dst_correction']">
<!-- auto DST correction code -->
<form action="profile.php?do=dst" method="post" name="dstform">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="dst" />
</form>
<script type="text/javascript">
<!--
var tzOffset = $bbuserinfo[timezoneoffset] + $bbuserinfo[dstonoff];
var utcOffset = new Date().getTimezoneOffset() / 60;
if (Math.abs(tzOffset + utcOffset) == 1)
{ // Dst offset is 1 so its changed
document.forms.dstform.submit();
}
//-->
</script>
<!-- / auto DST correction code -->

</if>
<script type="text/javascript">
<!--
// Main vBulletin Javascript Initialization
vBulletin_init();
//-->
</script>

Kirk Y
02-05-2008, 06:21 PM
You'll need to move it out of the footer template; I can't recall of the top of my head which template deals with that area. It might be SHOWTHREAD.

PS. http://articles.techrepublic.com.com/5100-22-5075969.html :)

Ranger269
02-05-2008, 07:08 PM
You'll need to move it out of the footer template; I can't recall of the top of my head which template deals with that area. It might be SHOWTHREAD.

Thanks! As I was eating lunch, I was coming to the same conclusion.

PS. http://articles.techrepublic.com.com/5100-22-5075969.html :)

And you just answered my next question as well! :up:

kronnos
02-06-2008, 05:08 AM
Kirk, any idea on my code problem?

Neetoman
03-06-2008, 07:06 PM
This thread looks like something that might be able to help me...

I am needing to display recent blog posts. Similar to how there is a module to display recent forum posts. The difference is I need to rotate every blog post (5-10) at a time in one minute intervals.

Any help and direction would GREATLY appreciated! I am a designer and not really a true coder, but I can follow directions easily enough.

Can any of you out there help me achieve what I am after? Is there a good way to do this?

habilonline
03-09-2008, 01:08 PM
ohh very simple. Thanks...

Neetoman
03-10-2008, 10:23 PM
Bumping this for my comment/question two posts back...

Can anyone help with this...?

Lynne
03-10-2008, 11:37 PM
Bumping this for my comment/question two posts back...

Can anyone help with this...?
You would do better to start your own thread. This is about banner rotations which is quite different than post rotations.

Neetoman
03-12-2008, 04:58 PM
Thanks Lynne for trying to help... I was actually sent to this thread from my own post that I origionally started here: https://vborg.vbsupport.ru/showthread.php?p=1463147#post1463147

So, if there is anyone who thinks they can help please come post there...

FishMRC
05-20-2008, 02:28 PM
We have this installed on our forums and works without issue, but is there a way of making this so that we do not have to refresh the page for a new banner to appear?

Sorry to say that I'm not really that clued up on PHP and all the internal workings of it.

Thanks
Fish

ETDC
06-30-2008, 08:10 PM
Simple to install. (We like that). I'm assuming that it'll support Flash with the requisite code...?

:up: :up: :up:

Mavs00
07-18-2009, 03:27 PM
I have tried everything to get this to work without success.

I have created a plugin

Hook Location: global_start
Name: Banner Rotator
Execution order: 1

Code

$random_number = rand(1, 2);

$random_banner[1] = '<a href="http://www.hawkvittles.com/"><img src="http://www.adkhighpeaks.com/banner/banner1.jpg" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://adkhighpeaks.com/sentinel/"><img src="http://www.adkhighpeaks.com/banner/banner2.jpg" alt="" border="0" /></a>';

Right now, I only have 2 (once it works, I'll add more).

I then have added the following code to the bottom of my postbit_legacy templete. It's set within a [if] condition to display it after the first post in each thread.

<if condition="$post[postcount] % $vboptions[maxposts] == 1">

<div style="padding: $stylevar[cellpadding]px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">


$random_banner[$random_number]


</td>
</tr>
</table>

</div>

</if>

If I replace the $random_banner[$random_number] with a single banner image link, or even adsense javascript code, it works perfect, but when I put in the $random banner call, I get an empty "sponsored link table".

Any help would be appreciated. Oh yeah, I'm running this on an old 3.6.2 version. I haven't tried it on another forum running 3.8. so I don't know if it works there.

--------------- Added 1247935578 at 1247935578 ---------------

Addendum to above post.

I was able to get it to successfully work within the Header template.

It must be a formatting error in my postbit_legacy "sponsored links table. I can't for the life of me figure it out.

Mavs00
08-28-2009, 12:41 PM
I have tried everything to get this to work without success.

I have created a plugin

Hook Location: global_start
Name: Banner Rotator
Execution order: 1

Code

$random_number = rand(1, 2);

$random_banner[1] = '<a href="http://www.hawkvittles.com/"><img src="http://www.adkhighpeaks.com/banner/banner1.jpg" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://adkhighpeaks.com/sentinel/"><img src="http://www.adkhighpeaks.com/banner/banner2.jpg" alt="" border="0" /></a>';

Right now, I only have 2 (once it works, I'll add more).

I then have added the following code to the bottom of my postbit_legacy templete. It's set within a [if] condition to display it after the first post in each thread.

<if condition="$post[postcount] % $vboptions[maxposts] == 1">

<div style="padding: $stylevar[cellpadding]px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">


$random_banner[$random_number]


</td>
</tr>
</table>

</div>

</if>

If I replace the $random_banner[$random_number] with a single banner image link, or even adsense javascript code, it works perfect, but when I put in the $random banner call, I get an empty "sponsored link table".

Any help would be appreciated. Oh yeah, I'm running this on an old 3.6.2 version. I haven't tried it on another forum running 3.8. so I don't know if it works there.

--------------- Added 1247935578 at 1247935578 ---------------

Addendum to above post.

I was able to get it to successfully work within the Header template.

It must be a formatting error in my postbit_legacy "sponsored links table. I can't for the life of me figure it out.

Any thoughts here, I still can not figure this out. PLEASE. thanks

Mavs00
09-03-2009, 03:03 PM
Does not work in 3.8.3 or 4

It seems the only place I cannot get it to work is the postbit_legacy template.

valdet
09-03-2010, 11:00 AM
Sorry for bumping an old thread. I am looking for similar solution.

Does not work in 3.8.3 or 4

It seems the only place I cannot get it to work is the postbit_legacy template.

For vb3 you need to use it on postbit_start or postbit_complete hooks. It worked for me.


But I am still interested to find out how to make this rotator work for vBulletin 4 here (https://vborg.vbsupport.ru/showthread.php?t=249848) .
Any ideas??

----

UPDATE:
After lots of trial&error testing I finally made it through
https://vborg.vbsupport.ru/showthread.php?p=2095330#post2095330