Jump to content

Time Showing


musicradiolive

Recommended Posts

Hi all,Just a question, i am wondering whether this is possible...I found this page, so whether i can use some of the way show i dont know. http://www.4guysfromrolla.com/webtech/faq/...iate/faq3.shtmlCould i make a script to show something for a certain week of the year, and certain day and certain time.So for example, say for example, could i do this:REQUEST NOWIF WEEK = 1 THENIF DAY = 1 {{{WHICH IS START OF WEEK, MONDAY OR SUNDAY ????????}}}IF TIME >0000 & <0700 then <img src=midnight_7am.jpg>IF TIME >0700 & <1000 then <img src=7am_10am.jpg>IF TIME >1000 & < 1300 then <img src=10am_1pm.jpg> {{{ETC ETC}}}IF DAY = 2IF TIME >0000 & <0700 then <img src=midnight_7am.jpg>IF TIME >0700 & <1000 then <img src=7am_10am.jpg>IF TIME >1000 & < 1300 then <img src=10am_1pm.jpg> {{{ETC ETC}}}IF WEEK = 2 THENIF DAY = 1 {{{WHICH IS START OF WEEK, MONDAY OR SUNDAY ????????}}}IF TIME >0000 & <0700 then <img src=midnight_7am.jpg>IF TIME >0700 & <1000 then <img src=7am_10am.jpg>IF TIME >1000 & < 1300 then <img src=10am_1pm.jpg> {{{ETC ETC}}}IF DAY = 2IF TIME >0000 & <0700 then <img src=midnight_7am.jpg>IF TIME >0700 & <1000 then <img src=7am_10am.jpg>IF TIME >1000 & < 1300 then <img src=10am_1pm.jpg> {{{ETC ETC}}}IF WEEK = 3 THENIF DAY = 1 {{{WHICH IS START OF WEEK, MONDAY OR SUNDAY ????????}}}IF TIME >0000 & <0700 then <img src=midnight_7am.jpg>IF TIME >0700 & <1000 then <img src=7am_10am.jpg>IF TIME >1000 & < 1300 then <img src=10am_1pm.jpg> {{{ETC ETC}}}IF DAY = 2IF TIME >0000 & <0700 then <img src=midnight_7am.jpg>IF TIME >0700 & <1000 then <img src=7am_10am.jpg>IF TIME >1000 & < 1300 then <img src=10am_1pm.jpg> {{{ETC ETC}}}If anyone can point me in the right direction, be appreciated. Thanks!Jon

Link to comment
Share on other sites

First tip is a general one: if you find yourself repeating code then separate it out into its own subroutine. For example, if you are displaying "7am_10am.jpg" between the hours of 0700 and 1000 regardless of the day of week or the week of the year, then separate out that code. Figure out what image to display based on the time of day before you delve into determining which day of the week it is or what week of the year it is.Same goes with the day of week code. If you are doing the same thing for every Sunday regardless of the week, then separate out that code so that you don't have to repeat that code for every week.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...