Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Rotational Banner in Header Details »»
Rotational Banner in Header
Version: 1.00, by HMBeaty HMBeaty is offline
Developer Last Online: Feb 2020 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.5.0 Rating:
Released: 10-20-2005 Last Update: Never Installs: 26
Template Edits
 
No support by the author.

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.....

Code:
	<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.....

Code:
<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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-23-2005, 02:51 AM
buffness buffness is offline
 
Join Date: Jan 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is not working for me for some reason. Nothing shows up. Where exactly do you edit the url and the image path at?
Reply With Quote
  #13  
Old 10-23-2005, 03:51 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buffness
This is not working for me for some reason. Nothing shows up. Where exactly do you edit the url and the image path at?
PHP Code:
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.
Reply With Quote
  #14  
Old 10-23-2005, 01:25 PM
buffness buffness is offline
 
Join Date: Jan 2004
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NRR
PHP Code:
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?
Reply With Quote
  #15  
Old 10-25-2005, 07:27 PM
Jenkins Jenkins is offline
 
Join Date: Nov 2002
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how can I make the banner "center"?

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

but nothing happened..
Reply With Quote
  #16  
Old 10-25-2005, 08:46 PM
DjTaz DjTaz is offline
 
Join Date: Apr 2003
Posts: 251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jenkins
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
Reply With Quote
  #17  
Old 10-26-2005, 01:27 AM
Jenkins Jenkins is offline
 
Join Date: Nov 2002
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DjTaz
Try putting <center> before the <script......
That should do it.

Excellent script here - just what i was looking for

yep that worked.. thanks for the info.. how about a page break?
Reply With Quote
  #18  
Old 10-29-2005, 01:59 AM
Benderson Benderson is offline
 
Join Date: Oct 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

as a newcomer to Vbulletin, this thread just made my life sooooo much easier. Many Thanx
Reply With Quote
  #19  
Old 10-29-2005, 02:16 AM
GamerJunk.net's Avatar
GamerJunk.net GamerJunk.net is offline
 
Join Date: Jan 2004
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a different style than the original and the header looks like this...

Code:
 <!-- 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?
Reply With Quote
  #20  
Old 10-30-2005, 03:53 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try putting it after this.....

PHP Code:
    <!-- 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
Reply With Quote
  #21  
Old 10-31-2005, 06:01 PM
yinyang's Avatar
yinyang yinyang is offline
 
Join Date: May 2004
Location: Los Angeles
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is it possible to put the adsense code in here and rotate that with traditional banners?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 07:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12513 seconds
  • Memory Usage 2,332KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete