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


PHP bp_group_is_visible函数代码示例

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


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

示例1: custom_media_nav_tab

 /**
  * Load Custom tabs on BuddyPress
  *
  * @global object $bp global BuddyPress object
  */
 function custom_media_nav_tab()
 {
     $bp = buddypress();
     if (!function_exists('bp_core_new_nav_item')) {
         return;
     }
     if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
         return;
     }
     global $rtmedia;
     if (function_exists('bp_is_group') && !bp_is_group()) {
         if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
             $profile_counts = $this->actual_counts($bp->displayed_user->id);
         }
         $tab_position = apply_filters('rtmedia_media_tab_position', 99);
         if (0 !== intval($rtmedia->options['buddypress_enableOnProfile'])) {
             bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
         }
     }
     if (bp_is_group() && 0 !== intval($rtmedia->options['buddypress_enableOnGroup'])) {
         $media_enabled = true;
         //filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
         $media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
         // check if current user can view this group
         $current_group = groups_get_current_group();
         /**
          * remove `$current_group->is_visible` and add `bp_group_is_visible( $current_group )`
          * reason   : In Buddypress 2.7 `is_visible` return false so we can't display `media` tab on group
          * issue id	: http://git.rtcamp.com/rtmedia/rtMedia/issues/119
          */
         // $is_visible_to_current_user = $current_group->is_visible;
         $is_visible_to_current_user = bp_group_is_visible($current_group);
         if ($media_enabled && $is_visible_to_current_user) {
             $group_counts = $this->actual_counts($bp->groups->current_group->id, 'group');
             $slug = apply_filters('rtmedia_group_media_tab_slug', RTMEDIA_MEDIA_SLUG);
             if (isset($bp->version) && $bp->version > '2.5.3') {
                 /*
                  * As from BuddyPress 2.6, you can't access $bp->bp_options_nav directly.
                  * Use `bp_core_new_subnav_item` to add subnav item.
                  *
                  * Check https://buddypress.trac.wordpress.org/ticket/6534 and https://buddypress.trac.wordpress.org/changeset/10745
                  * for more details
                  */
                 bp_core_new_subnav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'parent_slug' => bp_get_current_group_slug(), 'parent_url' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/'), 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all'));
             } else {
                 $bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
             }
         }
     }
 }
开发者ID:rtCamp,项目名称:rtMedia,代码行数:55,代码来源:RTMediaNav.php

