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)

attroll 10-28-2005 02:37 AM

OK thanks Daniel.

attroll 10-28-2005 05:25 AM

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> 


spongebobrox128 10-28-2005 12:45 PM

*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.

stinger2 10-28-2005 01:07 PM

wel if this is going to turn to installer it will be a hit.......nice work guys

GrendelKhan{TSU 10-29-2005 02:38 AM

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

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 :p :D



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


<<< /me awaits plugin/product. :)

admiralapril 10-30-2005 12:58 AM

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.

CSS59 12-03-2005 02:44 PM

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.

Daniel 12-03-2005 04:31 PM

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.

CSS59 12-03-2005 05:11 PM

here is a simple one that I ended up using.
http://photomatt.net/scripts/randomimage

ambumann 01-28-2006 10:58 PM

Great one, installed here!


All times are GMT. The time now is 08:00 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.01324 seconds
  • Memory Usage 1,754KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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