<div class="item-list-tabs no-ajax" id="subnav">
	<ul>
		<?php if ( bp_is_my_profile() ) : ?>
			<?php bp_get_options_nav() ?>
		<?php endif; ?>

		<?php if ( 'invites' != bp_current_action() ) : ?>
		<li id="groups-order-select" class="last filter">

			<?php _e( 'Order By:', 'buddypress' ) ?>
			<select id="groups-all">
				<option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option>
				<option value="popular"><?php _e( 'Most Members', 'buddypress' ) ?></option>
				<option value="newest"><?php _e( 'Newly Created', 'buddypress' ) ?></option>
				<option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option>

				<?php do_action( 'bp_member_group_order_options' ) ?>
			</select>
		</li>
		<?php endif; ?>
	</ul>
</div>

<div class="create-group" align="right">
	<?php _e( 'Groups Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() ) : ?><div class="button-wrap" style="margin-left:20px;"><div class=" button "><a href="<?php echo bp_get_root_domain() . '/' . BP_GROUPS_SLUG . '/create/' ?>"><?php _e( 'Create a Group', 'buddypress' ) ?></a></div></div><?php endif; ?>
</div>
<?php if ( 'invites' == bp_current_action() ) : ?>
	<?php locate_template( array( 'members/single/groups/invites.php' ), true ) ?>

<?php else : ?>

	<?php do_action( 'bp_before_member_groups_content' ) ?>

	<div class="groups mygroups">
		<?php locate_template( array( 'groups/groups-loop.php' ), true ) ?>
	</div>

	<?php do_action( 'bp_after_member_groups_content' ) ?>

<?php endif; ?>
