TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 566
  • Total: 567
  • @rjen

A Random Picture/Banner Script

Started by Mitchâ„¢, April 11, 2006, 11:34:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MADxMAX

Quote from: Mitchâââ,¬Å¾Ã,¢ on April 15, 2006, 04:03:28 PM
Oh no problem. I was just really confused there for a second. :D

welcome to my world,im always confused

elpvn

Quote from: G6 on April 14, 2006, 04:35:15 PM
Mitch script shouldent give a parse error like that.

Have you copyed the code from the first post and put it in a script Block? Or have you used the code from Elvpn ?



Not at all, though two codes has same feature, G6 !
To Mitchâââ,¬Å¾Ã,¢ : Thank, are u an art designer ?  ;)

Mitchâ„¢

Quote from: elpvn on April 16, 2006, 06:06:11 AM
Quote from: G6 on April 14, 2006, 04:35:15 PM
Mitch script shouldent give a parse error like that.

Have you copyed the code from the first post and put it in a script Block? Or have you used the code from Elvpn ?



Not at all, though two codes has same feature, G6 !
To Mitchâââ,¬Å¾Ã,¢ : Thank, are u an art designer ?  ;)

Eh more along the lines of an art editor.
I edit things alot more then I create.

sdl

There is another way. Very easy, very cool. I use it for random images for each time a page is loaded. Good for avatars, banners, anything at all.  Look at the following pic. Each time you refresh this page should see a different image.



I found that with a small code modification, it works equally well with flash files.
I learned how to do it here.
(be sure to read all the comments that follow the post in this link)

Enjoy!

elpvn

Thanks for code, sdl
I'm very happy when knew that, Mitchâââ,¬Å¾Ã,¢  ;D

sdl

Hey no problem! I also show how to do the same with Flash objects (clocks, in this case) on a new SMF experimental site that I set up.

http://smf.examples.com

Check it out!

technodragon73

Quote from: Mitchâââ,¬Å¾Ã,¢ on April 11, 2006, 11:34:21 PM
WHAT:
A Random Picture/Banner Script


WHY:
Well I was looking for something like this but I couldnt find it.
So well I googled it. I like this one the best I did a lil bit of editing to it tidied it up.
There was no copyright that went with this so I am guessing it is ok to post it here.


WHERE:
http://www.crowes.f9.co.uk/Javascript/test.htm



<center>
<SCRIPT LANGUAGE="Javascript">
function banner() {} ; b = new banner() ; n = 0
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
b[n++]= "<A HREF='http://www.yoursite.com/'><IMG SRC='http://www.yoursite.com/image.jpg' BORDER='0' ALT=''></A>"
i=Math.floor(Math.random() * n) ;
document.write( b[i] )
</SCRIPT>
</center>



Is there anyway to do this, but have it pull a link from a database at random?

copter

#27
Thanks Mitch! the code was very easy to use :)

Uthn

#28
Quote from: sdl on April 18, 2006, 08:06:13 AM
There is another way. Very easy, very cool. I use it for random images for each time a page is loaded. Good for avatars, banners, anything at all.  Look at the following pic. Each time you refresh this page should see a different image.




I found that with a small code modification, it works equally well with flash files.
I learned how to do it here.
(be sure to read all the comments that follow the post in this link)

Enjoy!

Hi there,

Thanks for the code, works fine on my local version of TP BUT i can't get it to work on my public site (it just displays an empty block, no image)

I think it's related to read rights (i can't change them via chmod on my hosting), any hint ?

thanks

technodragon73

Quote from: sdl on April 18, 2006, 08:06:13 AM
There is another way. Very easy, very cool. I use it for random images for each time a page is loaded. Good for avatars, banners, anything at all.  Look at the following pic. Each time you refresh this page should see a different image.



I found that with a small code modification, it works equally well with flash files.
I learned how to do it here.
(be sure to read all the comments that follow the post in this link)

Enjoy!

Works fine, but is there a way to add a hyperlink to it?

This website is proudly hosted on Crocweb Cloud Website Hosting.