$params = array('max' => $number, 'object' => $show); $output .= '<div class="wpb_wrapper">'; $output .= '<div class="activity kleo-activity-streams">'; if (is_user_logged_in() && $post_form == 'yes') { ob_start(); bp_get_template_part('activity/post-form'); $output .= ob_get_clean(); } if (bp_has_activities($params)) { $output .= '<ul id="activity-stream" class="activity-list item-list">'; while (bp_activities()) { bp_the_activity(); $output .= '<li class="' . bp_get_activity_css_class() . '" id="activity-' . bp_get_activity_id() . '">'; $output .= '<div class="activity-avatar rounded">'; $output .= '<a class="kleo-activity-avatar" title="' . __('View Profile', 'kleo_framework') . '" href="' . bp_get_activity_user_link() . '">'; $output .= bp_get_activity_avatar(); $output .= '</a>'; $output .= '</div>'; // activity content $output .= '<div class="activity-content">'; $output .= '<div class="activity-header">'; $output .= bp_get_activity_action(); $output .= '</div>'; $output .= '<div class="activity-inner">'; if (bp_activity_has_content()) { $output .= bp_get_activity_content_body(); } $output .= '</div>'; $output .= '<div class="activity-meta">'; if (bp_get_activity_type() == 'activity_comment') { $output .= '<a href="' . bp_get_activity_thread_permalink() . '" class="view bp-secondary-action" title="' . __('View Conversation', 'buddypress') . '">' . __('View Conversation', 'buddypress') . '</a>';
/** * Output the avatar of the user that performed the action * * @since 1.1.0 * * @param array $args * * @uses bp_get_activity_avatar() */ function bp_activity_avatar($args = '') { echo bp_get_activity_avatar($args); }
/** * Do widget framework. * * @param array $instance The settings for the particular instance of the widget. */ public static function framework($instance) { global $gs_counter, $processed_activities; genesis_markup(array('html5' => '<article %s>', 'xhtml' => sprintf('<div class="%s">', implode(' ', get_post_class())), 'context' => 'entry')); $settings = get_option('widget_featured-content'); if (!isset($settings[3]['buddypress-group']) || 1 != $settings[3]['buddypress-group']) { GS_Featured_Content::action('thememixfc_before_post_content', $instance); GS_Featured_Content::action('thememixfc_post_content', $instance); GS_Featured_Content::action('thememixfc_after_post_content', $instance); } else { if (!isset($processed_activities)) { $processed_activities = array(); } $group_id = $settings[3]['buddypress-group-group']; if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) { while (bp_activities()) { bp_the_activity(); $url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/'); $fontawesome_position = $settings[3]['fontawesome-position']; $activity_id = bp_get_activity_id(); if (!in_array($activity_id, $processed_activities) && !isset($done)) { // Get image HTML if (isset($settings[3]['show_image']) && 1 == $settings[3]['show_image']) { $size = $settings[3]['image_size']; $image_html = bp_get_activity_avatar('type=' . $size); // Add image link to image HTML if (isset($settings[3]['link_image']) && 1 == $settings[3]['link_image']) { $image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '">' . $image_html . '</a>'; } } echo ' <article itemscope="itemscope" itemtype="http://schema.org/Event">'; if (isset($settings[3]['image_position']) && 'before-title' == $settings[3]['image_position']) { echo $image_html; } if ('before_title' == $fontawesome_position) { echo thememixfc_span_fontawesome(); } echo ' <h2 class="entry-title">'; if ('inline_before_title' == $fontawesome_position) { echo thememixfc_span_fontawesome(); } echo ' <a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">' . esc_html($group->name) . '</a>'; if ('inline_after_title' == $fontawesome_position) { echo thememixfc_span_fontawesome(); } echo ' </h2>'; if ('after_title' == $fontawesome_position) { echo thememixfc_span_fontawesome(); } if (isset($settings[3]['image_position']) && 'after-title' == $settings[3]['image_position']) { echo $image_html; } if (bp_activity_has_content()) { bp_activity_content_body(); } if (isset($settings[3]['image_position']) && 'after-content' == $settings[3]['image_position']) { echo $image_html; } echo ' </article>'; $processed_activities[] = $activity_id; $done = true; } } } } $gs_counter++; genesis_markup(array('html5' => '</article>', 'xhtml' => '</div>')); }
/** * @deprecated gears_get_activity_stream */ function gears_get_activity_stream() { $output = ''; $output .= '<li class="' . bp_get_activity_css_class() . '" id="activity-' . bp_get_activity_id() . '">'; $output .= '<div class="activity-avatar">'; $output .= '<a class="gears-activity-avatar" title="' . __('View Profile', 'gears') . '" href="' . bp_get_activity_user_link() . '">'; $output .= bp_get_activity_avatar(); $output .= '</a>'; $output .= '</div>'; // activity content $output .= '<div class="activity-content">'; $output .= '<div class="activity-header">'; $output .= bp_get_activity_action(); $output .= '</div>'; $output .= '<div class="activity-inner">'; if (bp_activity_has_content()) { $output .= bp_get_activity_content_body(); } $output .= '</div>'; do_action('bp_activity_entry_content'); $output .= '<div class="activity-meta">'; if (bp_get_activity_type() == 'activity_comment') { $output .= '<a href="' . bp_get_activity_thread_permalink() . '" class="view bp-secondary-action" title="' . __('View Conversation', 'gears') . '">' . __('View Conversation', 'gears') . '</a>'; } if (is_user_logged_in()) { if (bp_activity_can_favorite()) { if (!bp_get_activity_is_favorite()) { $output .= '<a href="' . bp_get_activity_favorite_link() . '" class="fav bp-secondary-action" title="' . esc_attr(__('Mark as Favorite', 'gears')) . '">' . __('Favorite', 'gears') . '</a>'; } else { $output .= '<a href="' . bp_get_activity_unfavorite_link() . '" class="unfav bp-secondary-action" title="' . esc_attr(__('Remove Favorite', 'gears')) . '">' . __('Remove Favorite', 'gears') . '</a>'; } } if (bp_activity_user_can_delete()) { $output .= bp_get_activity_delete_link(); } do_action('bp_activity_entry_meta'); } $output .= '</div>'; if (bp_get_activity_type() == 'activity_comment') { $output .= '<a href="' . bp_get_activity_thread_permalink() . '" class="view bp-secondary-action" title="' . __('View Conversation', 'gears') . '">' . __('View Conversation', 'gears'); } // end bp_get_activity_type() $output .= '</div>'; // end activity content $output .= '</li>'; return $output; }
* * @package BuddyPress * @subpackage bp-legacy */ global $bp, $wpdb, $activities_template; if (bp_activity_has_content()) { $bp->avatar->thumb->width = 75; $bp->avatar->thumb->width = 75; $postedBy = false; $skip = false; $activity_id = bp_get_activity_id(); $group_id = $wpdb->get_var("SELECT item_id FROM wp_bp_activity WHERE id={$activity_id}"); $group_id = intval($group_id); if ($group_id === 0 || $bp->current_component == 'groups' || $bp->current_component == 'activity' && $bp->current_action != 'just-me') { $link = bp_get_activity_user_link(); $avatar = bp_get_activity_avatar(); $user_id = $wpdb->get_var("SELECT user_id FROM wp_bp_activity WHERE id={$activity_id}"); $user_data = get_userdata($user_id); $name = $user_data->first_name . ' ' . $user_data->last_name; $img_class = 'round'; } else { $avatar = bp_core_fetch_avatar(array('item_id' => $group_id, 'object' => 'group', 'width' => 75, 'height' => 75)); $link = '/teams/' . $wpdb->get_var("SELECT slug FROM wp_bp_groups WHERE id={$group_id}"); $name = $wpdb->get_var("SELECT name FROM wp_bp_groups WHERE id={$group_id}"); $img_class = ''; } $date = date("F jS, Y", strtotime($activities_template->activity->date_recorded)); $otheruser = false; $regex_url = '/<a\\s[^>]*href=(\\"??)([^\\" >]*?)\\1[^>]*>@(.*)<\\/a>/siU'; $regex_username = '******'; if (preg_match_all($regex_url, $activities_template->activity->content, $matches)) {
function themefix_buddypress_groups_widget($settings, $key, $group) { global $gs_counter, $processed_activities; if (!isset($processed_activities)) { $processed_activities = array(); } $group_id = $settings[$key]['buddypress-group-group']; $group = groups_get_group(array('group_id' => $group_id)); if (bp_has_activities(bp_ajax_querystring('activity') . '&primary_id=' . $group_id)) { while (bp_activities()) { bp_the_activity(); $url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/'); $fontawesome_position = $settings[$key]['fontawesome-position']; $activity_id = bp_get_activity_id(); if (!in_array($activity_id, $processed_activities) && !isset($done)) { // Get image HTML if (isset($settings[$key]['show_image']) && 1 == $settings[$key]['show_image']) { $size = $settings[$key]['image_size']; $image_html = bp_get_activity_avatar('type=' . $size); // Add image link to image HTML if (isset($settings[$key]['link_image']) && 1 == $settings[$key]['link_image']) { if ('' == $settings[$key]['gravatar_alignment']) { $alignment = 'alignnone'; } else { $alignment = $settings[$key]['gravatar_alignment']; } $image_html = '<a href="' . esc_attr(bp_get_activity_user_link()) . '"><span class="' . esc_attr($alignment) . '">' . $image_html . '</span></a>'; } } echo ' <article itemscope="itemscope" itemtype="http://schema.org/Event">'; if (isset($settings[$key]['image_position']) && 'before-title' == $settings[$key]['image_position']) { echo $image_html; } if ('before_title' == $fontawesome_position) { thememix_featured_content_span_fontawesome($key); } echo ' <h2 class="entry-title">'; echo ' <a href="' . esc_url($url) . '" title="' . esc_attr($group->name) . '">'; if ('inline_before_title' == $fontawesome_position) { thememix_featured_content_span_fontawesome($key, true); echo ' '; } echo esc_html($group->name); if ('inline_after_title' == $fontawesome_position) { echo ' '; thememix_featured_content_span_fontawesome($key, true); } echo '</a>'; echo ' </h2>'; if ('after_title' == $fontawesome_position) { thememix_featured_content_span_fontawesome($key); } if (isset($settings[$key]['image_position']) && 'after-title' == $settings[$key]['image_position']) { echo $image_html; } if (bp_activity_has_content()) { bp_activity_content_body(); } if (isset($settings[$key]['image_position']) && 'after-content' == $settings[$key]['image_position']) { echo $image_html; } echo ' </article>'; $processed_activities[] = $activity_id; $done = true; } } } }