View Full Version : Rotating Banners
soulplayer
05-08-2007, 02:22 PM
Hy,
I was wondering if it's possible to implement rotating banners in my forum? So that every time you load the index.php it will change the banner?
I'v found this script: http://www.webdesign.org/web/web-programming/php/simple-ad-rotation.11100.html
My forum:
http://www.xeonix.be
My style:
Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
http://beta.colorizeit.com/index.php?style=vb_evo
I hope you guys can help me?
SoftDux
05-08-2007, 09:09 PM
take a look @ openads (formerly known as phpAdsNew) on http://www.openads.org
HMBeaty
05-08-2007, 10:03 PM
Check my signature ;)
theOZer
12-18-2007, 03:03 AM
Random Banners, How I Did It.
Thanks to vB.org, Thread Thumbnails for the banner on/off user option spin-off, other similar threads on vB.org & vB.com/forums.
That I know of this hack works in 3.6.8 PL2 and 3.7.0 Beta 2.
I use the stock vBulletin templates.
For the header area I use a GIF size height of 88. I display 2 animated GIFs, a 710x88 GIF and a 88x88 GIF. This seems to comfortably fits in the header for screen resolutions of 1024x768 or greater. Simply don't display the 2nd banner if you have only one banner. You have around 800 for the width size.
This hack displays GIFs. Change .gif to .jpg (or, .png, .jpeg, .whatever) in the $YourPrefix_randombanner line if needed. FTP your GIFs to your your_vb_forumname/images/misc directory. [Note: $stylevar[imgdir_misc] points to that directory. (I found that in the vB manual.)]
You could call the 3 lines of plugin code $x, $y, $z. But, I suggest: To insure you don't bang heads with vB uniqueify your plugin code. Replace "YourPrefix_" with whatever you wish. For example, Using the prefix "OMAC_" helps me later find changes in my templates and elsewhere.
Because some forum members are still on dial-up I also give forum members the options to turn off the animated banner display. It cuts down on load times for them. If you don't add a User Profile Field just remove the <if condition="$bbuserinfo['fieldXX'] <> 'Off'"> if clause.
In the $YourPrefix_banners line add the names of your banner files. Using an array allows you an unlimited number of banners possible. My example has 4 randomized banners. Yes, you will need to edit/change the plugin if you want to add or remove banners. Smolly.
>>>Add the plugin:
ACP > Plugins & Products > Add New Plugin.
Hook: global_start
Title: Random Banners
Plugin PHP Code:
$YourPrefix_banners=array('thisbannername', 'thatbannername', 'anotherbannername', 'whatever');
$YourPrefix_shuffle=$YourPrefix_banners[rand(0,count($YourPrefix_banners)-1)];
$YourPrefix_randombanner="<img src=\"$stylevar[imgdir_misc]/$YourPrefix_shuffle.gif\" border=\"0\" alt=\"\">\n";
Plugin is Active:
YES
>>>Make the following changes in each style you wish to add the banner to.
ACP > Styles & Templates > Style Manager, select a template, click on All Style Options GO, then under Common Templates, header.
---vB3.6.8 PL2:
find/replace
<td align="$stylevar[right]">
</td>
with
<td align="$stylevar[right]">
<if condition="$bbuserinfo['field10'] <> 'Off'">
$YourPrefix_randombanner <!-- randomized banner -->
<img src="$stylevar[imgdir_misc]/Your_GIF_filename_Here.gif" border="0" /> <!-- the 2nd, non-randomized banner on OMAC-->
<else />
</if>
</td>
---vB3.7.0 Beta2:
find/replace
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else /> </if>
with
<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]
<else />
<if condition="$bbuserinfo['fieldXX'] <> 'Off'"> <!-- Use Banner User Profile Field number, eg, field8 -->
$YourPrefix_randombanner <!-- randomized banner -->
<img src="$stylevar[imgdir_misc]/Your_GIF_filename_Here.gif" border="0" /> <!-- the 2nd, non-randomized banner on OMAC-->
<else />
</if>
</if>
>>>Add a user option to turn the banner On or Off.
ACP > User Profile Fields > Add New User Profile Field.
Select "single selection radio buttons"
Title: "Banners"
Description: "Turn the banner display On or Off."
In Options, enter "On" and "Off".
Skip down to Display Page and choose "Options: Other". This puts the option under Miscellaneous Options.
Note the field number assigned. Check for this field number in the if statement <if condition="$bbuserinfo['fieldXX'] <> 'Off'"> .
Cause4Chaos
12-19-2007, 09:07 AM
I use this program http://sourceforge.net/projects/phpadsnew and it is free, very easy to setup and use different codes on your site anywhere depending on your liking i.e: popup or static,,
you can set it up on the same database as your forums or set it up to another db, your choice,
I have 2 campaigns running at the moment, but you can have many:
"" Openads (phpAdsNew) is an open-source ad server, with an integrated banner management interface and tracking system for gathering statistics. With Openads you can easily rotate paid banners and your own in-house advertisements""
sample is working on my website www.cause4chaos.com and the Forums (http://www.cause4chaos.com/forums)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.