/**
  * Creates html for activity page
  */
 public function __construct()
 {
     switch (pageArray(1)) {
         default:
         case "all":
             $this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0));
             break;
         case "mine":
             $this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => getLoggedInUserGuid());
             break;
         case "friends":
             $this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => "('" . FriendsPlugin::getFriendGuidCSString(getLoggedInUser()) . "')", "operand" => "IN");
             break;
     }
     $this->params['count'] = true;
     $this->count = getEntities($this->params);
     unset($this->params['count']);
     $this->params['limit'] = 10;
     $entities = listEntities($this->params);
     $pagination = display("page_elements/pagination", array("count" => $this->count, "offset" => getInput("offset"), "limit" => $this->limit, "url" => "activity"));
     $this->tabs = display("page_elements/tabs", array("tabs" => array("All" => getSiteURL() . "activity", "Mine" => getSiteURL() . "activity/mine", "Friends" => getSiteURL() . "activity/friends")));
     $this->html = drawPage(array("header" => "Activity", "body" => $this->tabs . $entities . $pagination));
 }
/* * ***********************************************************************
 * 
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$activity_url = getSiteURL() . "activity";
$guid = Vars("guid");
$user = getEntity($guid);
if (isEnabledPlugin("Friends")) {
    $friends = FriendsPlugin::getFriendGuidCSString($user);
}
if (isset($friends)) {
    $params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "limit" => 8, "metadata_name" => "owner_guid", "metadata_value" => "(" . $friends . ")", "operand" => "IN");
    echo display("ajax/entity_list", array("params" => $params, "wrapper" => "ul", "wrapper_class" => "timeline timeline-small", "title" => translate("latest_friends_activity"), "id" => "ajax_friends_activity", "panel" => true));
}
<?php

/* * ***********************************************************************
 * 
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$friends = FriendsPlugin::getFriendGuidCSString(getLoggedInUser());
$blogs = listEntities(array("type" => "Blog", "limit" => 5, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => "(" . $friends . ")", "operand" => "IN"));
$count = getEntities(array("type" => "Blog", "count" => true, "metadata_name" => "owner_guid", "metadata_value" => "(" . $friends . ")", "operand" => "IN"));
echo $blogs;
echo display("page_elements/pagination", array("url" => getSiteURL() . "blogs/my_blogs", "offset" => getInput("offset", 0), "limit" => 5, "count" => $count));