vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Home Enhancements - Banner Rotator Under Navbar (https://vborg.vbsupport.ru/showthread.php?t=238004)

mavigul 03-10-2010 10:00 PM

Banner Rotator Under Navbar
 
1 Attachment(s)
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!

cagbaazee 03-11-2010 02:32 PM

Thanks .. will try it.

Blain 03-12-2010 06:27 AM

Looks very promising - Thanks for sharing.

Dr.osamA 03-14-2010 11:06 PM

thanxxx

installed
________
Half-Baked

wickedstangs 03-15-2010 03:25 AM

nice mod, how do you add more images? and link them?

patrick91 03-15-2010 07:58 AM

Hey,

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

mavigul 03-16-2010 06:30 AM

Quote:

Originally Posted by wickedstangs (Post 2003872)
nice mod, how do you add more images? and link them?

yes
theImages[0] = 'imageurl'
theImages[1] = 'imageurl'
theImages[2] = 'imageurl'
theImages[3] = 'imageurl'
theImages[4] = 'imageurl'
theImages[5] = 'imageurl'
theImages[6] = 'imageurl'
theImages[7] = 'imageurl'
theImages[8] = 'imageurl'
theImages[9] = 'imageurl'

for example

Quote:

Originally Posted by patrick91 (Post 2003929)
Hey,

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

i don't know

Johnny G 03-16-2010 08:48 AM

Could something be done with this code that would allow it to be used in the AdminCP->Advertising->Add New Ad section?

I love the idea of the array working there to randomly select a banner.

Johnny G 03-16-2010 05:10 PM

Quote:

Originally Posted by Johnny G (Post 2004652)
Could something be done with this code that would allow it to be used in the AdminCP->Advertising->Add New Ad section?

I love the idea of the array working there to randomly select a banner.

I've pasted it in to the stock advertising setup. Appears to work in Firefox, but not in IE. Which is strange...
EDIT: Scrap that, turned out to be a malformed JPG.

Code works fine, currently rotating 9 banners.

wickedstangs 03-21-2010 02:30 PM

Quote:

Originally Posted by mavigul (Post 2004605)
yes
theImages[0] = 'imageurl'
theImages[1] = 'imageurl'
theImages[2] = 'imageurl'
theImages[3] = 'imageurl'
theImages[4] = 'imageurl'
theImages[5] = 'imageurl'
theImages[6] = 'imageurl'
theImages[7] = 'imageurl'
theImages[8] = 'imageurl'
theImages[9] = 'imageurl'

for example



i don't know

Thank You, I like to have them linked too:)


All times are GMT. The time now is 01:53 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.02197 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete