1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. 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

Discussion in 'Template Modifications [Archive]' started by Decent60, Nov 11, 2010.

  1. Decent60

    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.
     
    CentOS 6, Reedswood, Jo. and 3 others like this.
  2. Vincent

    Vincent Well-Known Member

    Adding a '<div class="userLinks">' isn't a bad idea.
     

Share This Page