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.

Add ban user link to profile page

Discussion in 'Template Modifications [Archive]' started by Allan, Nov 7, 2010.

  1. Allan

    Allan Well-Known Member

    Add ban user link to profile page
    _____________________
    This mod add a link for ban user directly on profil page
    Inspire to this mod: Add Edit User Button to Profile page

    • In "member_view" template, find:
    Code:
    <div class="followBlock">
    
    • Replace with:
    Code:
    <xen:if is="{$visitor.is_admin}">
    <a href="admin.php?banning/users/{$user.username}.{$user.user_id}/add">{xen:phrase ban_user}</a><br />
    </xen:if>
    
    PS: Only show for administrators
     

    Attached Files:

    Alien, Lenin, Jo. and 4 others like this.
  2. JVCode

    JVCode Well-Known Member

    Liked, and should be included in default package.
     
  3. cobra1162

    cobra1162 Active Member

    thx good job
     
  4. Ranger375

    Ranger375 Well-Known Member

    So changing the conditional to the moderator group wouldn't work by chance?
     
  5. Allan

    Allan Well-Known Member

    Replace
    Code:
    <xen:if is="{$visitor.is_admin}">
    
    by
    Code:
    <xen:if is="{$visitor.is_moderator}">
    
     
    Ranger375 likes this.
  6. Ranger375

    Ranger375 Well-Known Member

    Thanks!!!
     
  7. Allan

    Allan Well-Known Member

    With pleasure :)
     
  8. Perspektif

    Perspektif Active Member

  9. Jamie

    Jamie Well-Known Member


    So here's a question.. :)

    How can you combine these two statement so if either an admin or a moderator viewed this they would see the option?

    Jamie
     
  10. Allan

    Allan Well-Known Member

    test this:
    Code:
    <xen:if is="{$visitor.is_admin} OR {$visitor.is_moderator}">
    
     
  11. twhiting9275

    twhiting9275 Active Member

    Replace with:
    Code:
    <xen:if is="{$visitor.is_admin}">
    <a href="admin.php?banning/users/{$user.username}.{$user.user_id}/add">{xen:phrase ban_user}</a><br />
    </xen:if>
    
    This is incorrect, you should be adding this after the div, otherwise you really screw things up, so you're looking at something like
    Code:
    <div class="followBlock">
    <xen:if is="{$visitor.is_admin}">
    <a href="admin.php?banning/users/{$user.username}.{$user.user_id}/add">{xen:phrase ban_user}</a><br />
    </xen:if>
    
    Otherwise you have a </div> that's not handled properly, and that's a whole different mess.

    Nice modification though, thanks!
     
    Reedswood likes this.
  12. Anthony Parsons

    Anthony Parsons Well-Known Member

    If you want admins and mods to ban, then you can also just change the spam management settings to zero, so the spam link is available from every user, not removed after meeting the default or set criteria, and enable the permission for mods to use the spam functions.

    Nice mod though...
     

Share This Page