Beispiel #1
0
/**
 * Inject options nav onto end of active displayed user nav component
 *
 * @param string $html
 * @param array $user_nav_item
 * @return string
 */
function infinity_bp_nav_inject_options_filter($html, $user_nav_item)
{
    // slug of nav item being filtered
    $component = $user_nav_item['slug'];
    // show options nav?
    $show = bp_is_current_component($component);
    // special hack to handle profile in BP versions < 1.7
    if ('profile' == $component && -1 == version_compare(BP_VERSION, '1.7') && false == bp_is_my_profile()) {
        // force hide it
        $show = false;
    }
    // filter the show var because i love developers
    $show = (bool) apply_filters('infinity_bp_nav_inject_options_show', $show, $user_nav_item);
    // ok, finally... should we show it?
    if (true === $show) {
        // yes, need to capture options nav output
        ob_start();
        // run options nav template tag
        bp_get_options_nav();
        // grab buffer and wipe it
        $nav = trim((string) ob_get_clean());
        // make sure the result has some meat
        if ('' != $nav) {
            // yep, inject options nav onto end of list item wrapped in special <ul>
            return preg_replace('/(<\\/li>.*)$/', '<ul class="profile-subnav">' . $nav . '</ul>$1', $html, 1);
        }
    }
    // no changes
    return $html;
}
Beispiel #2
0
<?php

/**
 * BuddyPress - Single Member Forums
 *
 * @package BuddyPress
 * @subpackage Theme
 */
?>

<div class="item-list-tabs bp-sub-tabs no-ajax" id="subnav" role="navigation">
	<ul>
		<?php 
bp_get_options_nav();
?>

		<li id="forums-order-select" class="last filter">

			<label for="forums-order-by"><?php 
_e('Order By:', 'buddypress');
?>
</label>
			<select id="forums-order-by">
				<option value="active"><?php 
_e('Last Active', 'buddypress');
?>
</option>
				<option value="popular"><?php 
_e('Most Posts', 'buddypress');
?>
</option>
Beispiel #3
0
<?php if ( bp_is_my_profile() ) : ?>
	<div class="item-list-tabs no-ajax" id="subnav">
		<ul>
			<?php bp_get_options_nav() ?>
		</ul>
	</div><!-- .item-list-tabs -->
<?php endif; ?>

<?php do_action( 'bp_before_profile_content' ) ?>

<div class="profile">
	<?php if ( 'edit' == bp_current_action() ) : ?>
		<?php locate_template( array( 'members/single/profile/edit.php' ), true ) ?>

	<?php elseif ( 'change-avatar' == bp_current_action() ) : ?>
		<?php locate_template( array( 'members/single/profile/change-avatar.php' ), true ) ?>

	<?php else : ?>
		<?php locate_template( array( 'members/single/profile/profile-loop.php' ), true ) ?>

	<?php endif; ?>
</div><!-- .profile -->

<?php do_action( 'bp_after_profile_content' ) ?>
Beispiel #4
0
/**
 *  widget for the community navigation
 *
 * @package Custom Community
 * @since 1.8.3
 */
