Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications

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
  #2  
Old 01-30-2006, 01:57 AM
Dreamchaser Dreamchaser is offline
 
Join Date: Nov 2005
Location: India
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems Interesting and something that I needed to add to my forums!
Thanks for the hack !

* First to Install
Reply With Quote
  #3  
Old 01-30-2006, 02:22 AM
Dreamchaser Dreamchaser is offline
 
Join Date: Nov 2005
Location: India
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have one small suggestion or you may call it a request !

You have provided a way to add images and link them to various sites, what if I wanted to add various codes like, google adsense, yahoo and other publisher codes which provide them as JavaScript, and I need to add 5 such codes, so each time the page loads, different ads appear.

Any help on this ? Thanks in advance ! Btw, I installed this and works fine

Regards,
DC
Reply With Quote
  #4  
Old 01-30-2006, 02:52 AM
icare icare is offline
 
Join Date: Jan 2006
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did exactly what is dictated above but cant see any banners..... :ermm:
Reply With Quote
  #5  
Old 01-30-2006, 02:58 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 Dreamchaser
I have one small suggestion or you may call it a request !

You have provided a way to add images and link them to various sites, what if I wanted to add various codes like, google adsense, yahoo and other publisher codes which provide them as JavaScript, and I need to add 5 such codes, so each time the page loads, different ads appear.

Any help on this ? Thanks in advance ! Btw, I installed this and works fine

Regards,
DC
If you using google adsense then you have no choice what ads appear anyways. They are random ads and read the content of your site to pick what ads are displayed. I don't know much about Yahoo because they are still in the test stages and I can not find where to apply for them to get them. I would like to get Yahoo ads so I could answer you question and use them. But I would be willing to bet that they work on the same principle as google adsense.

If you could explain more about what you mean I could probably answer your question better.
Reply With Quote
  #6  
Old 01-30-2006, 03:43 AM
CAMS's Avatar
CAMS CAMS is offline
 
Join Date: Jan 2006
Location: Edinburgh, Scotland
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just wat i was looking for after some other code wasnt working properly

cheers and installed
Reply With Quote
  #7  
Old 01-30-2006, 04:43 AM
CopoGuy CopoGuy is offline
 
Join Date: Nov 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome (and simple) mod! Thank You!

Has anyone tried to add the target="_blank" piece to the banner's URL (so it opens the banner link in an external browser window?)
example:
Code:
// imageArray 
image[number++] = "<a href='http://www.bannerurl.com" target="_blank">
The default script works great but when I try to do it that way the banner disappears on the forum page. Perhaps I have a typo?
Reply With Quote
  #8  
Old 01-30-2006, 03:17 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 CopoGuy
Awesome (and simple) mod! Thank You!

Has anyone tried to add the target="_blank" piece to the banner's URL (so it opens the banner link in an external browser window?)
example:
Code:
// imageArray 
image[number++] = "<a href='http://www.bannerurl.com" target="_blank">
The default script works great but when I try to do it that way the banner disappears on the forum page. Perhaps I have a typo?
You can make it open in a seperate browser window by adding the target='ad' in the line as shown below. Sorry I did not explain that. I left it out because I wanted to make this hack very easy.

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>" 
I have just added this to the documentation.
Reply With Quote
  #9  
Old 01-30-2006, 03:47 PM
LisaD1's Avatar
LisaD1 LisaD1 is offline
 
Join Date: May 2005
Location: True North Strong & Free!
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and works great!! Thanks
Reply With Quote
  #10  
Old 01-30-2006, 03:56 PM
LEAD_WEIGHT LEAD_WEIGHT is offline
 
Join Date: Feb 2005
Location: Canada
Posts: 369
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this not do the same? or does yours have more unique qualities?
http://www.vbulletin.com/forum/showthread.php?t=170826
Reply With Quote
Reply

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

Forum Jump


All times are GMT. The time now is 03:34 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.06864 seconds
  • Memory Usage 2,312KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (6)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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