[EventCalendar] Making it work with AJAX.....

Benoît Gréant gordie.lachance at gmail.com
Tue Mar 11 16:47:45 UTC 2008


Hello, got a little problem here :

I'm explaining myself :

When displaying a category, under each post, I have an "info" button that
loads various informations related to the posts (if there are some), with
ajax.
In those informations, the date of the event (calendar plugin) should be
shown.

This is how it works :

http://folioscope.awn.com/wordpress/?s=abeille&language=fr

when the info button is hovered (try the first post), javascript makes an
ajax query with the ID of the post as parameter, and calls the function

function folio_mk_infos_getlist($id) {
    global $post, $wpdb;
    $post = get_post($id);

    ///DATE

    $ec3schedule = ec3_get_schedule('%1$s, ',LANG_TPL_SCHEDULE_FROM.' %s
'.LANG_TPL_SCHEDULE_TO.' %2$s','%s');

...............

}

with this ajax call, the event date is not displayed.

But it's working when displaying a single post (folio_mk_infos_getlist is
called without ajax here),

 http://folioscope.awn.com/wordpress/?p=1129&language=fr

So I guess it's because of the global $post or something like that.

How can I do to make this work ?


thanks !

Benoît
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20080311/1030f1b4/attachment.html


More information about the EventCalendar mailing list