diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:42:50 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:42:50 -0300 |
commit | 971b54fe719ed70704fb3bcac4ef1d5f093cb454 (patch) | |
tree | 26e090c444b1e34881bc088a9cd6f3223e26047a /mod/graphstats/views/json/timeline | |
parent | 711dab09b5146e74dbeda56679c65e3b6bec71f3 (diff) | |
parent | 36102a094de700ee339f6eaeffb8ab16ba4f2f3b (diff) | |
download | elgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.gz elgg-971b54fe719ed70704fb3bcac4ef1d5f093cb454.tar.bz2 |
Merge commit '36102a094de700ee339f6eaeffb8ab16ba4f2f3b' as 'mod/graphstats'
Diffstat (limited to 'mod/graphstats/views/json/timeline')
-rw-r--r-- | mod/graphstats/views/json/timeline/group.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mod/graphstats/views/json/timeline/group.php b/mod/graphstats/views/json/timeline/group.php new file mode 100644 index 000000000..77655938b --- /dev/null +++ b/mod/graphstats/views/json/timeline/group.php @@ -0,0 +1,35 @@ +<?php + +$group_guid = sanitize_int(get_input('group_guid')); + +$entities = elgg_get_entities(array('container_guid'=>$group_guid, 'limit'=>0, 'type'=>'object')); +$events = array(); + +$db_prefix = elgg_get_config('dbprefix'); +$river = elgg_get_river(array( + 'limit' => 0, + 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"), + 'wheres' => array("(e1.container_guid = $group_guid)"), +)); + +foreach($river as $item){ + $subject = $item->getSubjectEntity(); + $object = $item->getObjectEntity(); + + array_push($events, array( + 'start' => date('c', $item->posted), + 'icon'=> $icon, + 'title' => $object->title, + 'classname' => 'hot_event', + 'description' => elgg_get_excerpt($object->description), + 'durationEvent' => false, + )); + +} + +$data = array( + 'dateTimeFormat'=>'iso8601', + 'events'=>$events, +); + +echo json_encode($data); |