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

PHP bp_is_group函数代码示例

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

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



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

示例1: mpp_is_group_gallery_component

/**
 * Is it groups gallery component?
 * @return boolean
 */
function mpp_is_group_gallery_component()
{
    if (function_exists('bp_is_group') && bp_is_group() && bp_is_current_action(MPP_GALLERY_SLUG)) {
        return true;
    }
    return false;
}
开发者ID:baden03,项目名称:mediapress,代码行数:11,代码来源:conditionals.php


示例2: lsx_buddypress_page_columns

/**
 * Forces the BP Profile Pages to be 1 Column
 * 
 * @package lsx
 * @subpackage jetpack
 * @category infinite scroll
 */
function lsx_buddypress_page_columns($layout)
{
    if (bp_is_profile_component() || bp_is_settings_component() || bp_is_activity_component() || bp_is_group() || bp_is_messages_component() || bp_is_members_directory() || bp_is_groups_directory() || bp_is_groups_component() || bp_is_members_component()) {
        $layout = '1c';
    }
    return $layout;
}
开发者ID:LinaPeterssonOberg,项目名称:exam,代码行数:14,代码来源:buddypress.php


示例3: setup_item

 /**
  * Gets the item id of the item (eg group, user) associated with the page you're on.
  *
  * @package BuddyPress Docs
  * @since 1.0-beta
  *
  * @return str $view The current item type
  */
 function setup_item()
 {
     global $bp;
     if (empty($this->item_type)) {
         return false;
     }
     $id = '';
     $name = '';
     $slug = '';
     switch ($this->item_type) {
         case 'group':
             if (bp_is_group()) {
                 $group = groups_get_current_group();
                 $id = $group->id;
                 $name = $group->name;
                 $slug = $group->slug;
             }
             break;
         case 'user':
             if (bp_is_user()) {
                 $id = bp_displayed_user_id();
                 $name = bp_get_displayed_user_fullname();
                 $slug = bp_get_displayed_user_username();
             }
             break;
     }
     // Todo: abstract into groups. Will be a pain
     $this->item_id = apply_filters('bp_docs_get_item_id', $id);
     $this->item_name = apply_filters('bp_docs_get_item_name', $name);
     $this->item_slug = apply_filters('bp_docs_get_item_slug', $slug);
     // Put some stuff in $bp
     $bp->bp_docs->current_item = $this->item_id;
 }
开发者ID:Apatrid,项目名称:buddypress-docs,代码行数:41,代码来源:query-builder.php


示例4: bp_activity_at_message_notification

/**
 * Sends an email notification and a BP notification when someone mentions you in an update
 *
 * @since BuddyPress (1.2)
 *
 * @param int $activity_id The id of the activity update
 * @param int $receiver_user_id The unique user_id of the user who is receiving the update
 *
 * @uses bp_core_add_notification()
 * @uses bp_get_user_meta()
 * @uses bp_core_get_user_displayname()
 * @uses bp_activity_get_permalink()
 * @uses bp_core_get_user_domain()
 * @uses bp_get_settings_slug()
 * @uses bp_activity_filter_kses()
 * @uses bp_core_get_core_userdata()
 * @uses wp_specialchars_decode()
 * @uses get_blog_option()
 * @uses bp_is_active()
 * @uses bp_is_group()
 * @uses bp_get_current_group_name()
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_to' hook
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook
 * @uses wp_mail()
 * @uses do_action() To call the 'bp_activity_sent_mention_email' hook
 */
