PDA

View Full Version : Miscellaneous Hacks - Rotational Banner in Header


HMBeaty
10-20-2005, 10:00 PM
Well, I KNOW alot of you are looking for this as I was so here it is......

Also, found this on vBulletin.com, so ALL credit goes to "express" for this one. :) (I just modified it a little)

Go to AdminCP > Styles and Templates> Style Manager > YOUR TEMPLATE > header

In that, find.....

<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>

Under that, add.....

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: <a href="http://WWW.CGISCRIPT.NET," target="_blank">WWW.CGISCRIPT.NET,</a> LLC
// URL: <a href="http://www.cgiscript.net" target="_blank">http://www.cgiscript.net</a>
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( <a href="http://www.cgiscript.net/scripts.htm" target="_blank">http://www.cgiscript.net/scripts.htm</a> )
// ***********************************************

function banner() {
};

banner = new banner();
number = 0;

// bannerArray
banner[number++] = "<a href='REDIRECT URL' target='_blank'><img src='BANNER IMAGE' border='1'></a>"
banner[number++] = "<a href='REDIRECT URL' target='_blank'><img src='BANNER IMAGE' border='1'></a>"
banner[number++] = "<a href='REDIRECT URL' target='_blank'><img src='BANNER IMAGE' border='1'></a>"

// keep adding items here...

increment = Math.floor(Math.random() * number);

document.write(banner[increment]);

//--></SCRIPT>


Save and you're done

HMBeaty
10-21-2005, 02:19 AM
Sorry, this is probably supposed to go in template modifications if someone can move it please.

:Judge:
10-21-2005, 02:56 AM
Very nice, thank you much!

HMBeaty
10-21-2005, 02:58 AM
You are very welcome. You can't imagine how happy I was when I found this after searching for something like this for 6 weeks

mholtum
10-21-2005, 03:16 AM
hmm. A simple image rotator? And?????

:Judge:
10-21-2005, 03:54 AM
hmm. A simple image rotator? And?????

Makes it a little easier to find for people such as myself without the time to search all over the place looking for something.

Snake
10-21-2005, 10:02 AM
Nice, thanks and installed! :)

