• Resolved mykael

    (@mykael)


    Hi guys,

    after updating to 5.5.3 I get a white page when I go to EM > Events in the backend. When I go to my EM > Recurring events page in the backend all my recurring events are listet.. Any ideas?

    Next issue: To display certain events in a table view I use this code in my page:

    <table>
    
    <thead>
          <tr>
            <th>Day</th>
            <th>Time</th>
    	<th>Level</th>
    	<th>Studio</th>
    	<th>Teacher</th>
    	<th>Infos</th>
           </tr>
       	</thead>
    
     <tbody>
    [events_list scope="this-week" limit="100"]
      <tr>
      	<td>#_ATT{Day}</td>
        <td>#_EVENTTIMES</td>
        <td> #_ATT{Level}</td>
        <td>#_ATT{Studio}</td>
        <td> #_ATT{Teacher}</td>
        <td>#_ATT{Infos}</td>
      </tr>
    [/events_list]
    </tbody>
    </table>

    I figured out that the problem is the scope=”this-week” which doesn’t work anymore since the update. The corresponding code in my functions.php is:

    $today = getdate();
    
    	add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);
    
    if (date('w') == 0)
    {
        function my_em_scope_conditions($conditions, $args){
        if( !empty($args['scope']) && $args['scope']=='this-week' ){
    		$now = time();
            $start_date = date('Y-m-d',strtotime('monday last week', $now));
    		$end_date = date('Y-m-d',strtotime('monday  last week + 6 days', $now));
    
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
    
    	    if( !empty($args['scope']) && $args['scope']=='next-week' ){
    		$now2 = time();
            $start_date = date('Y-m-d',strtotime('monday  this week', $now2));
    		$end_date = date('Y-m-d',strtotime('monday  this week + 6 days', $now2));
    
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
    
        return $conditions;
    }
    
    }
    else
    {
        function my_em_scope_conditions($conditions, $args){
        if( !empty($args['scope']) && $args['scope']=='this-week' ){
    		$now = time();
            $start_date = date('Y-m-d',strtotime('monday this week', $now));
    		$end_date = date('Y-m-d',strtotime('monday  this week + 6 days', $now));
    
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
    
    	    if( !empty($args['scope']) && $args['scope']=='next-week' ){
    		$now2 = time();
            $start_date = date('Y-m-d',strtotime('monday  next week', $now2));
    		$end_date = date('Y-m-d',strtotime('monday  next week + 6 days', $now2));
    
            $conditions['scope'] = " (event_start_date BETWEEN CAST('$start_date' AS DATE) AND CAST('$end_date' AS DATE)) OR (event_end_date BETWEEN CAST('$end_date' AS DATE) AND CAST('$start_date' AS DATE))";
        }
    
        return $conditions;
    }
    }
    
    add_filter( 'em_get_scopes','my_em_scopes',1,1);
    function my_em_scopes($scopes){
        $my_scopes = array(
            'this-week' => 'This Week',
    		'this-week' => 'Next Week'
        );
        return $scopes + $my_scopes;
    }

    Any idea where the bug can be?

    Thank you!
    Micha

    https://wordpress.org/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Micha,

    What do you see instead of this week’s events?

    Are you still getting the white screen in events admin? If you are try deactivating the plugin by renaming the /events-manager/ folder on the server to /events-manager-bak/.

    Go to the Plugins page and you’ll see Events Manager listed as being deactivated.

    Rename /events-manager-bak/ to /events-manager/, refresh the Plugins page and activate Events Manager as normal.

    Thread Starter mykael

    (@mykael)

    Hello,

    thanks for your quick reply.

    Here are my results:

    White screen: I did what you suggested.. still a white screen under
    /wp-admin/edit.php?post_type=event whereas under /wp-admin/edit.php?post_type=event-recurring I see the list of the events correctly 🙁

    Instead of this week’s events there is just nothing displayed. Even more: the site elements that follow directly UNDER the table e.g. footer are cut off.. so the code it not executed.

    Really no clue here..

    Micha

    Thread Starter mykael

    (@mykael)

    OK what I found out that the problem is NOT the scope functions.

    The problem is the limit=”100″ in my short codes.

    The scope filters all events for the week, let’s say this week 70 events. When I limit up to 69 it’s gone show the right output. When I limit equal or over 70 there is no output anymore.

    Can you use a scope of more than 70 when using a standard scope like 12-months?

    Are you still getting the white screen problem?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with EM admin page and scope function’ is closed to new replies.