[EventCalendar] v3.1 out soon?

Aylwin Cal aylwin.cal at gmail.com
Mon Jan 30 02:48:07 UTC 2006


Hi,

I'm using it with 3.0.3 with no problems.  In classes.php, find (around line
660 or so):

             } else {
                 if (mysql2date('U', $this->posts[0]->post_date_gmt) >
mysql2date('U', $now)) { //it's future dated
                     $this->is_preview = true;

After the line, $this->is_preview = true; insert the following code:

                    /* DIRTY FUTURE-POSTS HACK FOR EC3 */
                    if (function_exists('ec3_get_calendar')) {
                        global $ec3;
                        $ec3_post_0_is_event = intval($wpdb->get_var(
                            "SELECT COUNT(0) FROM $wpdb->post2cat WHERE
post_id="
                            .$this->posts[0]->ID." AND
category_id=$ec3->event_category"));
                        if ($ec3_post_0_is_event) {
                            $this->is_preview = false;
                        }
                    }
                    if ($this->is_preview)
                    /* DIRTY FUTURE-POSTS HACK FOR EC3 */

Afterwards, that area of code should look exactly like this:

            } else {
                if (mysql2date('U', $this->posts[0]->post_date_gmt) >
mysql2date('U', $now)) { //it's future dated
                    $this->is_preview = true;
                    /* DIRTY FUTURE-POSTS HACK FOR EC3 */
                    if (function_exists('ec3_get_calendar')) {
                        global $ec3;
                        $ec3_post_0_is_event = intval($wpdb->get_var(
                            "SELECT COUNT(0) FROM $wpdb->post2cat WHERE
post_id="
                            .$this->posts[0]->ID." AND
category_id=$ec3->event_category"));
                        if ($ec3_post_0_is_event) {
                            $this->is_preview = false;
                        }
                    }
                    if ($this->is_preview)
                    /* DIRTY FUTURE-POSTS HACK FOR EC3 */
                    if (!current_user_can('edit_post', $this->posts[0]->ID))
{
                        $this->posts = array ( );
                    }
                }
            }

I hope you get it to work.

Aylwin

On 1/30/06, Jørgen Thomsen <jt at jorgent.com> wrote:
>
> Hi.
>
> I saw that hack, but didn't understand it. I looked at it again now, and
> tried to replace the suggested code in classes.php with the hack, but
> then my whole website got blank. But is this hack only for v3.0? On 3.0
> I got some database problems when I tried to list my events, so I don't
> know if I'll switch to 3.0.
>
> - Jørgen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20060130/c4b055ee/attachment.html


More information about the EventCalendar mailing list