TygerTyger
10-21-2005, 02:09 PM
I don't mean to rain on anyone's parade :( but this image rotator requries javascript to be enabled in the user's browser. The hack below does exactly the same thing but does not.

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

I like the stylistic idea though, I did exactly the same thing on my own forum and removed the bbtitle to make way for the banner. Looks very cool :D

Nuckolsc.com
10-21-2005, 02:45 PM
Thanks man... Ive been looking for a simple banner mod for my sponsors. Installed

Jenkins
10-21-2005, 09:28 PM
I don't mean to rain on anyone's parade :( but this image rotator requries javascript to be enabled in the user's browser. The hack below does exactly the same thing but does not.

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

I like the stylistic idea though, I did exactly the same thing on my own forum and removed the bbtitle to make way for the banner. Looks very cool :D

This one allows you to make the Picture a link. I don't see where the one you pointed out does that.

buffness
10-23-2005, 02:51 AM
This is not working for me for some reason. Nothing shows up. Where exactly do you edit the url and the image path at?

HMBeaty
10-23-2005, 03:51 AM
This is not working for me for some reason. Nothing shows up. Where exactly do you edit the url and the image path at?
banner[number++] = "<a href='REDIRECT URL' target='_blank'><img src='BANNER IMAGE' border='1'></a>"
Replace redirect url with URL you want the banner to go to when you click it and Banner image with the URL of your banner. Make sure you leave the quotation marks there though, just replacing the REDIRECT URL and BANNER IMAGE.

buffness
10-23-2005, 01:25 PM
banner[number++] = "<a href='REDIRECT URL' target='_blank'><img src='BANNER IMAGE' border='1'></a>"
Replace redirect url with URL you want the banner to go to when you click it and Banner image with the URL of your banner. Make sure you leave the quotation marks there though, just replacing the REDIRECT URL and BANNER IMAGE.

thanks, did that but nothing shows up on the page. Any ideas what I maybe missing?

Jenkins
10-25-2005, 07:27 PM
how can I make the banner "center"?

i tried adding a <td align="center"> script </td>

but nothing happened..

DjTaz
10-25-2005, 08:46 PM
how can I make the banner "center"?

i tried adding a <td align="center"> script </td>

but nothing happened..


Try putting <center> before the <script......
That should do it.

Excellent script here - just what i was looking for :D

Jenkins
10-26-2005, 01:27 AM
Try putting <center> before the <script......
That should do it.

Excellent script here - just what i was looking for :D


yep that worked.. thanks for the info.. how about a page break?

Benderson
10-29-2005, 01:59 AM
as a newcomer to Vbulletin, this thread just made my life sooooo much easier. Many Thanx

GamerJunk.net
10-29-2005, 02:16 AM
I have a different style than the original and the header looks like this...

<!-- begin disturbed header-->
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<!-- This is where the top logo image goes -->
<td width="355" height="89" align="left" valign="top"><img src="$stylevar[imgdir_misc]/dis_hdr_logo.jpg" width="355" height="89" alt="" /></td>
<!-- End top logo area -->
<td width="386" height="89" align="left" valign="top"><img src="$stylevar[imgdir_misc]/dis_hdr_sliced_rs-top.jpg" width="386" height="89" alt="" /></td>
<td width="100%" height="89" align="right" valign="top" style="background-image: url($stylevar[imgdir_misc]/dis_hdr_rs.gif)"><img src="$stylevar[imgdir_misc]/dis_hdr_rs.gif" width="100%" height="89" alt="" /></td>
</tr>
</table>
<table bgcolor="#111210" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<!-- This is navigation/button area -->
<td width="13" height="40" align="left" valign="top"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_repeat.gif" width="13" height="40" border="0" alt="" /></td>
<td width="106" height="40" align="left" valign="top"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_home.gif" width="106" height="40" border="0" alt="" /></a></td>
<td width="106" height="40" align="left" valign="top"><a href="usercp.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_userCP.gif" width="106" height="40" border="0" alt="" /></a></td>
<if condition="$show['registerbutton']">
<td width="106" height="40" align="left" valign="top"><a href="register.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_register.gif" width="106" height="40" border="0" alt="" /></a></td>
<else />
<td width="106" height="40" align="left" valign="top" id="usercptools"><a href="#usercptools"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_menu.gif" width="106" height="40" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("usercptools" ,1); </script></td>
</if>
<td width="106" height="40" align="left" valign="top"><a href="memberlist.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_members.gif" width="106" height="40" border="0" alt="" /></a></td>
<td width="106" height="40" align="left" valign="top"><a href="calendar.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_calendar.gif" width="106" height="40" border="0" alt="" /></a></td>
<td width="106" height="40" align="left" valign="top" id="navbar_search"><a href="search.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_search.gif" width="106" height="40" border="0" alt="" /></a><script type="text/javascript"> vbmenu_register("navbar_search" ,1); </script></td>
<td width="108" height="40" align="left" valign="top"><a href="faq.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_faq.gif" width="108" height="40" border="0" alt="" /></a></td>
<td width="100%" height="40" align="left" valign="top" style="background-image: url($stylevar[imgdir_misc]/dis_hdr_nav_rs_x.gif)"><img src="$stylevar[imgdir_misc]/dis_hdr_nav_rs_x.gif" width="100%" height="40" border="0" alt="" /></td>
<!--End navigation/button area -->
</tr>
</table>
<table bgcolor="#111210" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="2" height="56" align="left" valign="top"><img src="$stylevar[imgdir_misc]/dis_hdr_bottom_bg.gif" width="2" height="56" alt="" /></td>
<td width="765" height="56" align="left" valign="top"><img src="$stylevar[imgdir_misc]/dis_hdr_bottom_main.gif" width="765" height="56" alt="" /></td>
<td width="100%" height="56" align="left" valign="top" style="background-image: url($stylevar[imgdir_misc]/dis_hdr_bottom_rs.gif)"><img src="$stylevar[imgdir_misc]/dis_hdr_bottom_rs.gif" width="3" height="56" alt="" /></td>
</tr>
</table>
<!-- end disturbed header-->

<!-- begin main inner table area-->
<table border="0" width="100%" cellpadding="10" cellspacing="0" bgcolor="#34353B">
<tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#34353B">
<tr>
<td width="12" align="left" valign="top"><img src="$stylevar[imgdir_misc]/ls_main_table_top.gif" width="12" height="8" alt="" /></td>
<td width="100%" align="left" valign="top"><img src="$stylevar[imgdir_misc]/expand_main_table.gif" width="100%" height="8" alt="" /></td>
<td width="12" align="left" valign="top"><img src="$stylevar[imgdir_misc]/rs_main_table_top.gif" width="12" height="8" alt="" /></td>
</tr>
</table>
<!-- content table -->
<table bgcolor="#34353B" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>

$spacer_open

$_phpinclude_output

Where would I put the hack?

HMBeaty
10-30-2005, 03:53 PM
Try putting it after this.....

<!-- End top logo area -->
<td width="386" height="89" align="left" valign="top"><img src="$stylevar[imgdir_misc]/dis_hdr_sliced_rs-top.jpg" width="386" height="89" alt="" /></td>
<td width="100%" height="89" align="right" valign="top" style="background-image: url($stylevar[imgdir_misc]/dis_hdr_rs.gif)"><img src="$stylevar[imgdir_misc]/dis_hdr_rs.gif" width="100%" height="89" alt="" /></td>

yinyang
10-31-2005, 06:01 PM
is it possible to put the adsense code in here and rotate that with traditional banners?

yinyang
11-03-2005, 11:39 PM
is it possible to put the adsense code in here and rotate that with traditional banners?

bueller? bueller?

HMBeaty
11-03-2005, 11:43 PM
I have no idea. I've never used or messed with adsense myself

fonzie11
01-10-2006, 08:38 PM
i need help
on the main page, when i put my mouse cursor over the banner it says
www.pbontario.com/forums/www.519paintball.com
i want it 2 just say
www.519paintball.com
this is the code i got in my board style thing

<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>

<SCRIPT LANGUAGE="Javascript"><!--

// ***********************************************
// AUTHOR: <a href="http://WWW.CGISCRIPT.NET," target="_blank">WWW.CGISCRIPT.NET,</a> LLC
// URL: <a href="http://www.cgiscript.net" target="_blank">http://www.cgiscript.net</a>
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( <a href="http://www.cgiscript.net/scripts.htm" target="_blank">http://www.cgiscript.net/scripts.htm</a> )
// ***********************************************

function banner() {
};

banner = new banner();
number = 0;

// bannerArray
banner[number++] = "<a href='www.519paintball.com' target='_blank'><img src='/forums/images/519BANNER.gif' border='1'></a>"


// keep adding items here...

increment = Math.floor(Math.random() * number);

document.write(banner[increment]);

//--></SCRIPT>

<td align="$stylevar[right]"></a></td>
<td align="$stylevar[right]">


&nbsp;
</td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output


ALSO
is there away i can get rid of the vbulletin logo at the top and make the bannners appear there?

fonzie11
01-11-2006, 07:10 PM
sum 1 plz help?

fonzie11
01-11-2006, 07:17 PM
heres an screenshot http://img492.imageshack.us/img492/1397/see2pb.png

fonzie11
01-12-2006, 02:47 PM
sum 1?