Advertise Here

Author Topic: [Code] Random Banner  (Read 14181 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Random Banner
« on: August 14, 2007, 10:23:28 pm »
Code: [Select]
<script>
var randbanner = []
//Created by Agent Moose (smcodes.smfforfree3.com)
randbanner[0]=["URL"]

rawr = Math.floor(Math.random()*randbanner.length)
document.write("<center><img src='" + randbanner[rawr][0] + "' /></center>")
</script>
Place it where ever you want your banners to show.
URL = the URL of the image

To add more, just add more of these lines:
randbanner[0]=["URL"]

Change the 0 to a 1, if you add another line after that, you would change the 1 to a 2.
« Last Edit: August 27, 2007, 09:09:28 pm by simply sibyl »
Check out Revolution X's Brand new Code Index!

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: Random Banner
« Reply #1 on: August 15, 2007, 05:54:15 am »
Thanks, Moose, sounds cool.  As soon as I can figure out what I want will give it a try.


And I Play:  Mafia-Mandemz

Offline nitsua

  • SMF For Free Member
  • *
  • Posts: 30
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Random Banner
« Reply #2 on: August 15, 2007, 06:22:23 pm »
can i do a directory of images instead of a specific image

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: Random Banner
« Reply #3 on: August 16, 2007, 05:39:43 pm »
No.  You have to use the URL of the whole image.
Check out Revolution X's Brand new Code Index!

Offline nitsua

  • SMF For Free Member
  • *
  • Posts: 30
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Random Banner
« Reply #4 on: August 18, 2007, 08:23:26 pm »
k k

Offline squal

  • SMF For Free Newbie
  • *
  • Posts: 12
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Random Banner
« Reply #5 on: September 12, 2007, 01:48:34 am »
where i put this code?

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Random Banner
« Reply #6 on: September 12, 2007, 05:55:36 am »
where i put this code?

Admin > Manage Styles > Edit Header/Footer

Put it in your Header if you want it above the forum,  footer if you want it below the forum.   

Offline stefun8

  • SMF For Free Member
  • *
  • Posts: 53
    • View Profile
    • Avanyx

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Random Banner
« Reply #7 on: March 29, 2008, 05:43:07 am »
do u want to put a preview plzzz.


Thanks.
The motocross freaks is in tha game.

Offline -Sя.Sharp

  • SMF For Free Master
  • *
  • Posts: 1032
    • View Profile
    • Hidden Designers

  • Total Badges: 19
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: [Code] Random Banner
« Reply #8 on: March 29, 2008, 12:10:21 pm »
http://randombanner.smfforfree3.com/index.php
Keep refreshing the page to see em.
The banners i just found....

Offline Chico

  • SMF For Free Member
  • *
  • Posts: 21
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Random Banner
« Reply #9 on: October 19, 2008, 01:23:39 am »
Is there a way to make the banners clickable with this code?

Offline Shimmy Shabby

  • SMF For Free Full Member
  • *
  • Posts: 143
    • View Profile

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [Code] Random Banner
« Reply #10 on: November 01, 2008, 04:30:53 pm »
[quote ]
Is there a way to make the banners clickable with this code?
[/quote]

Use this for each banner

Code: [Select]
randbanner[0]=["URL OF IMAGE' onclick=location.href='URL OF SITE' style='cursor: pointer"]
« Last Edit: January 04, 2010, 11:57:08 am by simply sibyl »


Offline Chico

  • SMF For Free Member
  • *
  • Posts: 21
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Random Banner
« Reply #11 on: November 02, 2008, 01:38:27 am »
Thanks , That works.

Offline pancakes991

  • SMF For Free Member
  • *
  • Posts: 47
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Random Banner
« Reply #12 on: November 28, 2008, 10:39:08 pm »
thats cool
My forum go there please CuteSite3.smfforfree3.com go to cutesite3.piczo.com the 2 sites go together

Offline taogem

  • SMF For Free Hero
  • *
  • Posts: 840
    • View Profile
    • My Snuff Bottle Journal

  • Total Badges: 29
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [Code] Random Banner
« Reply #13 on: February 18, 2009, 06:49:49 pm »
Forum Url: http://gemstone.smfforfree4.com/.smfforfree4.com
I looked through the list of codes, but can't figure out which one I might use to be able and place this code so that it shows in between a couple of the forums boards on the forum.

Can someone point me to how I might be able to do this... ?

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Random Banner
« Reply #14 on: February 18, 2009, 07:25:44 pm »
hi tao -   some scripts can be put in a Boards Description area just fine.. Ild always try it on a test forum first though and not your real forum.    Mentioning that as Im not sure what you mean by  "between a couple of the forums boards"   If you meant in the space between Categorys I know of no way to do that.

 

Related Topics

  Subject / Started by Replies Last post
10 Replies
1548 Views
Last post February 09, 2008, 10:56:34 pm
by taogem
19 Replies
2022 Views
Last post March 29, 2008, 11:06:29 am
by Blade
4 Replies
744 Views
Last post April 06, 2008, 11:38:51 am
by Max.
5 Replies
2079 Views
Last post June 19, 2008, 08:13:56 am
by 3lf-ครรครรเภ
0 Replies
1405 Views
Last post May 05, 2014, 03:38:41 am
by taogem