function bp_last_activity($user_id = 0)
{
    echo apply_filters('bp_last_activity', bp_get_last_activity($user_id));
}
/**
 * Output the "active [x days ago]" string for a user.
 *
 * @see bp_get_last_activity() for a description of parameters.
 *
 * @param int $user_id See {@link bp_get_last_activity()}.
 */
function bp_last_activity($user_id = 0)
{
    /**
     * Filters the 'active [x days ago]' string for a user.
     *
     * @since 1.0.0
     *
     * @param string $value Formatted 'active [x days ago]' string.
     */
    echo apply_filters('bp_last_activity', bp_get_last_activity($user_id));
}
Exemple #3
0
function kleo_bp_get_new_group_invite_friend_list($args = '')
{
    global $bp;
    if (!bp_is_active('friends')) {
        return false;
    }
    $defaults = array('group_id' => false, 'separator' => 'li');
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    if (empty($group_id)) {
        $group_id = !empty($bp->groups->new_group_id) ? $bp->groups->new_group_id : $bp->groups->current_group->id;
    }
    if ($friends = friends_get_friends_invite_list(bp_loggedin_user_id(), $group_id)) {
        $invites = groups_get_invites_for_group(bp_loggedin_user_id(), $group_id);
        for ($i = 0, $count = count($friends); $i < $count; ++$i) {
            $checked = '';
            if (!empty($invites)) {
                if (in_array($friends[$i]['id'], $invites)) {
                    $checked = ' checked="checked"';
                }
            }
            $items[] = '<' . $separator . '>' . '<label class="mark-item">' . '<input class="checkbox-cb"' . $checked . ' type="checkbox" name="friends[]" id="f-' . $friends[$i]['id'] . '" value="' . esc_attr($friends[$i]['id']) . '" /> ' . '<span class="checkbox-mark"></span>' . '</label>' . '<div class="item-avatar rounded">' . get_avatar($friends[$i]['id']) . '</div>' . '<div class="invite-list-content"><h4>' . bp_core_get_userlink($friends[$i]['id']) . '</h4>' . '<span class="activity">' . bp_get_last_activity($friends[$i]['id']) . '</span>' . '<span class="group-invites-status"></span></div>' . '</' . $separator . '>';
        }
    }
    if (!empty($items)) {
        return implode("\n", (array) $items);
    }
    return false;
}