Results 1 to 7 of 7

Thread: Upcoming Events Handler

  1. #1
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Upcoming Events Handler

    This is probably something realllllly basic but I can't seem to find a working answer anywhere.

    Basically I want to create a box, probably a div, that displays various info based on date and time, to tell users about upcoming events.

    So for example:

    11am - 3pm GMT on the 21st of april 09 it would display:
    "1pm Fishing"

    But then 3pm - 1am it'd display:
    4pm darts

    etc.

    So essentially I need a script that either tells the div what content to display at the specified time or a script that tells a series of div's to hide/display according to time.

    Anyone got any ideas?

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    Can you explain a bit more what you want.

    Do you want in effect to have an event calendar?

    Are you wanting the user to input a date and hour span and then display any event during that period?

    Is it real time, ie always today, so display upcoming events for a number of hours from now?

    Where do you intend storing the events?

  3. #3
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I don't want anything with user interaction, but it is a calendar of sorts.

    Essentially I want the output to be:

    Upcoming Event:
    Fishing 3pm GMT 21/04/2009

    It doesn't matter so much what the event is or how it is stored. Ideally it'd be something simply such as a txt file or html document but I could set up a database or anything tht is required.

    The goal is to have a dynamic text area which will display the next event based on time and date.

    So if the data it was reading had:
    20/04/2009 3pm GMT Darts...
    21/04/2009 3pm GMT Fishing...
    21/04/2009 5pm GMT Poker...

    Where all data was in the form of (or similar i dunno what it'd need to work):
    Date Time TextStringToReturn

    The dynamic area would determine the current date and time and then choose the next chronological event to display.

    So the returns for:
    20/04/2009 3pm GMT Darts...
    21/04/2009 3pm GMT Fishing...
    21/04/2009 5pm GMT Poker...

    Would be up until 3pm gmt on the 20th april it would display darts...
    3pm 20th - 3pm 21st it'd display fishing...
    3pm - 5pm 21st it'd display darts...

  4. #4
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    and whats about a page refresh via <meta http-equiv="refresh" each 15 min or so ?
    All the script must do is to select events for the rest of the day or week
    or whatever

  5. #5
    Join Date
    Apr 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes a page refresh would ensure the display was always up to date but that is not what I am after. I need the actual coding to make it pick the right event data to display in the first place.

  6. #6
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, i only use databases to store such things and in sql the query would sound
    like select subject, eventtime from event where eventtime > now() and day(eventtime) = today order by eventtime

    the query would return the next events. The rest is to output the data...

  7. #7
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    A possible way to handle this, crudely, would be to use the page refresh option with PHP & MYSQL.

    You could create a MYSQL table, easy for maintaining events.

    You could do a query based on the current date & time using less than or equal to as the operand.

    You can get a count of the number of records returned and display the last record.

    There may well be a more sophisticated way of doing this but if you want it simple this should work.

Bookmarks

Posting Permissions

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