Ticket #107: mythweb.program_listing.diff
File mythweb.program_listing.diff, 1.5 KB (added by , 19 years ago) |
---|
-
mythweb/themes/Default/program_listing.php
40 40 ?></select></td> 41 41 <td align="right"><?echo t('Date') ?>: </td> 42 42 <td><select name="date" onchange="get_element('program_listing').submit()"><?php 43 // Find out how many days into the past we should bother checking 44 $result = mysql_query('SELECT TO_DAYS(min(starttime)) - TO_DAYS(NOW()) FROM program') 45 or trigger_error('SQL Error: '.mysql_error(), FATAL); 46 list($min_days) = mysql_fetch_row($result); 47 mysql_free_result($result); 43 48 // Find out how many days into the future we should bother checking 44 49 $result = mysql_query('SELECT TO_DAYS(max(starttime)) - TO_DAYS(NOW()) FROM program') 45 50 or trigger_error('SQL Error: '.mysql_error(), FATAL); 46 51 list($max_days) = mysql_fetch_row($result); 47 52 mysql_free_result($result); 48 53 // Print out the list 49 for ($i= -1;$i<=$max_days;$i++) {54 for ($i=$min_days;$i<=$max_days;$i++) { 50 55 $time = mktime(0,0,0, date('m'), date('d') + $i, date('Y')); 51 56 $date = date("Ymd", $time); 52 57 echo "<option value=\"$date\"";