当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_is_user_profile函数代码示例

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


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

示例1: ajax_test_enqueue_scripts

function ajax_test_enqueue_scripts()
{
    if (bp_is_members_directory() || bp_is_user_profile()) {
        wp_enqueue_style('love', plugins_url('/style.css', __FILE__));
    }
    wp_enqueue_script('love', plugins_url('/love-basic-ajax.js', __FILE__), '1.0', true);
    wp_localize_script('love', 'postlove', array('ajax_url' => admin_url('admin-ajax.php')));
    wp_enqueue_script('parse', '//www.parsecdn.com/js/parse-1.6.0.min.js', '1.0', true);
    wp_enqueue_script('veri', plugins_url('/veri.js', __FILE__), '1.0', true);
}
开发者ID:abegit,项目名称:harmony,代码行数:10,代码来源:plugin.php

示例2: lazy_load_css_js

 /**
  * Lazy load CSS/JS files?
  *
  * @package s2Member\CSS_JS
  * @since 131028
  *
  * @return boolean TRUE if we should load; else FALSE.
  */
 public static function lazy_load_css_js()
 {
     static $load;
     // Static cache var.
     if (isset($load)) {
         return $load;
     }
     $null = NULL;
     // Needed below in earlier versions of WP.
     if (!$GLOBALS['WS_PLUGIN__']['s2member']['o']['lazy_load_css_js']) {
         $load = TRUE;
     } else {
         if (c_ws_plugin__s2member_systematics::is_s2_systematic_use_page()) {
             $load = TRUE;
         } else {
             if (!empty($_GET[apply_filters('ws_plugin__s2member_check_force_ssl_get_var_name', 's2-ssl', array())])) {
                 $load = TRUE;
             } else {
                 if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile())) {
                     $load = TRUE;
                 } else {
                     if (is_singular() && ($post = get_post($null)) && (stripos($post->post_content, 's2member') !== FALSE || stripos($post->post_content, '[s2') !== FALSE)) {
                         $load = TRUE;
                     } else {
                         if (preg_match('/\\/wp\\-signup\\.php|\\/wp\\-login\\.php|\\/wp\\-admin\\/(?:user\\/)?profile\\.php|[?&]s2member/', $_SERVER['REQUEST_URI'])) {
                             $load = TRUE;
                         }
                     }
                 }
             }
         }
     }
     if (!isset($load)) {
         $load = FALSE;
     }
     // Make sure it's set; always.
     return $load = apply_filters('ws_plugin__s2member_lazy_load_css_js', $load);
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:46,代码来源:css-js-themes.inc.php

示例3: lazy_load_css_js

 /**
  * Lazy load CSS/JS files?
  *
  * @package s2Member\CSS_JS
  * @since 131028
  *
  * @return boolean TRUE if we should load; else FALSE.
  */
 public static function lazy_load_css_js()
 {
     static $load;
     // Static cache var.
     if (isset($load)) {
         return $load;
     }
     if (!$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["lazy_load_css_js"]) {
         $load = TRUE;
     } else {
         if (c_ws_plugin__s2member_systematics::is_s2_systematic_use_page()) {
             $load = TRUE;
         } else {
             if (!empty($_GET[apply_filters("ws_plugin__s2member_check_force_ssl_get_var_name", "s2-ssl", array())])) {
                 $load = TRUE;
             } else {
                 if (c_ws_plugin__s2member_utils_conds::bp_is_installed() && (bp_is_register_page() || bp_is_activation_page() || bp_is_user_profile())) {
                     $load = TRUE;
                 } else {
                     if (is_singular() && ($post = get_post(NULL)) && (stripos($post->post_content, "s2member") !== FALSE || stripos($post->post_content, "[s2") !== FALSE)) {
                         $load = TRUE;
                     } else {
                         if (preg_match("/\\/wp\\-signup\\.php" . "|\\/wp\\-login\\.php" . "|\\/wp\\-admin\\/(?:user\\/)?profile\\.php" . "|[?&]s2member/", $_SERVER["REQUEST_URI"])) {
                             $load = TRUE;
                         }
                     }
                 }
             }
         }
     }
     if (!isset($load)) {
         $load = FALSE;
     }
     // Make sure it's set; always.
     return $load = apply_filters("ws_plugin__s2member_lazy_load_css_js", $load);
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:44,代码来源:css-js-themes.inc.php

示例4: bp_displayed_user_is_friend

 function bp_displayed_user_is_friend()
 {
     global $bp;
     $friend_privacy_enable = get_option('tn_wpmu_friend_privacy_status');
     $friend_privacy_redirect = get_option('tn_wpmu_friend_privacy_redirect');
     if ($friend_privacy_enable == "enable") {
         if (bp_is_user_activity() || bp_is_user_profile() || bp_is_user()) {
             if ('is_friend' != BP_Friends_Friendship::check_is_friend($bp->loggedin_user->id, $bp->displayed_user->id) && bp_loggedin_user_id() != bp_displayed_user_id()) {
                 if (!is_super_admin(bp_loggedin_user_id())) {
                     if ($friend_privacy_redirect == '') {
                         bp_core_redirect($bp->root_domain);
                     } else {
                         bp_core_redirect($friend_privacy_redirect);
                     }
                 }
             }
         }
     }
     //enable
 }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:20,代码来源:functions.php

示例5: miss_is_bp

 /**
  *
  */
 function miss_is_bp()
 {
     if (function_exists('bp_is_group') && (bp_is_blog_page() || bp_is_my_profile() || bp_is_my_profile() || is_front_page() || bp_is_component_front_page('activity') || bp_is_directory() || bp_is_profile_component() || bp_is_activity_component() || bp_is_blogs_component() || bp_is_messages_component() || bp_is_friends_component() || bp_is_groups_component() || bp_is_settings_component() || bp_is_user_activity() || bp_is_user_friends_activity() || bp_is_activity_permalink() || bp_is_user_profile() || bp_is_profile_edit() || bp_is_change_avatar() || bp_is_user_groups() || bp_is_group() || bp_is_group_home() || bp_is_group_create() || bp_is_group_admin_page() || bp_is_group_forum() || bp_is_group_activity() || bp_is_group_forum_topic() || bp_is_group_forum_topic_edit() || bp_is_group_members() || bp_is_group_invites() || bp_is_group_membership_request() || bp_is_group_leave() || bp_is_group_single() || bp_is_user_blogs() || bp_is_user_recent_posts() || bp_is_user_recent_commments() || bp_is_create_blog() || bp_is_user_friends() || bp_is_friend_requests() || bp_is_user_messages() || bp_is_messages_inbox() || bp_is_messages_sentbox() || bp_is_notices() || bp_is_messages_compose_screen() || bp_is_activation_page() || bp_is_register_page())) {
         return true;
     }
     return false;
 }
开发者ID:schiz,项目名称:scrollax,代码行数:10,代码来源:app.php

示例6: amt_buddypress_jsonld_schemaorg

function amt_buddypress_jsonld_schemaorg($metadata_arr, $post, $options, $attachments, $embedded_media)
{
    // User Profiles
    // Determines if a BuddyPress user profile has been requested
    if (bp_is_user_profile()) {
        // https://codex.buddypress.org/developer/the-bp-global/
        global $bp;
        // $user_id = $bp->displayed_user->id;
        $user_id = bp_displayed_user_id();
        // $user_domain = $bp->displayed_user->domain;
        // bp_core_get_user_domain( bp_displayed_user_id() )
        $user_domain = bp_displayed_user_domain();
        $user_profile_url = trailingslashit(bp_displayed_user_domain() . amt_bp_get_profile_slug());
        $user_fullname = $bp->displayed_user->fullname;
        // $user_fullname = bp_displayed_user_fullname();
        // $user_username = $bp->displayed_user->user_login;
        $user_username = bp_get_displayed_user_username();
        //$wp_user_obj = get_user_by( 'id', $user_id );
        $wp_user_obj = get_userdata($user_id);
        //var_dump($wp_user_obj);
        // Context
        $metadata_arr['@context'] = 'http://schema.org';
        // Schema.org type
        $metadata_arr['@type'] = 'Person';
        // name
        $metadata_arr['name'] = esc_attr($user_fullname);
        // URL
        $metadata_arr['url'] = esc_url($user_profile_url, array('http', 'https'));
        // mainEntityOfPage
        $metadata_arr['mainEntityOfPage'] = esc_url($user_profile_url, array('http', 'https'));
        // Related resources as sameAs
        $metadata_arr['sameAs'] = array();
        // Facebook Profile
        //$fb_author_url = get_the_author_meta('amt_facebook_author_profile_url', $user_id);
        $fb_author_url = get_user_meta($user_id, 'amt_facebook_author_profile_url', true);
        if (!empty($fb_author_url)) {
            $metadata_arr['sameAs'][] = esc_url($fb_author_url, array('http', 'https'));
        }
        // Twitter
        //$twitter_author_username = get_the_author_meta('amt_twitter_author_username', $user_id);
        $twitter_author_username = get_user_meta($user_id, 'amt_twitter_author_username', true);
        if (!empty($twitter_author_username)) {
            $metadata_arr['sameAs'][] = 'https://twitter.com/' . esc_attr($twitter_author_username);
        }
        // Google+
        //$googleplus_author_url = get_the_author_meta('amt_googleplus_author_profile_url', $wp_user_obj);
        $googleplus_author_url = get_user_meta($user_id, 'amt_googleplus_author_profile_url', true);
        if (!empty($googleplus_author_url)) {
            $metadata_arr['sameAs'][] = esc_url($googleplus_author_url, array('http', 'https'));
        }
        // Determines if Extended Profiles component is active.
        if (!bp_is_active('xprofile')) {
            // Website
            //$website_url = get_user_meta($user_id, 'amt_googleplus_author_profile_url', true);
            $website_url = get_the_author_meta('user_url', $user_id);
            if (!empty($website_url)) {
                $metadata_arr['sameAs'][] = esc_url($website_url, array('http', 'https'));
            }
            // Description
            $author_description = sanitize_text_field(amt_sanitize_description($wp_user_obj->description));
            if (empty($author_description)) {
                $metadata_arr['description'] = esc_attr(__('Profile of', 'add-meta-tags') . ' ' . $wp_user_obj->display_name);
            } else {
                $metadata_arr['description'] = esc_attr($author_description);
            }
            // Profile Image
            $author_email = sanitize_email($wp_user_obj->user_email);
            $avatar_size = apply_filters('amt_bp_avatar_size', array('width' => 50, 'height' => 50));
            $avatar_url = '';
            // First try to get the avatar link by using get_avatar().
            // Important: for this to work the "Show Avatars" option should be enabled in Settings > Discussion.
            $avatar_img = get_avatar(get_the_author_meta('ID', $wp_user_obj->ID), $avatar_size, '', get_the_author_meta('display_name', $wp_user_obj->ID));
            if (!empty($avatar_img)) {
                if (preg_match("#src=['\"]([^'\"]+)['\"]#", $avatar_img, $matches)) {
                    $avatar_url = $matches[1];
                }
            } elseif (!empty($author_email)) {
                // If the user has provided an email, we use it to construct a gravatar link.
                $avatar_url = "http://www.gravatar.com/avatar/" . md5($author_email) . "?s=" . $avatar_size;
            }
            if (!empty($avatar_url)) {
                //$avatar_url = html_entity_decode($avatar_url, ENT_NOQUOTES, 'UTF-8');
                $metadata_arr['image'] = esc_url($avatar_url);
            }
            // familyName
            $last_name = $wp_user_obj->last_name;
            if (!empty($last_name)) {
                $metadata_arr['familyName'] = esc_attr($last_name);
            }
            // givenName
            $first_name = $wp_user_obj->first_name;
            if (!empty($first_name)) {
                $metadata_arr['givenName'] = esc_attr($first_name);
            }
            // Extended Profiles
        } else {
            // https://codex.buddypress.org/themes/guides/displaying-extended-profile-fields-on-member-profiles/
            $xprofile_field_map = amt_buddypress_get_xprofile_field_map();
            // Get list of IDs of public fields
            $xprofile_public_fields = bp_xprofile_get_fields_by_visibility_levels($user_id, array('public'));
//.........这里部分代码省略.........
开发者ID:prkirby,项目名称:AbsolutePressure,代码行数:101,代码来源:amt_extended.php

示例7: bp_get_the_body_class

	function bp_get_the_body_class( $wp_classes, $custom_classes = false ) {
		global $bp;

		if ( bp_is_front_page() )
			$bp_classes[] = 'home-page';

		if ( bp_is_directory() )
			$bp_classes[] = 'directory';

		if ( bp_is_user_profile() && !bp_is_blog_page() )
			$bp_classes[] = 'profile';

		if ( bp_is_activity_component() && !bp_is_blog_page() || ( bp_is_activity_front_page() && bp_is_front_page() ) )
			$bp_classes[] = 'activity';

		if ( bp_is_blogs_component() && !bp_is_blog_page()  )
			$bp_classes[] = 'blogs';

		if ( bp_is_messages_component() && !bp_is_blog_page()  )
			$bp_classes[] = 'messages';

		if ( bp_is_friends_component() && !bp_is_blog_page()  )
			$bp_classes[] = 'friends';

		if ( bp_is_groups_component() && !bp_is_blog_page()  )
			$bp_classes[] = 'groups';

		if ( bp_is_settings_component() && !bp_is_blog_page()  )
			$bp_classes[] = 'settings';

		if ( bp_is_single_item() )
			$bp_classes[] = 'single-item';

		if ( bp_is_messages_inbox() )
			$bp_classes[] = 'inbox';

		if ( bp_is_messages_sentbox() )
			$bp_classes[] = 'sentbox';

		if ( bp_is_messages_compose_screen() )
			$bp_classes[] = 'compose';

		if ( bp_is_notices() )
			$bp_classes[] = 'notices';

		if ( bp_is_friend_requests() )
			$bp_classes[] = 'friend-requests';

		if ( bp_is_user_friends() )
			$bp_classes[] = 'my-friends';

		if ( bp_is_create_blog() )
			$bp_classes[] = 'create-blog';

		if ( bp_is_user_recent_commments() )
			$bp_classes[] = 'recent-comments';

		if ( bp_is_user_recent_posts() )
			$bp_classes[] = 'recent-posts';

		if ( bp_is_user_blogs() && !bp_is_directory() )
			$bp_classes[] = 'my-blogs';

		if ( bp_is_user_groups() && !bp_is_directory() )
			$bp_classes[] = 'my-groups';

		if ( bp_is_group_leave() )
			$bp_classes[] = 'leave-group';

		if ( bp_is_group_invites() )
			$bp_classes[] = 'group-invites';

		if ( bp_is_group_members() )
			$bp_classes[] = 'group-members';

		if ( bp_is_group_forum_topic() )
			$bp_classes[] = 'group-forum-topic';

		if ( bp_is_group_forum_topic_edit() )
			$bp_classes[] = 'group-forum-topic-edit';

		if ( bp_is_group_forum() )
			$bp_classes[] = 'group-forum';

		if ( bp_is_group_admin_page() )
			$bp_classes[] = 'group-admin';

		if ( bp_is_group_create() )
			$bp_classes[] = 'group-create';

		if ( bp_is_group_home() )
			$bp_classes[] = 'group-home';

		if ( bp_is_change_avatar() )
			$bp_classes[] = 'change-avatar';

		if ( bp_is_profile_edit() )
			$bp_classes[] = 'profile-edit';

		if ( bp_is_user_friends_activity() )
//.........这里部分代码省略.........
开发者ID:n-sane,项目名称:zaroka,代码行数:101,代码来源:bp-core-templatetags.php

示例8: custom_profile_field_items_4bp

 /**
  * Adds Custom Fields to BuddyPress Profiles in public view.
  *
  * @package s2Member\Custom_Reg_Fields
  * @since 110524RC
  *
  * @attaches-to ``add_action("bp_profile_field_item");``
  *
  * @return null
  */
 public static function custom_profile_field_items_4bp()
 {
     global $bp;
     static $processed = false;
     do_action("ws_plugin__s2member_before_custom_profile_field_items_4bp", get_defined_vars());
     if (!$processed && in_array("profile-view", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields_4bp"])) {
         if (apply_filters("ws_plugin__s2member_custom_profile_field_items_4bp_display", true, get_defined_vars())) {
             if (bp_is_user_profile() && (function_exists("bp_is_user_profile_edit") && !bp_is_user_profile_edit() || function_exists("bp_is_profile_edit") && !bp_is_profile_edit()) && (int) bp_get_the_profile_group_id() === 1) {
                 if (isset($bp->displayed_user->id) && ($user_id = $bp->displayed_user->id)) {
                     if ($processed = true) {
                         foreach (array_keys(get_defined_vars()) as $__v) {
                             $__refs[$__v] =& ${$__v};
                         }
                         do_action("ws_plugin__s2member_during_custom_profile_field_items_4bp_before", get_defined_vars());
                         unset($__refs, $__v);
                         if ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"]) {
                             if (($level = c_ws_plugin__s2member_user_access::user_access_level(new WP_User($user_id))) >= 0) {
                                 if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level($level, "profile-view")) {
                                     $fields = get_user_option("s2member_custom_fields", $user_id);
                                     foreach (json_decode($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_fields"], true) as $field) {
                                         foreach (array_keys(get_defined_vars()) as $__v) {
                                             $__refs[$__v] =& ${$__v};
                                         }
                                         do_action("ws_plugin__s2member_during_custom_profile_field_items_4bp_before_custom_fields", get_defined_vars());
                                         unset($__refs, $__v);
                                         if (in_array($field["id"], $fields_applicable)) {
                                             $field_var = preg_replace("/[^a-z0-9]/i", "_", strtolower($field["id"]));
                                             $field_id_class = preg_replace("/_/", "-", $field_var);
                                             foreach (array_keys(get_defined_vars()) as $__v) {
                                                 $__refs[$__v] =& ${$__v};
                                             }
                                             if (apply_filters("ws_plugin__s2member_during_custom_profile_field_items_4bp_during_custom_fields_display", true, get_defined_vars())) {
                                                 if (!empty($field["section"]) && $field["section"] === "yes") {
                                                     echo '<tr class="ws-plugin--s2member-profile-field-4bp-divider-section">' . "\n";
                                                     echo '<td colspan="2"><div class="ws-plugin--s2member-profile-field-4bp-divider-section' . (!empty($field["sectitle"]) ? '-title' : '') . '">' . (!empty($field["sectitle"]) ? $field["sectitle"] : '') . '</div></td>' . "\n";
                                                     echo '</tr>' . "\n";
                                                 }
                                                 echo '<tr class="ws-plugin--s2member-profile-field-4bp ws-plugin--s2member-profile-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . '">' . "\n";
                                                 echo '<td class="ws-plugin--s2member-profile-field-4bp ws-plugin--s2member-profile-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . ' label"><span>' . $field["label"] . '</span></td>' . "\n";
                                                 echo '<td class="ws-plugin--s2member-profile-field-4bp ws-plugin--s2member-profile-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . ' data">' . c_ws_plugin__s2member_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, "ws_plugin__s2member_profile_4bp_", "ws-plugin--s2member-profile-4bp-", "ws-plugin--s2member-profile-field-4bp", "", "", "", $fields, $fields[$field_var], "profile-view") . '</td>' . "\n";
                                                 echo '</tr>' . "\n";
                                             }
                                             unset($__refs, $__v);
                                         }
                                         foreach (array_keys(get_defined_vars()) as $__v) {
                                             $__refs[$__v] =& ${$__v};
                                         }
                                         do_action("ws_plugin__s2member_during_custom_profile_field_items_4bp_after_custom_fields", get_defined_vars());
                                         unset($__refs, $__v);
                                     }
                                 }
                             }
                         }
                         foreach (array_keys(get_defined_vars()) as $__v) {
                             $__refs[$__v] =& ${$__v};
                         }
                         do_action("ws_plugin__s2member_during_custom_profile_field_items_4bp_after", get_defined_vars());
                         unset($__refs, $__v);
                     }
                 }
             }
         }
     }
     do_action("ws_plugin__s2member_after_custom_profile_field_items_4bp", get_defined_vars());
     return;
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:76,代码来源:custom-reg-fields-4bp.inc.php

示例9: gconnect_member_single_template

function gconnect_member_single_template()
{
    $template = 'activity.php';
    if (bp_is_user_blogs()) {
        $template = 'blogs.php';
    } elseif (bp_is_user_friends()) {
        $template = 'friends.php';
    } elseif (bp_is_user_groups()) {
        $template = 'groups.php';
    } elseif (bp_is_user_messages()) {
        $template = 'messages.php';
    } elseif (bp_is_user_profile()) {
        $template = 'profile.php';
    }
    do_action('bp_before_member_body');
    gconnect_locate_template(array("members/single/{$template}"), true);
    do_action('bp_after_member_body');
}
开发者ID:hscale,项目名称:webento,代码行数:18,代码来源:class.theme.php

示例10: bp_get_the_body_class

function bp_get_the_body_class($nxt_classes, $custom_classes = false)
{
    $bp_classes = array();
    /** Pages *************************************************************/
    if (is_front_page()) {
        $bp_classes[] = 'home-page';
    }
    if (bp_is_directory()) {
        $bp_classes[] = 'directory';
    }
    if (bp_is_single_item()) {
        $bp_classes[] = 'single-item';
    }
    /** Components ********************************************************/
    if (!bp_is_blog_page()) {
        if (bp_is_user_profile()) {
            $bp_classes[] = 'xprofile';
        }
        if (bp_is_activity_component()) {
            $bp_classes[] = 'activity';
        }
        if (bp_is_blogs_component()) {
            $bp_classes[] = 'blogs';
        }
        if (bp_is_messages_component()) {
            $bp_classes[] = 'messages';
        }
        if (bp_is_friends_component()) {
            $bp_classes[] = 'friends';
        }
        if (bp_is_groups_component()) {
            $bp_classes[] = 'groups';
        }
        if (bp_is_settings_component()) {
            $bp_classes[] = 'settings';
        }
    }
    /** User **************************************************************/
    if (!bp_is_directory()) {
        if (bp_is_user_blogs()) {
            $bp_classes[] = 'my-blogs';
        }
        if (bp_is_user_groups()) {
            $bp_classes[] = 'my-groups';
        }
        if (bp_is_user_activity()) {
            $bp_classes[] = 'my-activity';
        }
    }
    if (bp_is_my_profile()) {
        $bp_classes[] = 'my-account';
    }
    if (bp_is_user_profile()) {
        $bp_classes[] = 'my-profile';
    }
    if (bp_is_user_friends()) {
        $bp_classes[] = 'my-friends';
    }
    if (bp_is_user_messages()) {
        $bp_classes[] = 'my-messages';
    }
    if (bp_is_user_recent_commments()) {
        $bp_classes[] = 'recent-comments';
    }
    if (bp_is_user_recent_posts()) {
        $bp_classes[] = 'recent-posts';
    }
    if (bp_is_user_change_avatar()) {
        $bp_classes[] = 'change-avatar';
    }
    if (bp_is_user_profile_edit()) {
        $bp_classes[] = 'profile-edit';
    }
    if (bp_is_user_friends_activity()) {
        $bp_classes[] = 'friends-activity';
    }
    if (bp_is_user_groups_activity()) {
        $bp_classes[] = 'groups-activity';
    }
    if (is_user_logged_in()) {
        $bp_classes[] = 'logged-in';
    }
    /** Messages **********************************************************/
    if (bp_is_messages_inbox()) {
        $bp_classes[] = 'inbox';
    }
    if (bp_is_messages_sentbox()) {
        $bp_classes[] = 'sentbox';
    }
    if (bp_is_messages_compose_screen()) {
        $bp_classes[] = 'compose';
    }
    if (bp_is_notices()) {
        $bp_classes[] = 'notices';
    }
    if (bp_is_user_friend_requests()) {
        $bp_classes[] = 'friend-requests';
    }
    if (bp_is_create_blog()) {
        $bp_classes[] = 'create-blog';
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:101,代码来源:bp-core-template.php

示例11: custom_profile_field_items_4bp

 /**
  * Adds Custom Fields to BuddyPress Profiles in public view.
  *
  * @package s2Member\Custom_Reg_Fields
  * @since 110524RC
  *
  * @attaches-to ``add_action('bp_profile_field_item');``
  */
 public static function custom_profile_field_items_4bp()
 {
     global $bp;
     // Global reference to the BuddyPress object.
     static $processed = FALSE;
     // Process this routine only one time.
     do_action('ws_plugin__s2member_before_custom_profile_field_items_4bp', get_defined_vars());
     if (!$processed && in_array('profile-view', $GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields_4bp'])) {
         if (apply_filters('ws_plugin__s2member_custom_profile_field_items_4bp_display', TRUE, get_defined_vars())) {
             if (bp_is_user_profile() && !bp_is_user_profile_edit() && (int) bp_get_the_profile_group_id() === 1) {
                 if (isset($bp->displayed_user->id) && ($user_id = $bp->displayed_user->id) && ($processed = TRUE)) {
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     do_action('ws_plugin__s2member_during_custom_profile_field_items_4bp_before', get_defined_vars());
                     unset($__refs, $__v);
                     if ($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields']) {
                         if (($level = c_ws_plugin__s2member_user_access::user_access_level(new WP_User($user_id))) >= 0) {
                             if ($fields_applicable = c_ws_plugin__s2member_custom_reg_fields::custom_fields_configured_at_level($level, 'profile-view')) {
                                 $fields = get_user_option('s2member_custom_fields', $user_id);
                                 foreach (json_decode($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_fields'], TRUE) as $field) {
                                     foreach (array_keys(get_defined_vars()) as $__v) {
                                         $__refs[$__v] =& ${$__v};
                                     }
                                     do_action('ws_plugin__s2member_during_custom_profile_field_items_4bp_before_custom_fields', get_defined_vars());
                                     unset($__refs, $__v);
                                     if (in_array($field['id'], $fields_applicable)) {
                                         $field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($field['id']));
                                         $field_id_class = preg_replace('/_/', '-', $field_var);
                                         foreach (array_keys(get_defined_vars()) as $__v) {
                                             $__refs[$__v] =& ${$__v};
                                         }
                                         if (apply_filters('ws_plugin__s2member_during_custom_profile_field_items_4bp_during_custom_fields_display', TRUE, get_defined_vars())) {
                                             if (!empty($field['section']) && $field['section'] === 'yes') {
                                                 echo '<tr class="ws-plugin--s2member-profile-field-4bp-divider-section">' . "\n";
                                                 echo '<td colspan="2"><div class="ws-plugin--s2member-profile-field-4bp-divider-section' . (!empty($field['sectitle']) ? '-title' : '') . '">' . (!empty($field['sectitle']) ? $field['sectitle'] : '') . '</div></td>' . "\n";
                                                 echo '</tr>' . "\n";
                                             }
                                             echo '<tr class="ws-plugin--s2member-profile-field-4bp ws-plugin--s2member-profile-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . '">' . "\n";
                                             echo '<td class="ws-plugin--s2member-profile-field-4bp ws-plugin--s2member-profile-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . ' label"><span>' . $field['label'] . '</span></td>' . "\n";
                                             echo '<td class="ws-plugin--s2member-profile-field-4bp ws-plugin--s2member-profile-4bp-' . esc_attr($field_id_class) . ' field_' . esc_attr($field_var) . ' data">' . c_ws_plugin__s2member_custom_reg_fields::custom_field_gen(__FUNCTION__, $field, 'ws_plugin__s2member_profile_4bp_', 'ws-plugin--s2member-profile-4bp-', 'ws-plugin--s2member-profile-field-4bp', '', '', '', $fields, @$fields[$field_var], 'profile-view') . '</td>' . "\n";
                                             echo '</tr>' . "\n";
                                         }
                                         unset($__refs, $__v);
                                     }
                                     foreach (array_keys(get_defined_vars()) as $__v) {
                                         $__refs[$__v] =& ${$__v};
                                     }
                                     do_action('ws_plugin__s2member_during_custom_profile_field_items_4bp_after_custom_fields', get_defined_vars());
                                     unset($__refs, $__v);
                                 }
                             }
                         }
                     }
                     foreach (array_keys(get_defined_vars()) as $__v) {
                         $__refs[$__v] =& ${$__v};
                     }
                     do_action('ws_plugin__s2member_during_custom_profile_field_items_4bp_after', get_defined_vars());
                     unset($__refs, $__v);
                 }
             }
         }
     }
     do_action('ws_plugin__s2member_after_custom_profile_field_items_4bp', get_defined_vars());
 }
开发者ID:adnandot,项目名称:intenseburn,代码行数:73,代码来源:custom-reg-fields-4bp.inc.php

示例12: bp_registration_buddypress_allowed_areas

/**
 * Check if on an allowed BuddyPress component
 *
 * @since  4.2.0
 *
 * @return boolean  true if an allowed component, false otherwise
 */
function bp_registration_buddypress_allowed_areas()
{
    if (!function_exists('bp_is_my_profile')) {
        return false;
    }
    global $bp;
    if (bp_is_my_profile() || bp_is_user_profile() || bp_is_user_profile_edit() || $bp->current_component == 'register' || $bp->current_component == 'activate') {
        return true;
    }
    return false;
}
开发者ID:profezzeur,项目名称:BuddyPress-Registration-Options,代码行数:18,代码来源:core.php

示例13: shoestrap_is_bp

/**
 * Check if this is a BuddyPress page or not.
 * Returns true or false (boolean)
 */
function shoestrap_is_bp()
{
    $bp = false;
    /** Pages *************************************************************/
    if (!$bp && bp_is_directory()) {
        $bp = true;
    } elseif (!$bp && bp_is_single_item()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_profile()) {
        $bp = true;
    } elseif (!$bp && bp_is_activity_component()) {
        $bp = true;
    } elseif (!$bp && bp_is_blogs_component()) {
        $bp = true;
    } elseif (!$bp && bp_is_messages_component()) {
        $bp = true;
    } elseif (!$bp && bp_is_friends_component()) {
        $bp = true;
    } elseif (!$bp && bp_is_groups_component()) {
        $bp = true;
    } elseif (!$bp && bp_is_settings_component()) {
        $bp = true;
    } elseif (!$bp && bp_is_user()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_blogs()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_groups()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_activity()) {
        $bp = true;
    } elseif (!$bp && bp_is_my_profile()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_profile()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_friends()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_messages()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_recent_commments()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_recent_posts()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_change_avatar()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_profile_edit()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_friends_activity()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_groups_activity()) {
        $bp = true;
    } elseif (!$bp && is_user_logged_in()) {
        $bp = true;
    } elseif (!$bp && bp_is_messages_inbox()) {
        $bp = true;
    } elseif (!$bp && bp_is_messages_sentbox()) {
        $bp = true;
    } elseif (!$bp && bp_is_messages_compose_screen()) {
        $bp = true;
    } elseif (!$bp && bp_is_notices()) {
        $bp = true;
    } elseif (!$bp && bp_is_user_friend_requests()) {
        $bp = true;
    } elseif (!$bp && bp_is_create_blog()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_leave()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_invites()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_members()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_forum_topic()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_forum_topic_edit()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_forum()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_admin_page()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_create()) {
        $bp = true;
    } elseif (!$bp && bp_is_group_home()) {
        $bp = true;
    } elseif (!$bp && bp_is_single_activity()) {
        $bp = true;
    } elseif (!$bp && bp_is_register_page()) {
        $bp = true;
    } elseif (!$bp && bp_is_activation_page()) {
        $bp = true;
    } elseif (!$bp && !bp_is_blog_page()) {
        $bp = true;
    }
    return $bp;
}
开发者ID:MinecraftServernet,项目名称:shoestrap-3,代码行数:97,代码来源:buddypress.php

示例14: test_member_profile

 function test_member_profile()
 {
     $this->go_to(bp_core_get_user_domain(bp_loggedin_user_id()) . bp_get_profile_slug());
     $this->assertTrue(bp_is_user_profile());
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:5,代码来源:xprofile.php

示例15: modify_profile_loop

 function modify_profile_loop($has_profile)
 {
     global $profile_template;
     // We only want to modify the loop if this is a public profile
     if (!bp_is_user_profile() || bp_is_user_profile_edit()) {
         return $has_profile;
     }
     $this->load_fieldmeta();
     // While we're looping through, grab the ids and put them in a property for later
     // access
     $this_user_data_ids = array();
     foreach ($profile_template->groups as $group_key => $group) {
         foreach ($group->fields as $field_key => $field) {
             $this_field_id = (int) $field->id;
             if (isset($this->fieldmeta[$this_field_id])) {
                 unset($profile_template->groups[$group_key]->fields[$field_key]);
             }
             $this_user_data_ids[] = $this_field_id;
         }
         // If we've emptied the group, remove it now
         if (empty($group->fields)) {
             unset($profile_template->groups[$group_key]);
         }
     }
     if (empty($this->this_user_data_ids)) {
         $this->this_user_data_ids = $this_user_data_ids;
     }
     // Reset indexes
     $profile_template->groups = array_values($profile_template->groups);
     return $has_profile;
 }
开发者ID:rjbaniel,项目名称:bp-social-media-profiles,代码行数:31,代码来源:bp-social-media-profiles.php


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