Forum Moderators: open

Message Too Old, No Replies

Day of Week Link Rotation

Looking For Code Please...

         

Heartlander

10:08 pm on Aug 12, 2005 (gmt 0)

10+ Year Member



I'm looking to create a table on my phpbb site where a different Link will appear according to the day of the week.
All I've been able to find is "redirect" programs, but that isn't what I'm looking for.
We're looking to devote each day on our forum to a different Theme, and would like that day's theme to show a link for that day...such as Friday would be "Travel" day.

So, I'd like something like the following-
"Today is Friday. Our Special Theme today is- Travel"<-----(the link to our Travel Forum)

Any help is greatly appreciated!

RonPK

12:26 pm on Aug 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something like this might work:

<script type="text/javascript">
<!--
var dayLinks = [
['Sunday', 4587, 'Travel'],
['Monday', 888, 'Leisure'],
['Tuesday', 120, 'Shopping'],
['Wednesday', 66, 'Books'],
['Thursday', 78, 'Movies'],
['Friday', 123, 'Sports'],
['Saturday', 456, 'Cleaning']
];
var today = new Date();
var d = today.getDay();
document.write('Today is ' + dayLinks[d][0] + '. Our Special Theme today is <a href="board.php?forumID=' + dayLinks[d][1] + '">' + dayLinks[d][2] + '<\/a>.') ;
// -->
</script>

Heartlander

1:58 am on Aug 14, 2005 (gmt 0)

10+ Year Member



That works wonderfully, and I've found some other uses for it with a little tweaking.
Thanks much!