• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Edit and Ban in Member Card

Decent60

Well-known member
This is another small modification, inspired by both: http://xenforo.com/community/threads/add-edit-user-button-to-profile-page.7714/ and http://xenforo.com/community/threads/add-ban-user-link-to-profile-page.7739/#post-110002

This is slightly different than http://xenforo.com/community/threads/add-ban-user-link-to-popup-card-to-member.7737/#post-109706 (which I didn't notice existed until just before posting this)

This adds the Edit and Ban user to the member card (the overlay that appears when you click names on most of the website) while ignoring the your own:

In the Templates => {Template_Name} => member_card:
Code:
<div class="userInfo">
        <h3 class="username"><a href="{xen:link members, $user}">{$user.username}</a></h3>

and add this blow:

Code:
<xen:if is="{$visitor.is_admin}">
    <xen:if is="{$user.user_id} != {$visitor.user_id}">
      <a href="admin.php?users/{$user.username}.{$user.user_id}/edit">{xen:phrase edit_user}</a> || 
      <a href="admin.php?banning/users/{$user.username}.{$user.user_id}/add">{xen:phrase ban_user}</a><br />
      <xen:else />
    </xen:if>
</xen:if>

It only shows for Admins only, but changing
Code:
<xen:if is="{$visitor.is_admin}">
to
Code:
<xen:if is="{$visitor.is_admin} || {$visitor.is_moderator}">

will allow for both Moderators and Admins.
 
Top Bottom