[EventCalendar] Big Calendar in a Category Template - How to do it?

theplacebo webadmin theplacebo.webadmin at gmail.com
Thu Mar 5 08:17:57 UTC 2009


Thanks very much, Rick!

I.. don't actually know  how or where to use that code but I very much
appreciate the additional info.

I do see that the Big Calendar function you quote is in
eventcalendar3.php but am not sure how to let the call snippet you
posted know that as it seems to be looking in the template itself for
the function. ?  [tries to think back to C++ class a decade back; gets
nowhere] Yeah, still not so much with the understanding. :D Perhaps
I'm taking the code literally in places I need to provide variables or
paths?

The category template thing was definitely unanticipated but it's the
closest I could get to emulating some hand-coded (possibly circa 1998)
pages that the recipients are enamoured of: they specifically want the
enticing full descriptions of upcoming events to fall directly below
the monthly calendar. And it's always cool learning how to do stuff,
so...

Thank you again. I'll try to sleep on it and see if things make more
sense when I wake.

_D.


On Wed, Mar 4, 2009 at 11:01 PM, Rick Boatright <rboatright at gmail.com> wrote:
> Yes, the calls changed.
> In 3.2, we are filtering "The Content" not the template to put the bigcal
> in, so if you want  it on a CATAGORY ARCHIVE -- which frankly isn't
> something we considered,  uh,  you can't use the [EC3BigCal} thing...
> because that only works on PAGES not POSTS....
> but you COULD call it directly.
> The filter code that calls the big-calendar renderer is below, but
> basically, you could do something along the lines of
>
>       $calobj = new ec3_BigCalendar($options);
>       $calcode = $calobj->generate();
>
>       return $calcode;
>
> here's the function that calls the ec3bigcalendar generator.
>
> function ec3_filter_the_content_bigcal(&$post_content)
> {
>   if(is_page())
>   {
>     $placeholder = '[EC3BigCalendar';
>     $pos=strpos($post_content,$placeholder);
>     if($pos!==FALSE)
>     {
>       // Only load the Big Calendar code now that we know we need it.
>       require_once(dirname(__FILE__).'/calendar-big.php');
>       // Process options.
>       $options=array();
>       $options['id']='ec3_big_cal';
>       $options['num_months']=1;
>       $options['day_length']=9;
>       $options['show_only_events']=1;
>       $re='/\[EC3BigCalendar(:(\w+=\w+(&|&amp;|&#0*38;))*(\w+=\w+))?]/i';
>       if(preg_match($re,$post_content,$m))
>       {
>         if(!empty($m[1]))
>         {
>           $args = strtolower(preg_replace('/(&amp;|&#0*38;)/','&',$m[1]));
>           $options = wp_parse_args(substr($args,1),$options);
>         }
>         $placeholder = $m[0];
>       }
>       $calobj = new ec3_BigCalendar($options);
>       $calcode = $calobj->generate();
>       $post_content = str_replace($placeholder,$calcode,$post_content);
>     }
>   }
>   return $post_content;
>
>



More information about the EventCalendar mailing list