• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_activity_add函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bp_activity_add函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_activity_add函数的具体用法?PHP bp_activity_add怎么用?PHP bp_activity_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bp_activity_add函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buddyreshare_handle_ajax_reshare

/**
 * Catches an activity to reshare if js is enabled
 *
 * @package BP Reshare
 * @since    1.0
 *
 * @uses  check_ajax_referer() for security reasons
 * @uses  buddyreshare_prepare_reshare() to build the reshare arguments
 * @uses  bp_activity_add() to save the reshare
 */
function buddyreshare_handle_ajax_reshare()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    check_ajax_referer('buddyreshare_update', 'nonce');
    $response = array('result' => 'error', 'message' => __('OOps, error while trying to reshare..', 'bp-reshare'));
    $activity_id = intval($_POST['activity']);
    if (empty($activity_id)) {
        $response['message'] = __('The activity was not found.', 'bp-reshare');
        exit(json_encode($response));
    }
    $args = buddyreshare_prepare_reshare($activity_id);
    if (isset($args['error'])) {
        $response['message'] = $args['error'];
        exit(json_encode($response));
    }
    $reshare_id = bp_activity_add($args);
    if (!empty($reshare_id)) {
        do_action('buddyreshare_reshare_added', $reshare_id);
        $response['result'] = 'success';
        $response['message'] = __('Activity successfully reshared.', 'bp-reshare');
    } else {
        do_action('buddyreshare_reshare_added_error', $reshare_id);
    }
    exit(json_encode($response));
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:38,代码来源:ajax.php


示例2: record_activity

 private static function record_activity($args = array())
 {
     // Default activity args
     $activity = array_merge(array('id' => null, 'user_id' => get_current_user_id(), 'type' => '', 'action' => '', 'item_id' => '', 'secondary_item_id' => '', 'content' => '', 'primary_link' => '', 'component' => 'dln-product-component', 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false), $args);
     // Add the activity
     return bp_activity_add($activity);
 }
开发者ID:httvncoder,项目名称:151722441,代码行数:7,代码来源:dln-buddypress-loader.php


示例3: bp_like_post_to_stream

/**
 * bp_like_post_to_stream()
 * 
 * Posts to stream, depending on settings
 * 
 * TODO, Should we be posted that people like comments to the feed? This can get messy..
 * Also no point having 20 posts saying people liked the same status..
 * 
 */
function bp_like_post_to_stream($item_id, $user_id)
{
    if (bp_like_get_settings('post_to_activity_stream') == 1) {
        $activity = bp_activity_get_specific(array('activity_ids' => $item_id, 'component' => 'buddypress-like'));
        $author_id = $activity['activities'][0]->user_id;
        if ($user_id == $author_id) {
            $action = bp_like_get_text('record_activity_likes_own');
        } elseif ($user_id == 0) {
            $action = bp_like_get_text('record_activity_likes_an');
        } else {
            $action = bp_like_get_text('record_activity_likes_users');
        }
        $liker = bp_core_get_userlink($user_id);
        $author = bp_core_get_userlink($author_id);
        $activity_url = bp_activity_get_permalink($item_id);
        $content = '';
        //content must be defined...
        /* Grab the content and make it into an excerpt of 140 chars if we're allowed */
        if (bp_like_get_settings('show_excerpt') == 1) {
            $content = $activity['activities'][0]->content;
            if (strlen($content) > bp_like_get_settings('excerpt_length')) {
                $content = substr($content, 0, bp_like_get_settings('excerpt_length'));
                $content = strip_tags($content);
                $content = $content . '...';
            }
        }
        /* Filter out the placeholders */
        $action = str_replace('%user%', $liker, $action);
        $action = str_replace('%permalink%', $activity_url, $action);
        $action = str_replace('%author%', $author, $action);
        bp_activity_add(array('action' => $action, 'content' => $content, 'primary_link' => $activity_url, 'component' => 'bp-like', 'type' => 'activity_liked', 'user_id' => $user_id, 'item_id' => $item_id));
    }
}
开发者ID:pausaura,项目名称:agora_nodes,代码行数:42,代码来源:activity-functions.php


示例4: buddyreshare_add_reshare

/**
 * Catches an activity to reshare if js is disabled
 *
 * @package BP Reshare
 * @since    1.0
 *
 * @uses  bp_is_activity_component() are we in activity component
 * @uses  bp_is_current_action() to check current action
 * @uses  buddyreshare_get_component_slug() to get component slug
 * @uses  bp_action_variable() to check the variables
 * @uses  check_admin_referer() for security reasons
 * @uses  bp_core_get_user_domain() to build user's url
 * @uses  bp_loggedin_user_id() to get current user's id
 * @uses  bp_get_activity_slug() to get activity slug
 * @uses  buddyreshare_prepare_reshare() to build the reshare arguments
 * @uses  bp_core_add_message() to print a warning message
 * @uses  bp_core_redirect() to safely redirect user
 * @uses  bp_activity_add() to save the reshare
 */
