One of my DJs pointed out that sometimes the schedule can make it hard to determine exactly when a show is starting or ending. They suggested that when you hover, it displays the start and end time. E.g. "3pm to 5pm"
Should be very simple, I'll take a look at it myself soon, just wanted to share.

CommentFileSizeAuthor
#4 station_661892.patch1.15 KBtim.plunkett

Comments

tim.plunkett’s picture

Status: Active » Needs work
function THEMENAME_station_schedule_item($start, $finish, $program) {
  $class = 'station-sch-box station-sch-scheduled';
  $height = ($finish - $start);
  $link = url('node/'. $program->nid);

  $output = "<div class='{$class}'><a href='{$link}' style='height: {$height}em;' title='". theme('station_hour_range', $start, $finish) ."'>";
  $output .= '<span class="station-sch-time">'. theme('station_hour_range', $start, $finish) .'</span>';
  $output .= '<span class="station-sch-title">'. check_plain($program->title) .'</span>';
  if (!empty($program->field_station_program_dj)) {
    $djs = array();
    foreach ($program->field_station_program_dj as $entry) {
      $user = user_load($entry);
      $djs[] .= $user->name;
    }
    $output .= '<span class="station-sch-djs">'. check_plain(implode(', ', $djs)) .'</span>';
  }
  $output .= "</a></div>\n";
  return $output;
}

I put that in my template.php.

Thoughts, anyone?
Worth modifying the actual version? I can roll a patch later if need be.

tim.plunkett’s picture

bump. i'll roll a patch for the module tomorrow.

refreshingapathy’s picture

Thanks. Ping me on IRC if you need testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new1.15 KB

Instead of calling theme('station_hour_range', $start, $finish) like I suggested originally, I just used a variable.

Also, there are some weird things going on alternating between single and double quotes throughout the module. I just made it match the above line.

refreshingapathy’s picture

Status: Needs review » Reviewed & tested by the community

Patched against the current dev and it works like a charm.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD! Yes!

drewish’s picture

nice one.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.