Index: mythweb/config/conf.php
===================================================================
--- mythweb/config/conf.php	(revision 8514)
+++ mythweb/config/conf.php	(working copy)
@@ -92,7 +92,17 @@
     define('star_character', '&diams;');    // the character(s) to represent stars with
 
 /*
+ 
+    The following constants are defined for TV listings
 
+*/
+
+// Enable to also mark TV listings in the "oldrecorded" table. Provides more information,
+// but may slow down mythweb if "oldrecorded" is very large.
+    define('tv_listings_mark_old_duplicate', false);
+
+/*
+
     The following constants are defined for the recorded programs page
 
 */
Index: mythweb/includes/programs.php
===================================================================
--- mythweb/includes/programs.php	(revision 8514)
+++ mythweb/includes/programs.php	(working copy)
@@ -115,14 +115,26 @@
             trigger_error("load_all_program_data() attempted with an empty \$Channels array", FATAL);
         $these_channels = implode(',', $these_channels);
     // Build the sql query, and execute it
-        $query = 'SELECT program.*,'
-                 .' UNIX_TIMESTAMP(program.starttime) AS starttime_unix,'
-                 .' UNIX_TIMESTAMP(program.endtime) AS endtime_unix,'
-                 .' CONCAT(repeat('.escape(star_character).', program.stars * '.escape(max_stars).'), IF((program.stars * '.escape(max_stars).' * 10) % 10, "&frac12;", "")) AS starstring,'
-                 .' IFNULL(programrating.system, "") AS rater,'
-                 .' IFNULL(programrating.rating, "") AS rating'
-                 .' FROM program LEFT JOIN programrating USING (chanid, starttime)'
-                 .' WHERE';
+        $query = 'SELECT program.*'
+                 .',UNIX_TIMESTAMP(program.starttime) AS starttime_unix'
+                 .',UNIX_TIMESTAMP(program.endtime) AS endtime_unix'
+                 .',CONCAT(repeat('.escape(star_character)
+                 .', program.stars * '.escape(max_stars)
+                 .'), IF((program.stars * '.escape(max_stars)
+                 .' * 10) % 10, "&frac12;", "")) AS starstring'
+                 .',IFNULL(programrating.system, "") AS rater'
+                 .',IFNULL(programrating.rating, "") AS rating';
+        if (tv_listings_mark_old_duplicate) {
+            $query .= ',oldrecorded.recstatus'
+                . ' FROM (program'
+                . '     LEFT JOIN oldrecorded'
+                . '     USING (seriesid, programid))';
+        } else {
+            $query .= ' FROM program';
+        }
+        $query .= ' LEFT JOIN programrating'
+                . ' USING (chanid, starttime)'
+                . ' WHERE';
     // Only loading a single channel worth of information
         if ($chanid > 0)
             $query .= ' program.chanid='.escape($chanid);
@@ -314,9 +326,6 @@
             $this->auto_expire  = ($progflags & 0x04) ? true : false;    // FL_AUTOEXP   = 0x04
             $this->is_editing   = ($progflags & 0x08) ? true : false;    // FL_EDITING   = 0x08
             $this->bookmark     = ($progflags & 0x10) ? true : false;    // FL_BOOKMARK  = 0x10
-        // Turn recstatus into a word
-            if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus])
-                $this->recstatus = $GLOBALS['RecStatus_Types'][$this->recstatus];
         // Add a generic "will record" variable, too
             $this->will_record = ($this->rectype && $this->rectype != rectype_dontrec) ? true : false;
         }
@@ -348,6 +357,7 @@
             $this->colorcode               = $data['colorcode'];
             $this->syndicatedepisodenumber = $data['syndicatedepisodenumber'];
             $this->title_pronounce         = $data['title_pronounce'];
+            $this->recstatus               = $data['recstatus'];
 
             if ($program_data['tsdefault']) {
                 $this->timestretch = $program_data['tsdefault'];
@@ -355,6 +365,11 @@
                 $this->timestretch = 1.0;
             }
         }
+
+    // Turn recstatus into a word
+        if (isset($this->recstatus) && $GLOBALS['RecStatus_Types'][$this->recstatus])
+            $this->recstatus = $GLOBALS['RecStatus_Types'][$this->recstatus];
+
     // No longer a null column, so check for blank entries
         if ($this->airdate == '0000-00-00')
             $this->airdate = NULL;
Index: mythweb/includes/css.php
===================================================================
--- mythweb/includes/css.php	(revision 8514)
+++ mythweb/includes/css.php	(working copy)
@@ -47,7 +47,7 @@
     status.
 */
     function recstatus_class(&$item) {
-        if ($item->recordid && !strcasecmp(get_class($item), 'program')) {
+        if ($item->recstatus && !strcasecmp(get_class($item), 'program')) {
             switch ($item->recstatus) {
                 case 'ForceRecord':
                     return 'record_override_record';
@@ -59,6 +59,8 @@
                 case 'PreviousRecording':
                 case 'CurrentRecording':
                     return 'record_duplicate';
+                case 'Recorded':
+                    return 'record_old_duplicate';
                 case 'ManualOverride':
                 case 'Cancelled':
                     return 'record_override_suppress';
