本文整理汇总了PHP中bp_get_group_status函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_group_status函数的具体用法?PHP bp_get_group_status怎么用?PHP bp_get_group_status使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_group_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_groups_group_admin_menu
/**
* Adds the Group Admin top-level menu to group pages
*
* @package BuddyPress
* @since 1.5
*
* @todo Add dynamic menu items for group extensions
*/
function bp_groups_group_admin_menu()
{
global $nxt_admin_bar, $bp;
// Only show if viewing a group
if (!bp_is_group()) {
return false;
}
// Only show this menu to group admins and super admins
if (!is_super_admin() && !bp_group_is_admin()) {
return false;
}
if ('3.2' == bp_get_major_nxt_version()) {
// Group avatar
$avatar = bp_core_fetch_avatar(array('object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'width' => 16, 'height' => 16));
// Unique ID for the 'My Account' menu
$bp->group_admin_menu_id = !empty($avatar) ? 'group-admin-with-avatar' : 'group-admin';
// Add the top-level Group Admin button
$nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => $avatar . bp_get_current_group_name(), 'href' => bp_get_group_permalink($bp->groups->current_group)));
} elseif ('3.3' == bp_get_major_nxt_version()) {
// Unique ID for the 'My Account' menu
$bp->group_admin_menu_id = 'group-admin';
// Add the top-level Group Admin button
$nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
}
// Group Admin > Edit details
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
// Group Admin > Group settings
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
// Group Admin > Group avatar
if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
}
// Group Admin > Manage invitations
if (bp_is_active('friends')) {
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
}
// Group Admin > Manage members
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
// Group Admin > Membership Requests
if (bp_get_group_status($bp->groups->current_group) == 'private') {
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
}
// Delete Group
$nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
示例2: bp_groups_group_admin_menu
/**
* Add the Group Admin top-level menu when viewing group pages.
*
* @since BuddyPress (1.5.0)
*
* @todo Add dynamic menu items for group extensions.
*/
function bp_groups_group_admin_menu()
{
global $wp_admin_bar, $bp;
// Only show if viewing a group
if (!bp_is_group()) {
return false;
}
// Only show this menu to group admins and super admins
if (!bp_current_user_can('bp_moderate') && !bp_group_is_admin()) {
return false;
}
// Unique ID for the 'Edit Group' menu
$bp->group_admin_menu_id = 'group-admin';
// Add the top-level Group Admin button
$wp_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
// Group Admin > Edit details
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
// Group Admin > Group settings
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
// Group Admin > Group avatar
if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
}
// Group Admin > Manage invitations
if (bp_is_active('friends')) {
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
}
// Group Admin > Manage members
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
// Group Admin > Membership Requests
if (bp_get_group_status($bp->groups->current_group) == 'private') {
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
}
// Delete Group
$wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
示例3: bp_group_status
function bp_group_status($group = false)
{
echo bp_get_group_status($group);
}
示例4: _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
示例5: do_action
</div><!-- .forums.single-forum -->
<?php
}
?>
<?php
do_action('bp_after_group_forum_content');
?>
<?php
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');
?>
示例6: _e
<input type="text" name="topic_title" id="topic_title" value="" />
<label><?php _e( 'Content:', 'buddypress' ) ?></label>
<textarea name="topic_text" id="topic_text"></textarea>
<label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label>
<input type="text" name="topic_tags" id="topic_tags" value="" />
<label><?php _e( 'Post In Group Forum:', 'buddypress' ) ?></label>
<select id="topic_group_id" name="topic_group_id">
<option value="">----</option>
<?php while ( bp_groups() ) : bp_the_group(); ?>
<?php if ( bp_group_is_forum_enabled() && 'public' == bp_get_group_status() ) : ?>
<option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
<?php endif; ?>
<?php endwhile; ?>
</select><!-- #topic_group_id -->
<?php do_action( 'groups_forum_new_topic_after' ) ?>
<div class="submit">
<input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ) ?>" />
<input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ) ?>" />
</div>
示例7: bp_group_status
function bp_group_status()
{
echo bp_get_group_status();
}
示例8: _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
示例9: run_stat_hub_csv
/**
* Create the hub overview CSV when requested.
*
* @since 1.0.0
*/
public function run_stat_hub_csv()
{
global $wpdb;
$bp = buddypress();
// Output headers so that the file is downloaded rather than displayed.
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=cc-hubs-overview.csv');
// Create a file pointer connected to the output stream.
$output = fopen('php://output', 'w');
// Write a header row.
$row = array('Hub ID', 'Name', 'Slug', 'Status', 'Date Created', 'Last Activity', 'Parent Hub ID', 'Total Members', 'Creator ID', 'Creator Email', 'Forum', 'BP Docs', 'CC Hub Home Page', 'CC Hub Pages', 'CC Hub Narratives', 'Custom Plugins');
fputcsv($output, $row);
// Groups Loop
if (bp_has_groups(array('order' => 'ASC', 'orderby' => 'date_created', 'page' => null, 'per_page' => null, 'max' => false, 'show_hidden' => true, 'user_id' => null, 'meta_query' => false, 'include' => false, 'exclude' => false, 'populate_extras' => false, 'update_meta_cache' => false))) {
while (bp_groups()) {
bp_the_group();
$group_id = bp_get_group_id();
$group_object = groups_get_group(array('group_id' => (int) $group_id, 'populate_extras' => true));
// Hub ID
$row = array($group_id);
// Name
$row[] = bp_get_group_name();
// Slug
$row[] = bp_get_group_slug();
// Status
$row[] = bp_get_group_status();
// Date Created
$row[] = $group_object->date_created;
// Date of last activity
$row[] = $group_object->last_activity;
// Parent Hub ID
$row[] = $wpdb->get_var($wpdb->prepare("SELECT g.parent_id FROM {$bp->groups->table_name} g WHERE g.id = %d", $group_id));
// Total Members
$row[] = groups_get_total_member_count($group_id);
// Creator ID
$creator_id = $group_object->creator_id;
$row[] = $creator_id;
// Creator Email
$creator = get_user_by('id', $creator_id);
$row[] = $creator->user_email;
// Forum
$row[] = $group_object->enable_forum;
// BP Docs
if (function_exists('bp_docs_is_docs_enabled_for_group')) {
$row[] = bp_docs_is_docs_enabled_for_group($group_id);
} else {
$row[] = '';
}
// CC Hub Home Page
if (function_exists('cc_get_group_home_page_post') && cc_get_group_home_page_post($group_id)->have_posts()) {
$row[] = 1;
} else {
$row[] = 0;
}
// CC Hub Pages
$row[] = (bool) groups_get_groupmeta($group_id, "ccgp_is_enabled");
// CC Hub Narratives
$row[] = (bool) groups_get_groupmeta($group_id, "ccgn_is_enabled");
// Custom Plugins
// To make your group-specific plugin be counted, so something like this:
/* add_filter( 'cc_stats_custom_plugins', 'prefix_report_custom_plugin', 10, 2 );
* function prefix_report_custom_plugin( $custom_plugins, $group_id ) {
* if ( $group_id == sa_get_group_id() ) {
* $custom_plugins[] = "CC Salud America";
* }
* return $custom_plugins;
* }
*/
$custom_plugins = apply_filters('cc_stats_custom_plugins', array(), $group_id);
$custom_plugins = implode(' ', $custom_plugins);
$row[] = $custom_plugins;
// Write the row.
fputcsv($output, $row);
}
}
fclose($output);
exit;
}
示例10: do_action
<?php do_action( 'bp_after_group_forum_topic_posts' ) ?>
<div class="pagination no-ajax">
<div id="post-count" class="pag-count">
<?php bp_the_topic_pagination_count() ?>
</div>
<div class="pagination-links" id="topic-pag">
<?php bp_the_topic_pagination() ?>
</div>
</div>
<?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
<?php if ( bp_get_the_topic_is_last_page() ) : ?>
<?php if ( bp_get_the_topic_is_topic_open() ) : ?>
<div id="post-topic-reply">
<p id="post-reply"></p>
<?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
<p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ) ?></p>
<?php endif; ?>
<?php do_action( 'groups_forum_new_reply_before' ) ?>
<h4><?php _e( 'Add a reply:', 'buddypress' ) ?></h4>
示例11: bp_groupblog_options_nav
//.........这里部分代码省略.........
?>
<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');
?>
</a>
</li>
<?php
}
?>
<li id="<?php
echo BP_MEMBERS_SLUG;
?>
-personal-li" >
<a id="<?php
echo BP_MEMBERS_SLUG;
?>
" href="<?php
bp_group_permalink();
?>
members/"><?php
_e('Members', 'groupblog');
?>
(<?php
bp_group_total_members();
?>
)</a>
</li>
<li id="invite-personal-li" >
<a id="invite" href="<?php
bp_group_permalink();
?>
send-invites/"><?php
_e('Send Invites', 'groupblog');
?>
</a>
</li>
<?php
} elseif (!bp_group_is_visible() && bp_get_group_status() != 'hidden') {
?>
<li id="request-membership-personal-li" >
<a id="request-membership" href="<?php
bp_group_permalink();
?>
request-membership/"><?php
_e('Request Membership', 'groupblog');
?>
</a>
</li>
<?php
}
?>
<?php
}
示例12: insert_activity
function insert_activity($id, $media)
{
if (!$this->activity_enabled()) {
return false;
}
$activity = new RTMediaActivity($media->id, $media->privacy);
$activity_content = $activity->create_activity_html();
$user = get_userdata($media->media_author);
$username = '<a href="' . get_rtmedia_user_link($media->media_author) . '">' . $user->user_nicename . '</a>';
$count = count($id);
$media_const = 'RTMEDIA_' . strtoupper($media->media_type);
if ($count > 1) {
$media_const .= '_PLURAL';
}
$media_const .= '_LABEL';
$media_str = constant($media_const);
$action = sprintf($count == 1 ? __('%1$s added a %2$s', 'rtmedia') : __('%1$s added %4$d %3$s', 'rtmedia'), $username, $media->media_type, $media_str, $count);
$action = apply_filters('rtmedia_buddypress_action_text_fitler', $action, $username, $count, $user->user_nicename, $media->media_type);
$activity_args = array('user_id' => $user->ID, 'action' => $action, 'content' => $activity_content, 'type' => 'rtmedia_update', 'primary_link' => '', 'item_id' => $id);
if ($media->context == "group" && function_exists("bp_get_group_status") && bp_get_group_status(groups_get_group(array("group_id" => $media->context_id))) != "public") {
$activity_args["hide_sitewide"] = true;
}
if ($media->context == 'group' || 'profile') {
$activity_args['component'] = $media->context;
if ($media->context == 'group') {
$activity_args['component'] = "groups";
$activity_args['item_id'] = $media->context_id;
}
}
$activity_id = bp_activity_add($activity_args);
bp_activity_update_meta($activity_id, 'rtmedia_privacy', $media->privacy == 0 ? -1 : $media->privacy);
$this->model->update(array('activity_id' => $activity_id), array('id' => $media->id));
// insert/update activity details in rtmedia activity table
$rtmedia_activity_model = new RTMediaActivityModel();
if (!$rtmedia_activity_model->check($activity_id)) {
$rtmedia_activity_model->insert(array('activity_id' => $activity_id, 'user_id' => $media->media_author, 'privacy' => $media->privacy));
} else {
$rtmedia_activity_model->update(array('activity_id' => $activity_id, 'user_id' => $media->media_author, 'privacy' => $media->privacy), array('activity_id' => $activity_id));
}
return $activity_id;
}
示例13: ccgn_create_activity_items
function ccgn_create_activity_items($post_id)
{
$bp = buddypress();
// We want to fetch the saved post, because WP has done some filtering on save.
$post_object = get_post($post_id);
$author_id = (int) $post_object->post_author;
$user_link = bp_core_get_userlink($author_id);
$post_type_object = get_post_type_object($post_object->post_type);
$post_type_label = strtolower($post_type_object->labels->singular_name);
// A single narrative may be associated with more than one group
$origin_group_id = ccgn_get_origin_group($post_id);
$associated_groups = ccgn_get_associated_group_ids($post_id);
$type = $post_object->post_type . '_created';
foreach ($associated_groups as $group_id) {
// Does an activity item already exist?
$exists = bp_activity_get_activity_id(array('component' => $bp->groups->id, 'type' => $type, 'item_id' => $group_id, 'secondary_item_id' => $post_id));
if (!empty($exists)) {
continue;
}
// Create a post url that is relative to this group.
$post_url = trailingslashit(ccgn_get_home_permalink($group_id)) . $post_object->post_name;
$post_link = sprintf('<a href="%s">%s</a>', $post_url, $post_object->post_title);
$group = groups_get_group(array('group_id' => $group_id));
$group_url = bp_get_group_permalink($group);
$group_link = '<a href="' . $group_url . '">' . $group->name . '</a>';
// Only set hide_sitewide to false if this is the origin group and it is a public group.
if ($group_id == $origin_group_id && 'public' == bp_get_group_status($group)) {
$hide_sitewide = false;
} else {
$hide_sitewide = true;
}
$action = sprintf(__('%1$s published the %2$s %3$s in the Hub %4$s', 'cc-group-narratives'), $user_link, $post_type_label, $post_link, $group_link);
$args = array('user_id' => $author_id, 'action' => $action, 'primary_link' => $post_link, 'component' => $bp->groups->id, 'type' => $type, 'item_id' => $group_id, 'secondary_item_id' => $post_id, 'recorded_time' => $post_object->post_date, 'hide_sitewide' => $hide_sitewide, 'content' => bp_create_excerpt($post_object->post_content, 358));
do_action($post_object->post_type . '_before_activity_save', $args);
$activity_id = bp_activity_add(apply_filters($post_object->post_type . '_activity_args', $args, $post_id));
}
}
示例14: _e
_e('Tags (comma separated):', 'buddypress');
?>
</label>
<input type="text" name="topic_tags" id="topic_tags" value="" />
<label><?php
_e('Post In Group Forum:', 'buddypress');
?>
</label>
<select id="topic_group_id" name="topic_group_id">
<?php
while (bp_groups()) {
bp_the_group();
?>
<?php
if ('public' == bp_get_group_status()) {
?>
<option value="<?php
bp_group_id();
?>
"><?php
bp_group_name();
?>
</option>
<?php
}
?>
<?php
}
?>
</select>
示例15: gconnect_locate_template
?>
</select>
</li>
</ul>
<div class="clear"></div>
</div>
<div class="forums single-forum" role="main">
<?php
gconnect_locate_template(array('forums/forums-loop.php'), true);
?>
</div><!-- .forums.single-forum -->
<?php
}
do_action('bp_after_group_forum_content');
if (!bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() && !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');
?>