Forum Moderators: open
Also, note that I am displaying both LIVE (active) and EXPIRED (but recurring) events. The latter are grayed out. Then again, in some categories, e.g., Baseball, I don't show an expired event at all (not even grayed).
Anyway, could use some sort of logic to be able to show events that start in, say April, and end in, say, November (8 month period). Thanks in advance.
Here is the existing code:
if (isset($_GET['month'])) {
$month = ucfirst($_GET['month']);
if (strtolower($month) == "current") {
$month = date("F");
}
$cat = ucfirst($_GET['cat']);
$cond = " (monthname(startdate) = '$month' or monthname(enddate) = '$month' or
(monthname(date_add(startdate, INTERVAL 1 MONTH)) = '$month' and monthname(date_sub(enddate, INTERVAL 1 MONTH)) = '$month'
and monthname(startdate) <> monthname(enddate))) and category = '$cat' and state = 'New York' and city = 'Ithaca' ";
if ($cat == "Theater" ¦¦ $cat == "Music" ¦¦ $cat == "Art" ¦¦ $cat == "Baseball") {
$cond .= " and datediff(enddate, current_date) >= 0";
}
} else {
exit(0);
}