Think about what this part of your query is saying:
FROM activity a, activity_group g LEFT JOIN activity_times t on a.activityid = t.activityid
From a parser perspective, it's saying to join activity_gourp g to activity_times t FIRST on a.activityid=t.activityid
Can you see the problem there? explicit join syntax is evaluated before where clause joins are evalutated, according to the SQL spec.
Before 5.0 MySQL would just do what it had to do to make this work, but not it follows the spec in this regard, and it's one of those things that's deeper than an ansi mode setting, because it changes the way the query parser works on a very low level and can't just be turned on and off.
Reverse those two tables and it should work.
FROM activity_group g, activity a LEFT JOIN activity_times t on a.activityid = t.activityid
But I highly recommend you move the query to an all join syntax:
FROM activity a
JOIN
activity_group g
on (a.groupid = g.groupid)
LEFT JOIN
activity_times t
on (a.activityid = t.activityid)
Now what you mean is obvious and your join syntax is much cleaner looking.
Note that some query optimizers might make bad decisions with explicit join syntax, so test it to be sure.