[EventCalendar] Today's events

Isaac H Dunlap IH-Dunlap at wiu.edu
Tue Oct 17 05:07:44 UTC 2006


Our campus system currently remains at MySQL version 3.23.32.  --Isaac


Quoting Alex Tingle <alex at firetree.net>:
> Keith, Isaac and Brian,
> 
> That SQL works perfectly for me (MySQL v5.0.22). Can you say which  
> version of MySQL you are running?
> 
> I think that Darrell's alternative version changes the meaning of the  
> select, so that the results will come out in a different order. That  
> would mean that some posts wouldn't actually be shown on the  
> calendar... The order of the results is vital to the logic further down.
> 
> -Alex
> 
> --
> 
> On 17 Oct 2006, at 02:34, Darrell Schulte wrote:
> >
> > On Oct 16, 2006, at 5:57 PM, Adams, Keith wrote:
> >
> >> I'm getting a wordpress database error in the event calendar.  I've
> >> tried adding it by putting in ec3_get_calendar() and using the widget
> >> and I get the same thing either way.
> >>
> >>
> >> WordPress database error: [You have an error in your SQL syntax  
> >> near '(
> >> SELECT DISTINCT id, post_title, GREATEST(start,'2006-10-0' at line 1]
> >> ( SELECT DISTINCT id, post_title, GREATEST(start,'2006-10-01  
> >> 00:00:00')
> >> AS start_date, LEAST(end,'2006-11-01 00:00:00') AS end_date, 1 AS
> >> is_event FROM wp_posts,wp_ec3_schedule WHERE post_status='publish'  
> >> AND
> >> post_id=id AND end>='2006-10-01 00:00:00' AND start<'2006-11-01
> >> 00:00:00' ) UNION ( SELECT DISTINCT id, post_title, post_date AS
> >> start_date, post_date AS end_date, 0 AS is_event FROM wp_posts WHERE
> >> post_status='publish' AND post_date>='2006-10-01 00:00:00' AND
> >> post_date<'2006-11-01 00:00:00' AND post_date<NOW() ) ORDER BY id,
> >> start_date, is_event DESC
> >
> > Keith, Isaac and Brian,
> >
> > I'm unable to reproduce the error you are experiencing on my local  
> > development blog, however, taking the query and putting it into  
> > phpMyAdmin does produce an error.
> >
> > If I take the UNION parts separately, I receive valid responses  
> > from MySQL. So, I suppose it could be getting fouled up on those  
> > parentheses. Try this -- go into template-functions.php and replace  
> > lines 130-143 with the following.
> >
> >     $sql=" $sql  UNION
> >       SELECT DISTINCT
> >          id,
> >          post_title,
> >          post_date AS start_date,
> >          post_date AS end_date,
> >          0 AS allday,
> >          0 AS is_event
> >        FROM $wpdb->posts
> >        WHERE post_status='publish'
> >          AND post_date>='$begin_date'
> >          AND post_date<'$end_date'
> >          AND post_date<NOW()
> >      ";
> >
> >
> > Give that a try. I could be completely wrong and possibly changing  
> > the scope of the query, but it might be worth a try...
> >
> > Darrell Schulte
> > http://schulte.mn
> >
> >
> >
> > _______________________________________________
> > 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
> 


----------------------------------------
Isaac Hunter Dunlap, Associate Professor
Information Systems Coordinator
Western Illinois University Libraries
Macomb, IL 61455 * 309-298-2745
ih-dunlap at wiu.edu * www.wiu.edu/library 



More information about the EventCalendar mailing list