Exemple #1
0
 /**
  * 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');
             }
         }
     }
 }
Exemple #2
0
		<?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();
                ?>
Exemple #3
0
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;
}
</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 {
Exemple #5
0
<?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>
Exemple #6
0
                    // 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>
Exemple #7
0
/**
 * 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')));
}
            ?>
</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>
Exemple #9
0
/**
 * 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');
            ?>
</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 
}
                                        <?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 
    /**
     * 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 />
					
					<?php 
            if (bp_group_is_admin() || bp_group_is_mod()) {
                ?>
						<input name="settings[post_comments]" type="radio" value="admins-mods" <?php 
                checked($post_comments, 'admins-mods');
                ?>
/> <?php 
                _e('Only admins and mods of this group', 'bp-docs');
                ?>
<br />
					<?php 
            }
            ?>
					
					<input name="settings[post_comments]" type="radio" value="no-one" <?php 
            checked($post_comments, 'no-one');
            ?>
/> <?php 
            _e('No one', 'bp-docs');
            ?>
<br />
				</td>
			</tr>
			
			<?php 
            /* READING COMMENTS */
            ?>
			<tr>
				<td class="desc-column">
					<label for="settings[read_comments]"><?php 
            _e('Who can <em>read</em> comments on this doc?', 'bp-docs');
            ?>
</label>
				</td>
				
				<td class="content-column">
					<?php 
            if (bp_docs_current_group_is_public()) {
                ?>
				
						<input name="settings[read_comments]" type="radio" value="anyone" <?php 
                checked($read_comments, 'anyone');
                ?>
/> <?php 
                _e('Anyone', 'bp-docs');
                ?>
<br />
					<?php 
            }
            ?>
					
					<input name="settings[read_comments]" type="radio" value="group-members" <?php 
            checked($read_comments, 'group-members');
            ?>
/> <?php 
            _e('All members of the group', 'bp-docs');
            ?>
<br />
					
					<?php 
            if (bp_group_is_admin() || bp_group_is_mod()) {
                ?>
						<input name="settings[read_comments]" type="radio" value="admins-mods" <?php 
                checked($read_comments, 'admins-mods');
                ?>
/> <?php 
                _e('Only admins and mods of this group', 'bp-docs');
                ?>
<br />
					<?php 
            }
            ?>
					
					<input name="settings[read_comments]" type="radio" value="no-one" <?php 
            checked($read_comments, 'no-one');
            ?>
/> <?php 
            _e('No one', 'bp-docs');
            ?>
<br />
				</td>
			</tr>
			
			<?php 
            /* VIEWING HISTORY */
            ?>
			<tr>
				<td class="desc-column">
					<label for="settings[view_history]"><?php 
            _e('Who can view this doc\'s history?', 'bp-docs');
            ?>
</label>
				</td>
				
				<td class="content-column">
				
					<input name="settings[view_history]" type="radio" value="anyone" <?php 
            checked($view_history, 'anyone');
            ?>
/> <?php 
            _e('Anyone', 'bp-docs');
            ?>
<br />
					
					<input name="settings[view_history]" type="radio" value="group-members" <?php 
            checked($view_history, 'group-members');
            ?>
/> <?php 
            _e('All members of the group', 'bp-docs');
            ?>
<br />
					
					<?php 
            if (bp_group_is_admin() || bp_group_is_mod()) {
                ?>
						<input name="settings[view_history]" type="radio" value="admins-mods" <?php 
                checked($view_history, 'admins-mods');
                ?>
/> <?php 
                _e('Only admins and mods of this group', 'bp-docs');
                ?>
<br />
					<?php 
            }
            ?>
					
					<input name="settings[view_history]" type="radio" value="no-one" <?php 
            checked($view_history, 'no-one');
            ?>
/> <?php 
            _e('No one', 'bp-docs');
            ?>
<br />
				</td>
			</tr>
			
			<?php 
        }
    }
Exemple #12
0
	</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