How To Get All Events By CiviCRM

Get All Events By CiviCRM Script

CiviEvents

“;
$output .= “

“;
$event_query = “SELECT * FROM `civicrm_event` WHERE is_active = 1 AND id IS NOT NULL”;
$event_results = mysql_query($event_query);
while($event_result = mysql_fetch_object($event_results)){
$time_date_arr = explode(” “,$event_result->start_date);
$date_arr = explode(“-“,$time_date_arr[0]) ;
$time_date_end_arr = explode(” “,$event_result->end_date);
$date_end_arr = explode(“-“,$time_date_end_arr[0]) ;
$months = array(‘January’,’February’,’March’,’April’,’May’,’June’,’July’,’August’,’September’,’October’,’November’,’December’);
$output .= “

“;
$output .= “

“;
}
return $output .= “

Event Title Start Date End Date Description
id.” style=text-align:left;color:#000;>”.$event_result->title.” “;
if($date_arr[0]!==”” && $date_arr[1]!==”” && $date_arr[2]!==””)
$output .= $months[$date_arr[1]-1] . ”   ” . $date_arr[2] . “th, ” . $date_arr[0];
$output .= ” 
“;
if($date_end_arr[0]!==”” && $date_end_arr[1]!==”” && $date_end_arr[2]!==””)
$output .= $months[$date_end_arr[1]-1] . ”   ” . $date_end_arr[2] . “th, ” . $date_end_arr[0];
$output .= “
“. $event_result->summary.” 

“;
}

echo compose_civi_events();
?>

Was this article helpful?

Related Articles