function buddyreshare_add_reshare()
{
    // Not adding a reshare
    if (!bp_is_activity_component() || !bp_is_current_action(buddyreshare_get_component_slug())) {
        return false;
    }
    // No reshare to add
    if (!bp_action_variable(0) || bp_action_variable(0) != 'add' || !bp_action_variable(1) || !is_numeric(bp_action_variable(1))) {
        return false;
    }
    $reshare_id = bp_action_variable(1);
    check_admin_referer('buddyreshare_update');
    // redirecting to user's profile
    $redirect = bp_core_get_user_domain(bp_loggedin_user_id()) . bp_get_activity_slug() . '/';
    $reshared_args = buddyreshare_prepare_reshare($reshare_id);
    if (isset($reshared_args['error'])) {
        bp_core_add_message($reshared_args['error'], 'error');
        bp_core_redirect($redirect);
    }
    $reshared = bp_activity_add($reshared_args);
    if (!empty($reshared)) {
        do_action('buddyreshare_reshare_added', $reshare_id);
        bp_core_add_message(__('Activity reshared !', 'bp-reshare'));
        bp_core_redirect($redirect);
    } else {
        do_action('buddyreshare_reshare_added_error', $reshare_id);
        bp_core_add_message(__('OOps, error while trying to reshare..', 'bp-reshare'), 'error');
        bp_core_redirect($redirect);
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:49,代码来源:actions.php


示例5: bp_reshare_post_reshare

/**
* let's add reshare if user's browser has javascript turned off
*/
function bp_reshare_post_reshare()
{
    if (!empty($_GET['to_reshare']) && is_numeric($_GET['to_reshare'])) {
        check_admin_referer('_reshare_update');
        $redirect = remove_query_arg(array('to_reshare', '_wpnonce'), wp_get_referer());
        /* We need to check if loggedin user is the author of the original activity
        		and if the loggedin user has already reshared this activity before posting the reshare */
        $to_reshare_id = intval($_GET['to_reshare']);
        if (bp_reshare_user_did_reshared($to_reshare_id)) {
            // user is the author of the original activity or already reshared
            do_action('bp_reshare_handle_nojs_already_reshared', $reshared_activity_id);
            bp_core_add_message(__('OOps, looks like you already reshared this activity or you are the author of it..', 'bp-reshare'), 'error');
            bp_core_redirect($redirect);
        } else {
            $reshared_args = bp_reshare_prepare_reshare($to_reshare_id);
            $reshared_activity_id = bp_activity_add($reshared_args);
            if (!empty($reshared_activity_id)) {
                do_action('bp_reshare_handle_nojs_posted', $reshared_activity_id);
                bp_core_add_message(__('Activity reshared !', 'bp-reshare'));
                bp_core_redirect($redirect);
            } else {
                do_action('bp_reshare_handle_nojs_missed', $reshared_activity_id);
                bp_core_add_message(__('OOps, error while trying to reshare..', 'bp-reshare'), 'error');
                bp_core_redirect($redirect);
            }
        }
    }
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:31,代码来源:bp-reshare-actions.php


示例6: create_object

 function create_object($args)
 {
     if (!isset($args['user_id'])) {
         $args['user_id'] = get_current_user_id();
     }
     return bp_activity_add($args);
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:7,代码来源:factory.php


示例7: friends_record_activity

/**
 * Record an activity item related to the Friends component.
 *
 * A wrapper for {@link bp_activity_add()} that provides some Friends-specific
 * defaults.
 *
 * @since 1.0.0
 *
 * @see bp_activity_add() for more detailed description of parameters and
 *      return values.
 *
 * @param array|string $args {
 *     An array of arguments for the new activity item. Accepts all parameters
 *     of {@link bp_activity_add()}. The one difference is the following
 *     argument, which has a different default here:
 *     @type string $component Default: the id of your Friends component
 *                             (usually 'friends').
 * }
 * @return bool See {@link bp_activity_add()}.
 */
function friends_record_activity($args = '')
{
    if (!bp_is_active('activity')) {
        return false;
    }
    $r = wp_parse_args($args, array('user_id' => bp_loggedin_user_id(), 'action' => '', 'content' => '', 'primary_link' => '', 'component' => buddypress()->friends->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false));
    return bp_activity_add($r);
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:28,代码来源:bp-friends-activity.php


示例8: bp_em_record_activity

/**
 * bp_em_record_activity()
 *
 * If the activity stream component is installed, this function will record activity items for your
 * component.
 */
function bp_em_record_activity($args = '')
{
    if (!function_exists('bp_activity_add')) {
        return false;
    }
    $defaults = array('id' => false, 'user_id' => '', 'action' => '', 'content' => '', 'primary_link' => '', 'component' => 'events-manager', 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => gmdate("Y-m-d H:i:s"), 'hide_sitewide' => false);
    $r = wp_parse_args($args, $defaults);
    extract($r);
    return bp_activity_add(array('id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
}
开发者ID:batruji,项目名称:metareading,代码行数:16,代码来源:bp-em-activity.php


示例9: friends_record_activity

function friends_record_activity($args = '')
{
    global $bp;
    if (!bp_is_active('activity')) {
        return false;
    }
    $defaults = array('user_id' => $bp->loggedin_user->id, 'action' => '', 'content' => '', 'primary_link' => '', 'component' => $bp->friends->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false);
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    return bp_activity_add(array('user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:11,代码来源:bp-friends-activity.php


示例10: bp_media_record_activity

function bp_media_record_activity($args = '')
{
    global $bp;
    if (!function_exists('bp_activity_add')) {
        return false;
    }
    $defaults = array('component' => BP_MEDIA_SLUG);
    add_filter('bp_activity_allowed_tags', 'bp_media_override_allowed_tags');
    $r = wp_parse_args($args, $defaults);
    $activity_id = bp_activity_add($r);
    return $activity_id;
}
开发者ID:nitun,项目名称:buddypress-media,代码行数:12,代码来源:bp-media-functions.php


示例11: bp_media_record_activity

function bp_media_record_activity($args = '')
{
    global $bp;
    if (!function_exists('bp_activity_add')) {
        return false;
    }
    $defaults = array('id' => false, 'action' => '', 'content' => '', 'component' => BP_MEDIA_SLUG, 'type' => false, 'primary_link' => '', 'user_id' => $bp->loggedin_user->id, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false);
    add_filter('bp_activity_allowed_tags', 'bp_media_override_allowed_tags');
    $r = wp_parse_args($args, $defaults);
    extract($r);
    $activity_id = bp_activity_add(array('id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
    return $activity_id;
}
开发者ID:rolandinsh,项目名称:buddypress-media,代码行数:13,代码来源:bp-media-functions.php


示例12: bbpvotes_buddypress_voted_activity

function bbpvotes_buddypress_voted_activity($post_id, $user_id, $vote)
{
    //check vote value
    if (is_bool($vote) === false) {
        return new WP_Error('vote_is_not_bool', __('Vote is not a boolean', 'bbpvotes'));
    }
    $voteplus = $vote === true;
    $voteminus = $vote === false;
    $post = get_post($post_id);
    $user_link = bbp_get_user_profile_link($user_id);
    //build item link
    if ($post->post_type == bbp_get_topic_post_type()) {
        $topic_id = $post->ID;
        $post_permalink = get_permalink($post->ID);
    } elseif ($post->post_type == bbp_get_reply_post_type()) {
        $topic_id = bbp_get_reply_topic_id($post->ID);
        $post_permalink = bbp_get_reply_url($post->ID);
    }
    //topic infos
    $topic = get_post($topic_id);
    $topic_author_link = bbp_get_user_profile_link($topic->post_author);
    $topic_title = $topic->post_title;
    $post_link = '<a href="' . $post_permalink . '">' . $topic_title . '</a>';
    if ($voteplus) {
        $type = 'bbpvotes_voted_up';
        if ($post->post_type == bbp_get_topic_post_type()) {
            $action = sprintf(esc_html__('%1$s voted up to the topic %2$s by %3$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
        } elseif ($post->post_type == bbp_get_reply_post_type()) {
            $action = sprintf(esc_html__('%1$s voted up to a reply by %3$s in the topic %2$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
        }
    } else {
        $type = 'bbpvotes_voted_down';
        if ($post->post_type == bbp_get_topic_post_type()) {
            $action = sprintf(esc_html__('%1$s voted down to the topic %2$s by %3$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
        } elseif ($post->post_type == bbp_get_reply_post_type()) {
            $action = sprintf(esc_html__('%1$s voted down to a reply by %3$s in the topic %2$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
        }
    }
    $args = array('action' => $action, 'component' => 'bbpress', 'type' => $type, 'item_id' => $topic->ID);
    if ($post->post_type == bbp_get_reply_post_type()) {
        $args['secondary_item_id'] = $post->ID;
    }
    /*
        if ($is_update){
       $previous_activity_id = 
       $args['id'] = $previous_activity_id;
        }
    */
    bp_activity_add($args);
}
开发者ID:ptrck-r,项目名称:bbpress-votes,代码行数:50,代码来源:bbpvotes-buddypress.php


示例13: answer_posted_activity

 /**
  * Create a wall activity for this user after posting an answer.
  *
  * @param CMA_AnswerThread $instance
  * @param CMA_Answer $answer
  */
 static function answer_posted_activity(CMA_AnswerThread $instance, CMA_Answer $answer)
 {
     if (!$instance->isPublished()) {
         return;
     } else {
         if (!$answer->isApproved()) {
             return;
         }
     }
     $post = $instance->getPost();
     $user_id = $answer->getAuthorId();
     $permalink = $answer->getPermalink();
     bp_activity_add(array('action' => sprintf(CMA::__('%s answered to the question "%s"'), bp_core_get_userlink($user_id), sprintf('<a href="%s">%s</a>', esc_attr($permalink), esc_html($instance->getTitle()))), 'content' => CMA_AnswerThread::lightContent($answer->getContent()), 'component' => self::COMPONENT, 'type' => 'answer_posted', 'primary_link' => $permalink, 'user_id' => $user_id, 'item_id' => $answer->getId()));
 }
开发者ID:hemangsk,项目名称:TCB,代码行数:20,代码来源:BuddyPress.php


示例14: bp_group_documents_record_activity

/**
 * bp_group_documents_record_activity()
 *
 * If the activity stream component is installed, this function will record upload
 * and edit activity items.
 */
function bp_group_documents_record_activity($args = '')
{
    global $bp;
    if (!function_exists('bp_activity_add')) {
        return false;
    }
    $defaults = array('primary_link' => bp_get_group_permalink($bp->groups->current_group), 'component_name' => 'groups', 'component_action' => false, 'hide_sitewide' => false, 'user_id' => $bp->loggedin_user->id, 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => false, 'content' => '');
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    // If the group is not public, don't broadcast updates.
    if ('public' != $bp->groups->current_group->status) {
        $hide_sitewide = 1;
    }
    return bp_activity_add(array('content' => $content, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'user_id' => $user_id, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'hide_sitewide' => $hide_sitewide, 'action' => $action));
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:21,代码来源:activity.php


示例15: bp_core_new_user_activity

/**
 * Create a "became a registered user" activity item when a user activates his account.
 *
 * @param array $user Array of userdata passed to bp_core_activated_user hook.
 *
 * @return bool
 */
function bp_core_new_user_activity($user)
{
    if (empty($user)) {
        return false;
    }
    if (is_array($user)) {
        $user_id = $user['user_id'];
    } else {
        $user_id = $user;
    }
    if (empty($user_id)) {
        return false;
    }
    bp_activity_add(array('user_id' => $user_id, 'component' => buddypress()->members->id, 'type' => 'new_member'));
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:22,代码来源:bp-members-activity.php


示例16: bp_reshare_handle_ajax_reshare

function bp_reshare_handle_ajax_reshare()
{
    check_ajax_referer('_reshare_update', 'nonce');
    $activity_id = $_POST['activity'];
    if (!$activity_id) {
        _e('Unknown activity ?!?', 'bp-reshare');
        die;
    }
    $args = bp_reshare_prepare_reshare($activity_id);
    if (bp_activity_add($args)) {
        echo '1';
    } else {
        _e('OOps, error while trying to reshare..', 'bp-reshare');
    }
    die;
}
开发者ID:KristianI,项目名称:bp-reshare,代码行数:16,代码来源:bp-reshare-ajax.php


示例17: groups_record_activity

function groups_record_activity($args = '')
{
    global $bp;
    if (!bp_is_active('activity')) {
        return false;
    }
    // If the group is not public, hide the activity sitewide.
    if (isset($bp->groups->current_group->status) && 'public' == $bp->groups->current_group->status) {
        $hide_sitewide = false;
    } else {
        $hide_sitewide = true;
    }
    $defaults = array('id' => false, 'user_id' => $bp->loggedin_user->id, 'action' => '', 'content' => '', 'primary_link' => '', 'component' => $bp->groups->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => $hide_sitewide);
    $r = nxt_parse_args($args, $defaults);
    extract($r);
    return bp_activity_add(array('id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:17,代码来源:bp-groups-activity.php


示例18: qa_buddypress_activity_post

function qa_buddypress_activity_post($args)
{
    global $bp;
    $defaults = array('content' => false, 'user_id' => $bp->loggedin_user->id);
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    // Record this on the user's profile
    $from_user_link = bp_core_get_userlink($user_id);
    $activity_action = $action;
    $activity_content = $content;
    $primary_link = bp_core_get_userlink($user_id, false, true);
    // Now write the values
    $activity_id = bp_activity_add(array('user_id' => $user_id, 'action' => apply_filters('bp_activity_new_update_action', $activity_action), 'content' => apply_filters('bp_activity_new_update_content', $activity_content), 'primary_link' => apply_filters('bp_activity_new_update_primary_link', $primary_link), 'component' => $bp->activity->id, 'type' => $type));
    // Add this update to the "latest update" usermeta so it can be fetched anywhere.
    bp_update_user_meta($bp->loggedin_user->id, 'bp_latest_update', array('id' => $activity_id, 'content' => wp_filter_kses($content)));
    do_action('bp_activity_posted_update', $content, $user_id, $activity_id);
    return $activity_id;
}
开发者ID:NoahY,项目名称:q2a-buddypress,代码行数:18,代码来源:qa-plugin.php


示例19: gmw_location_record_activity

/**
 * GMW Location function - post location to activity
 * @param $args
 * @return boolean|Ambigous <number, boolean, unknown, mixed>
 */
function gmw_location_record_activity($args)
{
    if (!function_exists('bp_activity_add')) {
        return false;
    }
    global $bp;
    $settings = get_option('gmw_options');
    $user_id = isset($args['user_id']) ? $args['user_id'] : $bp->loggedin_user->id;
    $from_user_link = bp_core_get_userlink($user_id);
    $defaults = array('id' => false, 'location' => false, 'user_id' => $user_id, 'action' => false, 'content' => '', 'primary_link' => bp_core_get_userlink($user_id, false, true), 'component' => $bp->gmw_location->id, 'type' => 'gmw_location', 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => gmdate("Y-m-d H:i:s"));
    $r = wp_parse_args($args, $defaults);
    extract($r);
    $cCity = !empty($_COOKIE['gmw_city']) ? urldecode($_COOKIE['gmw_city']) : false;
    $cState = !empty($_COOKIE['gmw_state']) ? urldecode($_COOKIE['gmw_state']) : false;
    $cCountry = !empty($_COOKIE['gmw_country']) ? urldecode($_COOKIE['gmw_country']) : false;
    $region = !empty($settings['general_settings']['country_code']) ? '&region=' . $settings['general_settings']['country_code'] : '';
    $language = !empty($settings['general_settings']['language_code']) ? '&hl=' . $settings['general_settings']['language_code'] : '';
    $activity_id = bp_activity_add(array('user_id' => $user_id, 'action' => sprintf(__('%s Updated new location at %s', 'GMW'), $from_user_link, '<span class="gmw-fl-activity-map-marker fa fa-map-marker"></span><a target="_blank" href="https://maps.google.com/maps?f=d' . $language . '' . $region . '&geocode=&saddr=' . $location . '&daddr=' . $cCity . ' ' . $cState . ' ' . $cCountry . '&ie=UTF8&z=12" >' . $location . '</a>'), 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time));
    //if ( $type == 'gmw_location' )
    //bp_update_user_meta( $user_id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );
    return $activity_id;
}
开发者ID:WP-Panda,项目名称:allergenics,代码行数:27,代码来源:gmw-fl-activity.php


示例20: bp_blogs_record_activity

function bp_blogs_record_activity($args = '')
{
    global $bp;
    if (!bp_is_active('activity')) {
        return false;
    }
    $defaults = array('user_id' => bp_loggedin_user_id(), 'action' => '', 'content' => '', 'primary_link' => '', 'component' => $bp->blogs->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, 'recorded_time' => bp_core_current_time(), 'hide_sitewide' => false);
    $r = wp_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    // Remove large images and replace them with just one image thumbnail
    if (bp_is_active('activity') && !empty($content)) {
        $content = bp_activity_thumbnail_content_images($content, $primary_link);
    }
    if (!empty($action)) {
        $action = apply_filters('bp_blogs_record_activity_action', $action);
    }
    if (!empty($content)) {
        $content = apply_filters('bp_blogs_record_activity_content', bp_create_excerpt($content), $content);
    }
    // Check for an existing entry and update if one exists.
    $id = bp_activity_get_activity_id(array('user_id' => $user_id, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id));
    return bp_activity_add(array('id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide));
}
开发者ID:newington,项目名称:buddypress,代码行数:23,代码来源:bp-blogs-activity.php



注:本文中的bp_activity_add函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_activity_add_user_favorite函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_activity_action函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap