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

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
  #12  
Old 10-28-2005, 02:37 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK thanks Daniel.
Reply With Quote
  #13  
Old 10-28-2005, 05:25 AM
attroll's Avatar
attroll attroll is offline
 
Join Date: Jan 2003
Location: Litchfield, Me
Posts: 664
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Danial

I found this that will work also for random pictures or banners.

PHP Code:
<script language="Javascript"><!-- 
function 
image() { 
}; 
image = new image(); 
number 0
// imageArray 
image[number++] = "<a href='http://www.domain.net'><img src='http://www.domain.net/picture1.gif' border='0'></a>"
image[number++] = "<a href='http://www.domain.net'><img src='http://www.domain.net/picture2.gif' border='0'></a>"
image[number++] = "<a href='http://www.domain.net'><img src='http://www.domain.net/picture3.jpg' border='0'></a>"
image[number++] = "<a href='http://www.domain.net'><img src='http://www.domain.net/picture4.gif' border='0'></a>"
image[number++] = "<a href='http://www.domain.net'><img src='http://www.domain.net/picture4.jpg' border='0'></a>"
 
// Carry on adding images - as many as you want
increment Math.floor(Math.random() * number); 
document.write(image[increment]); 
//-->
</script
But I liked the direction yours was heading in. With the one line you could place anywhere like this:

PHP Code:
<SCRIPT LANGUAGE="JavaScript">
 
 
<!-- 
Begin
showImage
();
// End --></script> 
Reply With Quote
  #14  
Old 10-28-2005, 12:45 PM
spongebobrox128 spongebobrox128 is offline
 
Join Date: Mar 2005
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*Sighs*, why cannot anyone write there own scripts (not vB hacks (leave that to coders who are expericend with vB), but JS is pretty simple)
Random Image Scripts with links or with out are really simple. This will work for links (put this in top of headinclude)
Code:
 <script type='text/javascript'> function randImage() {   images = new array();   links = new array();   images[0] = 'http://mysite.com/mybanner.gif';   links[0] = 'http://mysite.com/service/';   images[1] = 'http://mysite.com/cool.gif';   links[1] = 'http://mysite.com/cool.html';   var randIndex = Math.round(Math.random()*(images.length-1));   document.write("<a href='" + links[randIndex] + "'><img src='" + links[randIndex] + "'></a>");   return true; } </script>
In Header Under "<!-- logo -->" put:
Code:
 <script type='text/javascript'> randImage(); </script>
images[x] and links[x] are matching, so if you have images[1] configured to a banner for your hosting services, and you have a specific page for that banner, links[1] would be THE FULL URL to that page.And I just wrote this, and I didn't test it, so there may be a few errors. Tell me if it doesn't work.
Reply With Quote
  #15  
Old 10-28-2005, 01:07 PM
stinger2's Avatar
stinger2 stinger2 is offline
 
Join Date: Jul 2005
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wel if this is going to turn to installer it will be a hit.......nice work guys
Reply With Quote
  #16  
Old 10-29-2005, 02:38 AM
GrendelKhan{TSU's Avatar
GrendelKhan{TSU GrendelKhan{TSU is offline
 
Join Date: Jun 2005
Location: Boston | Seoul, S. Korea
Posts: 1,311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

10? 14? man, all of a sudden, I feel very old :/ lol

When I was ten... "tag" meant making a 'touch' when playing 'Tag' (as in, "TAG! you're it!!"). Making a "Bold tag" would be doing so aggresively and using a fancy word like "bold".

as in, "Wow! that was a bold tag! nice one! I guess I'm it!. RUN!"

lol



(ie: Nice work guys!! this will be very useful!)


<<< /me awaits plugin/product.
Reply With Quote
  #17  
Old 10-30-2005, 12:58 AM
admiralapril admiralapril is offline
 
Join Date: Nov 2001
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you!

I look forward to a plugin for this too, but with the template changes it works nicely.

Ten and fourteen, wow. I'm very impressed.
Reply With Quote
  #18  
Old 12-03-2005, 02:44 PM
CSS59 CSS59 is offline
 
Join Date: Oct 2004
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Daneil, I can't get this to align with a 3 paert fluid logo.

Here is the code
Code:
<!-- new logo -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" align="center">

  <tr>
    <td width="390">
    <img border="0" src="http://www.cardraft.com/themes/original/tunerleft.jpg" width="390" height="70"></td>
    <td width="100%" height="70" background="http://www.cardraft.com/themes/original/tunercenter.jpg">
    </td>
    <td width="390" border="0">

   <SCRIPT LANGUAGE="JavaScript">
 <!-- Begin
showImage();
// End --></script>

	</td>
  </tr>
</table>
<!-- end new logo -->
you can see it on my test site at http://cardraft.com (not vb cuz it's my test site for php but i have 3 vb's)


can you help me align the 3? They were aligned b4 i put in the script.
Reply With Quote
  #19  
Old 12-03-2005, 04:31 PM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CSS59
Daneil, I can't get this to align with a 3 paert fluid logo.

Here is the code
Code:
<!-- new logo -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" align="center">

  <tr>
    <td width="390">
    <img border="0" src="http://www.cardraft.com/themes/original/tunerleft.jpg" width="390" height="70"></td>
    <td width="100%" height="70" background="http://www.cardraft.com/themes/original/tunercenter.jpg">
    </td>
    <td width="390" border="0">

   <SCRIPT LANGUAGE="JavaScript">
 <!-- Begin
showImage();
// End --></script>

	</td>
  </tr>
</table>
<!-- end new logo -->
you can see it on my test site at http://cardraft.com (not vb cuz it's my test site for php but i have 3 vb's)


can you help me align the 3? They were aligned b4 i put in the script.
Talked over via AIM.
Reply With Quote
  #20  
Old 12-03-2005, 05:11 PM
CSS59 CSS59 is offline
 
Join Date: Oct 2004
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here is a simple one that I ended up using.
http://photomatt.net/scripts/randomimage
Reply With Quote
  #21  
Old 01-28-2006, 10:58 PM
ambumann ambumann is offline
 
Join Date: Jun 2004
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great one, installed here!
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 12:29 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.10126 seconds
  • Memory Usage 2,313KB
  • 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
  • (9)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
  • (3)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