Greetings,

All the shows on my station have their own logos/splash images, and I would like to display that image instead of text. Perhaps its not really a feature as much as it would be a tweak. But I thought I'd mention it here.

Thanks
Anthony

Comments

drewish’s picture

not sure i follow what you want. maybe you could make up a fake screen shot? how about a link to your site...

anthon1’s picture

Sure,

If you visit www.mix1079.net or www.q945rocks.com you will see on the upper right header, the current on air program. Its based on the good morning / good afternoon script which runs on a 24 hour loop.

As our shows are different on the weekends, I would like to get rid of that script and simply replace it with your "On Air" block.

But it only shows text right now. So I was wondering if it could be tweaked so that instead of the program name being shown I could put some html code in there such as Only local images are allowed. .

drewish’s picture

Status: Active » Fixed

Okay I've reworked the way the current progam block is built. Now it passes the program, unscheduled message, and webstream links into a theme function. You should be able to write your own theme_station_block_current_program function and display custom output based on the current program.

anthon1’s picture

Thanks

I really appreciate it. That was fast.

Sincerely
Anthony

Anonymous’s picture

Status: Fixed » Closed (fixed)
anthon1’s picture

Component: Miscellaneous » Code - Schedule

I know you closed this issue already, but I just cant get it to work right. Any chance you could show me a code snippet as an example of hour I could use the variables from the "whos on the air" so I can addimages to that block?

Thanks
Anthony

drewish’s picture

You'd put something like this into your theme's tempate.php file:

function phptemplate_station_block_current_program($program = NULL, $unscheduled_message ='', $high_url = NULL, $low_url = NULL) {
  if ($program) {
    // we have a program
    $output = l($program->title, $program->node_url) .'<br />';
    
    // ADD CODE HERE TO DISPLAY PROGRAM SPECIFIC IMAGE
    $path = '/path/to/some/program/specific.img';
    $output .= theme('image', $path, 'helpful text', $program->title)
  }
  else {
    // unscheduled
    $output = $unscheduled_message .'<br />';
  }

  // webstream links
  if ($high_url || $low_url) {
    $output .= t('Tune in: ');
    if ($high_url) {
      $output .= ' '. l(t('High'), $high_url);
    }
    if ($low_url) {
      $output .= ' '. l(t('Low'), $low_url);
    }
  }

  return $output;
}

And then modify the part to build a link to the appropriate image for each program. That obviously is the hard part. You could create an image for each program and save it with node id as the filename, something like that.