[EventCalendar] problem with static pages FIXED

Alex Tingle alex at firetree.net
Wed Nov 23 20:36:31 UTC 2005


Hi,

Thanks for forwarding that on. I've added it to my 'to do' list.

-Alex

--
On 23 Nov 2005, at 20:31, Chuck Vohs wrote:

> David wrote me and sent this fix (Thanks David!):
>
> Hi Chuck,
>
> I compared the version of eventcalendar3.php that I have running on  
> my site to a freshly downloaded copy and it looks like the correct  
> line numbers for a clean install would be lines 1023 and 1024. I  
> also had to correct this for search pages, so there are two  
> additions to the if statement instead of just one. Below is the  
> exact code before and after the modification.
>
> ORIGINAL CODE (Starting at Line 1014 through line 1025)
>
> ---------------------------------------------------------------------- 
> ---------
>
> if($ec3->is_listing && $ec3->advanced && !$wp_query->is_date)
>
> {
>
> // reverse date restriction for event category listing
>
> $now = gmdate('Y-m-d 00:00:00');
>
> $result=preg_replace(
>
> "/\bAND\s+post_date_gmt\s*<=\s*'([-0-9]+) [:0-9]+'/",
>
> "AND post_date_gmt > '\$1 00:00:00'",$where
>
> );
>
> }
>
> elseif($wp_query->is_date || $wp_query->is_single ||
>
> $ec3->is_listing || $ec3->advanced)
>
> {
>
> EDITED CODE (Starting at Line 1014 through line 1025, changes in red)
>
> ---------------------------------------------------------------------- 
> ---------
>
> if($ec3->is_listing && $ec3->advanced && !$wp_query->is_date)
>
> {
>
> // reverse date restriction for event category listing
>
> $now = gmdate('Y-m-d 00:00:00');
>
> $result=preg_replace(
>
> "/\bAND\s+post_date_gmt\s*<=\s*'([-0-9]+) [:0-9]+'/",
>
> "AND post_date_gmt > '\$1 00:00:00'",$where
>
> );
>
> }
>
> elseif($wp_query->is_date || $wp_query->is_single ||
>
> $ec3->is_listing || $ec3->advanced *&& !$wp_query->is_page && ! 
> $wp_query->is_search*)
>
> {
>
> ---------------------------------------------------------------------- 
> ------------
>
> I hope that helps. Let me know if you have any other questions,
>
> Dave
>
> Chuck Vohs wrote:
>
>> I have the same problem as mentioned here http://blog.firetree.net/ 
>> 2005/07/18/eventcalendar-30/:
>>
>>   1.
>>
>>
>>             David Ellenwood <http://davidpaulellenwood.com> said,
>>
>>       4 September, 2005 @ 23:07
>>       <http://blog.firetree.net/2005/07/18/eventcalendar-30/ 
>> #comment-298>
>>
>>       Hello,
>>       I’ve installed your plugin as part of a site that I’m  
>> setting up
>>       as a customized CMS. I will be using the events calandering  
>> most
>>       heavily and your solution is a perfect fit. However, I found
>>       that if I set the “Keep Events Separate” option and also try to
>>       keep content on static pages in WP, Event Calendar’s  
>> addition to
>>       WP’s query statement on line(s) 1055 and 1056 of
>>       eventcalendar3.php forgets to exclude those static pages, so  
>> all
>>       of my static pages come up as 404’s–the query returns no posts.
>>       I /think/ I have corrected the issue by simply adding |"&&
>>       !$wp_query->is_page"| to the end of the elseif statement on
>>       line(s) 1034 & 1035. Just commenting on the possible bug and my
>>       possible fix for your info. Let me know if you see something
>>       with my solution that will cause problems later.
>>
>>       Thanks for a great plugin,
>>
>>       DaveE
>>
>> I tied to apply this fix, but those line numbers don't have endif  
>> statements.
>> As anyone else seen this issue and figured out how to fix it?
>> Thanks,
>> Chuck
>>
>> --------------------------------------------------------------------- 
>> ---
>>
>> _______________________________________________
>> EventCalendar mailing list
>> EventCalendar at firetree.net
>> http://penguin.firetree.net/cgi-bin/mailman/listinfo/eventcalendar
>>
>
> _______________________________________________
> EventCalendar mailing list
> EventCalendar at firetree.net
> http://penguin.firetree.net/cgi-bin/mailman/listinfo/eventcalendar




More information about the EventCalendar mailing list