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
Random Logo in Header Details »»
Random Logo in Header
Version: 1.00, by Daniel Daniel is offline
Developer Last Online: Jul 2022 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 10-26-2005 Last Update: Never Installs: 44
Template Edits
 
No support by the author.

What This Does
This will make a random logo which you select appear on the top of your board.

You must have JavaScript enabled.

Now let's get started, shall we?
Go to your admincp and open up the "header" template.

At the very begining of your header template, add:
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] = 'http://www.yoursite.com/forum/images/banner1.gif'
theImages[1] = 'http://www.yoursite.com/forum/images/banner2.gif'
 
 
 
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="index.php"><img src="'+theImages[whichImage]+'" border="0" alt="$vboptions[bbtitle]" /></a></div>');
}
 
// End -->
</script>
Find:
Code:
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
    <td align="$stylevar[left]" class="logobg"><a href="$vboptions[forumhome].php?$session[sessionurl]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
</tr>
</table>
And replace it with:
Code:
<SCRIPT LANGUAGE="JavaScript">
 
 
<!-- Begin
showImage();
// End --></script>
And you're done

To add more images, go back to:
Code:
theImages[1] = 'http://www.yoursite.com/forum/images/banner2.gif'
And after, you can add:
Code:
theImages[2] = 'http://www.yoursite.com/forum/images/banner3.gif'
And so on.

I know this can be done with a plugin or some sort of installer, but since I have no idea on how to do that, I suppose there won't be one unless someone creates one, or until I figure out how.

If you would like to recieve updates on this modification, please click the 'Install' button.

Daniel
www.mmoccforum.com

Show Your Support

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

Comments
  #32  
Old 02-22-2006, 01:13 PM
MarkyD MarkyD is offline
 
Join Date: Jan 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Once I get to theImages[10], it doesn't seem to display anything higher than a value of 9. Am I missing something? I just added my 10th image for rotation, and sat there and hit reload for like 10 minutes...and never saw 10 or 11 appear...but it rotated fine thru 1-9. Any ideas?
Reply With Quote
  #33  
Old 02-22-2006, 04:44 PM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This using this code. You can add as many rotating banners that you want.


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 --> 
Reply With Quote
  #34  
Old 04-06-2006, 04:51 AM
maharajah maharajah is offline
 
Join Date: Feb 2005
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone been able to make this clickable yet ?

.
Reply With Quote
  #35  
Old 04-06-2006, 04:57 AM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

disregard... sorry
Reply With Quote
  #36  
Old 04-06-2006, 05:13 AM
maharajah maharajah is offline
 
Join Date: Feb 2005
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Worked out the Clickable ...

REPLACE:

PHP Code:
document.write('<div align="center"><img src="'+theImages[whichImage]+'"></div>'); 
With

PHP Code:
document.write('<div align="center"><a href="FORUM URL"><img src="'+theImages[whichImage]+'" border = "0"></a></div>'); 
And Replace FORUM URL with your url....




.
Reply With Quote
  #37  
Old 04-10-2006, 10:52 PM
rareclownfish rareclownfish is offline
 
Join Date: Mar 2006
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed, but having some issues. How can i take out the boxline around the image.
picture here.....http://www.rareclownfish.com/forums/index.php

I want it to look like this http://www.rareclownfish.com/modules.php?name=Jig
Reply With Quote
  #38  
Old 04-10-2006, 11:01 PM
Roms's Avatar
Roms Roms is offline
 
Join Date: Jun 2004
Location: Witness ProtectionProgram
Posts: 1,841
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

rareclownfish;

You need to include the: border = "0"


in your code to remove the link border.... Hope that helps.
Reply With Quote
  #39  
Old 04-11-2006, 01:42 AM
rareclownfish rareclownfish is offline
 
Join Date: Mar 2006
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Infantrymen
rareclownfish;

You need to include the: border = "0"


in your code to remove the link border.... Hope that helps.
Where in the code?
Reply With Quote
  #40  
Old 04-11-2006, 02:02 AM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I updated the code, it should be fine now. It now links to index.php and has a border. Sorry, sort of forgot about this thing or would have done it sooner :P
Reply With Quote
  #41  
Old 04-11-2006, 02:04 AM
rareclownfish rareclownfish is offline
 
Join Date: Mar 2006
Posts: 245
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks will try it now.
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 08:05 AM.


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.05531 seconds
  • Memory Usage 2,322KB
  • 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
  • (6)bbcode_code
  • (2)bbcode_php
  • (1)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
  • (4)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