|
|
|
|
|
|
![]() |
#1 |
Registered User
|
weekly image rotation?
I found this script
<script type="text/javascript" language="JavaScript"> var now = new Date (); var day = now.getDay(); //REMEMBER- the week begins on SUNDAY if(day == 0) document.write("<a href='YOUR-LINK-HERE'><img src='/images/sundayimage.gif' alt='sunday' width='125' height='80' border='0'></a>"); if(day == 1) document.write("<a href='YOUR-LINK-HERE'><img src='/images/mondayimage.gif' alt='sunday' width='125' height='80' border='0'></a>"); if(day == 2) document.write("<a href='YOUR-LINK-HERE'><img src='/images/tuesdayimage.gif' alt='sunday' width='125' height='80' border='0'></a>"); And its pretty close to what I need. I need a script that will rotate out my "host of the week" image on my site. This script does it everyday and then will revert back to the sunday image after the week has ended. Right now its getting to be a pain in the ass to manage the changes. I would perfer to put up a directory with 52 images in it and rotate threw them every sunday. Each new image would have the hosts name as the alt text and the link would take you to there bio, etc. I would perfer something simple like javascript but everyplace I look all the codes are for daily or monthly rotation. I have phpadsnew but to be honest its just a pain in the ass to get it to work with something simple like this. Maybe I should not say simple being i cant do it, but I know this is not super coding. Anyhelp would be great. Jugg.... |
![]() |
![]() |
![]() |
#2 |
Porn Blog Addict
|
Here is a javascript function that will let you get the number of the week the first week is week 1 and the last week being 52. Its not perfect but it does work.
remember in javascript January = 0 and December = 11 PHP Code:
I would just number my pictures 1.jpg thru 52.jpg and display them based on the week number. hope this helps. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|