Ticket #8604: mythweb.patch

File mythweb.patch, 2.2 KB (added by Raymond Wagner, 10 years ago)
  • modules/tv/classes/Channel.php

     
    3131    public $visible;
    3232    public $programs = array();
    3333
    34     public static function getChannelList() {
    35         $channel_list = Cache::get('[channelList]');
     34    public static function getChannelList($filtered=True) {
     35        if ($filtered)
     36            $channel_list = Cache::get('[filtered_channelList]');
     37        else
     38            $channel_list = Cache::get('[channelList]');
    3639        if (is_null($channel_list)) {
    3740            global $db;
    3841            $sql = 'SELECT channel.chanid FROM channel';
    39             if ($_SESSION['guide_favonly'])
    40                 $sql .= ', channelgroup, channelgroupnames WHERE channel.chanid = channelgroup.chanid AND channelgroup.grpid = channelgroupnames.grpid AND channelgroupnames.name = \'Favorites\' AND';
    41             else
    42                 $sql .= ' WHERE';
    43             $sql .= ' channel.visible = 1';
     42            if ($_SESSION['guide_favonly']) {
     43                $sql .= ', channelgroup, channelgroupnames WHERE channel.chanid = channelgroup.chanid AND channelgroup.grpid = channelgroupnames.grpid AND channelgroupnames.name = \'Favorites\'';
     44                if ($filtered)
     45                    $sql .= ' AND channel.visible = 1';
     46            } elseif ($filtered) {
     47                $sql .= ' WHERE channel.visible = 1';
     48            }
    4449            $sql .= ' GROUP BY channel.channum, channel.callsign';
    4550        // Sort
    4651            $sql .= ' ORDER BY '
  • modules/tv/tmpl/default/set_channels.php

     
    3535    <td width="5%"><?php  echo t('visible')       ?></td>
    3636    <td width="5%"><?php  echo t('useonairguide') ?></td>
    3737</tr><?php
    38     $channels = Channel::getChannelList();
     38    $channels = Channel::getChannelList(False);
    3939    foreach ($channels as $chanid) {
    4040        $channel =& Channel::find($chanid);
    4141?><tr class="settings" align="center">