[EventCalendar] narrow the list?
Johan Michaelsen
johan.orgel at post.tele.dk
Tue Apr 17 14:59:23 UTC 2007
Hey
I have a lot of different sub-categories in my event-category:
Event-category = 2
sub-category = 3
sub-category = 4
sub-category = 5 (etc)
This works fine when just writing the link:
http://blog.address/?ec3_after=today&cat=4
You can even pull more categories into this call:
http://blog.address/?ec3_after=today&cat=4,5
BUT I would like to be able to call the get_events function with some
limitations.
For instance, I would like to call the get_events function just for
sub-cat 3 and 5 - but the function is made to query from all events.
So I thought I might try to add a similar function to the "template-
functions.php" and just give it another name.
I think the difference will be within this section:
// Find the upcoming events.
$calendar_entries = $wpdb->get_results(
"SELECT DISTINCT
p.id AS id,
post_title,
start,
u.$ec3->wp_user_nicename AS author,
allday
FROM $ec3->schedule s
LEFT JOIN $wpdb->posts p ON s.post_id=p.id
LEFT JOIN $wpdb->users u ON p.post_author = u.id
WHERE p.post_status='publish'
AND end>='$ec3->today' $and_before
ORDER BY start $limit_numposts"
);
- I just don't know enough php to find out how to implement an "AND
category_ID = 3" into the query.
Would it be possible - and then how?
best regards
Johan
http://www.greenvalleygospel.dk/wordpress/
More information about the EventCalendar
mailing list