Building a new site for the wgdr.org radio station. We have radio programs that alternate weeks such as:
On Monday nights from 9-12... week1 = show A, week2 = show B, week3 = show A week4 = show B
But when I try to add show B to a schedule, Station/Drupal tells me that there's a conflicting show and can't add the new one to the schedule because show A occupies that time slot.

Is there a way to work around this? Thanks!

CommentFileSizeAuthor
#3 views_monday.jpg44.44 KBkeremito

Comments

frederickjh’s picture

Not unless you some how write a patch. The current schedule is setup for a schedule that is the same every week and repeats.

Sorry to be the barer of bad news.

ahillio’s picture

Would writing a patch that does this be a good way for me to learn php and module coding? I've painstakingly hacked a little php but am potentially interested in legitimately learning it... would it make sense for me to try patching this considering I'd be learningbydoing? Thanks!

keremito’s picture

StatusFileSize
new44.44 KB

Hi there,

I think it's a good point to start learningbydoing.

I've used a trick to show two-week schedules. It may be your answer too.

First, I've created two schedules; "first week" and "second week" and then, I create views
specific to my purpose (a screenshot is attached). I use handling code below as the argument;

$week = date("W");
if ( $week&1 ) {
    $result = db_query("SELECT program_nid FROM {station_schedule_item} WHERE schedule_nid = 3 AND start>1799 AND finish<3001 ORDER BY start ");
} else {
    $result = db_query("SELECT program_nid FROM {station_schedule_item} WHERE schedule_nid = 10 AND start>1799 AND finish<3001 ORDER BY start ");
}
$nid_array = array();
while ($products = db_fetch_object($result)) {
$nid_array[] = $products->program_nid;
}
$son = implode('+', $nid_array);

return $son;

This argument is for monday. It will check the number of the week; if it is odd, it will get the program nids from "first week" schedule (schedule_nid=3, in my case) as the arguments. If not, schedule_nid will be 10. Please note I've checked "Allow multiple terms per argument." In my schedule, Monday is between 1800 and 3000th minutes of the week but be careful; it depends on the start and end hours of your schedule.

Now I'm planning to develop a specific module; after you enter first week schedule, you will press a button which creates clone of the schedule (clone the row of the database for the second week). Then minor changes will easily be applied. Would you like to work together?

chris_riddell’s picture

keremito,

Is something you are still interested in working on? I'm working with a radio station that has the same need. Your multiple schedule solution seems like a good start, especially for displaying the schedule. Not sure if that can be used to do the same thing with the archive.

Anyway, I was approaching this as a patch to the schedule module, adding some fields to the form to indicate whether a show has a different frequency than weekly. But, having seen lots of chatter about overhauling the Station module in general, I wonder if your lower-impact approach is better.

Chris

keremito’s picture

Hi Chris,

Firstly, I even didnt think anything about the archive. All my aim was to display the schedule for two weeks. Yes, I'm still interested, especially if we go through such a side-way.

Update: Hey, we dont need a module for such a reason! Next week, I'll add a list selection field to the program node; by default, it will be 'all weeks' and you can change it to 'odd weeks' or 'even weeks', then add that field to the database query too. You gave me the light Chris!