[EventCalendar] Sorted categories by Ec3 event date -- now I need a little hand

Karynn swing.flyer at gmail.com
Wed Jun 18 16:37:05 UTC 2008


Sorry, I meant to say that the previous response to use
http://www.yourblog.com/?ec3_after=today does not work for me. My Event
category is called Event. I also have sub-categories underneath Event... so
when I create a post and assign an event date, it will automatically assign
the category "Event". I may also assign the post to the sub-category called
"Special Events". When I view the special events category, it is sorted by
publish date and not event date.

However, I just retested this and it seems to be working... you can just add
the category id at the end to specify a specific category. i.e.
http://www.yourblog.com/?ec3_after=today&cat=47
or
http://www.yourblog.com/category/events/special-events/?ec3_after=today
for past events, sorted chronologically:
http://www.yourblog.com/category/events?ec3_before=today&order=ASC


On Wed, Jun 18, 2008 at 9:24 AM, Liam Sarsfield <liams.email at gmail.com>
wrote:

> Karynn,
>
> Could you please explain this a little more -- I'm confused by your
> response.
>
> Thanks
>
>
> On Wed, Jun 18, 2008 at 8:22 AM, Karynn <swing.flyer at gmail.com> wrote:
>
>> That doesn't seem to work when you have subcategories under the main Event
>> category. I had this problem as well and just had to tweak the publish date
>> to get things to sort properly.
>>
>>
>> On Wed, Jun 18, 2008 at 6:18 AM, David Nolan <
>> david.nolan at celtic-irish.co.uk> wrote:
>>
>>> Why not just use:
>>>
>>> http://www.yourblog.com/?ec3_after=today
>>>
>>> ??
>>>
>>> David Nolan
>>>
>>> 2008/6/18 Liam Sarsfield <liams.email at gmail.com>:
>>>
>>>>  Hi guys,
>>>>
>>>> A friend of mine wrote up a plugin for ec3 thats allows you to sort
>>>> categories by eventdate -- the problem I am having now is that I cannot seem
>>>> to get posts that dont have an event to show up. Could someone take a look
>>>> at his code and let me know if it's a simple else statement that needs
>>>> tweaking or if its a full rehaul?
>>>>
>>>> Thanks
>>>>
>>>> code for the plugin:
>>>>
>>>>> <?php
>>>>> /*
>>>>> Plugin Name: ec3 post sorter
>>>>> Plugin URI: http://maisonbisson.com/blog/bsuite/
>>>>> Description: Sorts posts according to ec3 date. Requires Alex Tingle's
>>>>> <a href="http://wpcal.firetree.net/">Event Calendar 3</a>, tested with
>>>>> 3.1.1.rc3.
>>>>> Version: 0.1
>>>>> Author: Casey Bisson
>>>>> Author URI: http://maisonbisson.com/blog/
>>>>> */
>>>>>
>>>>> /*  Copyright 2007  Casey Bisson
>>>>>
>>>>>     This program is free software; you can redistribute it and/or
>>>>> modify
>>>>>     it under the terms of the GNU General Public License as published
>>>>> by
>>>>>     the Free Software Foundation; either version 2 of the License, or
>>>>>     (at your option) any later version.
>>>>>
>>>>>     This program is distributed in the hope that it will be useful,
>>>>>     but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>>>     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>>>     GNU General Public License for more details.
>>>>>
>>>>>     You should have received a copy of the GNU General Public License
>>>>>     along with this program; if not, write to the Free Software
>>>>>     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
>>>>> 02111-1307  USA
>>>>> */
>>>>>
>>>>> function bsuite_order_ec3_posts_where( &$where ){
>>>>>     global $ec3,$wp_query,$wpdb;
>>>>>
>>>>>     if( $wp_query->is_admin )
>>>>>         return($where);
>>>>>
>>>>>     if( ( $wp_query->is_search || $wp_query->is_category ||
>>>>> $wp_query->is_home ) && !( $wp_query->is_date ) ){
>>>>>         $where.=" AND (ec3_sch.end>='$ec3->today')";
>>>>>         $ec3->join_ec3_sch=true;
>>>>>         $ec3->order_by_start=true;
>>>>>         add_filter('posts_orderby','ec3_filter_posts_orderby');
>>>>>     }
>>>>>     return $where;
>>>>> }
>>>>>
>>>>> add_filter('posts_where',  'bsuite_order_ec3_posts_where',12);
>>>>>
>>>>
>>>> --
>>>> Liam Sarsfield
>>>> _______________________________________________
>>>> Blog: http://wpcal.firetree.net/
>>>> EventCalendar at firetree.net mailing list
>>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>>>
>>>>
>>>
>>>
>>> --
>>> Help raise funds for our community events by visiting
>>> http://www.celtic-irish.co.uk/shop
>>> _______________________________________________
>>> Blog: http://wpcal.firetree.net/
>>> EventCalendar at firetree.net mailing list
>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>>
>>>
>>
>> _______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net mailing list
>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>
>>
>
>
> --
> Liam Sarsfield
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20080618/aeb30d4d/attachment.htm


More information about the EventCalendar mailing list