Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Banner Rotator Under Navbar Details »»
Banner Rotator Under Navbar
Version: 1.00, by mavigul mavigul is offline
Developer Last Online: Apr 2012 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 4.0.2 Rating:
Released: 03-10-2010 Last Update: Never Installs: 23
Template Edits
 
No support by the author.

Banner Rotater under Navbar


find in navbar:
PHP Code:
</div><!-- closing div for above_body --> 

add under:

PHP Code:
<SCRIPT LANGUAGE="JavaScript">
 
<!-- 
Begin Random Logo In Header Script
 
var theImages = new Array() // do not change this
 
<!-- Edit the url images to match yours
theImages
[0] = 'imageurl'
theImages[1] = 'imageurl'
theImages[2] = 'imageurl'
theImages[3] = 'imageurl'
theImages[4] = 'imageurl'
theImages[5] = 'imageurl'



 
var 0
var theImages.length;
var 
preBuffer = new Array()
for (
0pi++){
preBuffer[i] = new Image()
preBuffer[i].src theImages[i]
}
var 
whichImage Math.round(Math.random()*(p-1));
function 
showImage(){
document.write('<div align="center"><img src="'+theImages[whichImage]+'" border="0" alt="{vb:raw vboptions.bbtitle}" /></a></div>');

// End -->
</script>

<!-- 
logo -->
<
a name="top"></a
<
td align="$stylevar[left]"><a href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}"><SCRIPT LANGUAGE="JavaScript"
showImage(); 
</
script>
<!-- /
logo --> 

change imageurl in yours. Enjoy!

Screenshots

File Type: jpg ban_rot.JPG (58.3 KB, 0 views)

Show Your Support

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

Comments
  #12  
Old 03-23-2010, 08:59 PM
pitrow pitrow is offline
 
Join Date: Jan 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by patrick91 View Post
Hey,

Is it possible to put the code in de default option in vB4 that advertising option and adsense!???

A small little change but it should work, though I have not tested it...

changes / additions in bold
Code:
...
var whichImage = Math.round(Math.random()*p);
function showImage(){
if (whichImage == p)
document.write(google_adsense_code_here);
else
document.write('<div align="center"><img src="'+theImages[whichImage]+'" border="0" alt="{vb:raw vboptions.bbtitle}" /></a></div>');
} 
// End -->
...
what it does is allows the random number to include 1 higher than the index of the array, then it checks if that number IS outside the array and prints the google adsense code, otherwise just prints the regular image

Again, I have NOT tested this.
Reply With Quote
  #13  
Old 03-25-2010, 09:38 AM
Johnny G Johnny G is offline
 
Join Date: Mar 2009
Location: Liverpool, England
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you want to add links to the banners into new windows

Code:
<SCRIPT LANGUAGE="JavaScript">
 
<!-- Begin Random Logo In Header Script
 
var theImages = new Array() // do not change this
var theLinks = new Array() // set up the container for the links

<!-- Edit the url images to match yours
theImages[0] = 'banner1.png'
theLinks[0] = 'http://link1.com'
theImages[1] = 'http://www.banner2.gif'
theLinks[1] = 'http://www.link2.net'



var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<div align="center"><a href="'+theLinks[whichImage]+'" target="_blank"><img src="'+theImages[whichImage]+'" border="0" alt="{vb:raw vboptions.bbtitle}" /></a></div>');
} 
// End -->
</script>

<!-- logo -->
<a name="top"></a> 
<td align="$stylevar[left]"><a href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}"><SCRIPT LANGUAGE="JavaScript"> 
showImage(); 
</script>
<!-- /logo -->
Reply With Quote
  #14  
Old 12-02-2010, 11:03 AM
Bram H Bram H is offline
 
Join Date: Jul 2007
Location: The Netherlands
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you want to use this code into the advertisement box, which part of the code should i use?
Reply With Quote
  #15  
Old 12-13-2010, 06:13 PM
MatiasCandy MatiasCandy is offline
 
Join Date: May 2008
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fixed the link from above added \' instead of " so it will see it as outside link

