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
  #12  
Old 01-30-2006, 04:08 PM
TruthElixirX's Avatar
TruthElixirX TruthElixirX is offline
 
Join Date: Sep 2004
Location: Oklahoma
Posts: 517
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look man, he made something and shared it for free. If something already does it who cares. If you have nothing ot contribute shut up. I'm getting tired of seeing posts like this "well this already does this"

Dells and Gateways d othe same thing. As does IPB and vBulletin. Its a matter of choice. Contribute or don't post at all.

Thank you for the hack. A client of mine might be needing this soon.
Reply With Quote
  #13  
Old 01-30-2006, 04:27 PM
LEAD_WEIGHT LEAD_WEIGHT is offline
 
Join Date: Feb 2005
Location: Canada
Posts: 369
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TruthElixirX
:speechless:
You are a fool for answering that way! I was asking a legitimate question from the coder and not some lame member who has nothing, but time to troll threads and start flaming everyone. Stick to your own hacks and let ppl ask their own question. :disappointed:
Reply With Quote
  #14  
Old 01-30-2006, 05:17 PM
CopoGuy CopoGuy is offline
 
Join Date: Nov 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Attroll,
The target='ad' modification worked perfectly.
Thanks again for sharing! Exactly what I needed
something nice and simple.
Reply With Quote
  #15  
Old 01-30-2006, 06:27 PM
LisaD1's Avatar
LisaD1 LisaD1 is offline
 
Join Date: May 2005
Location: True North Strong & Free!
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LEAD_WEIGHT
Does this not do the same? or does yours have more unique qualities?
http://www.vbulletin.com/forum/showthread.php?t=170826
No matter how many times we tried to get that one to work, it wouldn't. First try on this one and bam it works great. So I think it is a great thing to have many different ways to do the same thing.
Reply With Quote
  #16  
Old 01-30-2006, 07:09 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me clicks on install
Reply With Quote
  #17  
Old 01-30-2006, 09:11 PM
Mr Chad's Avatar
Mr Chad Mr Chad is offline
 
Join Date: Jul 2005
Posts: 911
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this doesnt always have to be an image does it?
image[number++] = "Hello"
Reply With Quote
  #18  
Old 02-04-2006, 12:09 PM
Gripemaster Gripemaster is offline
 
Join Date: Oct 2005
Location: MD
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I suppose if we want them centered, we would just have to change:

Code:
<td align="$stylevar[right]">
&nbsp;
To:

Code:
<td align="$stylevar[center]">
&nbsp;
Correct? I would prefer mine be centered on the top of the page.
Reply With Quote
  #19  
Old 02-04-2006, 01:15 PM
Gripemaster Gripemaster is offline
 
Join Date: Oct 2005
Location: MD
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind... Got it firgured out with a little tweaking... thank you very much!!! *Clicks Install*
Reply With Quote
  #20  
Old 02-04-2006, 01:21 PM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by chatbum
this doesnt always have to be an image does it?
image[number++] = "Hello"
You could do it that way but the word Hello would not be a link. If you wanted the word Hello to be a link you would do it this way
Code:
image[number++] = "<a href='http://www.yoursite.net'>Hello</a>"
Reply With Quote
  #21  
Old 02-19-2006, 04:04 PM
TruthElixirX's Avatar
TruthElixirX TruthElixirX is offline
 
Join Date: Sep 2004
Location: Oklahoma
Posts: 517
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway to get the banners to rotate in order, and not randomly?
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 04:09 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.05161 seconds
  • Memory Usage 2,318KB
  • 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
  • (5)bbcode_php
  • (3)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
  • (3)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