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
  #22  
Old 02-03-2006, 11:48 AM
Gripemaster Gripemaster is offline
 
Join Date: Oct 2005
Location: MD
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I LOVE THIS HACK!!! My only question is... how do I center the headers? As soon as I figure out how to center them the install button will be happily clicked!
Reply With Quote
  #23  
Old 02-04-2006, 06:10 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a great hack Daniel. But the only problem I had with it was that you could not click on the banner and have it bring you to the web site that you were advertising. All it did was display a banner. Most people that user banners using them to advertise and they want users to go the advertisors web site. You can not do this unless you have the banner as a active link.

I created this little hack here that seems to do it all. This hack may have room for improvement but it is basic and the banners rotate and are active links.
https://vborg.vbsupport.ru/showthread.php?t=106682
Reply With Quote
  #24  
Old 02-08-2006, 07:44 PM
Smiry Kin's's Avatar
Smiry Kin's Smiry Kin's is offline
 
Join Date: Dec 2005
Location: United Kingdom!
Posts: 954
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i can't seem to find the first bit..

im using element skin.

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>
please help
Reply With Quote
  #25  
Old 02-10-2006, 04:05 PM
Smiry Kin's's Avatar
Smiry Kin's Smiry Kin's is offline
 
Join Date: Dec 2005
Location: United Kingdom!
Posts: 954
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyhelp?
Reply With Quote
  #26  
Old 02-12-2006, 11:10 PM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Smiry Kin's
i can't seem to find the first bit..

im using element skin.

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>
please help
I don't have any experience with the element skin, but it's just replacing
Code:
 <!-- Begin
showImage();
// End -->
with the image that displays your logo.
Reply With Quote
  #27  
Old 02-20-2006, 01:28 PM
MarkyD MarkyD is offline
 
Join Date: Jan 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gripemaster
I LOVE THIS HACK!!! My only question is... how do I center the headers? As soon as I figure out how to center them the install button will be happily clicked!
that's my issue as well. How do I center?
Reply With Quote
  #28  
Old 02-20-2006, 02:21 PM
tbaleno tbaleno is offline
 
Join Date: Feb 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I changed the line

document.write('<img src="'+theImages[whichImage]+'">');

to

document.write('<center><img src="'+theImages[whichImage]+'"></center>');

I don't know if thats the cleanest way to do it but thats what I did.
Reply With Quote
  #29  
Old 02-20-2006, 02:24 PM
MarkyD MarkyD is offline
 
Join Date: Jan 2006
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbaleno
I changed the line

document.write('<img src="'+theImages[whichImage]+'">');

to

document.write('<center><img src="'+theImages[whichImage]+'"></center>');


I don't know if thats the cleanest way to do it but thats what I did.
thanks so much! that did the trick.
Reply With Quote
  #30  
Old 02-21-2006, 05:02 PM
tbaleno tbaleno is offline
 
Join Date: Feb 2006
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One comment. I found that when you don't have javascript enabled it shows no image at all. So what I have done is found:
Code:
<SCRIPT LANGUAGE="JavaScript">
 
 <!-- Begin
showImage();
// End --></script>
And added this right after:

Code:
<no script>
<center><img src='/images/put_your_default_image_name_here'></center>
</no script>
I think this should work to keep the site consistant when a non java script enabled person visits your site. Also note that the <center> and </center> are optional. I just use them on my board because I like my logo centered.
Reply With Quote
  #31  
Old 02-21-2006, 11:37 PM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea, thanks for sharing.

And thanks tbaleno for helping out.
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 05:27 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.04928 seconds
  • Memory Usage 2,320KB
  • 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
  • (12)bbcode_code
  • (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
  • (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