本文整理汇总了PHP中bp_group_is_member函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_group_is_member函数的具体用法?PHP bp_group_is_member怎么用?PHP bp_group_is_member使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_group_is_member函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _e
</label>
<select id="topic_group_id" name="topic_group_id">
<option value=""><?php
/* translators: no option picked in select box */
_e('----', 'buddypress');
?>
</option>
<?php
while (bp_groups()) {
bp_the_group();
?>
<?php
if (bp_group_is_forum_enabled() && (is_super_admin() || 'public' == bp_get_group_status() || bp_group_is_member())) {
?>
<option value="<?php
bp_group_id();
?>
"><?php
bp_group_name();
?>
</option>
<?php
}
?>
<?php
示例2: bp_group_name
"><?php
bp_group_name();
?>
</a></h1>
<p class="status"><?php
bp_group_type();
?>
</p>
</div>
<div class="info-group">
<?php
if (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>
</div>
</div>
<?php
}
}
?>
</div>
示例3: bp_get_group_class
/**
* Get the row class of the current group in the loop.
*
* @since 1.7.0
*
* @param array $classes Array of custom classes.
* @return string Row class of the group.
*/
function bp_get_group_class($classes = array())
{
global $groups_template;
// Add even/odd classes, but only if there's more than 1 group.
if ($groups_template->group_count > 1) {
$pos_in_loop = (int) $groups_template->current_group;
$classes[] = $pos_in_loop % 2 ? 'even' : 'odd';
// If we've only one group in the loop, don't bother with odd and even.
} else {
$classes[] = 'bp-single-group';
}
// Group type - public, private, hidden.
$classes[] = sanitize_key($groups_template->group->status);
// User's group role.
if (bp_is_user_active()) {
// Admin.
if (bp_group_is_admin()) {
$classes[] = 'is-admin';
}
// Moderator.
if (bp_group_is_mod()) {
$classes[] = 'is-mod';
}
// Member.
if (bp_group_is_member()) {
$classes[] = 'is-member';
}
}
// Whether a group avatar will appear.
if (bp_disable_group_avatar_uploads() || !buddypress()->avatar->show_avatars) {
$classes[] = 'group-no-avatar';
} else {
$classes[] = 'group-has-avatar';
}
/**
* Filters classes that will be applied to row class of the current group in the loop.
*
* @since 1.7.0
*
* @param array $classes Array of determined classes for the row.
*/
$classes = apply_filters('bp_get_group_class', $classes);
$classes = array_merge($classes, array());
$retval = 'class="' . join(' ', $classes) . '"';
return $retval;
}
示例4: do_action
if (!bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic()) {
?>
<?php
if (!bp_group_is_user_banned() && (is_user_logged_in() && 'public' == bp_get_group_status() || bp_group_is_member())) {
?>
<form action="" method="post" id="forum-topic-form" class="standard-form">
<div id="new-topic-post">
<?php
do_action('bp_before_group_forum_post_new');
?>
<?php
if (bp_groups_auto_join() && !bp_group_is_member()) {
?>
<p><?php
_e('You will auto join this group when you start a new topic.', 'buddypress');
?>
</p>
<?php
}
?>
<p id="post-new"></p>
<h4><?php
_e('Post a New Topic:', 'buddypress');
?>
</h4>
示例5: student_screen
/**
* student_screen( $vars )
*
* Hooks into courseware_assignment
* If a student is visiting assignment screen, his grade will be shown
*
* @param Array $vars a set of variables received for this screen template
* @return Array $vars a set of variable passed to this screen template
*/
function student_screen($vars)
{
global $bp;
$user_id = null;
if (bp_group_is_member($bp->groups->current_group) && !bp_group_is_admin()) {
$user_id = $bp->loggedin_user->id;
}
if ($user_id) {
$vars['user_grade'] = $this->load_grade_by_user_id($this->current_assignment, $user_id);
}
$vars['has_gradebook_caps'] = $this->has_gradebook_caps($bp->loggedin_user->id);
return $vars;
}
示例6: _e
} else {
?>
<div id="message" class="info">
<p><?php
_e('There are no topics for this group forum.', 'buddypress');
?>
</p>
</div>
<?php
}
?>
<?php
if (bp_group_is_member()) {
?>
<div id="post-new-topic">
<?php
do_action('groups_forum_new_topic_before');
?>
<a name="post-new"></a>
<p><strong><?php
_e('Post a New Topic:', 'buddypress');
?>
</strong></p>
<label><?php
示例7: populate_responses
/**
* populate_responses( $vars )
*
* Hooks into single_assignment_screen
* Populates $vars with responses
*
* @param Array $vars a set of variables received for this screen template
* @return Array $vars a set of variable passed to this screen template
*/
function populate_responses($vars)
{
global $bp;
if ($this->has_student_caps() && bp_group_is_member($bp->current_group->id)) {
$vars['response_add_uri'] = $vars['assignment_permalink'] . '/add_response';
}
$vars['response'] = $this->has_response();
$vars['response_permalink'] = $vars['assignment_permalink'] . '/response/';
if (!$this->group_responses_status() || $this->has_response_caps()) {
$vars['responses'] = get_posts(array('numberposts' => '-1', 'post_type' => 'response', 'post_status' => 'publish', 'post_parent' => $this->current_assignment->ID));
}
return $vars;
}
示例8: do_action
</option>
<?php
do_action('bp_group_activity_filter_options');
?>
</select>
</li>
</ul>
</div><!-- .item-list-tabs -->
<?php
do_action('bp_before_group_activity_post_form');
?>
<?php
if (is_user_logged_in() && bp_group_is_member() && !newwriting_is_lurker()) {
?>
<?php
locate_template(array('activity/post-form.php'), true);
}
?>
<?php
do_action('bp_after_group_activity_post_form');
do_action('bp_before_group_activity_content');
?>
<div class="activity single-group" role="main">
<?php
locate_template(array('activity/activity-loop.php'), true);
?>
示例9: current_user_can
public function current_user_can($action)
{
global $bp;
if (bp_group_is_admin()) {
return true;
}
$user_is_owner = $this->user_id == get_current_user_id();
switch ($action) {
case 'add':
switch (get_option('bp_group_documents_upload_permission')) {
case 'mods_decide':
switch (groups_get_groupmeta($bp->groups->current_group->id, 'group_documents_upload_permission')) {
case 'mods_only':
if (bp_group_is_mod($bp->groups->current_group)) {
return true;
}
break;
case 'members':
default:
if (bp_group_is_member($bp->groups->current_group)) {
return true;
}
break;
}
break;
case 'mods_only':
if (bp_group_is_mod($bp->groups->current_group)) {
return true;
}
break;
case 'members':
default:
if (bp_group_is_member($bp->groups->current_group)) {
return true;
}
break;
}
break;
case 'edit':
if (bp_group_is_mod($bp->groups->current_group) || bp_group_is_member($bp->groups->current_group) && $user_is_owner) {
return true;
}
break;
case 'delete':
if (bp_group_is_mod($bp->groups->current_group) || bp_group_is_member($bp->groups->current_group) && $user_is_owner) {
return true;
}
break;
}
return false;
}
示例10: project_perms
/**
* Filters the output of cp_check_project_permissions() to correspond to group membership
*
* When the project is not associated with a group, it falls back on the CP value of
* $has_access
*
* @package CollabPress
* @subpackage CP BP
* @since 1.2
*
* @param bool $has_access The value passed along by cp_check_project_permissions()
* @param int $user_id The id of the user being checked against
* @param int $project_id The id of the project
* @param array $cp_project_users The users of the project, as stored by CP
* @return bool $has_access Whether the user has access to the project
*/
function project_perms($has_access, $user_id, $project_id, $cp_project_users)
{
// Super admins always have access
if (is_super_admin()) {
return true;
}
if (bp_is_group()) {
// If we're looking at a group page, we can assume we're checking against
// that group
$has_access = bp_group_is_member();
} else {
// Otherwise (on the admin panel specifically) we have to check to see
// whether the user is in the associated group
$terms = wp_get_post_terms($project_id, 'cp-bp-group');
// If there are associated groups, check to see whether the current user
// is in at least one of them
if (!empty($terms)) {
foreach ((array) $terms as $term) {
$has_access = groups_is_user_member(bp_loggedin_user_id(), $term->name);
// Once we find a single group, no need to keep looping
if ($has_access) {
break;
}
}
}
}
return $has_access;
}
示例11: display
//.........这里部分代码省略.........
if (is_user_logged_in()) {
?>
<option value="places_around"><?php
_e('Places around', 'bp-checkins');
?>
</option>
<?php
}
?>
<?php
do_action('bp_checkins_group_places_filters');
?>
</select>
</li>
<?php
}
?>
</ul>
</form>
</div>
<?php
if (!bp_action_variable(0) || 'checkins' == bp_action_variable(0)) {
?>
<?php
do_action('bp_before_group_checkins_post_form');
?>
<?php
if (is_user_logged_in() && bp_group_is_member()) {
?>
<?php
bp_checkins_load_template_choose('bp-checkins-post-form');
?>
<?php
}
?>
<?php
do_action('bp_after_group_checkins_post_form');
?>
<?php
do_action('bp_before_group_checkins_content');
?>
<div class="activity single-group" role="main">
<?php
bp_checkins_locate_template_choose('activity/activity-loop');
?>
</div><!-- .activity.single-group -->
<?php
do_action('bp_after_group_checkins_content');
?>
<?php
} else {
?>
<?php
do_action('bp_before_group_places_post_form');
?>
示例12: bpfb_documents_allowed
/**
* Checks upload permissions.
* Adapted from Group Documents plugin.
*/
function bpfb_documents_allowed($group = false)
{
if (!$group) {
return false;
}
$user = wp_get_current_user();
$moderator_of = BP_Groups_Member::get_is_admin_of($user->ID) + BP_Groups_Member::get_is_mod_of($user->ID);
$moderator_of = is_array($moderator_of) && isset($moderator_of['groups']) ? $moderator_of['groups'] : false;
$is_mod = false;
foreach ($moderator_of as $gm) {
if ($gm->id == $group->id) {
$is_mod = true;
break;
}
}
switch (get_option('bp_group_documents_upload_permission')) {
case 'mods_decide':
switch (groups_get_groupmeta($group->id, 'group_documents_upload_permission')) {
case 'mods_only':
if ($is_mod) {
return true;
}
break;
case 'members':
default:
if (bp_group_is_member($group)) {
return true;
}
break;
}
break;
case 'mods_only':
if ($is_mod) {
return true;
}
break;
case 'members':
default:
if (bp_group_is_member($group)) {
return true;
}
break;
}
return false;
}
示例13: do_action
<?php do_action( 'bp_before_group_forum_edit_form' ) ?>
<?php if ( bp_has_forum_topic_posts() ) : ?>
<form action="<?php bp_forum_topic_action() ?>" method="post" id="forum-topic-form" class="standard-form">
<div id="topic-meta">
<h3><?php bp_the_topic_title() ?> (<?php bp_the_topic_total_post_count() ?>)</h3>
<a class="button" href="<?php bp_forum_permalink() ?>/">← <?php _e( 'Group Forum', 'buddypress' ) ?></a> <a class="button" href="<?php bp_forum_directory_permalink() ?>/"><?php _e( 'Group Forum Directory', 'buddypress') ?></a>
<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
<div class="admin-links"><?php bp_the_topic_admin_links() ?></div>
<?php endif; ?>
</div>
<?php if ( bp_group_is_member() ) : ?>
<?php if ( bp_is_edit_topic() ) : ?>
<div id="edit-topic">
<?php do_action( 'bp_group_before_edit_forum_topic' ) ?>
<p><strong><?php _e( 'Edit Topic:', 'buddypress' ) ?></strong></p>
<label for="topic_title"><?php _e( 'Title:', 'buddypress' ) ?></label>
<input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title() ?>" />
<label for="topic_text"><?php _e( 'Content:', 'buddypress' ) ?></label>
<textarea name="topic_text" id="topic_text"><?php bp_the_topic_text() ?></textarea>
示例14: bp_get_group_class
/**
* Return the row class of a group
*
* @global BP_Groups_Template $groups_template
* @return string Row class of the group
* @since BuddyPress (1.7)
*/
function bp_get_group_class()
{
global $groups_template;
$classes = array();
$pos_in_loop = (int) $groups_template->current_group;
// If we've only one group in the loop, don't both with odd and even.
if ($groups_template->group_count > 1) {
$classes[] = $pos_in_loop % 2 ? 'even' : 'odd';
} else {
$classes[] = 'bp-single-group';
}
// Group type - public, private, hidden.
$classes[] = esc_attr($groups_template->group->status);
// User's group status
if (bp_is_user_active()) {
if (bp_group_is_admin()) {
$classes[] = 'is-admin';
}
if (bp_group_is_member()) {
$classes[] = 'is-member';
}
if (bp_group_is_mod()) {
$classes[] = 'is-mod';
}
}
$classes = apply_filters('bp_get_group_class', $classes);
$classes = array_merge($classes, array());
$retval = 'class="' . join(' ', $classes) . '"';
return $retval;
}
示例15: _e
</label>
<select id="topic_group_id" name="topic_group_id">
<option value=""><?php
/* translators: no option picked in select box */
_e('----', 'buddypress');
?>
</option>
<?php
while (bp_groups()) {
bp_the_group();
?>
<?php
if (bp_group_is_forum_enabled() && (bp_current_user_can('bp_moderate') || 'public' == bp_get_group_status() || bp_group_is_member())) {
?>
<option value="<?php
bp_group_id();
?>
"><?php
bp_group_name();
?>
</option>
<?php
}
?>
<?php