Post by Todge on Apr 23, 2009 10:06:43 GMT -8
This will display a different, random, image each day.
Put it where ever you want the image displayed.. BUT.. If you are using a code to alter the welcome table, this code may need to be placed above it, depending on the welcome table code you are using.
Edit and add to the array at the top of the code with the FULL URL of your images...
The code uses cookies to check the date at the top of the page, if cookies are disabled, the code won't work.
Put it where ever you want the image displayed.. BUT.. If you are using a code to alter the welcome table, this code may need to be placed above it, depending on the welcome table code you are using.
<script>
<!--
// Random daily image
document.write('<center id="dailyImage"></center>');
var dailyImage = new Array();
// Edit below...
dailyImage[0] = 'URL OF IMAGE';
dailyImage[1] = 'URL OF IMAGE';
dailyImage[2] = 'URL OF IMAGE';
dailyImage[3] = 'URL OF IMAGE';
// Edit above...
function setCookie(cookieName,cookieValue)
{
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth()+1);
document.cookie = cookieName+'='+cookieValue+'; expires='+expireDate.toGMTString()+'; path=/';
return;
}
var today = document.getElementsByTagName('font')[2].innerHTML.split(/br>/i)[1].split(/\d\d\d\d/)[0];
if(document.cookie.length <1 || !document.cookie.match('dailyImage='+today))
{
setCookie('dailyImage',today+'|'+Math.floor(Math.random()*dailyImage.length+1)-1);
}
var banner = new Image();
banner.src = dailyImage[parseInt(document.cookie.split('dailyImage='+today+'|')[1])];
document.getElementById('dailyImage').appendChild(banner);
// -->
</script>
Edit and add to the array at the top of the code with the FULL URL of your images...
dailyImage[0] = 'URL OF IMAGE';
dailyImage[1] = 'URL OF IMAGE';
dailyImage[2] = 'URL OF IMAGE';
dailyImage[3] = 'URL OF IMAGE';
The code uses cookies to check the date at the top of the page, if cookies are disabled, the code won't work.