示例2: do_action

		<?php 
        /**
         * Fires before the display of the group home body.
         *
         * @since 1.2.0
         */
        do_action('bp_before_group_body');
        /**
         * Does this next bit look familiar? If not, go check out WordPress's
         * /wp-includes/template-loader.php file.
         *
         * @todo A real template hierarchy? Gasp!
         */
        // Looking at home location
        if (bp_is_group_home()) {
            if (bp_group_is_visible()) {
                // Load appropriate front template
                bp_groups_front_template_part();
            } else {
                /**
                 * Fires before the display of the group status message.
                 *
                 * @since 1.1.0
                 */
                do_action('bp_before_group_status_message');
                ?>

					<div id="message" class="info">
						<p><?php 
                bp_group_status_message();
                ?>
开发者ID:toby-bushell,项目名称:triumph,代码行数:31,代码来源:home.php

示例3: gconnect_group_single_template

function gconnect_group_single_template()
{
    $template = false;
    if (bp_is_group_membership_request()) {
        $template = 'request-membership.php';
    } elseif (bp_group_is_visible()) {
        if (bp_is_group_admin_page()) {
            $template = 'admin.php';
        } elseif (bp_is_group_members()) {
            $template = 'members.php';
        } elseif (bp_is_group_invites()) {
            $template = 'send-invites.php';
        } elseif (bp_is_group_forum()) {
            $template = 'forum.php';
        } elseif (bp_is_active('activity')) {
            $template = 'activity.php';
        }
    }
    if ($template) {
        gconnect_locate_template(array("groups/single/{$template}"), true);
    }
    return $template;
}
开发者ID:hscale,项目名称:webento,代码行数:23,代码来源:class.theme.php

示例4: bp_group_random_members

</h4>
					<?php 
            bp_group_random_members();
            ?>
				</div>
				
			<?php 
        }
        ?>
		
			<?php 
        do_action('groups_custom_group_boxes');
        ?>
	
			<?php 
        if (bp_group_is_visible() && bp_group_is_wire_enabled() && function_exists('bp_wire_get_post_list')) {
            ?>

					<?php 
            bp_wire_get_post_list(bp_get_group_id(), __('Group Wire', 'buddypress'), sprintf(__('The are no wire posts for %s', 'buddypress'), bp_get_group_name()), bp_group_is_member(), true);
            ?>
				
			<?php 
        }
        ?>

		</div>

	<?php 
    }
} else {
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:31,代码来源:group-home.php

示例5: do_action

<?php do_action( 'bp_before_group_header' ) ?>

<div id="item-actions">
	<?php if ( bp_group_is_visible() ) : ?>

		<h3><?php _e( 'Group Admins', 'buddypress' ) ?></h3>
		<?php bp_group_list_admins() ?>

		<?php do_action( 'bp_after_group_menu_admins' ) ?>

		<?php if ( bp_group_has_moderators() ) : ?>
			<?php do_action( 'bp_before_group_menu_mods' ) ?>

			<h3><?php _e( 'Group Mods' , 'buddypress' ) ?></h3>
			<?php bp_group_list_mods() ?>

			<?php do_action( 'bp_after_group_menu_mods' ) ?>
		<?php endif; ?>

	<?php endif; ?>
</div><!-- #item-actions -->

<div id="item-header-avatar">
	<a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>">
		<?php bp_group_avatar() ?>
	</a>
</div><!-- #item-header-avatar -->

<div id="item-header-content">
	<h2><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></h2>
	<span class="highlight"><?php bp_group_type() ?></span> <span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span>
开发者ID:n-sane,项目名称:zaroka,代码行数:31,代码来源:group-header.php

示例6: elseif

                    // Group Members
                } elseif (bp_is_group_members()) {
                    locate_template(array('groups/single/members.php'), true);
                    // Group Invitations
                } elseif (bp_is_group_invites()) {
                    locate_template(array('groups/single/send-invites.php'), true);
                    // Old group forums
                } elseif (bp_is_group_forum()) {
                    locate_template(array('groups/single/forum.php'), true);
                    // Anything else (plugins mostly)
                } else {
                    locate_template(array('groups/single/plugins.php'), true);
                }
            }
            // Group is not visible
        } elseif (!bp_group_is_visible()) {
            // Membership request
            if (bp_is_group_membership_request()) {
                locate_template(array('groups/single/request-membership.php'), true);
                // The group is not visible, show the status message
            } else {
                do_action('bp_before_group_status_message');
                ?>

						<div id="message" class="info">
							<p><?php 
                bp_group_status_message();
                ?>
</p>
						</div>
开发者ID:danielcoats,项目名称:schoolpress,代码行数:30,代码来源:home.php

示例7: groups_action_group_feed

/**
 * Load the activity feed for the current group.
 *
 * @since BuddyPress (1.2.0)
 *
 * @return bool|null False on failure.
 */
function groups_action_group_feed()
{
    // get current group
    $group = groups_get_current_group();
    if (!bp_is_active('activity') || !bp_is_groups_component() || !$group || !bp_is_current_action('feed')) {
        return false;
    }
    // if group isn't public or if logged-in user is not a member of the group, do
    // not output the group activity feed
    if (!bp_group_is_visible($group)) {
        return false;
    }
    // setup the feed
    buddypress()->activity->feed = new BP_Activity_Feed(array('id' => 'group', 'title' => sprintf(__('%1$s | %2$s | Activity', 'buddypress'), bp_get_site_name(), bp_get_current_group_name()), 'link' => bp_get_group_permalink($group), 'description' => sprintf(__("Activity feed for the group, %s.", 'buddypress'), bp_get_current_group_name()), 'activity_args' => array('object' => buddypress()->groups->id, 'primary_id' => bp_get_current_group_id(), 'display_comments' => 'threaded')));
}
开发者ID:eresyyl,项目名称:mk,代码行数:22,代码来源:bp-groups-actions.php

示例8: bp_group_random_members

            ?>
</h4>
					<?php 
            bp_group_random_members();
            ?>
				</div>
			<?php 
        }
        ?>
			
			<?php 
        do_action('groups_custom_group_boxes');
        ?>
		
			<?php 
        if (bp_group_is_visible() && bp_group_is_wire_enabled()) {
            ?>
				<?php 
            if (function_exists('bp_wire_get_post_list')) {
                ?>
					<?php 
                bp_wire_get_post_list(bp_group_id(false, false), __('Group Wire', 'buddypress'), sprintf(__('There are no wire posts for %s', 'buddypress'), bp_group_name(false)), bp_group_is_member(), true);
                ?>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
		
		</div>
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:31,代码来源:group-home.php

示例9: bp_groupblog_options_nav

/**
 * bp_groupblog_options_nav()
 *
 * Manually create the navigation for the group since we can't fetch any other way.
 * You should manually add items if you have third party plugins that add a menu item.
 *
 * The BuddyPress function we duplicate is called bp_get_options_nav()
 */
function bp_groupblog_options_nav()
{
    global $bp;
    $checks = get_site_option('bp_groupblog_blog_defaults_options');
    ?>

	  <li id="home-personal-li"<?php 
    if ($checks['deep_group_integration']) {
        ?>
 class="current selected"<?php 
    }
    ?>
>
			<a id="home" href="<?php 
    bp_group_permalink();
    ?>
"><?php 
    _e('Home', 'groupblog');
    ?>
</a>
		</li>

    <?php 
    if (groups_is_user_admin($bp->loggedin_user->id, bp_get_group_id()) || groups_is_user_mod($bp->loggedin_user->id, bp_get_group_id())) {
        ?>
			<li id="admin-personal-li" >
				<a id="admin" href="<?php 
        bp_group_permalink();
        ?>
admin/"><?php 
        _e('Admin', 'groupblog');
        ?>
</a>
			</li>
		<?php 
    }
    ?>

		<?php 
    if (bp_group_is_visible()) {
        ?>

			<?php 
        if (bp_groupblog_is_blog_enabled(bp_get_group_id())) {
            ?>
				<?php 
            if (!$checks['deep_group_integration']) {
                ?>
					<li id="<?php 
                echo BP_GROUPBLOG_SLUG;
                ?>
-personal-li"<?php 
                //if ( is_page() ) :
                ?>
 class="current selected"<?php 
                //endif;
                ?>
>
						<a id="<?php 
                echo BP_GROUPBLOG_SLUG;
                ?>
" href="<?php 
                bp_group_permalink();
                ?>
blog/"><?php 
                _e('Blog', 'groupblog');
                ?>
</a>
					</li>
				<?php 
            }
            ?>
		  <?php 
        }
        ?>

			<?php 
        if (bp_is_active('forums') && (function_exists('bp_forums_is_installed_correctly') && bp_group_is_forum_enabled() && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) {
            ?>
				<li id="<?php 
            echo BP_FORUMS_SLUG;
            ?>
-personal-li" >
					<a id="<?php 
            echo BP_FORUMS_SLUG;
            ?>
" href="<?php 
            bp_group_permalink();
            ?>
forum/"><?php 
            _e('Forum', 'groupblog');
            ?>
//.........这里部分代码省略.........
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:functions.php

示例10: bbp_get_user_role

                                        <?php 
$isForumModerator = bbp_get_user_role(get_current_user_id()) != 'bbp_moderator' && bbp_get_user_role(get_current_user_id()) != 'bbp_keymaster';
if (bbp_has_forums($buddypress_id)) {
    $topics = false;
    while (bbp_forums()) {
        bbp_the_forum();
        if ($forum_id != bbp_get_forum_id()) {
            continue;
        }
        $topics = bbp_has_topics(array('post_parent' => $forum_id, 'posts_per_page' => 11));
        if (!$topics) {
            _e('This forum does not have topics', 'qode');
            break;
        }
        $counter = 0;
        if (bp_group_is_visible($group)) {
            global $post;
            $post = bbp_get_forum($forum_id);
            $counter = 0;
            while (bbp_topics()) {
                bbp_the_topic();
                if (++$counter == 12) {
                    break;
                }
                ?>
										            <div class="topics_list_single_topic <?php 
                $postUser = new WP_User(bbp_get_topic_author_id());
                echo $postUser->has_cap('bbp_keymaster') || $postUser->has_cap('bbp_moderator') ? "isAdmin" : "";
                ?>
"
										                id="topic-<?php 
开发者ID:Bnei-Baruch,项目名称:kabacademy,代码行数:31,代码来源:single-namaste_course_old_forum.php

示例11: doc_settings_markup

    /**
     * Creates the markup for the group-specific doc settings
     *
     * In the future I'll try to get the markup out of here. Sorry, themers.
     *
     * @package BuddyPress Docs
     * @since 1.0-beta
     *
     * @param array $doc_settings Passed along to reduce lookups
     */
    function doc_settings_markup($doc_settings)
    {
        global $bp;
        // Only add these settings if we're in the group component
        // BP 1.2/1.3 compatibility
        $is_group_component = function_exists('bp_is_current_component') ? bp_is_current_component('groups') : $bp->current_component == $bp->groups->slug;
        if ($is_group_component) {
            // Get the current values
            $edit = !empty($doc_settings['edit']) ? $doc_settings['edit'] : 'group-members';
            $post_comments = !empty($doc_settings['post_comments']) ? $doc_settings['post_comments'] : 'group-members';
            // Read settings have a different default value for public groups
            if (!empty($doc_settings['read_comments'])) {
                $read_comments = $doc_settings['read_comments'];
            } else {
                $read_comments = bp_group_is_visible() ? 'anyone' : 'group-members';
            }
            $view_history = !empty($doc_settings['view_history']) ? $doc_settings['view_history'] : 'anyone';
            $manage = !empty($doc_settings['manage']) ? $doc_settings['manage'] : 'creator';
            // Set the text of the 'creator only' label
            if (!empty($bp->bp_docs->current_post->post_author) && $bp->bp_docs->current_post->post_author != bp_loggedin_user_id()) {
                $creator_text = sprintf(__('Doc creator only (%s)', 'bp-docs'), bp_core_get_user_displayname($bp->bp_docs->current_post->post_author));
            } else {
                $creator_text = __('Doc creator only (that\'s you!)', 'bp-docs');
            }
            ?>
			
			<?php 
            /* EDITING */
            ?>
			<tr>
				<td class="desc-column">
					<label for="settings[edit]"><?php 
            _e('Who can edit this doc?', 'bp-docs');
            ?>
</label>
				</td>
				
				<td class="content-column">
					<input name="settings[edit]" type="radio" value="group-members" <?php 
            checked($edit, 'group-members');
            ?>
/> <?php 
            _e('All members of the group', 'bp-docs');
            ?>
<br />
			
					<input name="settings[edit]" type="radio" value="creator" <?php 
            checked($edit, 'creator');
            ?>
/> <?php 
            echo esc_html($creator_text);
            ?>
<br />
			
					<?php 
            if (bp_group_is_admin() || bp_group_is_mod()) {
                ?>
						<input name="settings[edit]" type="radio" value="admins-mods" <?php 
                checked($edit, 'admins-mods');
                ?>
/> <?php 
                _e('Only admins and mods of this group', 'bp-docs');
                ?>
<br />
					<?php 
            }
            ?>
				</td>
			</tr>
			
			<?php 
            /* POSTING COMMENTS */
            ?>
			<tr>
				<td class="desc-column">
					<label for="settings[post_comments]"><?php 
            _e('Who can <em>post</em> comments on this doc?', 'bp-docs');
            ?>
</label>
				</td>
				
				<td class="content-column">
					<input name="settings[post_comments]" type="radio" value="group-members" <?php 
            checked($post_comments, 'group-members');
            ?>
/> <?php 
            _e('All members of the group', 'bp-docs');
            ?>
<br />
					
//.........这里部分代码省略.........
开发者ID:Nightgunner5,项目名称:Pubcomp-CMS,代码行数:101,代码来源:integration-groups.php

示例12: bp_get_options_nav

	</div>
	<div id="item-nav">
		<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
			<ul>
				<?php 
        bp_get_options_nav();
        do_action('bp_group_options_nav');
        ?>
			</ul>
			<div class="clear"></div>
		</div>
	</div>
	<div id="item-body">
<?php 
        do_action('bp_before_group_body');
        if (!gconnect_group_single_template() && !bp_group_is_visible()) {
            do_action('bp_before_group_status_message');
            ?>
		<div id="message" class="info">
			<p><?php 
            bp_group_status_message();
            ?>
</p>
		</div>
<?php 
            do_action('bp_after_group_status_message');
        }
        do_action('bp_after_group_body');
        ?>
	</div>
<?php 
开发者ID:hscale,项目名称:webento,代码行数:31,代码来源:home.php


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