Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 06:01:20 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 58
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 51
Total: 52

Author Topic: Random Photo display  (Read 9701 times)

0 Members and 1 Guest are viewing this topic.

juggler

  • Guest
Random Photo display
« on: January 06, 2006, 05:28:22 PM »
OK it's not a coppermine tie in and does mean you'll have to upload the photos to a directory your self. I've used this script on my site for a "Rogues Gallery" of members of the forum. It also allows you to have each photo link to a website individually as well (Although mine all point to my gallery at the moment). To see it in action drop by www.bluebuzzards.com/buzzards.

<script language="JavaScript">
<!--

/*
Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com)
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/

function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="http://www.bluebuzzards.com/tpimages/Image1.jpg"
myimages[2]="http://www.bluebuzzards.com/tpimages/Image2.jpg"
myimages[3]="http://www.bluebuzzards.com/tpimages/Image3.jpg"
myimages[4]="http://www.bluebuzzards.com/tpimages/Image4.jpg"
myimages[5]="http://www.bluebuzzards.com/tpimages/Image5.jpg"


//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://www.bluebuzzards.com/gallery"
imagelinks[2]="http://www.bluebuzzards.com/gallery"
imagelinks[3]="http://www.bluebuzzards.com/gallery"
imagelinks[4]="http://www.bluebuzzards.com/gallery"
imagelinks[5]="http://www.bluebuzzards.com/gallery"



var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0>[/url]')
}
random_imglink()
//-->
</script>

<p align="center"><font face="arial" size="-2">This free script provided by</font>

<font face="arial, helvetica" size="-2">JavaScript
Kit
</font></p>

crip

  • Guest
Re: Random Photo display
« Reply #1 on: January 07, 2006, 10:24:24 AM »
I'll try this..

thanks! :)

crip

  • Guest
Re: Random Photo display
« Reply #2 on: January 07, 2006, 01:04:42 PM »
Handy link to this useful image script |Randomised|


jackgordon

  • Guest
Re: Random Photo display
« Reply #3 on: January 12, 2006, 07:17:28 AM »
nice script - thanks!

scope

  • Guest
Re: Random Photo display
« Reply #4 on: January 16, 2006, 05:05:56 PM »
OK, I have the random display of pics setup, but I don't want to resize each picture I put on.  What is the right html code to add to the javascript/html box to get a size in there.   I currently have the following:

<table>
 <tr >
  <td width="50"  length="50">
<p></p>
<script language="JavaScript">
<!--

/*
Random Image Link Script- By JavaScript Kit(http://www.javascriptkit.com)
Over 200+ free JavaScripts here!
Updated: 00/04/25
*/

function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="../pics/1.jpg"
myimages[2]="../pics/2.jpg"
myimages[3]="../pics/3.jpg"
myimages[4]="../pics/4.jpg"
myimages[5]="../pics/5.jpg"
myimages[6]="../pics/6.jpg"

//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]=""
imagelinks[2]=""
imagelinks[3]=""
imagelinks[4]=""
imagelinks[5]=""
imagelinks[6]=""

var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0>[/url]')
}
random_imglink()
//-->
</script>
     </td>
 </tr>
<p></p>
 <tr>
     <td>
<p align="center"><font face="arial" size="-2">This free script provided by</font>

<font face="arial, helvetica" size="-2">JavaScript
Kit
</font></p>
    </td>
 </tr>
</table>

As you can see I created tables and it still doesn't seem to work.  Any suggestions or anytihng you notice I did wrong.

crip

  • Guest
Re: Random Photo display
« Reply #5 on: January 17, 2006, 03:57:01 PM »
If you have thumbnails to a for each image; just link the random ones to the full size images..i'm pretty sure you need thumbnails as the random in the script/html block..

DJRONY

  • Guest
Re: Random Photo display
« Reply #6 on: July 22, 2009, 05:08:28 AM »
That won't make any good if I have 100 pictures or more. I have to link up all the images..?

« Last Edit: July 22, 2009, 10:39:16 AM by IchBinâ„¢ »

JPDeni

  • Guest
Re: Random Photo display
« Reply #7 on: July 22, 2009, 07:41:31 AM »
If you want the photos linked to external websites, then, yes, you would have to create links for the images. If you want something else, maybe not.