1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Members Page - Highest Posting Members - How to remove staff?

Discussion in 'XenForo Questions and Support' started by ArnyVee, Oct 21, 2010.

  1. ArnyVee

    ArnyVee Well-Known Member

    So, is there an option (or would I have to place a conditional) to remove the staff (admins/mods) from the "Highest Posting Members" block on the member page?

    Here: http://www.teeveetown.com/forum/index.php?members/

    You can see that the block has me and Def (co-admins) and I'm trying to give props to the members (or "Citizens" of TeeVeeTown ;) ) rather than having the staff take the top spots there.

    Any suggestions?
     
    fattony69 likes this.
  2. Lawrence

    Lawrence Well-Known Member

    Open: member_list template

    Find:
    Code:
            <div class="section activeMembers">
                 <h2 class="textHeading">{xen:phrase highest_posting_members}</h2>
                 <div class="secondaryContent avatarHeap">
                     <ol>
                         <xen:foreach loop="$activeUsers" value="$user">
                             <li><xen:avatar user="$user" size="s"  text="{$user.username} ({xen:number $user.message_count})"  class="Tooltip" title="{$user.username}, {xen:phrase messages}:  {xen:number $user.message_count}" /></li>
                         </xen:foreach>
                     </ol>
                 </div>
             </div>
    
    and replace with:

    Code:
            <div class="section activeMembers">
                <h2 class="textHeading">{xen:phrase highest_posting_members}</h2>
                <div class="secondaryContent avatarHeap">
                    <ol>
                        <xen:foreach loop="$activeUsers" value="$user">
                        <xen:if is="{$user.user_id} != 1 AND {$user.user_id} != 2">
                            <li><xen:avatar user="$user" size="s" text="{$user.username} ({xen:number $user.message_count})" class="Tooltip" title="{$user.username}, {xen:phrase messages}: {xen:number $user.message_count}" /></li>
                        </xen:if>
                        </xen:foreach>
                    </ol>
                </div>
            </div>
    
    Change the numbers in this: <xen:if is="{$user.user_id} != 1 AND {$user.user_id} != 2"> to reflect the two admins user id's.
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    As an option, presumably those xen:if statements could be substituted with usergroups so you could remove all admins, moderators, etc. without having to enter individual userid's?
     
  4. Lawrence

    Lawrence Well-Known Member

    There was only a request for 2 users to be excluded from the top poster list, so the user numbers work.

    To exclude just Admins: <xen:if is="!{$user.is_admin}">
    If you want to exclude all Admins and Mods: <xen:if is="!{$user.is_admin} AND !{$user.is_moderator}">
     
    Brogan likes this.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Thanks Lawrence, I'll definitely be making that change on my site.
     
  6. Floris

    Floris Guest

    I rather see a generic script that everybody can use, so in the future new admins are not showing either ..

    And split the template up in 2 .. list the team members, and below list the users. If someone doesn't want that, they can remove the team block above it completely.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    I guess an additional block would also work well.
    One for staff, one for non-staff.
     
  8. Lawrence

    Lawrence Well-Known Member

    The downside of using a template conditional for this is that the total displayed will be 12 - the 2 Admins, for a total of ten. You can increase the top-posters number if you are comfortable making a small edit to one of the core XF files. An addon would work much better to allow for various other options.

    To manually make the change (not recommended unless you are comfortable making the change):

    Open: yourforo/library/XenForo/ControllerPublic/Member.php

    Find:

    // most active users (highest post count)
    $activeUsers = $userModel->getMostActiveUsers($criteria, array('limit' => 12));

    and increase the 12 to 14 to reflect the exclusion of your 2 Admin.
     

Share This Page