Daily timetable script

splotch

New Member
Messages
6
Reaction score
0
Points
0
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:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
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:

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
xav0989 said:
x10hostingforumsguyzx4.png
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:
ss20090128213226kq8.png

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:
// 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.
 

splotch

New Member
Messages
6
Reaction score
0
Points
0
Thanks t2t2t, this is really helpful.

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.
 
Top