Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Rotating banners Details »»
Rotating banners
Version: 1.00, by attroll attroll is offline
Developer Last Online: Mar 2023 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 01-29-2006 Last Update: Never Installs: 68
Uses Plugins Template Edits
 
No support by the author.

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

Show Your Support

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

Comments
  #102  
Old 01-09-2008, 06:56 PM
fridaypassion fridaypassion is offline
 
Join Date: Dec 2007
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I get the image displayed to centre? I am wanting it to appear below my main logo which is also centred

thanks!
Reply With Quote
  #103  
Old 01-10-2008, 03:06 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fridaypassion View Post
How do I get the image displayed to centre? I am wanting it to appear below my main logo which is also centred

thanks!
How did you get your main logo centered? You shouold be able to do it the same way you main logo was centered. If I could see your header I could help you out but I do not know how you have your header template setup.
Reply With Quote
  #104  
Old 01-10-2008, 04:53 PM
fridaypassion fridaypassion is offline
 
Join Date: Dec 2007
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

thanks for the reply this is my current header template:

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


</td>

</table>

<!-- /logo -->
<td align="center">

<!-- content table -->
$spacer_open

$_phpinclude_output
Reply With Quote
  #105  
Old 01-13-2008, 05:37 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would try something like this. If this is not what you want let me know.
Code:
<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td>
<center>
<a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a><br />
<a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a>
</td>
</center>
</td>
</tr>
</table>
<!-- /logo -->
<!-- content table -->
$spacer_open
$_phpinclude_output
Reply With Quote
  #106  
Old 06-30-2008, 03:00 AM
Chance4Today Chance4Today is offline
 
Join Date: Aug 2007
Location: NE
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder if this works with the 3.7.0 patch 2? anyone know. I am looking for a banner changer

wanting a extra navbar but not any drop down or anything just another navbar to clean up mine has too many
Reply With Quote
  #107  
Old 06-30-2008, 04:45 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Chance4Today View Post
I wonder if this works with the 3.7.0 patch 2? anyone know. I am looking for a banner changer

wanting a extra navbar but not any drop down or anything just another navbar to clean up mine has too many
I do not see why it wouldn't. Nothing has changed since VB 3.5 that I can see that would keep this from working.

I have to admit though. I no longer use this mode that I created. I have switch to GARS for my banner rotation. It is not free software but it works good for setting the start and stop times that you want each banner to display.
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 11:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04303 seconds
  • Memory Usage 2,282KB
  • Queries Executed 21 (?)
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
  • (1)bbcode_code
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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