/**
  * Fetches Activity for rtmedia updates, if user id for activity is provided fetches the user specific rtmedia updates
  * @global type $activities_template
  * @param type $activity_user_id
  * @param type $activity_id
  * @return array(), Activity data
  */
 function rtmedia_api_get_feed($activity_user_id = FALSE, $activity_id = FALSE, $per_page = 10)
 {
     global $activities_template, $rtmediajsonapi;
     $activity_feed = array();
     extract($_REQUEST);
     $i = 0;
     $args = array('user_id' => $activity_user_id, 'action' => '', 'page' => !empty($_REQUEST['page']) ? $_REQUEST['page'] : 1, 'per_page' => $per_page, 'in' => $activity_id);
     if (bp_has_activities($args)) {
         $activity_feed['total_activity_count'] = $activities_template->total_activity_count;
         $activity_feed['total'] = ceil((int) $activities_template->total_activity_count / (int) $activities_template->pag_num);
         $activity_feed['current'] = $activities_template->pag_page;
         while (bp_activities()) {
             bp_the_activity();
             //Activity basic details
             $activity_feed[$i]['id'] = $activities_template->activity->id;
             $activity_feed[$i]['activity_type'] = $activities_template->activity->type;
             $activity_feed[$i]['activity_time'] = bp_get_activity_date_recorded();
             $activity_feed[$i]['activity_time_human'] = strip_tags(bp_insert_activity_meta(''));
             $activity_feed[$i]['activity_content'] = $activities_template->activity->content;
             //activity User
             if (!$activity_user_id) {
                 //Activity User data
                 $activity_feed[$i]['user'] = $this->rtmedia_api_user_data_from_id(bp_get_activity_user_id());
             }
             //Media Details
             if (class_exists("RTMediaModel")) {
                 $model = new RTMediaModel();
                 $media = $model->get_by_activity_id($activities_template->activity->id);
                 if (isset($media['result']) && count($media['result']) > 0) {
                     //Create media array
                     $media = $this->rtmedia_api_media_details($media['result']);
                 } else {
                     $media = false;
                 }
             }
             if ($activity_id) {
                 //Activity Comment Count
                 $id = $media[0]['id'];
                 $activity_feed[$i]['comments'] = $this->rtmedia_api_get_media_comments($id);
             }
             //Activity Image
             $activity_feed[$i]['media'] = $media;
             $i++;
         }
     }
     return $activity_feed;
 }
/**
 * Return the activity content body
 *
 * @since 1.2.0
 *
 * @global object $activities_template {@link BP_Activity_Template}
 * @uses bp_insert_activity_meta()
 * @uses apply_filters_ref_array() To call the 'bp_get_activity_content_body' hook
 *
 * @return string The activity content body
 */
function bp_get_activity_content_body()
{
    global $activities_template;
    // Backwards compatibility if action is not being used
    if (empty($activities_template->activity->action) && !empty($activities_template->activity->content)) {
        $activities_template->activity->content = bp_insert_activity_meta($activities_template->activity->content);
    }
    return apply_filters_ref_array('bp_get_activity_content_body', array($activities_template->activity->content, &$activities_template->activity));
}
/**
 * Return the activity content body
 *
 * @since BuddyPress (1.2.0)
 *
 * @global object $activities_template {@link BP_Activity_Template}
 * @uses bp_insert_activity_meta()
 * @uses apply_filters_ref_array() To call the 'bp_get_activity_content_body' hook.
 *
 * @return string The activity content body.
 */
function bp_get_activity_content_body()
{
    global $activities_template;
    // Backwards compatibility if action is not being used
    if (empty($activities_template->activity->action) && !empty($activities_template->activity->content)) {
        $activities_template->activity->content = bp_insert_activity_meta($activities_template->activity->content);
    }
    /**
     * Filters the activity content body.
     *
     * @since BuddyPress (1.2.0)
     *
     * @param array $value Array containing the current activity content body and the current activity.
     */
    return apply_filters_ref_array('bp_get_activity_content_body', array($activities_template->activity->content, &$activities_template->activity));
}
	function bp_get_activity_content_body() {
		global $activities_template;

		/* Backwards compatibility if action is not being used */
		if ( empty( $activities_template->activity->action ) && !empty( $activities_template->activity->content ) )
			$activities_template->activity->content = bp_insert_activity_meta( $activities_template->activity->content );

		return apply_filters( 'bp_get_activity_content_body', $activities_template->activity->content, &$activities_template->activity );
	}