[EventCalendar] Advanced mode in admin

Darrell Schulte d at schulte.mn
Fri May 9 13:08:26 UTC 2008


On May 2, 2008, at 5:33 AM, Darren Brown wrote:

> Hi
>
> I have just upgraded event calendar  3.1.1.rc3 with wordpress 2.5.
>
> I wish to keep event posts seperate from normal posts so i switched  
> advanced mode on. However when doing this all the inactive posts  
> disappeared in admin. My events are band listings and while the  
> bands dont play on regularly reoccuring dates we do get the same  
> bands playing again and again so accessing and updating past event  
> posts makes updating easier.
>
> Looking at the code shows advanced mode should be switched off in  
> admin in filter_admin_head() (in admin.php), or  
> ec3_action_admin_head() (in eventcalendar3.php). Some testing showed  
> that both of these functions are called and switch off advanced  
> mode, however they are not called until after  
> ec3_filter_posts_where(), where the updated advanced mode variable  
> is required to display the posts correctly.
>
> I do not know much about the hooks and plugin development for  
> wordpress, but the following works as a quick fix:

Andrew submitted a patch that seemed to clear it up.

http://wpcal.svn.sourceforge.net/viewvc/wpcal?view=rev&revision=284

Basically...

if($wp_query->is_page || $wp_query->is_single || $wp_query->is_admin)


Darrell

>
>
> insert the following into ec3_filter_posts_where() in  
> eventcalendar3.php
>
>  // Turn OFF advanced mode when we're in the admin screens.
>  if (is_admin())
>   $ec3->advanced=0;
>
> eg:
>
> function ec3_filter_posts_where(&$where)
> {
>  global $ec3,$wp_query,$wpdb;
>
>  if($wp_query->is_page || $wp_query->is_single)
>      return $where;
>
>  // Turn OFF advanced mode when we're in the admin screens.
>  if (is_admin())
>   $ec3->advanced=0;
>    ........
>
>   rest of code
>
>  ...........
>  }
>
> Hopefully someone with more plugin experience can come up with a  
> more elegant solution, but meanwhile i hope that this highlights the  
> issue and gives a temporary solution to anyone who has come across  
> the same problem
>
> cheers
>
> darren_______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar




More information about the EventCalendar mailing list