Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Archaniel

    (@archaniel)

    Well the thing is, if I remove the group-by, it works like a charm. $where is created in some complex manner (which I didn’t look much into)

    In the listing, there are 3 SQL queries performed with following $where statements. I can’t see any error there (as it doesn’t limit anything) and basically “group by” should take the FIRST occurence of the record

    following are the where conditions for statements executed after a click for “all events”

    string(241) ” WHERE (recurrence!=1 OR recurrence IS NULL) AND ( event_start_date >= CAST(‘2013-08-30’ AS DATE) OR (event_end_date >= CAST(‘2013-08-30’ AS DATE) AND event_end_date != ‘0000-00-00’ AND event_end_date IS NOT NULL)) AND (event_status=1)”

    string(241) ” WHERE (recurrence!=1 OR recurrence IS NULL) AND ( event_start_date >= CAST(‘2013-08-30’ AS DATE) OR (event_end_date >= CAST(‘2013-08-30’ AS DATE) AND event_end_date != ‘0000-00-00’ AND event_end_date IS NOT NULL)) AND (event_status=1)”

    string(241) ” WHERE (recurrence!=1 OR recurrence IS NULL) AND ( event_start_date >= CAST(‘2013-08-30’ AS DATE) OR (event_end_date >= CAST(‘2013-08-30’ AS DATE) AND event_end_date != ‘0000-00-00’ AND event_end_date IS NOT NULL)) AND (event_status=1)”

    Thread Starter Archaniel

    (@archaniel)

    Well I looked more into it, I made an external script which synchronized all bookings across all recurring events. It was called every minute and it kinda hanged the sql server up. Now it stopped (I’ve switched to manual sync)

    Anyway, I still look for a possibility to display only “upcomming” event from a recurring list. This is atm not possible 🙁

    my solution was about:

    $sql = apply_filters('em_events_get_sql',"
    			SELECT $selectors FROM $events_table
    			LEFT JOIN $locations_table ON {$locations_table}.location_id={$events_table}.location_id
    			$where".
    			( (is_admin() || $dev)? '' : ' GROUP BY event_name ' ).
    			"
    			$orderby_sql
    			$limit $offset
    		", $args);

    and in the count:

    if (!is_admin() || $dev) {
    				$rtemp = $wpdb->get_results( str_replace('COUNT(*)',$events_table.'.post_id',$sql), ARRAY_A);
    				return sizeof($rtemp);
    			}

    when $dev = false, the changes kick-in
    sadly, it shows not the all-first event from the recurring set, but only the second.
    I have no idea how to force it to display the first. Any ideas for a switch?

    Thread Starter Archaniel

    (@archaniel)

    Basically there are roughly 400 events generated (as each recurring is created as one event)
    And yes, it’s happening when listing a category – doesn’t matter if it’s in backend (management) or frontend – just a listing.

    But the listing of ALL events takes basically no time. I don’t understand it. Do you do some kinde of GROUP by in the statement which just consumes so much time?

    Thread Starter Archaniel

    (@archaniel)

    Nah, I recoded the wp-polls option quite much to get the functionality into it.
    I can share the modified plugin (it’s rather dirty made though)

    categories seem to be messed up. Mine ain’t showing up in admin menu on a clean install
    What about another theme ?

    … in case you’ll struggle:

    UPDATE wp_posts SET comment_status='closed' WHERE post_date<'2011-05-01 00:00:00'

    Thread Starter Archaniel

    (@archaniel)

    Thread Starter Archaniel

    (@archaniel)

    probbably found the problem

    it was the leading blank space in header.

    I don’t understand it 🙁

Viewing 8 replies - 1 through 8 (of 8 total)