[EventCalendar] Help with a modification that sorts by EC3 Date

Liam Sarsfield liams.email at gmail.com
Thu Nov 27 03:07:54 UTC 2008


Brilliant Alex,

Thanks Chap!

LS


On Tue, Nov 25, 2008 at 3:19 PM, Alex Tingle <alex at firetree.net> wrote:

> Liam Sarsfield wrote:
> > Hi Alex,
> >
> > Okay - here's what I'm doing:
> >
> > My site lists conferences and workshops - we've split them into
> categories
> > by location and by type. What I initially wanted was for events to come
> up
> > in the categories sorted by event date, beginning with the events that
> were
> > just about to occur. That's what this bolt-on does for me, all my
> categories
> > are sorted by event date. From my understanding, the stock behavior did
> not
> > allow this type of organization.
> >
> > Now that it's installed and everything is good to go, I want somehow to
> make
> > it so that I have a news category, with posts that are not events.
> > Unfortunately this bolt-on seems to not allow me to do that - so here I
> am.
> >
> > Am I making sense?
>
> Perfectly. What about this:
>
> Take out...
>
> if( ( $wp_query->is_search || $wp_query->is_category || $wp_query->is_home
> )
> && !( $wp_query->is_date ) ){
>
> ...and replace it with...
>
> if( $wp_query->is_category && !$wp_query->is_date ){
>
> That should simply make *all* of your categories into event categories.
> Your
> front page will *not* be affected though, so it should still show your
> other
> posts as a normal blog.
>
> Get rid of your news category, and just don't put your news-posts into ANY
> category.
>
> -Alex
>
> --
>
> >
> > LS
> >
> >
> > On Tue, Nov 25, 2008 at 2:39 PM, Alex Tingle <alex at firetree.net> wrote:
> >
> >> Hi Liam,
> >>
> >> Liam Sarsfield wrote:
> >>> I recently dug up a plugin an acquaintance let me use that sorted EC3
> >> posts
> >>> by event date. Unfortunately, now that everything is sorted it has
> pushed
> >> my
> >>> few news posts that I had straight out - they dont appear in my
> >> categories
> >>> or anywhere else, though it still shows they are still there. I was
> >>> wondering if anyone knew what, in the code provided, would I have to
> add
> >> in
> >>> order for my news posts to come up at the bottom of the list, so that I
> >> can
> >>> have a category for news. Any help would be _much_ appreciated, as I'm
> >> not
> >>> at all a php programmer.
> >> The latest stable version of the plug-in is 3.1.4. It's not changed
> very
> >> much
> >> since 3.1.1, so that bolt-on should still work as before.
> >>
> >> The purpose of the bolt-on seems to be to force your blog to only ever
> show
> >> event listings. Is that what you want?
> >>
> >> I think you'd better start by describing what you *do* want. Have you
> tried
> >> the EC plug-in on its own, in both normal and "keep events separate"
> mode?
> >> What do you want that's different from the stock behaviour?
> >>
> >> (Try to be specific. Include examples if that will help.)
> >>
> >> -Alex
> >>
> >> --
> >>
> >>> The plugins code:
> >>>
> >>> <?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);
> >>>
> >>>
> >>>
> >>> LS
> >>>
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------
> >>>
> >>> _______________________________________________
> >>> Blog: http://wpcal.firetree.net/
> >>> EventCalendar at firetree.net mailing list
> >>> Unsubscribe: http://penguin.firetree.net/eventcalendar
> >>
> >> --
> >> :: Let me solve your problems: http://www.firetree.net/alex/
> >> :: alex.tingle AT firetree.net  +44-7901-552763
> >>
> >>
> >> _______________________________________________
> >> 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
>
>
> --
> :: Let me solve your problems: http://www.firetree.net/alex/
> :: alex.tingle AT firetree.net  +44-7901-552763
>
>
> _______________________________________________
> 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/20081126/41a561e8/attachment.html


More information about the EventCalendar mailing list