Ticket #5496: my.diff
File my.diff, 11.3 KB (added by , 16 years ago) |
---|
-
includes/sorting.php
161 161 return strnatcasecmp($a->channel->channum, $b->channel->channum); 162 162 } 163 163 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 164 172 function by_airdate(&$a, &$b) { 165 173 if ($a->starttime == $b->starttime) return 0; 166 174 return ($a->starttime > $b->starttime) ? 1 : -1; -
modules/tv/classes/Program.php
335 335 // Get a nice description with the full details 336 336 $details = array(); 337 337 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 338 349 if ($this->hdtv) 339 350 $details[] = t('HDTV'); 340 351 if ($this->widescreen) -
modules/tv/upcoming.php
65 65 $_SESSION['scheduled_recordings']['disp_duplicates'] = $_POST['disp_duplicates'] ? true : false; 66 66 $_SESSION['scheduled_recordings']['disp_deactivated'] = $_POST['disp_deactivated'] ? true : false; 67 67 $_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']; 68 70 } 69 71 70 72 // Defaults … … 81 83 } 82 84 83 85 if (!is_array($_SESSION['tv']['settings']['screens']['upcoming'])) 84 $_SESSION['tv']['settings']['screens']['upcoming'] = array('title' => 'on', 'channel' => 'on', 'rec date' => 'on', 'length' => 'on');86 $_SESSION['tv']['settings']['screens']['upcoming'] = array('title' => 'on', 'channel' => 'on', 'record date' => 'on', 'length' => 'on'); 85 87 86 88 // Parse the list of scheduled recordings 87 89 global $Scheduled_Recordings; … … 91 93 foreach ($shows as $starttime => $show_group) { 92 94 // Parse each show group 93 95 foreach ($show_group as $key => $show) { 96 $Groups[$show->recgroup]++; 94 97 // Skip things we've already recorded (or missed) 95 98 if ($starttime <= time() && $show->recstatus != 'Recording') 96 99 continue; 97 100 // Make sure this is a valid show (ie. skip in-progress recordings and other junk) 98 101 if (!$callsign || $show->length < 1) 99 102 continue; 103 $Program_Titles[$show->title]++; 100 104 // Skip scheduled shows? 101 105 if (in_array($show->recstatus, array('WillRecord', 'ForceRecord'))) { 102 106 if (!$_SESSION['scheduled_recordings']['disp_scheduled']) … … 117 121 if (!$_SESSION['scheduled_recordings']['disp_deactivated']) 118 122 continue; 119 123 } 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; 120 130 // Assign a reference to this show to the various arrays 121 131 $all_shows[] =& $Scheduled_Recordings[$callsign][$starttime][$key]; 122 132 } … … 127 137 if (count($all_shows)) 128 138 sort_programs($all_shows, 'scheduled_sortby'); 129 139 140 uksort($Groups, 'by_no_articles'); 141 uksort($Program_Titles, 'by_no_articles'); 142 130 143 // Load the class for this page 131 144 require tmpl_dir.'upcoming.php'; 132 145 -
modules/tv/tmpl/default/set_screens.php
21 21 <fieldset> 22 22 <legend><?php echo t('Upcoming Recordings'); ?></legend> 23 23 <?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) { 25 25 echo '<input type="checkbox" name="upcoming['.$option.']" id="upcoming['.$option.']" '; 26 26 if ($_SESSION['tv']['settings']['screens']['upcoming'][$option] == 'on') 27 27 echo 'checked'; -
modules/tv/tmpl/default/upcoming.php
99 99 <?php echo t('Conflicts') ?></label> 100 100 </td> 101 101 </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 102 136 </table> 103 137 104 138 </form> … … 109 143 <th class="x-status"><?php echo t('Status') ?></th> 110 144 <?php if ($_SESSION['tv']['settings']['screens']['upcoming']['title'] == 'on') { ?> 111 145 <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> 112 150 <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['channel'] == 'on') { ?> 113 151 <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> 114 154 <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['airdate'] == 'on') { ?> 115 155 <th class="x-airdate"><?php echo get_sort_link('airdate', t('Airdate')) ?></th> 116 156 <?php } if ($_SESSION['tv']['settings']['screens']['upcoming']['record date'] == 'on') { ?> … … 302 342 303 343 if ( $cur_group != $prev_group && $group_field != '' ) { 304 344 ?><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> 306 346 </tr><?php 307 347 } 308 348 … … 314 354 if ($_SESSION['tv']['settings']['screens']['upcoming']['title'] == 'on') { 315 355 ?> 316 356 <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>'; 317 361 // Print the link to edit this scheduled recording 318 362 echo '<a id="program-'.$show->chanid.'-'.$show->starttime.'"'; 319 363 if ($_SESSION["show_popup_info"]) { … … 338 382 </td> 339 383 <?php 340 384 } 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 } 341 395 if ($_SESSION['tv']['settings']['screens']['upcoming']['channel'] == 'on') { 342 396 ?> 343 397 <td class="x-channum"><?php echo $show->channel->channum, ' - ', $show->channel->name ?></td> 344 398 <?php 345 399 } 400 if ($_SESSION['tv']['settings']['screens']['upcoming']['recording group'] == 'on') { 401 ?> 402 <td class="x-recgroup"><?php echo $show->recgroup ?></td> 403 <?php 404 } 346 405 if ($_SESSION['tv']['settings']['screens']['upcoming']['airdate'] == 'on') { 347 406 ?> 348 407 <td class="x-airdate"><?php echo strftime($_SESSION['date_scheduled'], $show->starttime) ?></td> -
skins/default/tv_upcoming.css
52 52 } 53 53 #listings th.x-title { 54 54 } 55 #listings th.x-originalairdate { 56 } 57 #listings th.x-episodenumber { 58 } 55 59 #listings th.x-channum { 56 60 } 61 #listings th.x-recgroup { 62 } 57 63 #listings th.x-airdate { 58 64 } 59 65 #listings th.x-length { … … 64 70 } 65 71 #listings td.x-title { 66 72 } 73 #listings td.x-originalairdate { 74 } 75 #listings td.x-episodenumber { 76 } 67 77 #listings td.x-channum { 68 78 } 79 #listings td.x-recgroup { 80 } 69 81 #listings td.x-airdate { 70 82 white-space: nowrap; 71 83 }