prefix . 'communievents_events'; $limit = 10; $tz = new DateTimeZone(CommuniApi::TIMEZONE); $now_dt = new DateTime('now', $tz); $list = $wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name WHERE %s < end AND official=1 ORDER BY start LIMIT %d", $now_dt->format('Y-m-d H:i:s'), $limit)); if ($list) { $out .= '
| ' . $wp_locale->get_weekday_abbrev($wp_locale->get_weekday($start_dt->format('w'))) . ', '; $out .= ' | ' . $start_dt->format('j.') . $wp_locale->get_month_abbrev($wp_locale->get_month($start_dt->format('m'))); $out .= ' | ' . ($event->allday ? '' : $start_dt->format( 'G:i' )); $out .= ' | '; $out .= ''; $out .= $event->title; $out .= ''; } $out .= ' |