Ticket #2139: search.patch

File search.patch, 2.4 KB (added by myth@…, 18 years ago)

patch to indicate previously recorded, or up coming recordings for canned search

  • default/search.php

    old new  
    146146        </td>
    147147    </tr><?php
    148148            }
     149
     150    $dquery = "select *,UNIX_TIMESTAMP(`starttime`) as `starttime` from `oldrecorded` where `title`='".mysql_escape_string($show->title)."' and
     151                `subtitle`='".mysql_escape_string($show->subtitle)."' and
     152                `description`='".mysql_escape_string($show->description)."'";
     153    $dres = mysql_query($dquery);
     154    if(mysql_num_rows($dres) <= 0)
     155    {
     156        $extraclass = "";
     157    } else {
     158        $drow = mysql_fetch_assoc($dres);
     159        if($show->starttime > $drow['starttime'])
     160                $extraclass = " rec_class record_duplicate PreviousRecording";
     161        if($show->starttime < $drow['starttime'])
     162                $extraclass = " rec_class record_duplicate CurrentRecording";
     163    }
     164
     165    if($extraclass == "")
     166    {
     167        $dquery = "select *,UNIX_TIMESTAMP(CONCAT(`startdate`,' ',`starttime`)) as `starttime` from `record` where
     168                    `title`='".mysql_escape_string($show->title)."' and
     169                    `subtitle`='".mysql_escape_string($show->subtitle)."' and
     170                    `description`='".mysql_escape_string($show->description)."'";
     171        $dres = mysql_query($dquery);
     172        if(mysql_num_rows($dres) <= 0)
     173        {
     174            $extraclass = "";
     175        } else {
     176            $drow = mysql_fetch_assoc($dres);
     177            if($show->starttime > $drow['starttime'])
     178                $extraclass = " rec_class record_duplicate PreviousRecording";
     179            if($show->starttime < $drow['starttime'])
     180                $extraclass = " rec_class record_duplicate CurrentRecording";
     181        }
     182    }
     183
     184    if($extraclass == "")
     185    {
     186        $dquery = "select `title` from `record` where `title`='".mysql_escape_string($show->title)."' and `type`='3'";
     187        $dres = mysql_query($dquery);
     188        if(mysql_num_rows($dres) <= 0)
     189        {
     190            $extraclass = "";
     191        } else {
     192            $extraclass = " rec_class will_record WillRecord";
     193        }
     194    }
     195
    149196    // Print the content
    150     ?><tr class="<?php echo $show->class ?>" valign="top">
     197    ?><tr class="<?php echo $show->class ?><?=$extraclass?>" valign="top">
    151198    <?php if (!empty($group_field)) echo "<td class=\"list\">&nbsp;</td>\n" ?>
    152     <td class="<?php echo $show->class ?>"><?php
     199    <td class="<?php echo $show->class ?><?=$extraclass?>"><?php
    153200        if ($show->hdtv)
    154201            echo '<span class="hdtv_icon">HD</span>';
    155202        echo '<a href="', root, 'tv/detail/', $show->chanid, '/', $show->starttime, '">',