Back to vBulletin 3.5 Template Modifications

Rotating banners
Mod Version: 1.00, by attroll

This modification is in the archives.
vB Version: 3.5.3 Rating: (1 vote - 4.00 average) Installs: 68
Released: 30 Jan 2006 Last Update: Never Downloads: 7
Not Supported Uses Plugins Template Edits  

I created this simple and easy hack for a rotating banner block. All you have to do is create a template and add a plugin location and your done.

1. Go to your ADMINCP and create a template called "banner" and insert the attacked code:
PHP Code:
<!-- Begin rotating ad code -->
<
script language="Javascript"><!-- 
function 
image() { 
}; 
image = new image(); 
number 0
// imageArray 
image[number++] = "<a href='http://www.yoursite.net/forum/payments.php'><img src='http://www.yoursite.net/forum/sponsors/donatebanner.gif' border='0'></a>"
image[number++] = "<a href='http://www.hikersupply.com'><img src='http://www.yoursite.net/forum/sponsors/hikersupply.gif' border='0'></a>"
image[number++] = "<a href='http://www.modelt.net'><img src='http://www.yoursite.net/forum/sponsors/modeltbanner.gif' border='0'></a>"
image[number++] = "<a href='http://appalachiantrailservices.com/'><img src='http://www.yoursite.net/forum/sponsors/atservicesbanner.gif' border='0'></a>"
image[number++] = "<a href='http://www.thepacka.com/'><img src='http://www.yoursite.net/forum/sponsors/cedartreebanner.gif' border='0'></a>"
// Carry on adding images - as many as you want
increment Math.floor(Math.random() * number); 
document.write(image[increment]); 
//-->
</script>
<!-- 
End rotating ad code --> 
2. Now still in your ADMINCP go to PLUGIN SYSTEM-->ADD NEW PLUGIN
HOOK LOCATION is "global_start"
TITLE is "banner"
PLUGIN PHP CODE:
PHP Code:
eval('$banner = "' fetch_template('banner') . '";'); 
Do not forget to make the plugin active.

3. Now you can go into any template you want and where ever you put the $banner your rotating banners will appear.

4. Most people want to put this in the top right corner of the forums. If this is what where you want it then. go into you ADMINCP templates and into you header:

Find:
PHP Code:
<td align="$stylevar[right]">
&
nbsp
Under that insert:
PHP Code:
$banner 
Now you done. All you have to do is edit your template your created with the links and banners you want to use.

You can add more rotating banners then what is in the code. All you have to do in insert more lines with banners in the right location in the code. That should be self explanatory.

Note:
You can make your link open in a seperate browser window by adding the target='ad' in the line as shown below.
PHP Code:
image[number++] = "<a target='ad' href='http://www.hikersupply.com'><img src='http://www.yoursite.net/forum/sponsors/hikersupply.gif' border='0'></a>" 

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024