with the
Code:
href="'+theLinks[whichImage]+'"
It saw the link as http://www.yourdomain.com/http://www.outsidedomain.com

with the with the
Code:
href=\''+theLinks[whichImage]+'\'
it will read it as http://www.outsidedomain.com


Code:
<!-- Banner Ad Add-on Start -->
<SCRIPT LANGUAGE="JavaScript">
 
<!-- Begin Random Logo In Header Script
 
var theImages = new Array() // do not change this
var theLinks = new Array() // set up the container for the links

<!-- Edit the url images to match yours
theImages[0] = 'images/banners/00001.jpg'
theLinks[0] = 'http://www.00001.net'
theImages[1] = 'images/banners/00002.gif'
theLinks[1] = 'http://www.00002.com'
theImages[2] = 'images/banners/00003.gif'
theLinks[2] = 'http://www.00003.com'


var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<div align="center"><a href=\''+theLinks[whichImage]+'\' target="_blank"><img src="'+theImages[whichImage]+'" border="0" alt="{vb:raw vboptions.bbtitle}" /></a></div>');
} 
// End -->
</script>

<!-- logo -->
<a name="top"></a> 
<td align="$stylevar[left]"><SCRIPT LANGUAGE="JavaScript"> 
showImage(); 
</script>
 
<!-- Banner Ad Add-on End -->
left the image part alone so it will read the root as http://www.yourdomain.com/
Reply With Quote
  #16  
Old 01-24-2011, 10:21 PM
smooth-c smooth-c is offline
 
Join Date: Jan 2008
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strange question - but I'd like to have 3 random images displayed in a row - not just one. Linked of course.

How can I achieve this?

Thank you.
Reply With Quote
  #17  
Old 03-17-2011, 07:06 AM
flaguns flaguns is offline
 
Join Date: Sep 2010
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MatiasCandy View Post
Fixed the link from above added \' instead of " so it will see it as outside link

with the
Code:
href="'+theLinks[whichImage]+'"
It saw the link as http://www.yourdomain.com/http://www.outsidedomain.com

with the with the
Code:
href=\''+theLinks[whichImage]+'\'
it will read it as http://www.outsidedomain.com


Code:
<!-- Banner Ad Add-on Start -->
<SCRIPT LANGUAGE="JavaScript">
 
<!-- Begin Random Logo In Header Script
 
var theImages = new Array() // do not change this
var theLinks = new Array() // set up the container for the links

<!-- Edit the url images to match yours
theImages[0] = 'images/banners/00001.jpg'
theLinks[0] = 'http://www.00001.net'
theImages[1] = 'images/banners/00002.gif'
theLinks[1] = 'http://www.00002.com'
theImages[2] = 'images/banners/00003.gif'
theLinks[2] = 'http://www.00003.com'


var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<div align="center"><a href=\''+theLinks[whichImage]+'\' target="_blank"><img src="'+theImages[whichImage]+'" border="0" alt="{vb:raw vboptions.bbtitle}" /></a></div>');
} 
// End -->
</script>

<!-- logo -->
<a name="top"></a> 
<td align="$stylevar[left]"><SCRIPT LANGUAGE="JavaScript"> 
showImage(); 
</script>
 
<!-- Banner Ad Add-on End -->
left the image part alone so it will read the root as http://www.yourdomain.com/
I tried using this, and got nothing. Did I need to change anything else besides the image urls and the link urls?
Reply With Quote
  #18  
Old 03-17-2011, 08:24 AM
sematopdemir sematopdemir is offline
 
Join Date: Oct 2009
Location: ankara
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks
Reply With Quote
  #19  
Old 03-26-2011, 03:40 PM
yilmaz's Avatar
yilmaz yilmaz is offline
 
Join Date: Sep 2004
Posts: 751
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work thank you.
One question is this required?
Code:
<td align="$stylevar[left]">
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 10:28 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.07815 seconds
  • Memory Usage 2,332KB
  • Queries Executed 24 (?)
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
  • (9)bbcode_code
  • (2)bbcode_php
  • (2)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
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete