PDA

View Full Version : Random images.


Sidecar Doug
04-07-2008, 09:06 PM
I've seen this on other forums. And since we're always changing the pics in our avatars & signatures, we could have them constantly changing.

The code they use is something like this: http://www.mysite.com/signature1, 3.gif
This will select signature1.gif, signature2.gif or signature3.gif

I don't know how to write code, but hopefully someone here does.

Sidecar Doug
04-07-2008, 11:17 PM
I found this on a search:
<script type="text/javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var currentdate = 0
var core = 0

function StringArray (n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '

}
}

image = new StringArray(10)
image[0] = '0.gif'
image[1] = '1.gif'
image[2] = '2.gif'
image[3] = '3.gif'
image[4] = '4.gif'
image[5] = '5.gif'
image[6] = '6.gif'
image[7] = '7.gif'
image[8] = '8.gif'
image[9] = '9.gif'

var ran = 60/image.length

function ranimage() {
currentdate = new Date()
core = currentdate.getSeconds()
core = Math.floor(core/ran)
return(image[core])
}

document.write("<img width='xx' height='xx' alt='' src='" +ranimage()+ "'>")

//-->
</script>

It all looks Greek to me, but maybe someone here can figure it out. :blink:

Big MAK
06-26-2008, 08:48 AM
Posting some images to link

Big MAK
06-26-2008, 08:56 AM
reduced

8-Ball
06-26-2008, 02:13 PM
This would require allowing HTML code to be used in signatures. vBulletin strongly advises against this practice due to security and hacking issues...

dwarthog
06-26-2008, 02:31 PM
I found this on a search:

<script type="text/javascript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var currentdate = 0
var core = 0

function StringArray (n) {
this.length = n;
for (var i =1; i <= n; i++) {
this[i] = ' '

}
}

image = new StringArray(10)
image[0] = '0.gif'
image[1] = '1.gif'
image[2] = '2.gif'
image[3] = '3.gif'
image[4] = '4.gif'
image[5] = '5.gif'
image[6] = '6.gif'
image[7] = '7.gif'
image[8] = '8.gif'
image[9] = '9.gif'

var ran = 60/image.length

function ranimage() {
currentdate = new Date()
core = currentdate.getSeconds()
core = Math.floor(core/ran)
return(image[core])
}

document.write("<img width='xx' height='xx' alt='' src='" +ranimage()+ "'>")

//-->
</script>


It all looks Greek to me, but maybe someone here can figure it out. :blink:

It is basically creating an array that contains 10 images. Then it has a function that comes up with an index value of 0 through 9 and then displays that image from the array of previously stored images.

I am sure a real programmer can be more exact than that.