function cc::get_activities in Constant Contact 7.3
Same name and namespace in other branches
- 6.3 class.cc.php \cc::get_activities()
- 6.2 class.cc.php \cc::get_activities()
Gets all activities.
@access public
File
- ./
class.cc.php, line 1010 - Constant Contact PHP Class
Class
- cc
- @file Constant Contact PHP Class
Code
function get_activities($action = 'activities') {
$xml = $this
->load_url($action);
if (!$xml) {
return FALSE;
}
// Parse into nicer array.
$activities = array();
$_activities = isset($xml['feed']['entry']) ? $xml['feed']['entry'] : FALSE;
if (is_array($_activities)) {
if (isset($_activities[0]['link_attr']['href'])) {
foreach ($_activities as $k => $v) {
$id = $this
->get_id_from_link($v['link_attr']['href']);
$activity = $v['content']['Activity'];
$activity['id'] = $id;
$activities[] = $activity;
}
}
else {
$id = $this
->get_id_from_link($_activities['link_attr']['href']);
$activity = $_activities['content']['Activity'];
$activity['id'] = $id;
$activities[] = $activity;
}
}
return $activities;
}