[EventCalendar] Conflict with WP-Sticky
Cris McConkey
cmcc at lightlink.com
Fri Aug 31 16:13:28 UTC 2007
My thanks to Chris Janton for considering my problem with a conflict
between Event Calendar and WP-Sticky and suggesting a possible fix.
This small modification of the eventcalendar3.php script did resolve
the conflict, but it also defeated event calendar 3's reordering of
the order of posts in the event category page (keep posts separate),
in effect displaying event posts as normal posts.
So, I am still hoping someone can find a fix, and am willing to try
out other modifications. Perhaps I should put up a test site and
give admin role to whoever wants to try something out?
--Cris
On Aug 30, 2007, at 8:58 AM, Chris Janton wrote:
> On 2007-08-29 , at 20:24 , Cris McConkey wrote:
>
>> I've had to de-activcate wp-sticky as it conflics with
>> eventcalendar3 plugin. Actually, the two will work togerher as
>> long as the ec3 option "Show events as blog entries" is set to:
>> "Events are Normal Posts".
>>
>> Once set to "Keep Events Seperate", which changes the event
>> category to display only events in the future in chronological
>> order (earlier events first), an error occurs when a link in the
>> sidebar calendar is activated.
>>
>> Is this a fault with event calendar 3, WP-Sticky, or both?
>
> At the moment it looks like EC3.
>>
>> Here is the error message that is displayed:
>>
>> WordPress database error: [You have an error in your SQL
>> syntax; check the manual that corresponds to your MySQL server
>> version for the right syntax to use near 'DESC,'%Y-%m-%d') DESC,
>> (wp_sticky.sticky_status = 1 AND wp_sticky.sticky_status ' at line 1]
>> SELECT SQL_CALC_FOUND_ROWS wp_posts.*,
>> wp_sticky.sticky_status FROM wp_posts LEFT JOIN wp_post2cat ON
>> (wp_posts.ID = wp_post2cat.post_id) LEFT JOIN wp_ec3_schedule
>> ec3_sch ON ec3_sch.post_id=id LEFT JOIN wp_sticky ON
>> wp_sticky.sticky_post_id = wp_posts.ID WHERE 1=1 AND
>> wp_post2cat.category_id IN (10) AND (post_type = 'post' AND
>> (post_status = 'publish' OR post_status = 'private')) AND ((YEAR
>> (start)=2007 AND MONTH(start)=09 AND DAYOFMONTH(start)=08) OR
>> (start<='2007-09-08 0:0:0' AND end>='2007-09-08 0:0:0')) GROUP BY
>> wp_posts.ID ORDER BY (wp_sticky.sticky_status = 2 AND
>> wp_sticky.sticky_status IS NOT NULL) DESC, DATE_FORMAT
>> (wp_posts.ec3_sch.start DESC,'%Y-%m-%d') DESC,
>> (wp_sticky.sticky_status = 1 AND wp_sticky.sticky_status IS NULL)
>> DESC, DATE_FORMAT(wp_posts.ec3_sch.start DESC,'%T') DESC LIMIT 0, 10
>
> WP-Sticky adds the following "ORDER BY" to the query (slightly edited)
>
> DATE_FORMAT($wpdb->posts.post_date,'%Y-%m-%d') DESC,
> ... DATE_FORMAT($wpdb->posts.post_date,'%T') DESC
>
> EC3 happily changes the ".post_date" part of the order by to
> "ec3_sch.start DESC" giving us the illegal construct
>
> DATE_FORMAT(wp_posts.ec3_sch.start DESC, '%T')
>
> for example.
>
> When you set the option "Keep Events Separate" the ec3->advanced
> flag is set to true. When the advanced flag is true EC3 summarily
> rewrites the ORDER BY clause.
>
> This is something you could try (I don't use WP-sticky, so I can't)
>
> in eventcalendar3.php on approximately line 266 you should see this
>
> $regexp='/\bpost_date\b( DESC\b| ASC\b)?/i';
>
> you could try changing the post_date to posts.post_date - this
> would have the effect of matching the entire name of the column and
> replace the complete name with the ec3_sch.start -
>
> $regexp='/\bposts.post_date\b( DESC\b| ASC\b)?/i';
>
> I suspect this will fix the syntax error in the SQL, but I have no
> idea what the effect will be. ;-)
>
>
> 8)
> ----------------------------------
> Chris Janton - face at CentosPrime dot COM
> Netminder for Opus1.COM
>
>
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
More information about the EventCalendar
mailing list