[mythtv] MythWeb update

Russell Hatch mythtv-dev@snowman.net
Tue, 3 Dec 2002 16:17:29 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C29AE7.79CC7300
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_000D_01C29AE7.79CC7300"


------=_NextPart_001_000D_01C29AE7.79CC7300
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

here is all the stuff i've been working on for mythweb.. fixed a couple =
of bugs, added some helpful features, added support for "always record =
this program on this channel", and the recordings menu is now also fully =
functional.  just make sure you apply the patch with -F3

Russell Hatch
------=_NextPart_001_000D_01C29AE7.79CC7300
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>here is all the stuff i've been working =
on for=20
mythweb.. fixed a couple of bugs, added some helpful features, added =
support for=20
"always record this program on this channel", and the recordings menu is =
now=20
also fully functional.&nbsp; just make sure you apply the patch with=20
-F3</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Russell =
Hatch</FONT></DIV></BODY></HTML>

------=_NextPart_001_000D_01C29AE7.79CC7300--

------=_NextPart_000_000C_01C29AE7.79CC7300
Content-Type: application/octet-stream;
	name="mythweb-20021203.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="mythweb-20021203.patch"

Common subdirectories: /root/mythtv/mythweb/CVS and /var/www/mythweb/CVS=0A=
Only in /root/mythtv/mythweb/: README=0A=
diff -u /root/mythtv/mythweb/banner.php /var/www/mythweb/banner.php=0A=
--- /root/mythtv/mythweb/banner.php	Fri Sep 27 15:06:20 2002=0A=
+++ /var/www/mythweb/banner.php	Tue Dec  3 14:54:07 2002=0A=
@@ -29,6 +29,14 @@=0A=
 =0A=
 	print("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 =
Transitional//EN\">\n");=0A=
 	print("<HTML>\n");=0A=
+=0A=
+	print("<STYLE TYPE=3D\"text/css\">");=0A=
+	print("A:link    { text-decoration: none; color: $link_color; }");=0A=
+	print("A:visited { text-decoration: none; color: $link_visited_color; =
}");=0A=
+	print("A:active  { text-decoration: none; color: $link_active_color; =
}");=0A=
+	print("A:hover   { color: $link_hover_color; }");=0A=
+	print("</STYLE>");=0A=
+=0A=
 	print("\t<HEAD>\n");=0A=
 	print("\t\t<META HTTP-EQUIV=3D\"Content-Type\" CONTENT=3D\"text/html; =
charset=3DUTF-8\">\n");=0A=
 	print("\t\t<TITLE>MythWEB</TITLE>\n");=0A=
diff -u /root/mythtv/mythweb/classes.php /var/www/mythweb/classes.php=0A=
--- /root/mythtv/mythweb/classes.php	Fri Sep 27 15:06:20 2002=0A=
+++ /var/www/mythweb/classes.php	Sat Nov 30 17:00:58 2002=0A=
@@ -95,7 +95,12 @@=0A=
 class Recording=0A=
 {=0A=
 	var $chanid;=0A=
+	var $channum;=0A=
 	var $starttime;=0A=
+	var $endtime;=0A=
+	var $title;=0A=
+	var $subtitle;=0A=
+	var $description;=0A=
 }=0A=
 =0A=
 =0A=
diff -u /root/mythtv/mythweb/functions.php /var/www/mythweb/functions.php=0A=
--- /root/mythtv/mythweb/functions.php	Fri Sep 27 15:06:20 2002=0A=
+++ /var/www/mythweb/functions.php	Tue Dec  3 15:27:47 2002=0A=
@@ -60,7 +60,7 @@=0A=
 //	to record that program whenever it's shown=0A=
 //=0A=
 =0A=
-function recordAlways($programName)=0A=
+function recordAlways($programName, $theChannel)=0A=
 {=0A=
 	if(strlen($programName) > 0) // Are there program names as short as =
one character?=0A=
 	{=0A=
@@ -71,7 +71,9 @@=0A=
 			//	This program name is not in the allrecord table,=0A=
 			//	so we need to add it=0A=
 			//=0A=
-			mysql_query("insert into allrecord (title) values =
(\"$programName\")");	=0A=
+			//  See if the program is being always recorded just on a certain =
channel=0A=
+			if ($theChannel) mysql_query("insert into allrecord (title,chanid) =
values (\"$programName\",\"$theChannel\")");=0A=
+			else mysql_query("insert into allrecord (title) values =
(\"$programName\")");=0A=
 			=0A=
 			//=0A=
 			//	In case this is elsewhere, we should (?) delete it=0A=
@@ -169,6 +171,21 @@=0A=
 }=0A=
 =0A=
 //=0A=
+//	Boolean check to see if a given title=0A=
+//	is set to always record on a certain channel=0A=
+//=0A=
+=0A=
+function isInChannelAlwaysRecord($theChannel, $theTitle)=0A=
+{=0A=
+	$aQuery =3D mysql_query("select * from allrecord where title =3D =
\"$theTitle\" and chanid =3D \"$theChannel\"");=0A=
+	if(mysql_num_rows($aQuery) > 0)=0A=
+	{=0A=
+		return(TRUE);=0A=
+	}=0A=
+	return(FALSE);=0A=
+}=0A=
+=0A=
+//=0A=
 //	Boolean check to see if a given title is in =0A=
 //	the timeslotrecord table=0A=
 //=0A=
@@ -235,13 +252,19 @@=0A=
 //=0A=
 function setupRecordings()=0A=
 {=0A=
-	$recordQuery =3D mysql_query("SELECT * FROM singlerecord") or die("Uh =
oh, I couldn't open the singlerecord table");;=0A=
+	$theQuery =3D "select singlerecord.*,channel.channum from =
singlerecord,channel where channel.chanid =3D singlerecord.chanid order =
by singlerecord.starttime asc;";=0A=
+	$recordQuery =3D mysql_query($theQuery) or die("Uh oh, I couldn't open =
the singlerecord table");;=0A=
 	$i =3D 0;=0A=
-	while($recordTupple =3D mysql_fetch_array($recordQuery, MYSQL_ASSOC))=0A=
+	while($recordTuple =3D mysql_fetch_array($recordQuery, MYSQL_ASSOC))=0A=
 	{=0A=
 		$aRecord =3D new Recording;=0A=
-		$aRecord->chanid =3D $recordTupple["chanid"];=0A=
-		$aRecord->starttime =3D $recordTupple["starttime"];=0A=
+		$aRecord->chanid =3D $recordTuple["chanid"];=0A=
+		$aRecord->channum =3D $recordTuple["channum"];=0A=
+		$aRecord->starttime =3D $recordTuple["starttime"];=0A=
+		$aRecord->endtime =3D $recordTuple["endtime"];=0A=
+		$aRecord->title =3D $recordTuple["title"];=0A=
+		$aRecord->subtitle =3D $recordTuple["subtitle"];=0A=
+		$aRecord->description =3D $recordTuple["description"];=0A=
 		$recordArray[$i] =3D $aRecord;=0A=
 		$i +=3D 1;=0A=
 	}=0A=
@@ -320,5 +343,64 @@=0A=
 	return $programarray;=0A=
 }=0A=
 =0A=
+// Functions added by Russell Hatch=0A=
+=0A=
+// gather info from the allrecord table=0A=
+function setupAllRecordings() {=0A=
+	$theQuery =3D "select * from allrecord order by title asc;";=0A=
+	$recordQuery =3D mysql_query($theQuery) or die("ERROR: Unable to open =
the allrecord table");=0A=
+	$i =3D 0;=0A=
+	while($recordTuple =3D mysql_fetch_array($recordQuery, MYSQL_ASSOC)) {=0A=
+		$aRecord =3D new Recording;=0A=
+		$aRecord->title =3D $recordTuple['title'];=0A=
+		if ($recordTuple['chanid']) { // see if this program is always =
recorded on a certain channel=0A=
+			$aRecord->chanid =3D $recordTuple['chanid'];=0A=
+			$chanQuery =3D mysql_query("select channum from channel where =
chanid=3D\"$aRecord->chanid\";");=0A=
+			$aRow =3D mysql_fetch_row($chanQuery);=0A=
+			$aRecord->channum =3D $aRow[0];=0A=
+		}=0A=
+		$recordArray[$i] =3D $aRecord;=0A=
+		$i++;=0A=
+	}=0A=
+	return($recordArray);=0A=
+}=0A=
+=0A=
+// gather information from the timeslotrecord table=0A=
+function setupTimeSlotRecordings() {=0A=
+	$theQuery =3D "select timeslotrecord.*,channel.channum from =
timeslotrecord,channel where timeslotrecord.chanid=3Dchannel.chanid =
order by title asc;";=0A=
+	$recordQuery =3D mysql_query($theQuery) or die("ERROR: Unable to open =
the timeslotrecord table");;=0A=
+	$i =3D 0;=0A=
+	while($recordTuple =3D mysql_fetch_array($recordQuery, MYSQL_ASSOC))=0A=
+	{=0A=
+		$aRecord =3D new Recording;=0A=
+		$aRecord->chanid =3D $recordTuple["chanid"];=0A=
+		$aRecord->channum =3D $recordTuple["channum"];=0A=
+		$aRecord->starttime =3D $recordTuple["starttime"];=0A=
+		$aRecord->endtime =3D $recordTuple["endtime"];=0A=
+		$aRecord->title =3D $recordTuple["title"];=0A=
+		$recordArray[$i] =3D $aRecord;=0A=
+		$i++;=0A=
+	}=0A=
+	return $recordArray;=0A=
+}=0A=
+=0A=
+// parse the time strings into an array=0A=
+function parseTime($time) {=0A=
+	$theTime['year'] =3D substr($time, 0, 4);=0A=
+	$theTime['month'] =3D substr($time, 4, 2); =0A=
+	$theTime['day'] =3D substr($time, 6, 2);=0A=
+	$theTime['hour'] =3D substr($time, 8, 2);=0A=
+	$theTime['minute'] =3D substr($time, 10, 2);=0A=
+=0A=
+	return($theTime);=0A=
+}=0A=
+=0A=
+// since the timeslotrecord table stores times differently, here is =
another function to parse it=0A=
+function parseTimeSlotTime($time) {=0A=
+	$theTime['hour'] =3D substr($time, 0, 2);=0A=
+	$theTime['minute'] =3D substr($time, 3, 2);=0A=
+	$theTime['second'] =3D substr($time, 6, 2);=0A=
 =0A=
+	return($theTime);=0A=
+}=0A=
 ?>=0A=
Common subdirectories: /root/mythtv/mythweb/images and =
/var/www/mythweb/images=0A=
diff -u /root/mythtv/mythweb/listings.php /var/www/mythweb/listings.php=0A=
--- /root/mythtv/mythweb/listings.php	Sat Nov  9 16:47:51 2002=0A=
+++ /var/www/mythweb/listings.php	Tue Dec  3 15:45:49 2002=0A=
@@ -99,6 +99,7 @@=0A=
 //	Sort down by channels and across by program=0A=
 //=0A=
 $channelindex =3D 0;=0A=
+$timebar =3D 0;=0A=
 while ($mychannel =3D $channelarray[$channelindex])=0A=
 {=0A=
 	print "\t\t<TR><td>" . $mychannel->channum . "<br>" . =0A=
@@ -173,8 +174,9 @@=0A=
 			//	always record or a timeslot=0A=
 			//	record=0A=
 			//=0A=
+			// fixed a bug here, $proginfo->channel should have been =
$proginfo->chanid - Russ=0A=
 			if(isInAlwaysRecord($proginfo->title) || =0A=
-			isInTimeslotRecord($proginfo->channel, $proginfo->startts, =
$proginfo->endts, $proginfo->title))=0A=
+			isInTimeslotRecord($proginfo->chanid, $proginfo->startts, =
$proginfo->endts, $proginfo->title))=0A=
 			{=0A=
 				$proginfo->setColours($list_reccolour, $finalColour);=0A=
 			}=0A=
@@ -186,7 +188,20 @@=0A=
 		$lastsubtitle =3D $proginfo->subtitle;=0A=
 	}=0A=
 	print "\t</tr>\n";=0A=
+=0A=
+	if ($timebar =3D=3D $timeBarCount) { // print the time listing every =
15 channels=0A=
+		print "<tr><td>";=0A=
+		for ($timeslot =3D 0; $timeslot < $timeSlots; $timeslot +=3D 1) {=0A=
+			$theTime =3D $timearray[$timeslot];=0A=
+		    $theTime->setColour($list_fg_colour, $list_bg_colour);=0A=
+			$theTime->printYourself();=0A=
+		}=0A=
+		$timebar =3D 0;=0A=
+		print "</td></tr>";=0A=
+	}=0A=
+=0A=
 	$channelindex +=3D 1;=0A=
+	$timebar +=3D 1;=0A=
 }=0A=
 print "</TABLE></TD></TR></TABLE>\n";=0A=
 =0A=
diff -u /root/mythtv/mythweb/recordings.php =
/var/www/mythweb/recordings.php=0A=
--- /root/mythtv/mythweb/recordings.php	Tue Sep 10 23:08:52 2002=0A=
+++ /var/www/mythweb/recordings.php	Tue Dec  3 15:37:50 2002=0A=
@@ -13,10 +13,120 @@=0A=
 =0A=
 //=0A=
 //	recordings.php lets us see what's in the=0A=
-// 	recordings database. Some day, it may let us=0A=
-//	do something with that content=0A=
+// 	recordings database.=0A=
 //=0A=
 =0A=
-print("<BR><BR><BR><CENTER>Sorry, recordings doesn't do anything =
yet</CENTER><BR><BR><BR>");=0A=
+// return a nice time string to print=0A=
+function getTimeString($time) {=0A=
+	$theTime =3D parseTime($time);=0A=
+	$theHour =3D $theTime['hour'];=0A=
+	if ($theHour > 12) {=0A=
+		$theHour -=3D 12;=0A=
+		$ampm =3D "pm";=0A=
+	}=0A=
+	else $ampm =3D "am";=0A=
+	$returnTime =3D $theTime['month'] . "/" . $theTime['day'] . "/" . =
$theTime['year'] . " " . $theHour . ":" . $theTime['minute'] . $ampm;=0A=
+	return($returnTime);=0A=
+}=0A=
 =0A=
+// delete the program if they hit delete=0A=
+if ($_POST['delete']) dontRecord($_POST['title'], $_POST['chanid'], =
$_POST['starttime']);=0A=
+=0A=
+// gather information from all the recording tables=0A=
+$singlerecordings =3D setupRecordings();=0A=
+$allrecordings =3D setupAllRecordings();=0A=
+$timeslotrecordings =3D setupTimeSlotRecordings();=0A=
+=0A=
+print("<TABLE WIDTH=3D\"100%\" BGCOLOR=3D\"$list_fg_colour\" =
CELLSPACING=3D\"10\" CELLPADDING=3D\"7\"><TR><TD>");=0A=
+=0A=
+// print all the entries from the singlerecord table=0A=
+print("<TABLE BGCOLOR=3D\"$list_fg_colour\" CELLSPACING=3D\"5\" =
CELLPADDING=3D\"5\">");=0A=
+=0A=
+$index =3D 0;=0A=
+if ($singlerecordings[$index]) {=0A=
+	print("<TR VALIGN=3D\"TOP\"><TD></TD><TD>Programs scheduled to record =
once.</TD></TR>");=0A=
+	while ($show =3D $singlerecordings[$index]) {=0A=
+		$starttime =3D getTimeString($show->starttime);=0A=
+		$endtime =3D getTimeString($show->endtime);=0A=
+=0A=
+		print("<form action=3D\"main.php?mode=3Drecordings\" =
method=3D\"post\">");=0A=
+		print("<input type=3D\"hidden\" name=3D\"title\" =
value=3D\"$show->title\"><input type=3D\"hidden\" name=3D\"chanid\" =
value=3D\"$show->chanid\">");=0A=
+		print("<input type=3D\"hidden\" name=3D\"starttime\" =
value=3D\"$show->starttime\"><input type=3D\"hidden\" name=3D\"delete\" =
value=3D\"1\">");=0A=
+		print("<TR VALIGN=3D\"TOP\"><TD>Program:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">");=0A=
+		print("<a =
href=3D\"main.php?mode=3Dsingle&channel=3D$show->chanid&starttime=3D$show=
->starttime\">$show->title</a>");=0A=
+		if ($show->subtitle) print(" - $show->subtitle");=0A=
+		print("</TD><TD><input type=3D\"submit\" name=3D\"deletebutton\" =
value=3D\"Delete\"></TD></TR><TR VALIGN=3D\"TOP\">");=0A=
+		print("<TD>Airdate:</TD><TD BGCOLOR=3D\"$list_bg_colour\">$starttime =
to $endtime on channel $show->channum</TD></TR>");=0A=
+		if ($show->description) print("<TR =
VALIGN=3D\"TOP\"><TD>Description:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$show->description</TD></TR>");=0A=
+		print("<TR></TR><TR></TR></form>");=0A=
+		$index++;=0A=
+	}=0A=
+}=0A=
+else print("<TR><TD>You currently do not have any single programs =
scheduled to record.</TD></TR>");=0A=
+print("</table><br><br>");=0A=
+=0A=
+// print all the time slot recordings=0A=
+print("<TABLE BGCOLOR=3D\"$list_fg_colour\" CELLSPACING=3D\"5\" =
CELLPADDING=3D\"5\">");=0A=
+=0A=
+$index=3D0;=0A=
+if ($timeslotrecordings[$index]) {=0A=
+	print("<TR VALIGN=3D\"TOP\"><TD>Programs scheduled to record in a =
certain time slot</TD></TR>");=0A=
+	while ($show =3D $timeslotrecordings[$index]) {=0A=
+		$starttime =3D parseTimeSlotTime($show->starttime);=0A=
+		$endtime =3D parseTimeSlotTime($show->endtime);=0A=
+=0A=
+		$sHour =3D $starttime['hour'];=0A=
+		if ($sHour > 12) {=0A=
+			$sHour -=3D 12;=0A=
+			$ampm =3D "pm";=0A=
+		}=0A=
+		else $ampm =3D "am";=0A=
+		$sMinute =3D $starttime['minute'];=0A=
+		$starttime =3D $sHour . ":" . $sMinute . $ampm;=0A=
+=0A=
+		$eHour =3D $endtime['hour'];=0A=
+		if ($eHour > 12) {=0A=
+			$eHour -=3D 12;=0A=
+			$ampm =3D "pm";=0A=
+		}=0A=
+		else $ampm =3D "am";=0A=
+		$eMinute =3D $endtime['minute'];=0A=
+		$endtime =3D $eHour . ":" . $eMinute . $ampm;=0A=
+=0A=
+		print("<form action=3D\"main.php?mode=3Drecordings\" =
method=3D\"post\">");=0A=
+		print("<input type=3D\"hidden\" name=3D\"title\" =
value=3D\"$show->title\"><input type=3D\"hidden\" name=3D\"chanid\" =
value=3D\"$show->chanid\">");=0A=
+		print("<input type=3D\"hidden\" name=3D\"starttime\" =
value=3D\"$show->starttime\"><input type=3D\"hidden\" name=3D\"delete\" =
value=3D\"1\">");=0A=
+		print("<TR VALIGN=3D\"TOP\" =
BGCOLOR=3D\"$list_bg_colour\"><TD>$show->title</TD>");=0A=
+		print("<TD>$starttime to $endtime on channel $show->channum</TD>");=0A=
+		print("<TD BGCOLOR=3D\"$list_fg_colour\"><input type=3D\"submit\" =
name=3D\"deletebutton\" value=3D\"Delete\"></TR></form>");=0A=
+		$index++;=0A=
+	}=0A=
+}=0A=
+else print("<TR><TD>You currently do not have any time slots scheduled =
to record</TD></TR>");=0A=
+print("</table><br><br>");=0A=
+=0A=
+// print the shows that are always set to record=0A=
+print("<TABLE BGCOLOR=3D\"$list_fg_colour\" CELLSPACING=3D\"5\" =
CELLPADDING=3D\"5\">");=0A=
+=0A=
+$index=3D0;=0A=
+if ($allrecordings[$index]) {=0A=
+	print("<TR VALIGN=3D\"TOP\"><TD>Programs scheduled to always =
record</TD></TR>");=0A=
+	while ($show =3D $allrecordings[$index]) {=0A=
+		$theTitle =3D $show->title;=0A=
+		$theChanId =3D $show->chanid;=0A=
+		$theChannel =3D $show->channum;=0A=
+		print("<form action=3D\"main.php?mode=3Drecordings\" =
method=3D\"post\">");=0A=
+		print("<input type=3D\"hidden\" name=3D\"title\" =
value=3D\"$theTitle\"><input type=3D\"hidden\" name=3D\"chanid\" =
value=3D\"");=0A=
+		if ($theChanId) print($theChanId);=0A=
+		else print("NULL");=0A=
+		print("\"><input type=3D\"hidden\" name=3D\"starttime\" =
value=3D\"NULL\"><input type=3D\"hidden\" name=3D\"delete\" =
value=3D\"1\">");=0A=
+		print("<TR VALIGN=3D\"TOP\"><TD =
BGCOLOR=3D\"$list_bg_colour\">$theTitle");=0A=
+		if ($theChanId) print(" on channel $theChannel");=0A=
+		print("</TD><TD><input type=3D\"submit\" name=3D\"deletebutton\" =
value=3D\"Delete\"></TD></TR></form>");=0A=
+		$index++;=0A=
+	}=0A=
+}=0A=
+else print("<TR><TD>You currently do not have any programs set to =
always record.</TD></TR>");=0A=
+print("</table><br><br>");=0A=
+print("</td></tr></table>");=0A=
 ?>=0A=
diff -u /root/mythtv/mythweb/search.php /var/www/mythweb/search.php=0A=
--- /root/mythtv/mythweb/search.php	Thu Nov 14 00:12:48 2002=0A=
+++ /var/www/mythweb/search.php	Tue Dec  3 14:34:18 2002=0A=
@@ -157,7 +157,7 @@=0A=
 if(strlen($theQuery) > 0)=0A=
 {=0A=
 	$searchingSomething =3D FALSE;=0A=
-	$queryString =3D "select chanid, starttime, endtime, title from =
program ";=0A=
+	$queryString =3D "select channel.channum, starttime, endtime, title, =
program.chanid from program,channel ";=0A=
 	//=0A=
 	//	Figure out which columns to query=0A=
 	//=0A=
@@ -213,6 +213,9 @@=0A=
 		$searchingSomething =3D TRUE;=0A=
 	}=0A=
 	=0A=
+	// Get the actual channel its on instead of the chanid=0A=
+	$queryString .=3D ") AND channel.chanid =3D program.chanid";=0A=
+=0A=
 	//=0A=
 	//	Set the sorting order=0A=
 	//=0A=
@@ -221,18 +224,16 @@=0A=
 	=0A=
 	if($searchtime =3D=3D "forward")=0A=
 	{=0A=
-		$queryString .=3D ") AND starttime > \"$rightNow\" ORDER BY starttime =
ASC " ;=0A=
+		$queryString .=3D " AND starttime > \"$rightNow\"  ORDER BY starttime =
ASC " ;=0A=
 	}=0A=
 	elseif($searchtime =3D=3D "backward")=0A=
 	{=0A=
-		$queryString .=3D " ) AND starttime < \"$rightNow\" ORDER BY =
starttime DESC " ;=0A=
+		$queryString .=3D "  AND starttime < \"$rightNow\" ORDER BY starttime =
DESC " ;=0A=
 	}=0A=
 	else=0A=
 	{=0A=
-		$queryString .=3D " ) ORDER BY starttime ASC " ;=0A=
+		$queryString .=3D " ORDER BY starttime ASC " ;=0A=
 	}=0A=
-=0A=
-	=0A=
 		=0A=
 	if($searchingSomething =3D=3D TRUE)=0A=
 	{=0A=
@@ -283,13 +284,19 @@=0A=
 				print("$theDate");=0A=
 				print("</TD>");=0A=
 	=0A=
-				$theTime =3D substr($searchRow[1], 8, 2) . ":" . =
substr($searchRow[1], 10, 2);=0A=
+				$theHour =3D substr($searchRow[1], 8, 2);=0A=
+				if ($theHour > 12) {=0A=
+					$theHour -=3D 12;=0A=
+					$ampm =3D "pm";=0A=
+				}=0A=
+				else $ampm =3D "am";=0A=
+				$theTime =3D $theHour . ":" . substr($searchRow[1], 10, 2) . $ampm;=0A=
 				print("<TD BGCOLOR=3D\"$list_bg_colour\">");=0A=
 				print("$theTime");=0A=
 				print("</TD>");=0A=
 =0A=
 				print("<TD BGCOLOR=3D\"$list_bg_colour\">");=0A=
-				print("<A =
HREF=3D\"main.php?mode=3Dsingle&channel=3D$searchRow[0]&starttime=3D$sear=
chRow[1]&endtime=3D$searchRow[2]&refoffset=3D0\">$searchRow[3]</A>");=0A=
+				print("<A =
HREF=3D\"main.php?mode=3Dsingle&channel=3D$searchRow[4]&starttime=3D$sear=
chRow[1]&endtime=3D$searchRow[2]&refoffset=3D0\">$searchRow[3]</A>");=0A=
 				print("</TD>");=0A=
 =0A=
 				print("</TR>");=0A=
diff -u /root/mythtv/mythweb/settings.php /var/www/mythweb/settings.php=0A=
--- /root/mythtv/mythweb/settings.php	Thu Sep 12 11:47:46 2002=0A=
+++ /var/www/mythweb/settings.php	Tue Dec  3 14:53:06 2002=0A=
@@ -33,6 +33,7 @@=0A=
 	=0A=
 	$timeSlots		=3D 6;		// How many 30 minute columns to display =0A=
 	$includeDescription	=3D "TRUE"; 	// Anything but "TRUE" is false=0A=
+	$timeBarCount =3D 15; // How many lines to skip before redisplaying =
the timebar on the listings=0A=
 =0A=
 	//=0A=
 	//	Default Search=0A=
@@ -63,22 +64,26 @@=0A=
 	$list_fg_colour =3D "#3181B4";=0A=
 	$list_reccolour =3D "#FF0000";=0A=
 	$movie_colour	=3D "#AAAAFF";=0A=
+	$link_color		=3D "#3181B4";=0A=
+	$link_visited_color	=3D "#3181B4";=0A=
+	$link_active_color	=3D "#990033";=0A=
+	$link_hover_color	=3D "#CC0000";=0A=
 =0A=
 	$colorArray["Sports"] =3D "#FFCC00";=0A=
 	$colorArray["Sport - Events"] =3D "#FFCCOO";=0A=
-	$colorArray["Talk"] =3D "#FFCCCC";=0A=
-	$colorArray["News"] =3D "#99CCFF";=0A=
-	$colorArray["Comedy"] =3D "#AAAACC";=0A=
-	$colorArray["Children"] =3D "#CC99FF";=0A=
-	$colorArray["Children's"] =3D "#CC99FF";=0A=
+	$colorArray["Talk"] =3D "#CCCCCC";=0A=
+	$colorArray["News"] =3D "#9999CC";=0A=
+	$colorArray["Comedy"] =3D "#CCCCCC";=0A=
+	$colorArray["Children"] =3D "#CCFFCC";=0A=
+	$colorArray["Children's"] =3D "#CCFFCC";=0A=
 	$colorArray["Reality"] =3D "#EEDD99";=0A=
-	$colorArray["Soap"] =3D "#CC99CC";=0A=
-	$colorArray["Soaps"] =3D "#CC99CC";=0A=
-	$colorArray["Drama"] =3D "#AACCCC";=0A=
-	$colorArray["Edu"] =3D "#DC143C";=0A=
-	$colorArray["Educational"] =3D "#DC143C";=0A=
-	$colorArray["Doc"] =3D "#BC8F8F";=0A=
-	$colorArray["Documentary"] =3D "#BC8F8F";=0A=
+	$colorArray["Soap"] =3D "#CCCCCC";=0A=
+	$colorArray["Soaps"] =3D "#CCCCCC";=0A=
+	$colorArray["Drama"] =3D "#CCCCCC";=0A=
+	$colorArray["Edu"] =3D "#CCCCCC";=0A=
+	$colorArray["Educational"] =3D "#CCCCCC";=0A=
+	$colorArray["Doc"] =3D "#FFFFCC";=0A=
+	$colorArray["Documentary"] =3D "#FFFFCC";=0A=
 	$colorArray["Nature"] =3D "#309930";=0A=
 	$colorArray["House/Garden"] =3D "#309930";=0A=
 	$colorArray["Cooking"] =3D "#309930";=0A=
diff -u /root/mythtv/mythweb/single.php /var/www/mythweb/single.php=0A=
--- /root/mythtv/mythweb/single.php	Fri Sep 27 15:06:20 2002=0A=
+++ /var/www/mythweb/single.php	Tue Dec  3 14:37:22 2002=0A=
@@ -50,7 +50,14 @@=0A=
 		//=0A=
 		//	We want to always record this program=0A=
 		//=0A=
-		recordAlways($theProgram);=0A=
+		recordAlways($theProgram, FALSE);=0A=
+	}=0A=
+	if($theRecordSettings =3D=3D "RC")=0A=
+	{=0A=
+		//=0A=
+		//	We want to always record this program on this channel=0A=
+		//=0A=
+		recordAlways($theProgram, $theChannel);=0A=
 	}=0A=
 	if($theRecordSettings =3D=3D "RO")=0A=
 	{=0A=
@@ -115,23 +122,22 @@=0A=
 		print("</FORM>");=0A=
 		print("</CENTER></TD>");=0A=
 	}=0A=
-	print("</TR><TR VALIGN=3D\"TOP\"><TD>Category:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[6]</TD></TR>");=0A=
-	if(strlen($aRow[4]) > 0)=0A=
-	{=0A=
-		print("<TR VALIGN=3D\"TOP\"><TD>Episode:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[4]</TD></TR>");=0A=
-	}=0A=
+	if(strlen($aRow[6]) > 0) print("</TR><TR =
VALIGN=3D\"TOP\"><TD>Category:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[6]</TD></TR>");=0A=
+	if(strlen($aRow[4]) > 0) print("<TR =
VALIGN=3D\"TOP\"><TD>Episode:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[4]</TD></TR>");=0A=
 	print("<TR VALIGN=3D\"TOP\"><TD>Channel:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[10]</TD></TR>");=0A=
-	print("<TR VALIGN=3D\"TOP\"><TD>Description:</TD><TD WIDTH=3D\"300\" =
BGCOLOR=3D\"$list_bg_colour\">$aRow[5]</TD></TR>");=0A=
+	if(strlen($aRow[5]) > 0) print("<TR =
VALIGN=3D\"TOP\"><TD>Description:</TD><TD WIDTH=3D\"300\" =
BGCOLOR=3D\"$list_bg_colour\">$aRow[5]</TD></TR>");=0A=
 	if($aRow[8] > 12)=0A=
 	{=0A=
 		$aRow[8] -=3D 12;=0A=
+		$ampm =3D pm;=0A=
 	}=0A=
-	if($aRow[9] < 10)=0A=
+	else $ampm =3D am;=0A=
+	if($aRow[9] < 10) // i'm not doing to modify this, but is this desired =
behavior? -- Russ=0A=
 	{=0A=
 		$aRow[9] =3D "0" . $aRow[9];=0A=
 	}=0A=
-	print("<TR VALIGN=3D\"TOP\"><TD>Start:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[8]:$aRow[9]</TD></TR>");=0A=
-	print("<TR VALIGN=3D\"TOP\"><TD>Duration:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[7]</TD></TR>");=0A=
+	print("<TR VALIGN=3D\"TOP\"><TD>Start:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[8]:$aRow[9]$ampm</TD></TR>");=0A=
+	print("<TR VALIGN=3D\"TOP\"><TD>Duration:</TD><TD =
BGCOLOR=3D\"$list_bg_colour\">$aRow[7] minutes</TD></TR>");=0A=
 =0A=
 	//=0A=
 	//	Need to check if this is being recorded=0A=
@@ -141,6 +147,7 @@=0A=
 	=0A=
 	$isBeingSingleRecorded =3D FALSE;=0A=
 	$isBeingTimeslotRecorded =3D isInTimeslotRecord($aRow[0], $aRow[1], =
$aRow[2], $aRow[3]);=0A=
+	$isBeingChannelAlwaysRecorded =3D isInChannelAlwaysRecord($aRow[0], =
$aRow[3]);=0A=
 	$isBeingAlwaysRecorded =3D isInAlwaysRecord($aRow[3]);=0A=
 	$recordArrayIndex =3D 0;=0A=
 	while($aRecord =3D $recordArray[$recordArrayIndex])=0A=
@@ -183,12 +190,19 @@=0A=
 	}=0A=
 	print(">Record this program in this timeslot every day<BR>");=0A=
 =0A=
+	print("<INPUT TYPE=3D\"RADIO\" NAME=3D\"recordsettings\" =
VALUE=3D\"RC\" ");=0A=
+	if($isBeingChannelAlwaysRecorded =3D=3D TRUE)=0A=
+	{=0A=
+		print("CHECKED ");=0A=
+	}=0A=
+	print(">Always record this program on this channel<BR>");=0A=
+=0A=
 	print("<INPUT TYPE=3D\"RADIO\" NAME=3D\"recordsettings\" =
VALUE=3D\"RA\" ");=0A=
-	if($isBeingAlwaysRecorded =3D=3D TRUE)=0A=
+	if($isBeingAlwaysRecorded =3D=3D TRUE && =
!$isBeingChannelAlwaysRecorded)=0A=
 	{=0A=
 		print("CHECKED ");=0A=
 	}=0A=
-	print(">Always record this program<BR><BR>");=0A=
+	print(">Always record this program wherever<BR><BR>");=0A=
 =0A=
 	print("<INPUT TYPE=3D\"HIDDEN\" NAME=3D\"mode\" VALUE=3D\"single\">");=0A=
 	print("<INPUT TYPE=3D\"HIDDEN\" NAME=3D\"channel\" =
VALUE=3D\"$theChannel\">");=0A=

------=_NextPart_000_000C_01C29AE7.79CC7300--