--- tmpl.orig/default/search.php	2006-07-20 00:39:27.495938803 -0400
+++ tmpl/default/search.php	2006-08-09 01:18:50.000000000 -0400
@@ -146,10 +146,58 @@
         </td>
     </tr><?php
             }
+
+    $dquery = "select *,UNIX_TIMESTAMP(`starttime`) as `starttime` from `oldrecorded` where `title`='".mysql_escape_string($show->title)."' and
+		`subtitle`='".mysql_escape_string($show->subtitle)."' and
+		`description`='".mysql_escape_string($show->description)."'";
+    $dres = mysql_query($dquery);
+    if(mysql_num_rows($dres) <= 0)
+    {
+	$extraclass = "";
+    } else {
+	$drow = mysql_fetch_assoc($dres);
+	if($show->starttime > $drow['starttime'])
+		$extraclass = " rec_class record_duplicate PreviousRecording";
+	if($show->starttime < $drow['starttime'])
+		$extraclass = " rec_class record_duplicate CurrentRecording";
+    }
+
+    if($extraclass == "")
+    {
+	$dquery = "select *,UNIX_TIMESTAMP(CONCAT(`startdate`,' ',`starttime`)) as `starttime` from `record` where
+		    `title`='".mysql_escape_string($show->title)."' and
+		    `subtitle`='".mysql_escape_string($show->subtitle)."' and
+		    `description`='".mysql_escape_string($show->description)."'";
+	$dres = mysql_query($dquery);
+	if(mysql_num_rows($dres) <= 0)
+	{
+	    $extraclass = "";
+	} else {
+	    $drow = mysql_fetch_assoc($dres);
+	    if($show->starttime > $drow['starttime'])
+		$extraclass = " rec_class record_duplicate PreviousRecording";
+	    if($show->starttime < $drow['starttime'])
+		$extraclass = " rec_class record_duplicate CurrentRecording";
+	}
+    }
+
+    if($extraclass == "")
+    {
+	$dquery = "select `title` from `record` where `title`='".mysql_escape_string($show->title)."' and `type`='3'";
+	$dres = mysql_query($dquery);
+	if(mysql_num_rows($dres) <= 0)
+	{
+	    $extraclass = "";
+	} else {
+	    $extraclass = " rec_class will_record WillRecord";
+	}
+    }
+
     // Print the content
-    ?><tr class="<?php echo $show->class ?>" valign="top">
+    ?><tr class="<?php echo $show->class ?><?=$extraclass?>" valign="top">
     <?php if (!empty($group_field)) echo "<td class=\"list\">&nbsp;</td>\n" ?>
-    <td class="<?php echo $show->class ?>"><?php
+    <td class="<?php echo $show->class ?><?=$extraclass?>"><?php
         if ($show->hdtv)
             echo '<span class="hdtv_icon">HD</span>';
         echo '<a href="', root, 'tv/detail/', $show->chanid, '/', $show->starttime, '">',
