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

PHP bp_is_groups_component函数代码示例

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

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



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

示例1: is_group

 /**
  * Are we looking at something that needs group theme compatibility?
  *
  * @since 1.7.0
  */
 public function is_group()
 {
     // Bail if not looking at a group.
     if (!bp_is_groups_component()) {
         return;
     }
     // Group Directory.
     if (!bp_current_action() && !bp_current_item()) {
         bp_update_is_directory(true, 'groups');
         /**
          * Fires at the start of the group theme compatibility setup.
          *
          * @since 1.1.0
          */
         do_action('groups_directory_groups_setup');
         add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'directory_content'));
         // Creating a group.
     } elseif (bp_is_groups_component() && bp_is_current_action('create')) {
         add_filter('bp_get_buddypress_template', array($this, 'create_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'create_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'create_content'));
         // Group page.
     } elseif (bp_is_single_item()) {
         add_filter('bp_get_buddypress_template', array($this, 'single_template_hierarchy'));
         add_action('bp_template_include_reset_dummy_post_data', array($this, 'single_dummy_post'));
         add_filter('bp_replace_the_content', array($this, 'single_content'));
     }
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:35,代码来源:class-bp-groups-theme-compat.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: bp_groupblog_blog_defaults

function bp_groupblog_blog_defaults($blog_id)
{
    global $bp, $wp_rewrite;
    // only apply defaults to groupblog blogs
    if (bp_is_groups_component()) {
        switch_to_blog($blog_id);
        // get the site options
        $options = get_site_option('bp_groupblog_blog_defaults_options');
        foreach ((array) $options as $key => $value) {
            update_option($key, $value);
        }
        // override default themes
        if (!empty($options['theme'])) {
            // we want something other than the default theme
            $values = explode("|", $options['theme']);
            switch_theme($values[0], $values[1]);
        }
        // groupblog bonus options
        if (strlen($options['default_cat_name']) > 0) {
            global $wpdb;
            $cat = $options['default_cat_name'];
            $slug = str_replace(' ', '-', strtolower($cat));
            $results = $wpdb->query($wpdb->prepare("UPDATE {$wpdb->terms} SET name = %s, slug = %s  WHERE term_id = 1", $cat, $slug));
        }
        if (strlen($options['default_link_cat']) > 0) {
            global $wpdb;
            $cat = $options['default_link_cat'];
            $slug = str_replace(' ', '-', strtolower($cat));
            $results = $wpdb->query($wpdb->prepare("UPDATE {$wpdb->terms} SET name = %s, slug = %s  WHERE term_id = 2", $cat, $slug));
        }
        if (isset($options['delete_first_post']) && $options['delete_first_post'] == 1) {
            global $wpdb;
            $statement = "UPDATE {$wpdb->posts} SET post_status = 'draft'  WHERE id = 1";
            $results = $wpdb->query($statement);
        }
        if (isset($options['delete_first_comment']) && $options['delete_first_comment'] == 1) {
            wp_delete_comment(1);
        }
        if ($options['delete_blogroll_links'] == 1) {
            wp_delete_link(1);
            //delete Wordpress.com blogroll link
            wp_delete_link(2);
            //delete Wordpress.org blogroll link
        }
        if ($options['redirectblog'] == 2) {
            $blog_page = array('comment_status' => 'closed', 'ping_status' => 'closed', 'post_status' => 'publish', 'post_name' => $options['pageslug'], 'post_title' => $options['pagetitle'], 'post_type' => 'page', 'post_content' => __('<p><strong>This page has been created automatically by the BuddyPress GroupBlog plugin.</strong></p><p>Please contact the site admin if you see this message instead of your blog posts. Possible solution: please advise your site admin to create the <a href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates">page template</a> needed for the BuddyPress GroupBlog plugin.<p>', 'groupblog'));
            $blog_page_id = wp_insert_post($blog_page);
            if ($blog_page_id) {
                add_post_meta($blog_page_id, '_wp_page_template', 'blog.php');
            }
            add_post_meta($blog_page_id, 'created_by_groupblog_dont_change', '1');
            // Set the Blog Reading Settings to load the template page as front page
            if ($options['deep_group_integration'] == 1) {
                update_option('show_on_front', 'page');
                update_option('page_on_front', $blog_page_id);
            }
        }
        restore_current_blog();
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:60,代码来源:bp-groupblog-admin.php


示例4: ass_add_javascript

 public function ass_add_javascript()
 {
     if (bp_is_groups_component()) {
         wp_register_script('bp-activity-subscription-js', plugins_url() . '/buddypress-group-email-subscription/bp-activity-subscription-js.js', array('jquery'));
         wp_enqueue_script('bp-activity-subscription-js');
         wp_localize_script('bp-activity-subscription-js', 'bp_ass', array('mute' => __('Mute', 'bp-ass'), 'follow' => __('Follow', 'bp-ass'), 'error' => __('Error', 'bp-ass')));
     }
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:8,代码来源:bp-activity-subscription-main.php


示例5: bp_checkins_is_group_places_area

function bp_checkins_is_group_places_area()
{
    if (bp_is_groups_component() && bp_is_single_item() && bp_is_current_action('checkins') && bp_action_variable(0) == 'places') {
        return true;
    } else {
        return false;
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:8,代码来源:bp-checkins-functions.php


示例6: ass_add_javascript

 public function ass_add_javascript()
 {
     if (bp_is_groups_component()) {
         $revision_date = '20130729';
         wp_register_script('bp-activity-subscription-js', plugins_url('bp-activity-subscription-js.js', __FILE__), array('jquery'), $revision_date);
         wp_enqueue_script('bp-activity-subscription-js');
         wp_localize_script('bp-activity-subscription-js', 'bp_ass', array('mute' => __('Mute', 'bp-ass'), 'follow' => __('Follow', 'bp-ass'), 'error' => __('Error', 'bp-ass')));
     }
 }
开发者ID:pausaura,项目名称:agora_nodes,代码行数:9,代码来源:bp-activity-subscription-main.php


示例7: bp_groupblog_add_screen_css

/**
 * bp_groupblog_add_screen_css()
 */
function bp_groupblog_add_screen_css()
{
    if (bp_is_groups_component()) {
        if (file_exists(get_stylesheet_directory() . '/groupblog/css/style.css')) {
            wp_enqueue_style('bp-groupblog-screen', get_stylesheet_directory_uri() . '/groupblog/css/style.css');
        } else {
            wp_enqueue_style('bp-groupblog-screen', plugins_url() . '/bp-groupblog/groupblog/css/style.css');
        }
    }
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:13,代码来源:bp-groupblog-cssjs.php


示例8: bphelp_pbpp_redirect

function bphelp_pbpp_redirect()
{
    global $bp;
    //IMPORTANT: Do not alter the following line.
    $bphelp_my_redirect_slug = get_option('bphelp-my-redirect-slug', 'register');
    if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component()) {
        if (!is_user_logged_in()) {
            bp_core_redirect(get_option('home') . '/' . $bphelp_my_redirect_slug);
        }
    }
}
开发者ID:pausaura,项目名称:agora_nodes,代码行数:11,代码来源:private-bp-pages.php


示例9: bp_checkins_is_group_checkins_area

function bp_checkins_is_group_checkins_area()
{
    if (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component')) {
        return false;
    }
    if (bp_is_groups_component() && bp_is_single_item() && bp_is_current_action('checkins')) {
        return true;
    } else {
        return false;
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:11,代码来源:bp-checkins-shared.php


示例10: group_hierarchy_override_current_action

/**
 * Catch requests for the groups component and find the requested group
 */
function group_hierarchy_override_current_action($current_action)
{
    global $bp;
    do_action('bp_group_hierarchy_route_requests');
    /** Only process once - hopefully this won't have any side effects */
    remove_action('bp_current_action', 'group_hierarchy_override_current_action');
    /** Abort processing on dashboard pages and when not in groups component */
    if (is_admin() && !strpos(admin_url('admin-ajax.php'), $_SERVER['REQUEST_URI'])) {
        return $current_action;
    }
    if (!bp_is_groups_component()) {
        return $current_action;
    }
    $groups_slug = bp_get_groups_root_slug();
    bp_group_hierarchy_debug('Routing request');
    bp_group_hierarchy_debug('Current component: ' . $bp->current_component);
    bp_group_hierarchy_debug('Current action: ' . $current_action);
    bp_group_hierarchy_debug('Groups slug: ' . $groups_slug);
    bp_group_hierarchy_debug('Are we on a user profile page?: ' . (empty($bp->displayed_user->id) ? 'N' : 'Y'));
    if ($current_action == '') {
        return $current_action;
    }
    if (!empty($bp->displayed_user->id) || in_array($current_action, apply_filters('groups_forbidden_names', array('my-groups', 'create', 'invites', 'send-invites', 'forum', 'delete', 'add', 'admin', 'request-membership', 'members', 'settings', 'avatar', $groups_slug, '')))) {
        bp_group_hierarchy_debug('Not rewriting current action.');
        return $current_action;
    }
    $action_vars = $bp->action_variables;
    $group = new BP_Groups_Hierarchy($current_action);
    if (!$group->id && (!isset($bp->current_item) || !$bp->current_item)) {
        $current_action = '';
        bp_group_hierarchy_debug('Group not found - returning 404.');
        bp_do_404();
        return;
    }
    if ($group->has_children()) {
        $parent_id = $group->id;
        foreach ($bp->action_variables as $action_var) {
            $subgroup_id = BP_Groups_Hierarchy::check_slug($action_var, $parent_id);
            if ($subgroup_id) {
                $action_var = array_shift($action_vars);
                $current_action .= '/' . $action_var;
                $parent_id = $subgroup_id;
            } else {
                // once we find something that isn't a group, we're done
                break;
            }
        }
    }
    bp_group_hierarchy_debug('Action changed to: ' . $current_action);
    $bp->action_variables = $action_vars;
    $bp->current_action = $current_action;
    return $current_action;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:56,代码来源:bp-group-hierarchy-filters.php


示例11: update_activity_privacy_option

 /**
  * Hooked to `bp_activity_entry_meta`
  *
  * Show privacy dropdown inside activity loop along with activity meta buttons.
  */
 function update_activity_privacy_option()
 {
     if (function_exists('bp_activity_user_can_delete') && bp_activity_user_can_delete() && !bp_is_groups_component() && is_rtmedia_privacy_user_overide() && apply_filters('rtm_load_bp_activity_privacy_update_ui', true)) {
         global $activities_template;
         $selected = 0;
         if (isset($activities_template->activity->privacy)) {
             $selected = intval($activities_template->activity->privacy);
         }
         //todo strict standard error
         self::select_privacy_ui(true, 'rtm-ac-privacy-' . $activities_template->activity->id, array('rtm-activity-privacy-opt'), $selected);
     }
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:17,代码来源:RTMediaPrivacy.php


示例12: thatcamp_new_group_rss_catcher

function thatcamp_new_group_rss_catcher()
{
    global $wp_query;
    $feed_template = false;
    if (bp_is_groups_component() && bp_is_current_action('feed')) {
        $feed_template = 'rss-newest-groups.php';
    }
    if (!$feed_template) {
        return;
    }
    $wp_query->is_404 = false;
    status_header(200);
    include __DIR__ . '/includes/' . $feed_template;
    die;
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:15,代码来源:thatcamp-new-groups-feed.php


示例13: logged_out_redirect

function logged_out_redirect()
{
    global $bp;
    // BuddyPress components to lock
    if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page(BP_MEMBERS_SLUG) || bp_is_profile_component()) {
        // Check if user is logged out
        if (!is_user_logged_in()) {
            // Check if a page was selected for redirection
            if (of_get_option('redirect')) {
                $redirect_page = get_permalink(of_get_option('redirect'));
                // If not redirect to login page
            } else {
                $redirect_page = site_url('/wp-login.php');
            }
            wp_redirect($redirect_page);
            exit;
        }
    }
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:19,代码来源:private-bp.php


示例14: meso_schema_breadcrumbs


//.........这里部分代码省略.........
                        }
                    }
                    if ($taxlist) {
                        echo $taxlist;
                    }
                }
                echo ' ' . $delimiter . ' ' . __('You are reading &raquo;', 'mesocolumn');
            } else {
                $category = get_the_category();
                if ($category) {
                    foreach ($category as $cat) {
                        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_category_link($cat->term_id) . '">' . '<span' . $schema_prop_title . '>' . $cat->name . '</span>' . '</a></span>' . $delimiter . ' ';
                    }
                }
                echo __('You are reading &raquo;', 'mesocolumn');
            }
        } elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {
            $post_type = get_post_type_object(get_post_type());
            echo $before . $post_type->labels->singular_name . $after;
        } elseif (is_attachment()) {
            $parent = get_post($post->post_parent);
            $cat = get_the_category($parent->ID);
            $cat = $cat[0];
            if ($cat) {
                echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
            }
            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($parent) . '">' . '<span' . $schema_prop_title . '>' . $parent->post_title . '</span>' . '</a></span>';
            if ($showCurrent == 1) {
                echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
            }
        } elseif (is_page() && !$post->post_parent) {
            if (class_exists('buddypress')) {
                global $bp;
                if (bp_is_groups_component()) {
                    echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('groups') . '</span>' . '</a></span>';
                    if (!bp_is_directory()) {
                        echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '">' . '<span' . $schema_prop_title . '>' . bp_current_item() . '</span>' . '</a></span>';
                        if (bp_current_action()) {
                            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '/' . bp_current_action() . '">' . '<span' . $schema_prop_title . '>' . bp_current_action() . '</span>' . '</a></span>';
                        }
                    }
                } else {
                    if (bp_is_members_directory()) {
                        echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
                    } else {
                        if (bp_is_user()) {
                            echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
                            echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . '">' . '<span' . $schema_prop_title . '>' . bp_get_displayed_user_username() . '</span>' . '</a></span>';
                            if (bp_current_action()) {
                                echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . bp_current_component() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
                            }
                        } else {
                            if (bp_is_directory()) {
                                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
                            } else {
                                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
                            }
                        }
                    }
                }
            } else {
                echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
            }
        } elseif (is_page() && $post->post_parent) {
            $parent_id = $post->post_parent;
            $breadcrumbs = array();
开发者ID:jun200,项目名称:wordpress,代码行数:67,代码来源:hooks-functions.php


示例15: bp_is_group_admin_screen

function bp_is_group_admin_screen($slug)
{
    if (!bp_is_groups_component() || !bp_is_current_action('admin')) {
        return false;
    }
    if (bp_is_action_variable($slug)) {
        return true;
    }
    return false;
}
开发者ID:newington,项目名称:buddypress,代码行数:10,代码来源:bp-groups-template.php


示例16: widget

    function widget($args, $instance)
    {
        global $bp;
        extract($args);
        if (bp_checkins_is_group_places_area() || bp_checkins_is_user_area() && bp_is_current_action('places-area') || bp_checkins_if_single_place()) {
            return false;
        }
        if (!$instance['max_places']) {
            $instance['max_places'] = 5;
        }
        if (!$instance['places_type']) {
            $instance['places_type'] = -1;
        }
        if ($instance['dynamic'] === false) {
            $instance['dynamic'] = 1;
        }
        echo $before_widget;
        echo $before_title . $instance['title'] . $after_title;
        ?>
		
		<?php 
        $widget_args = array('per_page' => $instance['max_places'], 'type' => $instance['places_type']);
        if ((int) $instance['dynamic'] == 1 && bp_displayed_user_id()) {
            $widget_args['user_id'] = bp_displayed_user_id();
        }
        if ((int) $instance['dynamic'] == 1 && bp_is_groups_component() && bp_is_single_item() && $bp->groups->current_group->status == 'public') {
            $widget_args['group_id'] = $bp->groups->current_group->id;
        }
        ?>
		
		<?php 
        if (!empty($widget_args['group_id']) || !empty($widget_args['user_id'])) {
            ?>
			
			<div class="item-options">
				
				<?php 
            if (bp_displayed_user_id()) {
                printf(__('%s&#039;s places', 'bp-checkins'), bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'object' => 'user', 'type' => 'thumb', 'width' => 20, 'height' => 20)) . bp_core_get_userlink(bp_displayed_user_id()));
            }
            if (bp_is_groups_component() && bp_is_single_item()) {
                printf(__('%s&#039;s places', 'bp-checkins'), bp_core_fetch_avatar(array('item_id' => $bp->groups->current_group->id, 'object' => 'group', 'type' => 'thumb', 'width' => 20, 'height' => 20)) . '<a href="' . bp_get_group_permalink($bp->groups->current_group) . '">' . esc_attr($bp->groups->current_group->name) . '</a>');
            }
            ?>
	
				
			</div>
		
		<?php 
        }
        ?>

		<?php 
        if (bp_checkins_has_places($widget_args)) {
            ?>
			
			<ul id="widget-places-list" class="item-list">
				<?php 
            while (bp_checkins_has_places()) {
                bp_checkins_the_place();
                ?>

					<li>
						<div class="item-avatar">
							<?php 
                bp_checkins_places_avatar();
                ?>
						</div>
						<div class="item-title">
							<a href="<?php 
                bp_checkins_places_the_permalink();
                ?>
" title="<?php 
                bp_checkins_places_title();
                ?>
"><?php 
                bp_checkins_places_title();
                ?>
</a>
						</div>
						<?php 
                if (bp_checkins_places_is_live()) {
                    ?>
							<div class="item-meta">
								<span class="activity"><?php 
                    bp_checkins_places_live_status();
                    ?>
</span>
							</div>
						<?php 
                }
                ?>
						<div class="clear"></div>
					</li>

				<?php 
            }
            ?>

		<?php 
//.........这里部分代码省略.........
开发者ID:socialray,项目名称:surfied-2-0,代码行数:101,代码来源:bp-checkins-places-widget.php


示例17: rtmedia_modify_activity_upload_url

function rtmedia_modify_activity_upload_url($params)
{
    // return original params if BuddyPress multilingual plugin is not active
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    if (function_exists('is_plugin_active') && is_plugin_active('buddypress-multilingual/sitepress-bp.php')) {
        if (class_exists('BuddyPress')) {
            // change upload url only if it's activity page and if it's group page than it shouldn't group media page
            if (bp_is_activity_component() || bp_is_groups_component() && !is_rtmedia_page()) {
                if (function_exists('bp_get_activity_directory_permalink')) {
                    $params['url'] = bp_get_activity_directory_permalink() . 'upload/';
                }
            }
        }
    }
    return $params;
}
开发者ID:EfncoPlugins,项目名称:rtMedia,代码行数:16,代码来源:rt-template-functions.php


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


示例19: setup_title

 /**
  * Set up the title for pages and <title>.
  */
 public function setup_title()
 {
     if (bp_is_groups_component()) {
         $bp = buddypress();
         if (bp_is_my_profile() && !bp_is_single_item()) {
             $bp->bp_options_title = _x('Memberships', 'My Groups page <title>', 'buddypress');
         } elseif (!bp_is_my_profile() && !bp_is_single_item()) {
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => bp_displayed_user_id(), 'type' => 'thumb', 'alt' => sprintf(__('Profile picture of %s', 'buddypress'), bp_get_displayed_user_fullname())));
             $bp->bp_options_title = bp_get_displayed_user_fullname();
             // We are viewing a single group, so set up the
             // group navigation menu using the $this->current_group global.
         } elseif (bp_is_single_item()) {
             $bp->bp_options_title = $this->current_group->name;
             $bp->bp_options_avatar = bp_core_fetch_avatar(array('item_id' => $this->current_group->id, 'object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'alt' => __('Group Profile Photo', 'buddypress')));
             if (empty($bp->bp_options_avatar)) {
                 $bp->bp_options_avatar = '<img src="' . esc_url(bp_core_avatar_default_thumb()) . '" alt="' . esc_attr__('No Group Profile Photo', 'buddypress') . '" class="avatar" />';
             }
         }
     }
     parent::setup_title();
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:24,代码来源:bp-groups-loader.php


示例20: elseif

        echo $topnav_style == 'light' ? 'heading-light' : '';
        ?>
">
    <div class="container">
        <h1><?php 
        echo $post->post_title;
        ?>
</h1>
        <?php 
        if (is_plugin_active('buddypress/bp-loader.php') && bp_current_component()) {
            //buddypress
            if (bp_is_directory()) {
                //sitewide
                if (bp_is_activity_component()) {
                    //activity
                } elseif (bp_is_groups_component()) {
                    //groups
                    ?>
        <div id="group-dir-search" class="dir-search pull-right" role="search">
            <?php 
                    bp_directory_groups_search_form();
                    ?>
        </div>
        <!-- #group-dir-search -->
        <?php 
                } elseif (bp_current_component('members')) {
                    //members
                    ?>
        <div id="members-dir-search" class="dir-search pull-right" role="search">
            <?php 
                    bp_directory_members_search_form();
开发者ID:venamax,项目名称:trixandtrax-cl,代码行数:31,代码来源:page.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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