UPCOMING EVENTS

"; // count the number of events $event_count = count($obj['data']); for($x=0; $x<$event_count; $x++){ // set timezone date_default_timezone_set($obj['data'][$x]['timezone']); $start_date = date( 'l, F d, Y', strtotime($obj['data'][$x]['start_time'])); $start_time = date('g:i a', strtotime($obj['data'][$x]['start_time'])); $pic_big = isset($obj['data'][$x]['cover']['source']) ? $obj['data'][$x]['cover']['source'] : "https://graph.facebook.com/v2.7/{$fb_page_id}/picture?type=large"; $eid = $obj['data'][$x]['id']; $name = $obj['data'][$x]['name']; $description = isset($obj['data'][$x]['description']) ? $obj['data'][$x]['description'] : ""; // place $place_name = isset($obj['data'][$x]['place']['name']) ? $obj['data'][$x]['place']['name'] : ""; $city = isset($obj['data'][$x]['place']['location']['city']) ? $obj['data'][$x]['place']['location']['city'] : ""; $country = isset($obj['data'][$x]['place']['location']['country']) ? $obj['data'][$x]['place']['location']['country'] : ""; $zip = isset($obj['data'][$x]['place']['location']['zip']) ? $obj['data'][$x]['place']['location']['zip'] : ""; $location=""; if($place_name && $city && $country && $zip){ $location="{$place_name}, {$city}, {$country}, {$zip}"; }else{ $location="Location not set or event data is too old."; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "What:"; echo "{$name}"; echo ""; echo ""; echo "When:"; echo "{$start_date} at {$start_time}"; echo ""; echo ""; echo "Where:"; echo "{$location}"; echo ""; echo ""; echo "Description:"; echo "{$description}"; echo ""; echo ""; echo ""; echo ""; echo "View on Facebook"; echo ""; echo ""; } echo""; ?>
Demo Image Demo Image Demo Image Demo Image Demo Image