? station_archive_186770.patch
? test.patch
? archive/Thumbs.db
? archive/scripts/1193091785.mp3
? catalog/The Database.mdb
? catalog/fixit.php
? catalog/import.php
? schedule/Copy of station_schedule.module
? schedule/Copy of views.inc
? schedule/Copy of views_defaults.inc
? schedule/images/Thumbs.db
Index: schedule/station_schedule.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/schedule/station_schedule.module,v
retrieving revision 1.54
diff -u -p -u -p -r1.54 station_schedule.module
--- schedule/station_schedule.module	26 Oct 2007 19:00:14 -0000	1.54
+++ schedule/station_schedule.module	31 Oct 2007 18:06:22 -0000
@@ -771,14 +771,13 @@ function station_schedule_get_program_li
 function station_schedule_program_get_at($gmt_timestamp, $schedule_nid = 0) {
   // Load the schedule item based on the time.
   $ts = station_local_ts($gmt_timestamp);
-  $day = date('w', $ts);
-  $hour = date('G', $ts);
-  $minute = station_minute_from_day_hour($day, $hour);
+  $minute = station_minute_from_day_hour(date('w', $ts), date('G', $ts));
+
   $schedule_nid = (int) ($schedule_nid ? $schedule_nid : variable_get('station_schedule_default', 0));
-  $schedule_item = station_schedule_load_item_at($schedule_nid, $minute);
+  $schedule_item = db_fetch_object(db_query('SELECT * FROM {station_schedule_item} s WHERE s.schedule_nid = %d AND s.start <= %d AND s.finish > %d', $schedule_nid, $minute, $minute));
 
   // If there's an associated program, load it
-  if ($schedule_item->program_nid) {
+  if (isset($schedule_item->program_nid)) {
     if ($node = node_load($schedule_item->program_nid)) {
       // set this so that if the show is scheduled for multiple times the caller
       // can easily figure out which one.
@@ -803,21 +802,6 @@ function station_schedule_load_item($iid
   }
 }
 
-/**
- * Load the schedule by minute of the week.
- * @param $schedule_nid
- *  Schedule id
- * @param $minute
- *  the minute of the week...
- * @return schedule object
- */
-function station_schedule_load_item_at($schedule_nid, $minute) {
-  $result = db_query('SELECT * FROM {station_schedule_item} s WHERE s.schedule_nid = %d AND s.start <= %d AND s.finish > %d', $schedule_nid, $minute, $minute);
-  if ($s = db_fetch_object($result)) {
-    return $s;
-  }
-}
-
 function station_schedule_item_list($node) {
   drupal_add_css(drupal_get_path('module', 'station_schedule') .'/station_schedule.css');
   drupal_set_title(check_plain($node->title));
@@ -1170,15 +1154,6 @@ function theme_station_schedule_item($st
   return $output;
 }
 
-
-/**
- * Today's schedule. This is just a short cut for the menu system.
- */
-function station_schedule_today_page($schedule_nid) {
-  $node = node_load($schedule_nid);
-  return station_schedule_day_page($node, station_today());
-}
-
 /**
  * Print a day's schedule page.
  */
