I'm working on a radio station website in Drupal 6, with Views 2 (I'd love nothing more than to upgrade to 7 and 3, but that's another matter). Anyway, we have a regular schedule of shows to display, and sometimes we have specials.
I have two text string fields for when the program starts and when it ends; I have a field for Days of the week, so I can just check off which days it airs on, for a regular program; and I have a Special field, unlimited number, so I can specify a day that a special program airs.
I've gotten as far as displaying the regular schedule. I've got an argument that passes a day of the week (e.g., "Tuesday"), and it will show all the programs that air on that day, in order.
What I really want to do is pass an argument like "2011-12-20", which will find be able to tell that that's a Tuesday, and then list all of the programs that are checked for Tuesday, as well as any specials that are set for 2011-12-20.
After that, the last step should be to figure out how to hide the regular programs that a special has replaced.
Any help on this is greatly appreciated.
Comments
The Views Or module is key
The Views Or module is key here. Also key, which I didn't realize until I started looking at the SQL query: you have to include a field under Fields if you want it to work under Arguments. So, I've got the list working now. Now, I'm on to hiding the regular shows that a special replaces.
And it looks like I can do
And it looks like I can do that with some clever use of the
$staticvariable: use the special field for sorting, so that specials appear first, and then, when you have a special, store its end time field in$static. Then you can compare: if this program starts before the last special ends, don't show it.