+ Reply to Thread
Results 1 to 4 of 4

Thread: Daily timetable script

  1. #1
    splotch's Avatar
    splotch is offline x10Hosting Member splotch is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    New Zealand
    Posts
    6

    Daily timetable script

    I'm looking at implementing a daily "timetable" script in PHP.
    I am designing a website for a TV network and I was thinking of having an iframe on the homepage containing a list of the day's programs and having the frame jump so that the currently screening program shows at the top of it.

    The only problem is, I can't think of a way to accomplish this.
    :happysad: The timetable itself is fetched from a mysql db.
    Any help is appreciated.
    Last edited by splotch; 01-27-2009 at 08:41 PM.

  2. #2
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: Daily timetable script

    You could also do it so that the list is returned in a xml way, on a page called xml_listing.php , and on the listing.php file, that we will see, you make a AJAX request to load the xml_listing.php file... Actually, I am going to do a graphic and upload it.

    Here is the link : Graphical Idea Representation
    Last edited by xav0989; 01-27-2009 at 09:43 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  3. #3
    t2t2t's Avatar
    t2t2t is offline x10 Elder t2t2t is an unknown quantity at this point
    Join Date
    Sep 2006
    Location
    Europe, Estonia
    Posts
    690

    Re: Daily timetable script

    Quote Originally Posted by xav0989
    Why send a request between listing.php and xml_listing.php? Most likely these files are using the same database.

    splotch: Here's a small idea I've had:
    Database:

    day - Forgot to add this one, the day of the month the show is on (eg. 1 - sunday, 2 - monday, etc)
    (All times where show starts/ends is minutes since day start)
    (Additional ideas: Description of show to be shown on current show)

    And then add code that's something like following:
    PHP Code:
    // In a loop that loops items returned by db query that returns items for current day (ordered by start ASC)
    $currentTime 60 date('G') + date('i'); // Minutes since start of day
    if($row['start'] < $currentTime) {
    // Code for show already shown
    } elseif ($row['start'] >= $currentTime && $row['end'] < $currentTime) {
    // Code for current show
    } else {
    // Code for upcoming show

    Of course there are several bugs in code, eg. Shows that end in new day.
    This post has been marked spam 52 times.


  4. #4
    splotch's Avatar
    splotch is offline x10Hosting Member splotch is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    New Zealand
    Posts
    6

    Re: Daily timetable script

    Thanks t2t2t, this is really helpful.

    Quote Originally Posted by t2t2t View Post
    Of course there are several bugs in code, eg. Shows that end in new day.
    This isn't really a problem as the network closes down at midnight - 1am (why, I have no idea)

    I shall try it out and see what I can come up with.

+ Reply to Thread

Similar Threads

  1. CRON job : script timeout ?
    By webtomata in forum Free Hosting
    Replies: 4
    Last Post: 09-12-2008, 04:23 PM
  2. Access to 300+ PHP scripts (2500 credits)
    By jonathanyaniv in forum The Marketplace
    Replies: 11
    Last Post: 06-03-2008, 10:58 PM
  3. Replies: 8
    Last Post: 12-03-2007, 04:12 PM
  4. Point Lottery Wins
    By SEŅOR in forum Feedback and Suggestions
    Replies: 8
    Last Post: 06-11-2006, 12:24 PM
  5. Server UP time Script
    By dharmil in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-03-2006, 04:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers