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


PHP bp_is_settings_component函数代码示例

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


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

示例1: 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

示例2: bp_checkins_foursquare_user_actions

function bp_checkins_foursquare_user_actions()
{
    global $bp;
    if (!bp_checkins_is_foursquare_ready()) {
        return;
    }
    if (bp_is_current_component('checkins') && !bp_displayed_user_id() && !bp_current_action() && !empty($_GET['code'])) {
        $referer = trailingslashit(bp_loggedin_user_domain() . bp_get_settings_slug()) . 'checkins-settings';
        $foursquare_auth_user = new Bp_Checkins_Foursquare_Oauth();
        $foursquare_user = $foursquare_auth_user->token_url($_GET['code']);
        if ($foursquare_user['type'] == 'error') {
            bp_core_add_message($foursquare_user['message'], 'error');
        } else {
            update_user_meta($bp->loggedin_user->id, 'foursquare_latest_timestamp', current_time('timestamp'));
            bp_core_add_message($foursquare_user['message']);
        }
        bp_core_redirect($referer);
    }
    if (bp_is_settings_component() && bp_displayed_user_id() && 'checkins-settings' == bp_current_action() && !empty($_GET['update'])) {
        $referer = trailingslashit(bp_loggedin_user_domain() . bp_get_settings_slug()) . 'checkins-settings';
        if ((int) bp_get_option('foursquare-user-import')) {
            return false;
        }
        $user_import = new Bp_Checkins_Foursquare_Import($bp->loggedin_user->id);
        $user_import_do = $user_import->user_import();
        if ($user_import_do['type'] == 'error') {
            bp_core_add_message($user_import_do['message'], 'error');
        } else {
            bp_core_add_message($user_import_do['message']);
        }
        bp_core_redirect($referer);
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:33,代码来源:bp-checkins-foursquare-api.php

示例3: bp_get_the_body_class

/**
 * Customize the body class, according to the currently displayed BP content.
 *
 * Uses the above is_() functions to output a body class for each scenario.
 *
 * @since 1.1.0
 *
 * @param array      $wp_classes     The body classes coming from WP.
 * @param array|bool $custom_classes Classes that were passed to get_body_class().
 * @return array $classes The BP-adjusted body classes.
 */
function bp_get_the_body_class($wp_classes = array(), $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_user()) {
        $bp_classes[] = 'bp-user';
        // Add current user member types.
        if ($member_types = bp_get_member_type(bp_displayed_user_id(), false)) {
            foreach ($member_types as $member_type) {
                $bp_classes[] = sprintf('member-type-%s', esc_attr($member_type));
            }
        }
    }
    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';
        }
    } else {
        if (bp_get_current_member_type()) {
            $bp_classes[] = 'type';
        }
    }
    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';
    }
//.........这里部分代码省略.........
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:101,代码来源:bp-core-template.php

示例4: 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

示例5: wp_idea_stream_buddypress_is_delete_account

/**
 * Checks if the user/super admin is on the delete account screen
 *
 * @package WP Idea Stream
 * @subpackage buddypress/functions
 *
 * @since  2.0.0
 *
 * @uses   bp_is_settings_component() to check if on the settings component
 * @uses   bp_is_current_action() to check for a specific BuddyPress action
 * @uses   bp_is_my_profile() to check if the user is on his self profile
 * @uses   is_super_admin() to check if the user has delete capabilities on all WordPress configs
 * @return bool true if on the delete account screen, false otherwise
 */
function wp_idea_stream_buddypress_is_delete_account()
{
    $retval = false;
    if (bp_is_settings_component() && bp_is_current_action('delete-account') && (bp_is_my_profile() || is_super_admin())) {
        $retval = true;
    }
    return (bool) apply_filters('wp_idea_stream_buddypress_is_delete_account', $retval);
}
开发者ID:mrjarbenne,项目名称:wp-idea-stream,代码行数:22,代码来源:functions.php

示例6: 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

示例7: bp_get_the_body_class

function bp_get_the_body_class($wp_classes = array(), $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_user()) {
        $bp_classes[] = 'bp-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';
    }
    /** 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:sdh100shaun,项目名称:pantheon,代码行数:101,代码来源:bp-core-template.php

示例8: suffusion_bp_content_class

 /**
  * Similar to the post_class() function, but for BP. This is NOT used by core Suffusion, but is useful for child themes using BP.
  * This might be defined by the Suffusion BuddyPress Pack for BP users of Suffusion, but is included conditionally here so
  * that the theme and the plugin can be used independently of each other and so that one version of Suffusion can work with an older
  * version of the BP pack.
  *
  * @since 3.6.7
  * @param bool $custom
  * @param bool $echo
  * @return bool|string
  */
 function suffusion_bp_content_class($custom = false, $echo = true)
 {
     if (!function_exists('bp_is_group')) {
         return false;
     }
     $css = array();
     $css[] = 'post';
     if (function_exists('bp_is_profile_component') && bp_is_profile_component()) {
         $css[] = 'profile-component';
     }
     if (function_exists('bp_is_activity_component') && bp_is_activity_component()) {
         $css[] = 'activity-component';
     }
     if (function_exists('bp_is_blogs_component') && bp_is_blogs_component()) {
         $css[] = 'blogs-component';
     }
     if (function_exists('bp_is_messages_component') && bp_is_messages_component()) {
         $css[] = 'messages-component';
     }
     if (function_exists('bp_is_friends_component') && bp_is_friends_component()) {
         $css[] = 'friends-component';
     }
     if (function_exists('bp_is_groups_component') && bp_is_groups_component()) {
         $css[] = 'groups-component';
     }
     if (function_exists('bp_is_settings_component') && bp_is_settings_component()) {
         $css[] = 'settings-component';
     }
     if (function_exists('bp_is_member') && bp_is_member()) {
         $css[] = 'member';
     }
     if (function_exists('bp_is_user_activity') && bp_is_user_activity()) {
         $css[] = 'user-activity';
     }
     if (function_exists('bp_is_user_friends_activity') && bp_is_user_friends_activity()) {
         $css[] = 'user-friends-activity';
     }
     if (function_exists('bp_is_activity_permalink') && bp_is_activity_permalink()) {
         $css[] = 'activity-permalink';
     }
     if (function_exists('bp_is_user_profile') && bp_is_user_profile()) {
         $css[] = 'user-profile';
     }
     if (function_exists('bp_is_profile_edit') && bp_is_profile_edit()) {
         $css[] = 'profile-edit';
     }
     if (function_exists('bp_is_change_avatar') && bp_is_change_avatar()) {
         $css[] = 'change-avatar';
     }
     if (function_exists('bp_is_user_groups') && bp_is_user_groups()) {
         $css[] = 'user-groups';
     }
     if (function_exists('bp_is_group') && bp_is_group()) {
         $css[] = 'group';
     }
     if (function_exists('bp_is_group_home') && bp_is_group_home()) {
         $css[] = 'group-home';
     }
     if (function_exists('bp_is_group_create') && bp_is_group_create()) {
         $css[] = 'group-create';
     }
     if (function_exists('bp_is_group_admin_page') && bp_is_group_admin_page()) {
         $css[] = 'group-admin-page';
     }
     if (function_exists('bp_is_group_forum') && bp_is_group_forum()) {
         $css[] = 'group-forum';
     }
     if (function_exists('bp_is_group_activity') && bp_is_group_activity()) {
         $css[] = 'group-activity';
     }
     if (function_exists('bp_is_group_forum_topic') && bp_is_group_forum_topic()) {
         $css[] = 'group-forum-topic';
     }
     if (function_exists('bp_is_group_forum_topic_edit') && bp_is_group_forum_topic_edit()) {
         $css[] = 'group-forum-topic-edit';
     }
     if (function_exists('bp_is_group_members') && bp_is_group_members()) {
         $css[] = 'group-members';
     }
     if (function_exists('bp_is_group_invites') && bp_is_group_invites()) {
         $css[] = 'group-invites';
     }
     if (function_exists('bp_is_group_membership_request') && bp_is_group_membership_request()) {
         $css[] = 'group-membership-request';
     }
     if (function_exists('bp_is_group_leave') && bp_is_group_leave()) {
         $css[] = 'group-leave';
     }
     if (function_exists('bp_is_group_single') && bp_is_group_single()) {
//.........这里部分代码省略.........
开发者ID:jpsutton,项目名称:suffusion,代码行数:101,代码来源:bp-integration.php

示例9: ass_user_unsubscribe_action

function ass_user_unsubscribe_action()
{
    if (get_option('ass-global-unsubscribe-link') != 'yes' || !bp_is_settings_component() || !isset($_GET['ass_unsubscribe'])) {
        return;
    }
    check_admin_referer('ass_unsubscribe_all');
    ass_unsubscribe_user();
    if (bp_is_my_profile()) {
        bp_core_add_message(__('You have been unsubscribed from all groups notifications.', 'bp-ass'), 'success');
    } else {
        bp_core_add_message(__("This user's has been unsubscribed from all groups notifications.", 'bp-ass'), 'success');
    }
    bp_core_redirect(bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications/');
}
开发者ID:pausaura,项目名称:agora_nodes,代码行数:14,代码来源:bp-activity-subscription-functions.php

示例10: bp_core_screen_general_settings

/**
 * Handles the changing and saving of user email addressos and passwords
 * 
 * We do quite a bit of logic and error handling here to make sure that users
 * do not accidentally lock themselves out of their accounts. We also try to
 * provide as accurate of feedback as possible without exposing anyone else's
 * inforation to them.
 * 
 * Special considerations are made for super admins that are able to edit any
 * users accounts already, without knowing their existing password.
 *
 * @global BuddyPress $bp
 * @return If no reason to proceed
 */
function bp_core_screen_general_settings()
{
    global $bp;
    // 404 if there are any additional action variables attached
    if (bp_action_variables()) {
        bp_do_404();
        return;
    }
    /** Handle Form ***********************************************************/
    if ('POST' === strtoupper($_SERVER['REQUEST_METHOD'])) {
        // Bail if not in settings
        if (!bp_is_settings_component() || !bp_is_current_action('general')) {
            return;
        }
        // Define local defaults
        $email_error = false;
        // invalid|blocked|taken|empty|false
        $pass_error = false;
        // invalid|mismatch|empty|false
        $pass_changed = false;
        // true if the user changes their password
        $email_changed = false;
        // true if the user changes their email
        $feedback_type = 'error';
        // success|error
        $feedback = array();
        // array of strings for feedback
        // Nonce check
        check_admin_referer('bp_settings_general');
        // Validate the user again for the current password when making a big change
        if (is_super_admin() || !empty($_POST['pwd']) && nxt_check_password($_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id())) {
            $update_user = get_userdata(bp_displayed_user_id());
            /** Email Change Attempt ******************************************/
            if (!empty($_POST['email'])) {
                // What is missing from the profile page vs signup - lets double check the goodies
                $user_email = sanitize_email(esc_html(trim($_POST['email'])));
                // User is changing email address
                if ($bp->displayed_user->userdata->user_email != $user_email) {
                    // Is email valid
                    if (!is_email($user_email)) {
                        $email_error = 'invalid';
                    }
                    // Get blocked email domains
                    $limited_email_domains = get_site_option('limited_email_domains', 'buddypress');
                    // If blocked email domains exist, see if this is one of them
                    if (is_array($limited_email_domains) && empty($limited_email_domains) == false) {
                        $emaildomain = substr($user_email, 1 + strpos($user_email, '@'));
                        if (in_array($emaildomain, (array) $limited_email_domains) == false) {
                            $email_error = 'blocked';
                        }
                    }
                    // No errors, and email address doesn't match
                    if (false === $email_error && email_exists($user_email)) {
                        $email_error = 'taken';
                    }
                    // Yay we made it!
                    if (false === $email_error) {
                        $update_user->user_email = $user_email;
                        $email_changed = true;
                    }
                    // No change
                } else {
                    $email_error = false;
                }
                // Email address cannot be empty
            } else {
                $email_error = 'empty';
            }
            /** Password Change Attempt ***************************************/
            if (!empty($_POST['pass1']) && !empty($_POST['pass2'])) {
                // Password change attempt is successful
                if ($_POST['pass1'] == $_POST['pass2'] && !strpos(" " . $_POST['pass1'], "\\")) {
                    $update_user->user_pass = $_POST['pass1'];
                    $pass_changed = true;
                    // Password change attempt was unsuccessful
                } else {
                    $pass_error = 'mismatch';
                }
                // Both password fields were empty
            } elseif (empty($_POST['pass1']) && empty($_POST['pass2'])) {
                $pass_error = false;
                // One of the password boxes was left empty
            } elseif (empty($_POST['pass1']) && !empty($_POST['pass2']) || !empty($_POST['pass1']) && empty($_POST['pass2'])) {
                $pass_error = 'empty';
            }
            // The structure of the $update_user object changed in nxt 3.3, but
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:101,代码来源:bp-settings-actions.php

示例11: 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

示例12: get_content_width

/**
 * Get content width
 */
function get_content_width($site_width)
{
    global $cap, $post, $bp;
    if ($cap->cc_responsive_enable) {
        $cap->rightsidebar_width = 225;
        $cap->leftsidebar_width = 225;
    }
    $cap->archive_template = $cap->archive_template == 'full-width' && defined('is_pro') ? $cap->archive_template : $cap->sidebar_position;
    if (defined('BP_VERSION') && bp_is_user() && check_value($cap->bp_profile_sidebars, 'none', '==')) {
        return $site_width;
    } else {
        if (defined('BP_VERSION') && bp_is_user() && check_value($cap->bp_profile_sidebars, 'default', '!=')) {
            if (check_value($cap->bp_profile_sidebars, 'left', '==') || check_value($cap->bp_profile_sidebars, 'left and right', '==')) {
                $site_width -= $cap->leftsidebar_width;
            }
            if (check_value($cap->bp_profile_sidebars, 'right', '==') || check_value($cap->bp_profile_sidebars, 'left and right', '==')) {
                $site_width -= $cap->rightsidebar_width;
            }
            return $site_width;
        } else {
            if ((!is_page() || is_page('search') || is_search()) && !is_archive() || function_exists('is_bbpress') && is_bbpress() && !is_archive()) {
                $tpl = !empty($post) ? get_post_meta($post->ID, '_wp_page_template', TRUE) : FALSE;
                $tpl = empty($tpl) ? 'default' : $tpl;
                $affected = FALSE;
                if (check_value($cap->bp_profile_sidebars, 'default', '==') && $tpl == 'full-width.php') {
                    return $site_width;
                }
                if (check_value($cap->bp_profile_sidebars, 'default', '==') && ($tpl == '_pro/tpl-left-and-right-sidebar.php' || $tpl == '_pro/tpl-left-sidebar.php')) {
                    $site_width -= $cap->leftsidebar_width;
                    $affected = TRUE;
                }
                if (check_value($cap->bp_profile_sidebars, 'default', '==') && ($tpl == '_pro/tpl-left-and-right-sidebar.php' || $tpl == '_pro/tpl-right-sidebar.php')) {
                    $site_width -= $cap->rightsidebar_width;
                    $affected = TRUE;
                }
                if ($affected) {
                    return $site_width;
                }
                if (check_value($cap->bp_profile_sidebars, 'none', '==')) {
                    return $site_width;
                } elseif (check_value($cap->bp_profile_sidebars, 'left', '==') || check_value($cap->bp_profile_sidebars, 'default', '==') && check_value($cap->sidebar_position, 'left', '==')) {
                    $site_width -= $cap->leftsidebar_width;
                }
                if (check_value($cap->bp_profile_sidebars, 'right', '==') || check_value($cap->bp_profile_sidebars, 'default', '==') && check_value($cap->sidebar_position, 'right', '===')) {
                    $site_width -= $cap->rightsidebar_width;
                } else {
                    if (check_value($cap->bp_profile_sidebars, 'left and right', '==') || check_value($cap->bp_profile_sidebars, 'default', '==') && check_value($cap->sidebar_position, 'left and right', '==')) {
                        $site_width = $site_width - $cap->rightsidebar_width - $cap->leftsidebar_width;
                    }
                }
                return $site_width;
            } elseif (is_archive()) {
                if (defined('is_pro') && ($cap->archive_template == 'full-width' || check_value($cap->archive_template, 'full-width', '=='))) {
                    return $site_width;
                }
                if (is_archive() && ($cap->archive_template == 'left' || $cap->archive_template == 'left and right' || check_value($cap->archive_template, 'left', '==') || check_value($cap->archive_template, 'left and right', '=='))) {
                    $site_width -= $cap->leftsidebar_width;
                }
                if ($cap->archive_template == "right" || $cap->archive_template == "left and right" || check_value($cap->archive_template, 'right', '==') || check_value($cap->archive_template, 'left and right', '==')) {
                    $site_width -= $cap->rightsidebar_width;
                }
            } else {
                if (isset($post)) {
                    $detect = new TK_WP_Detect();
                    $component = explode('-', $detect->tk_get_page_type());
                    if (!empty($component[2])) {
                        if ($component[2] == 'groups' && !empty($component[3]) && (property_exists($bp, 'unfiltered_uri') && !empty($bp->unfiltered_uri[0]) && $bp->unfiltered_uri[0] != 'members')) {
                            if ($cap->bp_groups_sidebars == 'default' && check_value($cap->sidebar_position, 'left and right', '==') || $cap->bp_groups_sidebars == 'left' || $cap->bp_groups_sidebars == __('left', 'cc') || $cap->bp_groups_sidebars == 'left and right' || check_value($cap->bp_groups_sidebars, 'left and right', '==')) {
                                $site_width -= $cap->leftsidebar_width;
                            }
                            if ($cap->bp_groups_sidebars == 'default' || $cap->bp_groups_sidebars == 'right' || check_value($cap->bp_groups_sidebars, 'right', '==') || $cap->bp_groups_sidebars == 'left and right' || check_value($cap->bp_groups_sidebars, 'left and right', '==')) {
                                $site_width -= $cap->rightsidebar_width;
                            }
                            return $site_width;
                        } elseif (property_exists($bp, 'unfiltered_uri') && !empty($bp->unfiltered_uri[0]) && $bp->unfiltered_uri[0] == 'members' || bp_is_activity_component() || bp_is_profile_component() || bp_is_messages_component() || bp_is_friends_component() || bp_is_settings_component()) {
                            if (($cap->bp_profile_sidebars == 'default' || check_value($cap->sidebar_position, 'default', '==')) && ($cap->bp_profile_sidebars == 'left and right' || check_value($cap->sidebar_position, 'left and right', '==') || check_value($cap->sidebar_position, 'left', '==') || $cap->sidebar_position == 'left') || $cap->bp_profile_sidebars == 'left' || check_value($cap->bp_profile_sidebars, 'left', '==') || $cap->bp_profile_sidebars == 'left and right' || check_value($cap->bp_profile_sidebars, 'left and right', '==')) {
                                $site_width -= $cap->leftsidebar_width;
                            }
                            if (($cap->bp_profile_sidebars == "default" || check_value($cap->bp_profile_sidebars, 'default', '==')) && ($cap->sidebar_position == "right" || check_value($cap->sidebar_position, 'right', '==') || $cap->sidebar_position == "left and right" || check_value($cap->sidebar_position, 'left and right', '==')) || $cap->bp_profile_sidebars == 'right' || check_value($cap->bp_profile_sidebars, 'right', '==') || $cap->bp_profile_sidebars == 'left and right' || check_value($cap->bp_profile_sidebars, 'left and right', '==')) {
                                $site_width -= $cap->rightsidebar_width;
                            }
                            return $site_width;
                        } elseif ($component[2] == 'members') {
                            if (check_value($cap->sidebar_position, 'left and right', '==') || check_value($cap->sidebar_position, 'default', '==')) {
                                $site_width -= $cap->leftsidebar_width;
                            }
                            if (check_value($cap->sidebar_position, 'left and right', '==') || check_value($cap->sidebar_position, 'right', '==')) {
                                $site_width -= $cap->rightsidebar_width;
                            }
                            return $site_width;
                        } else {
                            if ($component[2] != 'forums') {
                                if (check_value($cap->sidebar_position, 'left and right', '==') || check_value($cap->sidebar_position, 'default', '==')) {
                                    $site_width -= $cap->leftsidebar_width;
                                }
                                if (check_value($cap->sidebar_position, 'left and right', '==') || check_value($cap->sidebar_position, 'right', '==')) {
                                    $site_width -= $cap->rightsidebar_width;
//.........这里部分代码省略.........
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:101,代码来源:width-calculators.php

示例13: bp_checkins_load_gmap3

function bp_checkins_load_gmap3()
{
    if (bp_checkins_is_activity_or_friends() || bp_checkins_is_directory() || bp_checkins_is_group_checkins_area()) {
        wp_enqueue_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=false');
        wp_enqueue_script('gmap3', BP_CHECKINS_PLUGIN_URL_JS . '/gmap3.min.js', array('jquery'));
        wp_enqueue_style('bpcistyle', BP_CHECKINS_PLUGIN_URL_CSS . '/bpcinstyle.css');
        if (!empty($_GET['map']) && $_GET['map'] == 1) {
            global $bpci_lat, $bpci_lng;
            $bpci_lat = bp_activity_get_meta(bp_current_action(), 'bpci_activity_lat');
            $bpci_lng = bp_activity_get_meta(bp_current_action(), 'bpci_activity_lng');
            if (!empty($bpci_lat) && !empty($bpci_lng)) {
                add_action('wp_head', 'bp_checkins_item_map');
            }
        } elseif (bp_checkins_show_friends_checkins()) {
            wp_enqueue_script('bp-ckeckins-friends', BP_CHECKINS_PLUGIN_URL_JS . '/bp-checkins-friends.js');
        } else {
            if (bp_checkins_is_directory() || bp_checkins_is_group_checkins_area()) {
                wp_enqueue_script('bp-ckeckins-dir', BP_CHECKINS_PLUGIN_URL_JS . '/bp-checkins-dir.js');
                bp_checkins_localize_script('dir');
            } else {
                wp_enqueue_script('bp-ckeckins', BP_CHECKINS_PLUGIN_URL_JS . '/bp-checkins.js');
                bp_checkins_localize_script('activity');
            }
        }
        if (bp_is_single_activity()) {
            add_action('wp_footer', 'bp_checkins_img_trick');
        }
    }
    if (bp_displayed_user_id() && bp_is_settings_component() && bp_is_current_action('checkins-settings')) {
        wp_enqueue_style('bpcistyle', BP_CHECKINS_PLUGIN_URL_CSS . '/bpcinstyle.css');
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:32,代码来源:bp-checkins-shared.php

示例14: sidebar_right

 /**
  * footer: add the sidebar and their default widgets to the right sidebar
  *
  * located: footer.php do_action( 'sidebar_left' )
  *
  * @package Custom Community
  * @since 1.8.3
  */
 function sidebar_right()
 {
     global $cap, $post, $bp;
     $tmp = !empty($post) ? get_post_meta($post->ID, '_wp_page_template', true) : '';
     if (defined('BP_VERSION') && bp_is_user() && ($cap->bp_profile_sidebars == __('none', 'cc') || $cap->bp_profile_sidebars == __('left', 'cc'))) {
         return;
     }
     if (defined('BP_VERSION') && bp_is_group() && ($cap->bp_groups_sidebars == __('none', 'cc') || $cap->bp_groups_sidebars == __('left', 'cc'))) {
         return;
     }
     if (function_exists('is_bbpress') && (is_bbpress() && defined('BP_VERSION') && !bp_is_user() && !bp_is_group()) && ($cap->sidebar_position == __('left', 'cc') || $cap->sidebar_position == __('full-width', 'cc'))) {
         return;
     } else {
         if (function_exists('is_bbpress') && (is_bbpress() && defined('BP_VERSION') && !bp_is_user() && !bp_is_group()) && ($cap->sidebar_position == __('right', 'cc') || $cap->sidebar_position == __('left and right', 'cc'))) {
             locate_template(array('sidebar.php'), true);
             return;
         }
     }
     if ($tmp == 'full-width.php' || $tmp == 'tpl-search-full-width.php' || $tmp == 'left-sidebar.php' || $tmp == '_pro/tpl-left-sidebar.php') {
         return;
     }
     if ($tmp == 'left-and-right-sidebar.php' || $tmp == 'right-sidebar.php' || $tmp == '_pro/tpl-left-and-right-sidebar.php' || $tmp == '_pro/tpl-search-right-and-left-sidebar.php' || $tmp == '_pro/tpl-right-sidebar.php' || $tmp == '_pro/tpl-search-right-sidebar.php') {
         locate_template(array('sidebar.php'), true);
         return;
     }
     $component = explode('-', $this->detect->tk_get_page_type());
     if (!empty($component[2])) {
         if ($component[2] == 'groups' && !empty($component[3]) && $bp->unfiltered_uri[0] != 'members') {
             if ($cap->bp_groups_sidebars == 'right' || $cap->bp_groups_sidebars == __('right', 'cc') || $cap->bp_groups_sidebars == 'left and right' || $cap->bp_groups_sidebars == __('left and right', 'cc')) {
                 locate_template(array('groups/single/group-sidebar-right.php'), true);
             } elseif (($cap->bp_groups_sidebars == "default" || $cap->bp_groups_sidebars == __("default", 'cc')) && ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc')) || ($cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) && ($cap->bp_groups_sidebars == "default" || $cap->bp_groups_sidebars == __("default", 'cc'))) {
                 locate_template(array('sidebar.php'), true);
             }
             return;
         } elseif ($bp->unfiltered_uri[0] == 'members' || bp_is_activity_component() || bp_is_profile_component() || bp_is_messages_component() || bp_is_friends_component() || bp_is_settings_component()) {
             if ($cap->bp_profile_sidebars == 'right' || $cap->bp_profile_sidebars == __('right', 'cc') || $cap->bp_profile_sidebars == 'left and right' || $cap->bp_profile_sidebars == __('left and right', 'cc')) {
                 locate_template(array('members/single/member-sidebar-right.php'), true);
             } elseif (($cap->bp_profile_sidebars == "default" || $cap->bp_profile_sidebars == __("default", 'cc')) && ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc')) || ($cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) && ($cap->bp_profile_sidebars == "default" || $cap->bp_profile_sidebars == __("default", 'cc'))) {
                 locate_template(array('sidebar.php'), true);
             }
             return;
         } else {
             if ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc') || $cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) {
                 locate_template(array('sidebar.php'), true);
                 return;
             }
         }
     } elseif (empty($component[2]) && !is_archive() && !is_page()) {
         if ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc') || $cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) {
             locate_template(array('sidebar.php'), true);
             return;
         }
     }
     $cap->archive_template = $cap->archive_template == 'full-width' && defined('is_pro') ? $cap->archive_template : $cap->sidebar_position;
     if (is_archive() && ($cap->archive_template == "right" || $cap->archive_template == "left and right" || $cap->archive_template == __("right", 'cc') || $cap->archive_template == __("left and right", 'cc'))) {
         locate_template(array('sidebar.php'), true);
         return;
     } else {
         if (!is_page() && ($cap->archive_template == "left" || $cap->archive_template == __("left", 'cc') || $cap->archive_template == 'full-width' || $cap->archive_template == __('full-width', 'cc'))) {
             return;
         }
     }
     if ($cap->sidebar_position == __('left and right', 'cc') || $cap->sidebar_position == __('right', 'cc')) {
         locate_template(array('sidebar.php'), true);
         return;
     }
 }
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:75,代码来源:theme-generator.php

示例15: bp_settings_verify_email_change

/**
 * Process email change verification or cancel requests.
 *
 * @since 2.1.0
 */
function bp_settings_verify_email_change()
{
    if (!bp_is_settings_component()) {
        return;
    }
    if (!bp_is_my_profile()) {
        return;
    }
    $redirect_to = trailingslashit(bp_displayed_user_domain() . bp_get_settings_slug());
    // Email change is being verified
    if (isset($_GET['verify_email_change'])) {
        $pending_email = bp_get_user_meta(bp_displayed_user_id(), 'pending_email_change', true);
        // Bail if the hash provided doesn't match the one saved in the database
        if (urldecode($_GET['verify_email_change']) !== $pending_email['hash']) {
            return;
        }
        $email_changed = wp_update_user(array('ID' => bp_displayed_user_id(), 'user_email' => trim($pending_email['newemail'])));
        if ($email_changed) {
            // Delete object cache for displayed user
            wp_cache_delete('bp_core_userdata_' . bp_displayed_user_id(), 'bp');
            // Delete the pending email change key
            bp_delete_user_meta(bp_displayed_user_id(), 'pending_email_change');
            // Post a success message and redirect
            bp_core_add_message(__('You have successfully verified your new email address.', 'buddypress'));
        } else {
            // Unknown error
            bp_core_add_message(__('There was a problem verifying your new email address. Please try again.', 'buddypress'), 'error');
        }
        bp_core_redirect($redirect_to);
        die;
        // Email change is being dismissed
    } elseif (!empty($_GET['dismiss_email_change'])) {
        bp_delete_user_meta(bp_displayed_user_id(), 'pending_email_change');
        bp_core_add_message(__('You have successfully dismissed your pending email change.', 'buddypress'));
        bp_core_redirect($redirect_to);
        die;
    }
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:43,代码来源:bp-settings-actions.php


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