Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 08 May 2007, 15:22
soulplayer soulplayer is offline
 
Join Date: Mar 2004
Rotating Banners

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-pro...ion.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?
Reply With Quote
  #2  
Old 08 May 2007, 22:09
SoftDux SoftDux is offline
 
Join Date: May 2007
take a look @ openads (formerly known as phpAdsNew) on http://www.openads.org
Reply With Quote
  #3  
Old 08 May 2007, 23:03
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Real name: Brooks
Check my signature
__________________
"Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time!"
"It's important to only think about what you desire, not what you fear to achieve your ultimate goal!!
Reply With Quote
  #4  
Old 18 Dec 2007, 04:03
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Real name: Dennis "theOZer" Osborne
Random Banners, How I Did It.

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]">
&nbsp;
</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 />
&nbsp;
</if>
</td>


---vB3.7.0 Beta2:

find/replace

<if condition="$ad_location['ad_header_logo']">$ad_location[ad_header_logo]<else />&nbsp;</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 />
&nbsp;
</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'"> .

Last edited by theOZer; 18 Dec 2007 at 12:20.
Reply With Quote
  #5  
Old 19 Dec 2007, 10:07
Cause4Chaos Cause4Chaos is offline
 
Join Date: Oct 2007
Real name: Don
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
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating banners attroll vBulletin 3.5 Template Modifications 105 30 Jun 2008 05:45



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 07:14.

Layout Options | Width: Wide Color: