vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Random Logo in Header (https://vborg.vbsupport.ru/showthread.php?t=99402)

Daniel 10-26-2005 10:00 PM

Random Logo in Header
 
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

attroll 10-27-2005 05:36 AM

Daniel

Could this be incorperated into a vBadvanced module?

attroll 10-27-2005 05:58 AM

I figured out how to get it working in vBadvanced. Now my question is, how can you get it to hyperlink the graphic you have. What I mean is I want the users to be able to click on the banner that pops up and have it take them to the sponsors web site.

AndyA 10-27-2005 12:43 PM

This is a mod for changing the Forum logo and not a banner mod right ?

spongebobrox128 10-27-2005 01:31 PM

I could probably make a plugin of it, but that would involve rewriting it.
I am also probably younger then anyone would think (10 years old)
I will work on it later if you want

sim tech 10-27-2005 02:28 PM

Sounds like a great mod to allow various business ads and notices to appear in the header, which is a great idea. I've been wanting to provide something like this for any of my members who made a donation to help keep my site up.

I'll be watching for this to become a plugin. Thanks!

Daniel 10-27-2005 04:55 PM

@attroll - I have some sort of idea on how to do that, but I'm at school right now so I won't be able to test it out. Once I get home I will.

@AndyA - The modification is for the logo, but I suppose it could be used for a banner aswell.

@Sponge - Thank you, if you have any updates on it, feel free to post here or PM me.
And if you're 10, good on you! I didn't even know how to use the bold tag when I was 10 :P I turned 14 about a month ago.

spongebobrox128 10-27-2005 08:39 PM

Ok, could you get on AIM as soon as you can?
And, I decided not to make a plugin but an installer because you would need to specify your images, so you would have to edit something for a plugin to work.
I am almost done, I just have to work out one small bug :)
K, can someone tell me why after it auto-edits template (DB) I have to go to template manager, goto the header template, and click OK for it to work? Because this is really weird...

dn lodge 10-27-2005 09:46 PM

nice hack

Daniel 10-27-2005 10:39 PM

@Sponge - No idea

@Attroll - I tried one test on it, didn't work too well. I'll work on it more over the weekend.


All times are GMT. The time now is 05: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.03560 seconds
  • Memory Usage 1,738KB
  • 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
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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