コード例 #1
0
ファイル: bp-em-activity.php プロジェクト: hypenotic/slowfood
/**
 * Records new events to the activity stream.
 * @param unknown_type $result
 * @param unknown_type $EM_Event
 * @return unknown
 */
function bp_em_record_activity_event_save($result, $EM_Event)
{
    if ($result && $EM_Event->status == 1 && ($EM_Event->previous_status == 0 || !empty($EM_Event->is_new))) {
        $user = get_userdata($EM_Event->owner);
        bp_em_record_activity(array('user_id' => $user->ID, 'action' => sprintf(__('%s added a the event %s', 'dbem'), "<a href='" . get_bloginfo('wpurl') . '/' . BP_MEMBERS_SLUG . '/' . $user->user_login . "/'>" . $user->display_name . "</a>", $EM_Event->output('#_EVENTLINK')), 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_event', 'item_id' => $EM_Event->id));
    }
    return $result;
}
コード例 #2
0
ファイル: bp-em-activity.php プロジェクト: hypenotic/slowfood
/**
 * Records new events to the activity stream.
 * @param unknown_type $result
 * @param unknown_type $EM_Event
 * @return unknown
 */
function bp_em_record_activity_event_save($result, $EM_Event)
{
    if ($result && $EM_Event->status == 1 && ($EM_Event->previous_status == 0 || !empty($EM_Event->is_new))) {
        $user = get_userdata($EM_Event->owner);
        bp_em_record_activity(array('user_id' => $user->ID, 'action' => sprintf(__('%s added the event %s', 'dbem'), "<a href='" . get_bloginfo('wpurl') . '/' . BP_MEMBERS_SLUG . '/' . $user->user_login . "/'>" . $user->display_name . "</a>", $EM_Event->output('#_EVENTLINK')), 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_event', 'item_id' => $EM_Event->id));
        //group activity
        if (!empty($EM_Event->group_id)) {
            //tis a group event
            $group = new BP_Groups_Group($EM_Event->group_id);
            bp_em_record_activity(array('user_id' => $user->ID, 'action' => sprintf(__('%s added the event %s of the %s group.', 'dbem'), "<a href='" . get_bloginfo('wpurl') . '/' . BP_MEMBERS_SLUG . '/' . $user->user_login . "/'>" . $user->display_name . "</a>", $EM_Event->output('#_EVENTLINK'), '<a href="' . bp_get_group_permalink($group) . '">' . bp_get_group_name($group) . '</a>'), 'component' => 'groups', 'type' => 'new_event', 'item_id' => $EM_Event->group_id));
        }
    }
    return $result;
}
コード例 #3
0
/**
 * Records new events to the activity stream.
 * @param unknown_type $result
 * @param unknown_type $EM_Event
 * @return unknown
 */
function bp_em_record_activity_event_save($result, $EM_Event)
{
    if ($result && $EM_Event->event_status == 1 && $EM_Event->get_previous_status() != 1) {
        $user = get_userdata($EM_Event->event_owner);
        $member_link = bp_core_get_user_domain($user->ID);
        if (empty($EM_Event->group_id)) {
            bp_em_record_activity(array('user_id' => $user->ID, 'action' => sprintf(__('%s added the event %s', 'dbem'), "<a href='" . $member_link . "'>" . $user->display_name . "</a>", $EM_Event->output('#_EVENTLINK')), 'primary_link' => $EM_Event->output('#_EVENTURL'), 'type' => 'new_event', 'item_id' => $EM_Event->event_id, 'hide_sitewide' => $EM_Event->event_private));
        } else {
            //tis a group event
            $group = new BP_Groups_Group($EM_Event->group_id);
            bp_em_record_activity(array('user_id' => $user->ID, 'action' => sprintf(__('%s added the event %s to %s.', 'dbem'), "<a href='" . $member_link . "'>" . $user->display_name . "</a>", $EM_Event->output('#_EVENTLINK'), '<a href="' . bp_get_group_permalink($group) . '">' . bp_get_group_name($group) . '</a>'), 'component' => 'groups', 'type' => 'new_event', 'item_id' => $EM_Event->group_id, 'hide_sitewide' => $EM_Event->event_private));
        }
    }
    return $result;
}