Apologies if the title is in lowercase but it's describing an extension format.
I've started using Dwoo as my template engine for PHP, and am not sure how to convert my PHP files into .tpl templates.
My site is similar to, but not the same as, http://library.digiguide.com/lib/programme/Medium-319648/Drama/ with its design (except colour scheme and site name are different, plus it's in PHP - so copyright issues are avoided here, the design arguably could be seen as parody even though the content is different.
The database is called tvguide, and it has these tables:
Programmes
House M.D.
Medium
Police Stop!
American Dad!
The tablenames of the above programmes are:
housemdonair
mediumonair
policestopair
americandad1
All of them have the following rows:
id (auto-increment)
programme
channel
airdate - DATETIME field
expiration - DATETIME field
Episodes
The tablenames for the above programmes' episode guides are:
housemdepidata
mediumepidata
policestopepidata
americandad1epidata
All of them have the following rows:
id (not an auto-increment, since I wish to dynamically generate a page from this)
episodename
seriesnumber
episodenumber
episodesynopsis
(the above four after id do exactly as stated)
I have a pagination script that works, it displays 20 records per page as I want it to. This is called pmcPagination.php - but I won't post it in full since it would take up too much space.
However, I'm trying to get it so that variables are filled in like this: (ok, so the examples below are ASP.NET, but if there's a PHP/MySQL equivalent I would gratefully appreciate this!!):
http://library.digiguide.com/lib/episode/741168
http://library.digiguide.com/lib/episode/714829
with the episode detail and data.
My site works, but it's fairly basic, and it's not online yet until my bugs are fixed.
Mod_rewrite is enabled so my site reads as http://mytvguide.com/episode/123456
or http://mytvguide.com/programme/123456
http://mytvguide.com/WorldInAction/123456/Documentary/
I've tried looking on Google, but am not sure how to get this TV guide script to work at its best - but I think .tpl, and .php/MySQL is the way to go.
This is the part of my pagination script where I'm not sure how to get foreign keys working:
<?php
//Require the file that contains the required classes
include("pmcPagination.php");
//PhpMyCoder Paginator
$paginator = new pmcPagination(20, "page");
//Connect to the database
mysql_connect("localhost","root","password");
//Select DB
mysql_select_db("mytvguide");
//Select only results for today and future
$result = mysql_query("SELECT <UNSURE WHAT TO INSERT> where airdate >= now() order by expiration");
//You can also add reuslts to paginate here
mysql_data_seek($queryresult,0) ;
while($row = mysql_fetch_array($result))
{
$paginator->add(new paginationData($row['programme'],
$row['channel'],
$row['airdate'],
$row['expiration'],
$row['episode'],
$row['setreminder']));
}
?>
Any advice anyone has on making this project into a fully workable, ready to use site would be much appreciated, I've spent months refining this project!
P.S. Apologies for the length of this, hope it describes my project well.