function widget_community_nav($sidebar_id = false)
{
    ?>
		<?php 
    global $cap;
    if ($sidebar_id == 'leftsidebar' && $cap->bg_leftsidebar_default_nav && $cap->bg_leftsidebar_default_nav == 'no') {
        return;
    }
    ?>
  		<div id="community-nav" class="widget widget-title" >
        	<h3 class="widgettitle"><?php 
    _e('Community', 'cc');
    ?>
</h3>
  				<ul class="item-list">
					
			  		<?php 
    if ('activity' != bp_dtheme_page_on_front() && bp_is_active('activity')) {
        ?>
                                        <li<?php 
        if (bp_is_activity_component()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
							<a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo BP_ACTIVITY_SLUG;
        ?>
/" title="<?php 
        _e('Activity', 'cc');
        ?>
"><?php 
        _e('Activity', 'cc');
        ?>
</a>
						</li>
					<?php 
    }
    ?>

                                        <li<?php 
    if (bp_is_members_component() || bp_is_user()) {
        ?>
 class="selected"<?php 
    }
    ?>
>
                                                <a href="<?php 
    echo site_url();
    ?>
/<?php 
    echo BP_MEMBERS_SLUG;
    ?>
/" title="<?php 
    _e('Members', 'cc');
    ?>
"><?php 
    _e('Members', 'cc');
    ?>
</a>
                                        </li>
			
                                    <?php 
    if (bp_is_active('groups')) {
        ?>
                                            <li<?php 
        if (bp_is_groups_component() || bp_is_group()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
                                                    <a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo BP_GROUPS_SLUG;
        ?>
/" title="<?php 
        _e('Groups', 'cc');
        ?>
"><?php 
        _e('Groups', 'cc');
        ?>
</a>
                                            </li>
			
                                        <?php 
        if (bp_is_active('forums') && (function_exists('bp_forums_is_installed_correctly') && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) {
            ?>
                                                <li<?php 
            if (bp_is_forums_component()) {
                ?>
 class="selected"<?php 
            }
            ?>
>
                                                        <a href="<?php 
            echo site_url();
            ?>
/<?php 
            echo BP_FORUMS_SLUG;
            ?>
/" title="<?php 
            _e('Forums', 'cc');
            ?>
"><?php 
            _e('Forums', 'cc');
            ?>
</a>
                                                </li>
                                        <?php 
        }
        ?>
					<?php 
    }
    ?>
					<?php 
    if (bp_is_active('blogs') && is_multisite()) {
        ?>
                                                        <li<?php 
        if (bp_is_blogs_component()) {
            ?>
 class="selected"<?php 
        }
        ?>
>
							<a href="<?php 
        echo site_url();
        ?>
/<?php 
        echo BP_BLOGS_SLUG;
        ?>
/" title="<?php 
        _e('Blogs', 'cc');
        ?>
"><?php 
        _e('Blogs', 'cc');
        ?>
</a>
						</li>
					<?php 
    }
    ?>
  				</ul>
				
   <?php 
    if (bp_is_single_item() || bp_is_user()) {
        ?>
	   	<?php 
        if (bp_is_group()) {
            ?>
		<div id="community-single-nav" class="widget-title" >
		  <ul class="item-list">
		  <h3 class="widgettitle"><?php 
            _e('@ Group', 'cc');
            ?>
</h3>
				<?php 
            bp_get_options_nav();
            ?>
				<?php 
            do_action('bp_group_options_nav');
            ?>
			</ul>
		
		</div>	
		<?php 
        }
        ?>

		<?php 
        if (bp_is_user()) {
            ?>
		<div id="community-single-nav" class="widget-title" >
		  <ul class="item-list">
		  <h3 class="widgettitle"><?php 
            _e('@ Member', 'cc');
            ?>
</h3>
		  <?php 
            bp_get_displayed_user_nav();
            ?>
				<?php 
            do_action('bp_group_options_nav');
            ?>
			</ul>
		
		</div>	
		<?php 
        }
        ?>
  	<?php 
    }
    ?>
  	</div>
<?php 
}
/**
 * HTML admin subnav items for group pages.
 *
 * @since 1.0.0
 *
 * @param object|bool $group Optional. Group object.
 *                           Default: current group in the loop.
 */
function bp_group_admin_tabs($group = false)
{
    global $groups_template;
    if (empty($group)) {
        $group = $groups_template->group ? $groups_template->group : groups_get_current_group();
    }
    $css_id = 'manage-members';
    if ('private' == $group->status) {
        $css_id = 'membership-requests';
    }
    add_filter("bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3);
    bp_get_options_nav($group->slug . '_manage');
    remove_filter("bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3);
}
    /**
     * groups home: add the sidebars and their default widgets to the groups header
     *
     * located: grous/home.php do_action( 'bp_before_group_home_content' )
     *
     * @package Custom Community
     * @since 1.8.3
     */
    function before_group_home_content()
    {
        global $cap;
        if ($cap->bp_groups_header == false || $cap->bp_groups_header == 'on' || $cap->bp_groups_header == __('on', 'cc')) {
            ?>
			<div id="item-header">
                <div class="row-fluid">
                    <?php 
            if (!dynamic_sidebar('groupheader')) {
                ?>
                     <?php 
                locate_template(array('groups/single/group-header.php'), true);
                ?>
                    <?php 
            }
            ?>

                    <?php 
            if (is_active_sidebar('groupheaderleft')) {
                ?>
                        <div class="widgetarea cc-widget span4">
                        <?php 
                dynamic_sidebar('groupheaderleft');
                ?>
                        </div>
                    <?php 
            }
            ?>
                    <?php 
            if (is_active_sidebar('groupheadercenter')) {
                ?>
                        <div class="<?php 
                if (!is_active_sidebar('groupheaderleft')) {
                    echo 'group-header-left';
                }
                ?>
 widgetarea cc-widget span4">
                        <?php 
                dynamic_sidebar('groupheadercenter');
                ?>
                        </div>
                    <?php 
            }
            ?>
                    <?php 
            if (is_active_sidebar('groupheaderright')) {
                ?>
                        <div class="widgetarea cc-widget cc-widget-right span4">
                        <?php 
                dynamic_sidebar('groupheaderright');
                ?>
                        </div>
                    <?php 
            }
            ?>
                </div>
			</div>
		<?php 
        } else {
            ?>
			<div id="item-header">
				<h2><a href="<?php 
            bp_group_permalink();
            ?>
" title="<?php 
            bp_group_name();
            ?>
"><?php 
            bp_group_name();
            ?>
</a></h2>
			</div>
		<?php 
        }
        ?>
		<?php 
        if ($cap->bp_default_navigation == true) {
            ?>
			<div id="item-nav">
				<div class="item-list-tabs no-ajax" id="object-nav">
					<ul>
						<?php 
            bp_get_options_nav();
            ?>

						<?php 
            do_action('bp_group_options_nav');
            ?>
					</ul>
				</div>
			</div><!-- #item-nav -->
		<?php 
        }
    }