function groups_ajax_member_admin_list()
{
    global $bp;
    ?>
	
	<?php 
    if (bp_group_has_members('group_id=' . $_REQUEST['group_id'] . '&per_page=' . $_REQUEST['num'])) {
        ?>
	
		<?php 
        if (bp_group_member_needs_pagination()) {
            ?>
			<div id="member-count" class="pag-count">
				<?php 
            bp_group_member_pagination_count();
            ?>
			</div>

			<div id="member-admin-pagination" class="pagination-links">
				<?php 
            bp_group_member_admin_pagination();
            ?>
			</div>
		<?php 
        }
        ?>
	
		<ul id="members-list" class="item-list single-line">
		<?php 
        while (bp_group_members()) {
            bp_group_the_member();
            ?>
			<?php 
            if (bp_group_member_is_banned()) {
                ?>
				<li class="banned-user">
					<?php 
                bp_group_member_avatar_mini();
                ?>

					<h5><?php 
                bp_group_member_link();
                ?>
 <?php 
                _e('(banned)', 'buddypress');
                ?>
 <span class="small"> &mdash; <a href="<?php 
                bp_group_member_unban_link();
                ?>
" title="<?php 
                _e('Kick and ban this member', 'buddypress');
                ?>
"><?php 
                _e('Remove Ban', 'buddypress');
                ?>
</a> </h5>
			<?php 
            } else {
                ?>
				<li>
					<?php 
                bp_group_member_avatar_mini();
                ?>
					<h5><?php 
                bp_group_member_link();
                ?>
  <span class="small"> &mdash; <a href="<?php 
                bp_group_member_ban_link();
                ?>
" title="<?php 
                _e('Kick and ban this member', 'buddypress');
                ?>
"><?php 
                _e('Kick &amp; Ban', 'buddypress');
                ?>
</a> | <a href="<?php 
                bp_group_member_promote_link();
                ?>
" title="<?php 
                _e('Promote this member', 'buddypress');
                ?>
"><?php 
                _e('Promote to Moderator', 'buddypress');
                ?>
</a></span></h5>

			<?php 
            }
            ?>
				</li>
		<?php 
        }
        ?>
		</ul>
	<?php 
    } else {
        ?>

		<div id="message" class="info">
			<p><?php 
        _e('This group has no members.', 'buddypress');
        ?>
</p>
		</div>

	<?php 
    }
    ?>
	<input type="hidden" name="group_id" id="group_id" value="<?php 
    echo attribute_escape($_REQUEST['group_id']);
    ?>
" />
<?php 
}
Beispiel #2
0
			<?php 
        }
        ?>

			<ul id="members-list" class="item-list single-line">
				<?php 
        while (bp_group_members()) {
            bp_group_the_member();
            ?>

					<li class="<?php 
            bp_group_member_css_class();
            ?>
">
						<?php 
            bp_group_member_avatar_mini();
            ?>

						<h5>
							<?php 
            bp_group_member_link();
            ?>

							<?php 
            if (bp_get_group_member_is_banned()) {
                _e('(banned)', 'buddypress');
            }
            ?>

							<span class="small">
function bp_group_management_admin_edit()
{
    ?>
	<div class="wrap">
<?php 
    $id = (int) $_GET['id'];
    $group = new BP_Groups_Group($id, true);
    $member_action = isset($_GET['member_action']) ? $_GET['member_action'] : false;
    $member_id = isset($_GET['member_id']) ? $_GET['member_id'] : false;
    switch ($member_action) {
        case "kick":
            if (!check_admin_referer('bp-group-management-action_kick')) {
                return false;
            }
            if (!bp_group_management_ban_member($member_id, $id)) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>';
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Member kicked and banned', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            do_action('groups_banned_member', $member_id, $id);
            break;
        case "unkick":
            if (!check_admin_referer('bp-group-management-action_unkick')) {
                return false;
            }
            if (!bp_group_management_unban_member($member_id, $id)) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Member unbanned', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            do_action('groups_banned_member', $member_id, $id);
            break;
        case "demote":
            if (!check_admin_referer('bp-group-management-action_demote')) {
                return false;
            }
            if (!groups_demote_member($member_id, $id)) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Member demoted', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            do_action('groups_demoted_member', $member_id, $id);
            break;
        case "mod":
            if (!check_admin_referer('bp-group-management-action_mod')) {
                return false;
            }
            if (!bp_group_management_promote_member($member_id, $id, 'mod')) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Member promoted to moderator', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            do_action('groups_promoted_member', $member_id, $id);
            break;
        case "admin":
            if (!check_admin_referer('bp-group-management-action_admin')) {
                return false;
            }
            if (!bp_group_management_promote_member($member_id, $id, 'admin')) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Member promoted to admin', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            break;
        case "add":
            if (!check_admin_referer('bp-group-management-action_add')) {
                return false;
            }
            if (!bp_group_management_join_group($id, $member_id)) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('User added to group', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            break;
        case "remove":
            if (!check_admin_referer('bp-group-management-action_remove')) {
                return false;
            }
            if (!groups_leave_group($id, $_GET['member_id'])) {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('Sorry, there was an error.', 'bp-group-management');
                ?>
</p></div>
			<?php 
            } else {
                ?>
				<div id="message" class="updated fade"><p><?php 
                _e('User removed from group', 'bp-group-management');
                ?>
</p></div>
			<?php 
            }
            break;
        default:
            do_action('bp_gm_member_action', $group, $id, $member_action, $member_id);
            break;
    }
    ?>


	    <h2><?php 
    _e('Group Management', 'bp-group-management');
    ?>
 : <?php 
    echo bp_get_group_name($group);
    ?>
</h2>

	    <a href="admin.php?page=bp-group-management">&larr; <?php 
    _e('Group index', 'bp-group-management');
    ?>
</a>

		<div class="bp-gm-group-actions">
	    <h3><?php 
    _e('Group actions', 'bp-group-management');
    ?>
</h3>

	    <?php 
    bp_group_management_group_action_buttons($id, $group);
    ?>

	    </div>


		<div class="bp-gm-group-members">

		<?php 
    if (bp_group_has_members('group_id=' . $id . '&exclude_admins_mods=0&exclude_banned=0')) {
        ?>
	    <h3><?php 
        _e('Manage current and banned group members', 'bp-group-management');
        ?>
</h3>

			<?php 
        if (bp_group_member_needs_pagination()) {
            ?>

				<div class="pagination no-ajax">

					<div id="member-count" class="pag-count">
						<?php 
            bp_group_member_pagination_count();
            ?>
					</div>

					<div id="member-admin-pagination" class="pagination-links">
						<?php 
            bp_group_member_admin_pagination();
            ?>
					</div>

				</div>

			<?php 
        }
        ?>

			<ul id="members-list" class="item-list single-line">
				<?php 
        while (bp_group_members()) {
            bp_group_the_member();
            ?>

					<?php 
            if (bp_get_group_member_is_banned()) {
                ?>

						<li class="banned-user">
							<?php 
                bp_group_member_avatar_mini();
                ?>
							<?php 
                $unkicklink = "admin.php?page=bp-group-management&amp;action=edit&amp;id=" . $id . "&amp;member_id=" . bp_get_group_member_id() . "&amp;member_action=unkick";
                $unkicklink = function_exists('wp_nonce_url') ? wp_nonce_url($unkicklink, 'bp-group-management-action_unkick') : $unkicklink;
                ?>
							<?php 
                bp_group_member_link();
                ?>
 <?php 
                _e('(banned)', 'bp-group-management');
                ?>
 <span class="small"> - <a href="<?php 
                echo $unkicklink;
                ?>
" class="confirm" title="<?php 
                _e('Remove Ban', 'bp-group-management');
                ?>
"><?php 
                _e('Remove Ban', 'bp-group-management');
                ?>
</a>

					<?php 
            } else {
                ?>

						<li>
							<?php 
                bp_group_member_avatar_mini();
                ?>

							<?php 
                $kicklink = "admin.php?page=bp-group-management&amp;action=edit&amp;id=" . $id . "&amp;member_id=" . bp_get_group_member_id() . "&amp;member_action=kick";
                $kicklink = function_exists('wp_nonce_url') ? wp_nonce_url($kicklink, 'bp-group-management-action_kick') : $kicklink;
                $removelink = "admin.php?page=bp-group-management&amp;action=edit&amp;id=" . $id . "&amp;member_id=" . bp_get_group_member_id() . "&amp;member_action=remove";
                $removelink = function_exists('wp_nonce_url') ? wp_nonce_url($removelink, 'bp-group-management-action_remove') : $removelink;
                $modlink = "admin.php?page=bp-group-management&amp;action=edit&amp;id=" . $id . "&amp;member_id=" . bp_get_group_member_id() . "&amp;member_action=mod";
                $modlink = function_exists('wp_nonce_url') ? wp_nonce_url($modlink, 'bp-group-management-action_mod') : $modlink;
                $demotelink = "admin.php?page=bp-group-management&amp;action=edit&amp;id=" . $id . "&amp;member_id=" . bp_get_group_member_id() . "&amp;member_action=demote";
                $demotelink = function_exists('wp_nonce_url') ? wp_nonce_url($demotelink, 'bp-group-management-action_demote') : $demotelink;
                $adminlink = "admin.php?page=bp-group-management&amp;action=edit&amp;id=" . $id . "&amp;member_id=" . bp_get_group_member_id() . "&amp;member_action=admin";
                $adminlink = function_exists('wp_nonce_url') ? wp_nonce_url($adminlink, 'bp-group-management-action_admin') : $adminlink;
                ?>
							<strong><?php 
                bp_group_member_link();
                ?>
</strong>
							<span class="small"> -
								<a href="<?php 
                echo $removelink;
                ?>
" title="<?php 
                _e('Remove Member', 'bp-group-management');
                ?>
"><?php 
                _e('Remove', 'bp-group-management');
                ?>
</a> |
								<a href="<?php 
                echo $kicklink;
                ?>
" class="confirm" title="<?php 
                _e('Kick and ban this member', 'bp-group-management');
                ?>
"><?php 
                _e('Kick &amp; Ban', 'bp-group-management');
                ?>
</a> |
								<?php 
                if (groups_is_user_admin(bp_get_group_member_id(), $id)) {
                    ?>
									<a href="<?php 
                    echo $demotelink;
                    ?>
" class="confirm" title="<?php 
                    _e('Demote to Member', 'bp-group-management');
                    ?>
"><?php 
                    _e('Demote to Member', 'bp-group-management');
                    ?>
</a>
								<?php 
                } elseif (groups_is_user_mod(bp_get_group_member_id(), $id)) {
                    ?>
									<a href="<?php 
                    echo $demotelink;
                    ?>
" class="confirm" title="<?php 
                    _e('Demote to Member', 'bp-group-management');
                    ?>
"><?php 
                    _e('Demote to Member', 'bp-group-management');
                    ?>
</a> | <a href="<?php 
                    echo $adminlink;
                    ?>
" class="confirm" title="<?php 
                    _e('Promote to Admin', 'bp-group-management');
                    ?>
"><?php 
                    _e('Promote to Admin', 'bp-group-management');
                    ?>
</a></span>
								<?php 
                } else {
                    ?>
									<a href="<?php 
                    echo $modlink;
                    ?>
" class="confirm" title="<?php 
                    _e('Promote to Moderator', 'bp-group-management');
                    ?>
"><?php 
                    _e('Promote to Moderator', 'bp-group-management');
                    ?>
</a> | <a href="<?php 
                    echo $adminlink;
                    ?>
" class="confirm" title="<?php 
                    _e('Promote to Admin', 'bp-group-management');
                    ?>
"><?php 
                    _e('Promote to Admin', 'bp-group-management');
                    ?>
</a></span>
								<?php 
                }
                ?>

					<?php 
            }
            ?>

							<?php 
            do_action('bp_group_manage_members_admin_item');
            ?>
						</li>

				<?php 
        }
        ?>
			</ul>

		<?php 
    }
    ?>

		</div>

		<?php 
    bp_group_management_add_member_list($id);
    ?>

		<?php 
    do_action('bp_gm_more_group_actions');
    ?>

	</div>
<?php 
}