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

David Nolan david.nolan at celtic-irish.co.uk
Wed Jun 18 13:18:08 UTC 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20080618/f8b869e0/attachment.html


More information about the EventCalendar mailing list