Results 1 to 13 of 13

Thread: Time Activated Event

  1. #1

    Time Activated Event

    So, I'm working on a project and at a specific time, my client wants some data to change on the home page. So, for example, at 2pm they want it to display one name in a list and at 3 display the next name on the list.

    I'm assuming this is something that must be done on the server side right? Using AJAX maybe?

  2. #2
    are the names going to be changing every hour "randomized"? or does a name have a predefined time to appear at? will this go on infinitely or is there some limit?

  3. #3
    Do you need it so on refresh the new data is displayed or do you need it to update 'seamlessly'?

  4. #4
    Maybe have a cron job run every hour?
    Member #2 of the "I wont critique Timmytot's designs anymore" club.

  5. #5
    foodpk's Avatar
    1,335
    posts
    ask me about being a jerk
    Why don't you just throw all that stuff into a big series of if else statements that check what time is it via the date() function?

  6. #6

  7. #7
    foodpk's Avatar
    1,335
    posts
    ask me about being a jerk
    Well, it probably is the simplest solution, but may or may not meet the requirements.

  8. #8
    If your data is retreived from a database let the SQL do the work.

    Example:
    Store the datetime when a item should be visible on the page in a column called 'contentDate'

    A sample statement could be:

    Code:
    SELECT * FROM contentTable WHERE contentDate < NOW()

  9. #9
    Quote Originally Posted by bwh2 View Post
    are the names going to be changing every hour "randomized"? or does a name have a predefined time to appear at? will this go on infinitely or is there some limit?
    no the names would go up at a predefined time and it would go for like a week or a few days at a time and then potentially the list would be replaced.

  10. #10
    Quote Originally Posted by evildrummer View Post
    Do you need it so on refresh the new data is displayed or do you need it to update 'seamlessly'?
    and it just needs to update on refresh, basically the same way alot of internet radio stations have it.

  11. #11
    Quote Originally Posted by teiz77 View Post
    If your data is retreived from a database let the SQL do the work.

    Example:
    Store the datetime when a item should be visible on the page in a column called 'contentDate'

    A sample statement could be:

    Code:
    SELECT * FROM contentTable WHERE contentDate < NOW()
    now would that option be something that I input into php or......something else.

  12. #12
    i would make a MySQL table with these colums:
    Code:
    tbl_show_names
    ------------------
    name
    show_start
    show_end
    then query the table:
    Code:
    SELECT * FROM tbl_show_names
    WHERE NOW() BETWEEN show_start AND show_end
    make show_start and show_end datetime datatypes.

  13. #13
    interesting, thanks. i'll play around with it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012