Creating TV guide script in PHP... ideas needed
I'm creating a TV guide project, and have managed to get three things working correctly:
- Pagination
- Databases (but linking tables via InnoDB is the hard part)
- PHP
- Datetime functions PHP
Creating the site is the harder part, as I know what I want to do, but how to accomplish this is the problem.
http://library.digiguide.tv/lib/programmenextshowing/Casualty-6313 is an example of how I'm trying to get my site to look - OK, so that one's an ASP site, but my one is in PHP.
This is the structure of how an episode would display:
(for a show with seasons/episode numbers)
开发者_开发技巧 True Blood showing on FX January 14th, 2011 - 10:00pm "Bad Blood"
Series 3, episode 1. Set Reminder
True Blood showing on FX HD January 14th, 2011 - 10:00pm "Bad Blood"
Series 3, episode 1. Set Reminder
True Blood showing on TG4 January 16th, 2011 - 12:25am Set Reminder
True Blood showing on TG4 January 16th, 2011 - 1:30am Set Reminder
for a show without seasons/episode numbers:
Casualty showing on BBC Entertainment 4:00pm Set Reminder
Casualty showing on BBC Entertainment 7:45pm Set Reminder
Casualty showing on BBC Entertainment 11:20pm Set Reminder
Casualty showing on Watch December 31st - 11:00am "Episode 1" Set Reminder
The "Set Reminder" part is where a user would click on it, and it would send an email to them saying "X show is on Y channel at Z time." using php's sendmail command.
This is my database structure:
CREATE TABLE IF NOT EXISTS `programme1airing` (
`programme` varchar(255) collate utf8_unicode_ci NOT NULL,
`channel` varchar(255) collate utf8_unicode_ci NOT NULL,
`airdate` datetime NOT NULL,
`displayair` datetime NOT NULL,
`expiration` datetime NOT NULL,
`episode` varchar(255) collate utf8_unicode_ci NOT NULL,
`series` varchar(255) collate utf8_unicode_ci NOT NULL,
`epno` varchar(255) collate utf8_unicode_ci NOT NULL,
`setreminder` varchar(255) collate utf8_unicode_ci NOT NULL,
KEY `channel` (`channel`),
KEY `episode` (`episode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
and for the episode table of programme1:
CREATE TABLE IF NOT EXISTS `episodes` (
`epname` varchar(255) NOT NULL,
`series` varchar(255) NOT NULL,
`epno` varchar(255) NOT NULL,
KEY `epname` (`epname`),
KEY `series` (`series`),
KEY `epno` (`epno`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
and for the channels:
CREATE TABLE IF NOT EXISTS `channel` (
`channel` varchar(255) character set utf8 collate utf8_unicode_ci
NOT NULL default '',
KEY `channel` (`channel`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
enter code here
However, it's getting it to work which is the problem - I've got a good pagination script which works, but should I integrate this with something like CodeIgniter etc.
I'm trying to work out a good way to get this project working with CodeIgniter, as I've learnt the basic skills, it's just finding a workable solution that's the problem.
This currently resides on localhost, under a testing domain, so there's no live site worries for now.
Any advice is appreciated, thanks.
First of all, you need to familiarize yourself with the MVC concept CI is using. Next up, get into the different standard classes, especially the database class. You can throw out your pagination script, since CI has a thing for that.
Now you've read some important documentation, start thinking how you would split the different functionalities across different controllers. You probably want the have a controller for channels, series and episodes.
Regarding the reminder functionality, you should look into cronjobs, this should check if any reminders should be sent on that specific time.
Luckily, CI has some excellent documentation. Just get your feet wet and when you run into specific problems, ask a specific question. Good luck!
精彩评论