function bp_activity_at_message_notification($activity_id, $receiver_user_id)
{
    // Don't leave multiple notifications for the same activity item
    $notifications = BP_Core_Notification::get_all_for_user($receiver_user_id, 'all');
    foreach ($notifications as $notification) {
        if ($activity_id == $notification->item_id) {
            return;
        }
    }
    $activity = new BP_Activity_Activity($activity_id);
    $subject = '';
    $message = '';
    $content = '';
    // Add the BP notification
    bp_core_add_notification($activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id);
    // Now email the user with the contents of the message (if they have enabled email notifications)
    if ('no' != bp_get_user_meta($receiver_user_id, 'notification_activity_new_mention', true)) {
        $poster_name = bp_core_get_user_displayname($activity->user_id);
        $message_link = bp_activity_get_permalink($activity_id);
        $settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
        $settings_link = bp_core_get_user_domain($receiver_user_id) . $settings_slug . '/notifications/';
        $poster_name = stripslashes($poster_name);
        $content = bp_activity_filter_kses(strip_tags(stripslashes($activity->content)));
        // Set up and send the message
        $ud = bp_core_get_core_userdata($receiver_user_id);
        $to = $ud->user_email;
        $subject = bp_get_email_subject(array('text' => sprintf(__('%s mentioned you in an update', 'buddypress'), $poster_name)));
        if (bp_is_active('groups') && bp_is_group()) {
            $message = sprintf(__('%1$s mentioned you in the group "%2$s":

"%3$s"

To view and respond to the message, log in and visit: %4$s

---------------------
', 'buddypress'), $poster_name, bp_get_current_group_name(), $content, $message_link);
        } else {
            $message = sprintf(__('%1$s mentioned you in an update:

"%2$s"

To view and respond to the message, log in and visit: %3$s

---------------------
', 'buddypress'), $poster_name, $content, $message_link);
        }
        // Only show the disable notifications line if the settings component is enabled
        if (bp_is_active('settings')) {
            $message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
        }
        /* Send the message */
        $to = apply_filters('bp_activity_at_message_notification_to', $to);
        $subject = apply_filters('bp_activity_at_message_notification_subject', $subject, $poster_name);
        $message = apply_filters('bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link);
        wp_mail($to, $subject, $message);
    }
    do_action('bp_activity_sent_mention_email', $activity, $subject, $message, $content);
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:85,代码来源:bp-activity-notifications.php


示例5: bp_groups_group_access_protection

/**
 * Protect access to single groups.
 *
 * @since BuddyPress (2.1.0)
 */
function bp_groups_group_access_protection()
{
    if (!bp_is_group()) {
        return;
    }
    $current_group = groups_get_current_group();
    $user_has_access = $current_group->user_has_access;
    $no_access_args = array();
    if (!$user_has_access && 'hidden' !== $current_group->status) {
        // Always allow access to home and request-membership
        if (bp_is_current_action('home') || bp_is_current_action('request-membership')) {
            $user_has_access = true;
            // User doesn't have access, so set up redirect args
        } else {
            if (is_user_logged_in()) {
                $no_access_args = array('message' => __('You do not have access to this group.', 'buddypress'), 'root' => bp_get_group_permalink($current_group) . 'home/', 'redirect' => false);
            }
        }
    }
    // Protect the admin tab from non-admins
    if (bp_is_current_action('admin') && !bp_is_item_admin()) {
        $user_has_access = false;
        $no_access_args = array('message' => __('You are not an admin of this group.', 'buddypress'), 'root' => bp_get_group_permalink($current_group), 'redirect' => false);
    }
    /**
     * Allow plugins to filter whether the current user has access to this group content.
     *
     * Note that if a plugin sets $user_has_access to false, it may also
     * want to change the $no_access_args, to avoid problems such as
     * logged-in users being redirected to wp-login.php.
     *
     * @since BuddyPress (2.1.0)
     *
     * @param bool $user_has_access True if the user has access to the
     *        content, otherwise false.
     * @param array $no_access_args Arguments to be passed to
     *        bp_core_no_access() in case of no access. Note that this
     *        value is passed by reference, so it can be modified by the
     *        filter callback.
     */
    $user_has_access = apply_filters_ref_array('bp_group_user_has_access', array($user_has_access, &$no_access_args));
    // If user has access, we return rather than redirect
    if ($user_has_access) {
        return;
    }
    // Hidden groups should return a 404 for non-members.
    // Unset the current group so that you're not redirected
    // to the default group tab
    if ('hidden' == $current_group->status) {
        buddypress()->groups->current_group = 0;
        buddypress()->is_single_item = false;
        bp_do_404();
        return;
    } else {
        bp_core_no_access($no_access_args);
    }
}
开发者ID:eresyyl,项目名称:mk,代码行数:62,代码来源:bp-groups-actions.php


示例6: mpp_group_filter_status

function mpp_group_filter_status($statuses)
{
    if (bp_is_group()) {
        unset($statuses['friends']);
        unset($statuses['private']);
    } else {
        unset($statuses['groupsonly']);
    }
    return $statuses;
}
开发者ID:markc,项目名称:mediapress,代码行数:10,代码来源:mpp-bp-groups-loader.php


示例7: bcg_is_disabled_for_group

/**
 *
 * @global type $bp
 * @return type 
 */
function bcg_is_disabled_for_group()
{
    $bp = buddypress();
    $group_id = false;
    if (bp_is_group_create()) {
        $group_id = $_COOKIE['bp_new_group_id'];
    } elseif (bp_is_group()) {
        $group_id = $bp->groups->current_group->id;
    }
    return apply_filters('bcg_is_disabled_for_group', bcg_is_disabled($group_id));
}
开发者ID:WP--plugins,项目名称:blog-categories-for-groups,代码行数:16,代码来源:bcg-functions.php


示例8: training_wpo_buddypress_init

 function training_wpo_buddypress_init()
 {
     if (bp_is_user_activity()) {
         remove_action('wpo_layout_breadcrumbs_buddy_render', 'training_wpo_layout_breadcrumbs_buddypress');
         add_action('wpo_layout_breadcrumbs_buddy_render', 'training_wpo_buddypress_user_header');
     }
     if (bp_is_group()) {
         remove_action('wpo_layout_breadcrumbs_buddy_render', 'training_wpo_layout_breadcrumbs_buddypress');
         add_action('wpo_layout_breadcrumbs_buddy_render', 'training_wpo_buddypress_group_header');
     }
 }
开发者ID:morganloehr,项目名称:chris-verna,代码行数:11,代码来源:function.php


示例9: mp_group_nav

function mp_group_nav()
{
    if (!bp_is_group()) {
        return;
    }
    $component = 'groups';
    $component_id = groups_get_current_group()->id;
    if (mpp_user_can_create_gallery($component, $component_id)) {
        echo sprintf("<li><a href='%s'>%s</a></li>", mpp_get_gallery_base_url($component, $component_id), __('All Galleries', 'mediapress'));
        echo sprintf("<li><a href='%s'>%s</a></li>", mpp_get_gallery_create_url($component, $component_id), __('Create Gallery', 'mediapress'));
    }
}
开发者ID:enboig,项目名称:mediapress,代码行数:12,代码来源:mpp-bp-groups-hooks.php


示例10: cfbgr_is_restriction_js

/**
 * Load the js only when needed
 *
 * @return bool
 */
function cfbgr_is_restriction_js()
{
    // Group create
    if (bp_is_group_create() && bp_is_group_creation_step('group-settings')) {
        return true;
    }
    // Group manage
    if (bp_is_group() && bp_is_group_admin_screen('group-settings')) {
        return true;
    }
    return false;
}
开发者ID:WeFoster,项目名称:buddypress-group-restrictions,代码行数:17,代码来源:functions.php


示例11: wff_populate_group_global

/**
 * Populate the $groups_template global for use outside the loop
 *
 * We build the group navigation outside the groups loop. In order to use BP's
 * group template functions while building the nav, we must have the template
 * global populated. In this function, we fill in any missing data, based on
 * the current group.
 *
 * This issue should be fixed more elegantly upstream in BuddyPress, ideally
 * by making the template functions fall back on the current group when the
 * loop global is not populated.
 */
function wff_populate_group_global()
{
    global $groups_template;
    if (bp_is_group() && isset($groups_template->groups[0]->group_id) && empty($groups_template->groups[0]->name)) {
        $current_group = groups_get_current_group();
        // Fill in all missing properties
        foreach ($current_group as $cur_key => $cur_value) {
            if (!isset($groups_template->groups[0]->{$cur_key})) {
                $groups_template->groups[0]->{$cur_key} = $cur_value;
            }
        }
    }
}
开发者ID:WeFoster,项目名称:wefoster,代码行数:25,代码来源:bp-general.php


示例12: bp_activity_at_message_notification

/**
 * Sends an email notification and a BP notification when someone mentions you in an update
 *
 * @since 1.2.0
 *
 * @param int $activity_id The id of the activity update
 * @param int $receiver_user_id The unique user_id of the user who is receiving the update
 *
 * @global object $bp BuddyPress global settings
 * @uses bp_core_add_notification()
 * @uses bp_get_user_meta()
 * @uses bp_core_get_user_displayname()
 * @uses bp_activity_get_permalink()
 * @uses bp_core_get_user_domain()
 * @uses bp_get_settings_slug()
 * @uses bp_activity_filter_kses()
 * @uses bp_core_get_core_userdata()
 * @uses nxt_specialchars_decode()
 * @uses get_blog_option()
 * @uses bp_is_active()
 * @uses bp_is_group()
 * @uses bp_get_current_group_name()
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_to' hook
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook
 * @uses nxt_mail()
 * @uses do_action() To call the 'bp_activity_sent_mention_email' hook
 */
function bp_activity_at_message_notification($activity_id, $receiver_user_id)
{
    global $bp;
    $activity = new BP_Activity_Activity($activity_id);
    $subject = '';
    $message = '';
    // Add the BP notification
    bp_core_add_notification($activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id);
    // Now email the user with the contents of the message (if they have enabled email notifications)
    if ('no' != bp_get_user_meta($receiver_user_id, 'notification_activity_new_mention', true)) {
        $poster_name = bp_core_get_user_displayname($activity->user_id);
        $message_link = bp_activity_get_permalink($activity_id);
        $settings_slug = function_exists('bp_get_settings_slug') ? bp_get_settings_slug() : 'settings';
        $settings_link = bp_core_get_user_domain($receiver_user_id) . $settings_slug . '/notifications/';
        $poster_name = stripslashes($poster_name);
        $content = bp_activity_filter_kses(strip_tags(stripslashes($activity->content)));
        // Set up and send the message
        $ud = bp_core_get_core_userdata($receiver_user_id);
        $to = $ud->user_email;
        $sitename = nxt_specialchars_decode(get_blog_option(bp_get_root_blog_id(), 'blogname'), ENT_QUOTES);
        $subject = '[' . $sitename . '] ' . sprintf(__('%s mentioned you in an update', 'buddypress'), $poster_name);
        if (bp_is_active('groups') && bp_is_group()) {
            $message = sprintf(__('%1$s mentioned you in the group "%2$s":

"%3$s"

To view and respond to the message, log in and visit: %4$s

---------------------
', 'buddypress'), $poster_name, bp_get_current_group_name(), $content, $message_link);
        } else {
            $message = sprintf(__('%1$s mentioned you in an update:

"%2$s"

To view and respond to the message, log in and visit: %3$s

---------------------
', 'buddypress'), $poster_name, $content, $message_link);
        }
        $message .= sprintf(__('To disable these notifications please log in and go to: %s', 'buddypress'), $settings_link);
        /* Send the message */
        $to = apply_filters('bp_activity_at_message_notification_to', $to);
        $subject = apply_filters('bp_activity_at_message_notification_subject', $subject, $poster_name);
        $message = apply_filters('bp_activity_at_message_notification_message', $message, $poster_name, $content, $message_link, $settings_link);
        nxt_mail($to, $subject, $message);
    }
    do_action('bp_activity_sent_mention_email', $activity, $subject, $message, $content);
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:77,代码来源:bp-activity-notifications.php


示例13: klein_get_cover_photo_src

/**
 * Returns the cover photo url
 * @return string the cover photo url
 */
function klein_get_cover_photo_src()
{
    if (!function_exists('bcp_get_cover_photo')) {
        return;
    }
    $item_id = bp_displayed_user_id();
    $item_type = 'user';
    if (bp_is_group()) {
        $item_id = bp_get_group_id();
        $item_type = 'group';
    }
    $args = array('type' => $item_type, 'object_id' => $item_id);
    $cover_photo_url = esc_url(bcp_get_cover_photo($args));
    return $cover_photo_url;
}
开发者ID:poweronio,项目名称:mbsite,代码行数:19,代码来源:buddypress.php


示例14: set_bp_component_context

 /**
  *
  */
 function set_bp_component_context()
 {
     if (bp_displayed_user_id() && !bp_is_group()) {
         $this->type = 'profile';
     } else {
         if (!bp_displayed_user_id() && bp_is_group()) {
             $this->type = 'group';
         } else {
             $this->type = 'profile';
         }
     }
     $this->id = $this->get_current_bp_component_id();
     if ($this->id == null) {
         global $bp;
         $this->id = $bp->loggedin_user->id;
     }
 }
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:20,代码来源:RTMediaContext.php


示例15: bp_groups_group_admin_menu

/**
 * Adds the Group Admin top-level menu to group pages
 *
 * @package BuddyPress
 * @since 1.5
 *
 * @todo Add dynamic menu items for group extensions
 */
function bp_groups_group_admin_menu()
{
    global $nxt_admin_bar, $bp;
    // Only show if viewing a group
    if (!bp_is_group()) {
        return false;
    }
    // Only show this menu to group admins and super admins
    if (!is_super_admin() && !bp_group_is_admin()) {
        return false;
    }
    if ('3.2' == bp_get_major_nxt_version()) {
        // Group avatar
        $avatar = bp_core_fetch_avatar(array('object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'width' => 16, 'height' => 16));
        // Unique ID for the 'My Account' menu
        $bp->group_admin_menu_id = !empty($avatar) ? 'group-admin-with-avatar' : 'group-admin';
        // Add the top-level Group Admin button
        $nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => $avatar . bp_get_current_group_name(), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    } elseif ('3.3' == bp_get_major_nxt_version()) {
        // Unique ID for the 'My Account' menu
        $bp->group_admin_menu_id = 'group-admin';
        // Add the top-level Group Admin button
        $nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    }
    // Group Admin > Edit details
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
    // Group Admin > Group settings
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
    // Group Admin > Group avatar
    if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
    }
    // Group Admin > Manage invitations
    if (bp_is_active('friends')) {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
    }
    // Group Admin > Manage members
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
    // Group Admin > Membership Requests
    if (bp_get_group_status($bp->groups->current_group) == 'private') {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
    }
    // Delete Group
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:53,代码来源:bp-groups-adminbar.php


示例16: bp_activity_at_message_notification

/**
 * Send email and BP notifications when a user is mentioned in an update.
 *
 * @since 1.2.0
 *
 * @uses bp_notifications_add_notification()
 * @uses bp_get_user_meta()
 * @uses bp_core_get_user_displayname()
 * @uses bp_activity_get_permalink()
 * @uses bp_core_get_user_domain()
 * @uses bp_get_settings_slug()
 * @uses bp_activity_filter_kses()
 * @uses bp_core_get_core_userdata()
 * @uses wp_specialchars_decode()
 * @uses get_blog_option()
 * @uses bp_is_active()
 * @uses bp_is_group()
 * @uses bp_get_current_group_name()
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_to' hook.
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_subject' hook.
 * @uses apply_filters() To call the 'bp_activity_at_message_notification_message' hook.
 * @uses wp_mail()
 * @uses do_action() To call the 'bp_activity_sent_mention_email' hook.
 *
 * @param int $activity_id      The ID of the activity update.
 * @param int $receiver_user_id The ID of the user who is receiving the update.
 */
function bp_activity_at_message_notification($activity_id, $receiver_user_id)
{
    $notifications = BP_Core_Notification::get_all_for_user($receiver_user_id, 'all');
    // Don't leave multiple notifications for the same activity item.
    foreach ($notifications as $notification) {
        if ($activity_id == $notification->item_id) {
            return;
        }
    }
    $activity = new BP_Activity_Activity($activity_id);
    $email_type = 'activity-at-message';
    $group_name = '';
    $message_link = bp_activity_get_permalink($activity_id);
    $poster_name = bp_core_get_user_displayname($activity->user_id);
    remove_filter('bp_get_activity_content_body', 'convert_smilies');
    remove_filter('bp_get_activity_content_body', 'wpautop');
    remove_filter('bp_get_activity_content_body', 'bp_activity_truncate_entry', 5);
    /** This filter is documented in bp-activity/bp-activity-template.php */
    $content = apply_filters('bp_get_activity_content_body', $activity->content);
    add_filter('bp_get_activity_content_body', 'convert_smilies');
    add_filter('bp_get_activity_content_body', 'wpautop');
    add_filter('bp_get_activity_content_body', 'bp_activity_truncate_entry', 5);
    // Now email the user with the contents of the message (if they have enabled email notifications).
    if ('no' != bp_get_user_meta($receiver_user_id, 'notification_activity_new_mention', true)) {
        if (bp_is_active('groups') && bp_is_group()) {
            $email_type = 'groups-at-message';
            $group_name = bp_get_current_group_name();
        }
        $args = array('tokens' => array('activity' => $activity, 'usermessage' => wp_strip_all_tags($content), 'group.name' => $group_name, 'mentioned.url' => $message_link, 'poster.name' => $poster_name, 'receiver-user.id' => $receiver_user_id));
        bp_send_email($email_type, $receiver_user_id, $args);
    }
    /**
     * Fires after the sending of an @mention email notification.
     *
     * @since 1.5.0
     * @since 2.5.0 $subject, $message, $content arguments unset and deprecated.
     *
     * @param BP_Activity_Activity $activity         Activity Item object.
     * @param string               $deprecated       Removed in 2.5; now an empty string.
     * @param string               $deprecated       Removed in 2.5; now an empty string.
     * @param string               $deprecated       Removed in 2.5; now an empty string.
     * @param int                  $receiver_user_id The ID of the user who is receiving the update.
     */
    do_action('bp_activity_sent_mention_email', $activity, '', '', '', $receiver_user_id);
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:72,代码来源:bp-activity-notifications.php


示例17: humcore_ajax_return_solr_results

/**
 * Return solr results when called from an ajax call.
 */
function humcore_ajax_return_solr_results()
{
    ob_start();
    if (bp_is_user()) {
        locate_template(array('deposits/user-deposits-loop.php'), true);
    } else {
        if (bp_is_group()) {
            locate_template(array('deposits/group-deposits-loop.php'), true);
        } else {
            locate_template(array('deposits/deposits-loop.php'), true);
        }
    }
    $results = ob_get_contents();
    ob_end_clean();
    echo $results;
    // XSS OK.
    exit;
}
开发者ID:MartinPaulEve,项目名称:humcore,代码行数:21,代码来源:template.php


示例18: group_activity_subscription

 function group_activity_subscription()
 {
     $this->name = __('Email Options', 'bp-ass');
     $this->slug = 'notifications';
     // Only enable the notifications nav item if the user is a member of the group
     if (bp_is_group() && groups_is_user_member(bp_loggedin_user_id(), bp_get_current_group_id())) {
         $this->enable_nav_item = true;
     } else {
         $this->enable_nav_item = false;
     }
     $this->nav_item_position = 91;
     $this->enable_create_step = false;
     if (get_option('ass-admin-can-send-email') == 'no') {
         $this->enable_edit_item = false;
     }
     // hook in the css and js
     add_action('wp_print_styles', array(&$this, 'add_settings_stylesheet'));
     add_action('wp_enqueue_scripts', array(&$this, 'ass_add_javascript'), 1);
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:19,代码来源:bp-activity-subscription-main.php


示例19: view_single

 public function view_single()
 {
     $bp = buddypress();
     if (function_exists('bp_is_group') && !bp_is_group()) {
         return;
     }
     //do not catch the request for creating new post
     if (bp_is_action_variable('create', 0)) {
         return;
     }
     $current_group = groups_get_current_group();
     if (bcg_is_disabled($current_group->id)) {
         return;
     }
     //if the group is private/hidden and user is not member, return
     if (($current_group->status == 'private' || $current_group->status == 'hidden') && (!is_user_logged_in() || !groups_is_user_member(bp_loggedin_user_id(), $current_group->id))) {
         return;
         //avoid prioivacy troubles
     }
     if (bcg_is_component() && !empty($bp->action_variables[0])) {
         //should we check for the existence of the post?
         add_action('bp_template_content', array($this, 'get_single_post_contents'));
     }
 }
开发者ID:WP--plugins,项目名称:blog-categories-for-groups,代码行数:24,代码来源:bcg-screens.php


示例20: bp_get_options_nav

/**
 * Uses the $bp->bp_options_nav global to render out the sub navigation for the current component.
 * Each component adds to its sub navigation array within its own setup_nav() function.
 *
 * This sub navigation array is the secondary level navigation, so for profile it contains:
 *      [Public, Edit Profile, Change Avatar]
 *
 * The function will also analyze the current action for the current component to determine whether
 * or not to highlight a particular sub nav item.
 *
 * @package BuddyPress Core
 * @global object $bp Global BuddyPress settings object
 * @uses bp_get_user_nav() Renders the navigation for a profile of a currently viewed user.
 */
function bp_get_options_nav()
{
    global $bp;
    // If we are looking at a member profile, then the we can use the current component as an
    // index. Otherwise we need to use the component's root_slug
    $component_index = !empty($bp->displayed_user) ? $bp->current_component : bp_get_root_slug($bp->current_component);
    if (!bp_is_single_item()) {
        if (!isset($bp->bp_options_nav[$component_index]) || count($bp->bp_options_nav[$component_index]) < 1) {
            return false;
        } else {
            $the_index = $component_index;
        }
    } else {
        if (!isset($bp->bp_options_nav[$bp->current_item]) || count($bp->bp_options_nav[$bp->current_item]) < 1) {
            return false;
        } else {
            $the_index = $bp->current_item;
        }
    }
    // Loop through each navigation item
    foreach ((array) $bp->bp_options_nav[$the_index] as $subnav_item) {
        if (!$subnav_item['user_has_access']) {
            continue;
        }
        // If the current action or an action variable matches the nav item id, then add a highlight CSS class.
        if ($subnav_item['slug'] == $bp->current_action) {
            $selected = ' class="current selected"';
        } else {
            $selected = '';
        }
        // List type depends on our current component
        $list_type = bp_is_group() ? 'groups' : 'personal';
        // echo out the final list item
        echo apply_filters('bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item);
    }
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:50,代码来源:bp-core-template.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP bp_is_group_activity函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_is_friends_component函数代码示例发布时间: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