Ticket #5496: my.diff

File my.diff, 11.3 KB (added by Bradley Bell <bradleyb@…>, 16 years ago)
  • includes/sorting.php

     
    161161        return strnatcasecmp($a->channel->channum, $b->channel->channum);
    162162    }
    163163
     164    function by_originalairdate(&$a, &$b) {
     165        return strnatcasecmp($a->airdate, $b->airdate);
     166    }
     167
     168    function by_episodenumber(&$a, &$b) {
     169        return strnatcasecmp($a->syndicatedepisodenumber, $b->syndicatedepisodenumber);
     170    }
     171
    164172    function by_airdate(&$a, &$b) {
    165173        if ($a->starttime == $b->starttime) return 0;
    166174        return ($a->starttime > $b->starttime) ? 1 : -1;
  • modules/tv/classes/Program.php

     
    335335    // Get a nice description with the full details
    336336        $details = array();
    337337
     338        if (!isset($this->syndicatedepisodenumber)) {
     339        // Get some data from SQL that the backend doesn't provide
     340            $query  = 'SELECT partnumber, parttotal, syndicatedepisodenumber FROM program'
     341                     .' WHERE chanid='.escape($this->chanid)
     342                     .' AND starttime=FROM_UNIXTIME('.escape($this->starttime).')';
     343            $result = mysql_query($query)
     344                or trigger_error('SQL Error: '.mysql_error(), FATAL);
     345            list($this->partnumber, $this->parttotal, $this->syndicatedepisodenumber) = mysql_fetch_row($result);
     346            mysql_free_result($result);
     347        }
     348
    338349        if ($this->hdtv)
    339350            $details[] = t('HDTV');
    340351        if ($this->widescreen)
  • modules/tv/upcoming.php

     
    6565        $_SESSION['scheduled_recordings']['disp_duplicates']  = $_POST['disp_duplicates']  ? true : false;
    6666        $_SESSION['scheduled_recordings']['disp_deactivated'] = $_POST['disp_deactivated'] ? true : false;
    6767        $_SESSION['scheduled_recordings']['disp_conflicts']   = $_POST['disp_conflicts']   ? true : false;
     68        $_SESSION['scheduled_recordings']['disp_recgroup']    = $_POST['disp_recgroup'];
     69        $_SESSION['scheduled_recordings']['disp_title']       = $_POST['disp_title'];
    6870    }
    6971
    7072// Defaults
     
    8183    }
    8284
    8385    if (!is_array($_SESSION['tv']['settings']['screens']['upcoming']))
    84         $_SESSION['tv']['settings']['screens']['upcoming'] = array('title' => 'on', 'channel' => 'on', 'recdate' => 'on', 'length' => 'on');
     86        $_SESSION['tv']['settings']['screens']['upcoming'] = array('title' => 'on', 'channel' => 'on', 'record date' => 'on', 'length' => 'on');
    8587
    8688// Parse the list of scheduled recordings
    8789    global $Scheduled_Recordings;
     
    9193        foreach ($shows as $starttime => $show_group) {
    9294        // Parse each show group
    9395            foreach ($show_group as $key => $show) {
     96                $Groups[$show->recgroup]++;
    9497            // Skip things we've already recorded (or missed)
    9598                if ($starttime <= time() && $show->recstatus != 'Recording')
    9699                    continue;
    97100            // Make sure this is a valid show (ie. skip in-progress recordings and other junk)
    98101                if (!$callsign || $show->length < 1)
    99102                    continue;
     103                $Program_Titles[$show->title]++;
    100104            // Skip scheduled shows?
    101105                if (in_array($show->recstatus, array('WillRecord', 'ForceRecord'))) {
    102106                    if (!$_SESSION['scheduled_recordings']['disp_scheduled'])
     
    117121                    if (!$_SESSION['scheduled_recordings']['disp_deactivated'])
    118122                        continue;
    119123                }
     124            // Show specific recgroup only
     125                if ($_SESSION['scheduled_recordings']['disp_recgroup'] && $show->recgroup != $_SESSION['scheduled_recordings']['disp_recgroup'])
     126                    continue;
     127            // Show specific title only
     128                if ($_SESSION['scheduled_recordings']['disp_title'] && $show->title != $_SESSION['scheduled_recordings']['disp_title'])
     129                    continue;
    120130            // Assign a reference to this show to the various arrays
    121131                $all_shows[] =& $Scheduled_Recordings[$callsign][$starttime][$key];
    122132            }
     
    127137    if (count($all_shows))
    128138        sort_programs($all_shows, 'scheduled_sortby');
    129139
     140    uksort($Groups, 'by_no_articles');
     141    uksort($Program_Titles, 'by_no_articles');
     142
    130143// Load the class for this page
    131144    require tmpl_dir.'upcoming.php';
    132145
  • modules/tv/tmpl/default/set_screens.php

     
    2121    <fieldset>
    2222        <legend><?php echo t('Upcoming Recordings'); ?></legend>
    2323        <?php
    24             foreach (array('title', 'channel', 'airdate', 'record date', 'length') as $option) {
     24            foreach (array('title', 'original airdate', 'episode number', 'channel', 'recording group', 'airdate', 'record date', 'length') as $option) {
    2525                echo '<input type="checkbox" name="upcoming['.$option.']" id="upcoming['.$option.']" ';
    2626                if ($_SESSION['tv']['settings']['screens']['upcoming'][$option] == 'on')
    2727                    echo 'checked';
  • modules/tv/tmpl/default/upcoming.php

     
    9999        <?php echo t('Conflicts') ?></label>
    100100        </td>
    101101</tr>
     102<tr>
     103    <td colspan="5">
     104<?php if (count($Groups) > 1) { ?>
     105    <select name="disp_recgroup" onchange="$('change_display').submit()">
     106        <option id="All groups" value=""><?php echo t('All groups') ?></option><?php
     107        foreach($Groups as $recgroup => $count) {
     108            echo '<option id="Group '.htmlspecialchars($recgroup).'" value="'.htmlspecialchars($recgroup).'"';
     109            if ($_SESSION['scheduled_recordings']['disp_recgroup'] == $recgroup)
     110                echo ' SELECTED';
     111            echo '>'.html_entities($recgroup)
     112                .' ('.tn('$1 episode', '$1 episodes', $count)
     113                .')</option>';
     114        }
     115        ?>
     116    </select>
     117<?php
     118    }
     119?>
     120    <select name="disp_title" onchange="$('change_display').submit()">
     121        <option id="All titles" value="">All titles</option>
     122<?php
     123        foreach($Program_Titles as $title => $count) {
     124            echo '<option id="Title '.htmlspecialchars($title).'" value="'.htmlspecialchars($title).'"';
     125            if ($_SESSION['scheduled_recordings']['disp_title'] == $title)
     126                echo ' SELECTED';
     127            echo '>'.html_entities($title)
     128                .($count > 1 ? ' ('.tn('$1 episode', '$1 episodes', $count).')' : "")
     129                ."</option>\n";
     130        }
     131?>
     132    </select>
     133    </td>
     134</tr>
     135
    102136</table>
    103137
    104138</form>
     
    109143        <th class="x-status"><?php  echo t('Status') ?></th>
    110144    <?php if ($_SESSION['tv']['settings']['screens']['upcoming']['title'] == 'on') { ?>
    111145        <th class="x-title"><?php   echo get_sort_link('title',   t('Title'))   ?></th>
     146    <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['original airdate'] == 'on') { ?>
     147        <th class="x-originalairdate"><?php echo get_sort_link('originalairdate', t('Original Airdate')) ?></th>
     148    <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['episode number'] == 'on') { ?>
     149        <th class="x-episodenumber"><?php echo get_sort_link('episodenumber', t('Episode Number')) ?></th>
    112150    <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['channel'] == 'on') { ?>
    113151        <th class="x-channum"><?php echo get_sort_link('channum', t('Channel')) ?></th>
     152    <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['recording group'] == 'on') { ?>
     153        <th class="x-recgroup"><?php echo get_sort_link('recgroup', t('Recording Group')) ?></th>
    114154    <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['airdate'] == 'on') { ?>
    115155        <th class="x-airdate"><?php echo get_sort_link('airdate', t('Airdate')) ?></th>
    116156    <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['record date'] == 'on') { ?>
     
    302342
    303343        if ( $cur_group != $prev_group && $group_field != '' ) {
    304344?><tr class="list_separator">
    305     <td colspan="10" class="list_separator"><?php echo $cur_group ?></td>
     345    <td colspan="<?php echo 4 + count($_SESSION['tv']['settings']['screens']['upcoming']) ?>" class="list_separator"><?php echo $cur_group ?></td>
    306346</tr><?php
    307347        }
    308348
     
    314354        if ($_SESSION['tv']['settings']['screens']['upcoming']['title'] == 'on') {
    315355            ?>
    316356                <td class="x-title <?php echo $show->css_class ?>"><?php
     357                    if ($show->hdtv)
     358                        echo '<span class="hdtv_icon">HD</span>';
     359                    if ($show->starstring)
     360                        echo '<span class="starstring" style="float: right">'.$show->starstring.'</span>';
    317361                // Print the link to edit this scheduled recording
    318362                    echo '<a id="program-'.$show->chanid.'-'.$show->starttime.'"';
    319363                    if ($_SESSION["show_popup_info"]) {
     
    338382                </td>
    339383            <?php
    340384        }
     385        if ($_SESSION['tv']['settings']['screens']['upcoming']['original airdate'] == 'on') {
     386            ?>
     387                <td class="x-originalairdate"><?php echo $show->airdate ?></td>
     388            <?php
     389        }
     390        if ($_SESSION['tv']['settings']['screens']['upcoming']['episode number'] == 'on') {
     391            ?>
     392                <td class="x-episodenumber"><?php echo $show->syndicatedepisodenumber ?></td>
     393            <?php
     394        }
    341395        if ($_SESSION['tv']['settings']['screens']['upcoming']['channel'] == 'on') {
    342396            ?>
    343397                <td class="x-channum"><?php echo $show->channel->channum, ' - ', $show->channel->name ?></td>
    344398            <?php
    345399        }
     400        if ($_SESSION['tv']['settings']['screens']['upcoming']['recording group'] == 'on') {
     401            ?>
     402                <td class="x-recgroup"><?php echo $show->recgroup ?></td>
     403            <?php
     404        }
    346405        if ($_SESSION['tv']['settings']['screens']['upcoming']['airdate'] == 'on') {
    347406            ?>
    348407                <td class="x-airdate"><?php echo strftime($_SESSION['date_scheduled'], $show->starttime) ?></td>
  • skins/default/tv_upcoming.css

     
    5252}
    5353#listings th.x-title {
    5454}
     55#listings th.x-originalairdate {
     56}
     57#listings th.x-episodenumber {
     58}
    5559#listings th.x-channum {
    5660}
     61#listings th.x-recgroup {
     62}
    5763#listings th.x-airdate {
    5864}
    5965#listings th.x-length {
     
    6470}
    6571#listings td.x-title {
    6672}
     73#listings td.x-originalairdate {
     74}
     75#listings td.x-episodenumber {
     76}
    6777#listings td.x-channum {
    6878}
     79#listings td.x-recgroup {
     80}
    6981#listings td.x-airdate {
    7082    white-space:        nowrap;
    7183}