Expert: Marty Landman Date: 7/1/2008 Subject: Display a weekly message
Question QUESTION: Hi Marty
I'm an amateur trying to maintain a community website for our small English village. I want to make the site useful, and one thing would be to say which type of waste is collected each week. One week the general "landfill waste", and the next "Recyclable". What I want, therefore, is to know how to automatically display a message that alternates each week. I can find ways to display a message according to time of day, but not one to display a message according to which week of the year! Any suggestions - or pointers to resources - gratefully received. For your info the site is www.almondsburycommunityshop.org.uk/
Kind regards - Chris
ANSWER: Hi Chris,
Nice site, and nice town. To do this you'll need a little bit of programming. Can you find out what scripting is allowed by your hosting provider?
Ideally Perl and SSI would be best, but for such a simple application it could be most anything.
You can retrieve the week of the year as a number. Then to alternate output on a weekly basis between trash and recycling just figure out whether trash is on even weeks and recycling on odd weeks, or vice versa.