예제 #1
0
function bp_wire_record_activity($args = true)
{
    if (function_exists('bp_activity_record')) {
        extract($args);
        bp_activity_record($item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id);
    }
}
예제 #2
0
function messages_record_activity($args = true)
{
    if (function_exists('bp_activity_record')) {
        extract($args);
        bp_activity_record($item_id, $component_name, $component_action, $is_private);
    }
}
예제 #3
0
/**
 * bp_zoneideas_record_activity()
 *
 * If the activity stream component is installed, this function will record activity items for your
 * component.
 *
 * You must pass the function an associated array of arguments:
 *
 *     $args = array( 
 *       'item_id' => The ID of the main piece of data being recorded, for zoneideas a group_id, user_id, forum_post_id
 *       'component_name' => The slug of the component.
 *       'component_action' => The action being carried out, for zoneideas 'new_friendship', 'joined_group'. You will use this to format activity.
 *     'is_private' => Boolean. Should this not be shown publicly?
 *       'user_id' => The user_id of the person you are recording this activity stream item for.
 *     'secondary_item_id' => (optional) If the activity is more complex you may need a second ID. For zoneideas a group forum post needs the group_id AND the forum_post_id.
 *       'secondary_user_id' => (optional) If this activity applies to two users, provide the second user_id. Eg, Andy and John are now friends should show on both users streams
 *     )
 */
function bp_zoneideas_record_activity($args)
{
    if (function_exists('bp_activity_record')) {
        extract((array) $args);
        bp_activity_record($item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id);
    }
}
예제 #4
0
function groups_record_activity($args = true)
{
    global $group_obj;
    if (function_exists('bp_activity_record')) {
        extract($args);
        if (!$group_obj) {
            if (!($group_obj = wp_cache_get('groups_group_nouserdata_' . $item_id, 'bp'))) {
                $group_obj = new BP_Groups_Group($item_id, false, false);
                wp_cache_set('groups_group_nouserdata_' . $item_id, $group_obj, 'bp');
            }
        }
        if ('public' == $group_obj->status) {
            bp_activity_record($item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id);
        }
    }
}
예제 #5
0
function bp_blogs_record_activity($args = true)
{
    global $bp;
    /* Because blog, comment, and blog post code execution happens before anything else
       we need to manually instantiate the activity component globals */
    if (!$bp->activity && function_exists('bp_activity_setup_globals')) {
        bp_activity_setup_globals();
    }
    if (function_exists('bp_activity_record')) {
        extract($args);
        bp_activity_record($item_id, $component_name, $component_action, $is_private, $secondary_item_id, $user_id, $secondary_user_id, $recorded_time);
    }
}