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

XF 1.4 Remove User Group from Notable Members page

Discussion in 'Styling and Customization Questions' started by kingjavo, Jun 2, 2015.

  1. kingjavo

    kingjavo Member

    I only want to see Registered users in this page. Anyone know how?
     
  2. Demon

    Demon Active Member

    Last edited: Jun 2, 2015
  3. Martok

    Martok Well-Known Member

    As all members should have the Registered group as their primary user group, then surely Notable Members is working as expected? Unless you mean you want to remove the notable members (in which case your title is confusing as it says remove user group) which can be done with the above mentioned add-on.
     
  4. kingjavo

    kingjavo Member

    I figured this out on my own! :D

    Find below code in member_notable template
    PHP:
    <div class="section">
        <
    ol class="memberList">
            <
    xen:foreach loop="$usersvalue="$user">
                <
    xen:include template="member_list_item">
                    <
    xen:set var="$noOverlay">1</xen:set>
                    <
    xen:set var="$extraTemplate"><xen:if is="{$bigKey}"><span class="bigNumber">{xen:number {$user.{$bigKey}}}</span></xen:if></xen:set>
                </
    xen:include>
            </
    xen:foreach>
        </
    ol>
    </
    div>
    Replace with the following code
    PHP:
    <div class="section">
        <
    ol class="memberList">
            <
    xen:foreach loop="$usersvalue="$user">
            <
    xen:if is="{xen:helper ismemberof, $user, 2}">
                <
    xen:include template="member_list_item">
                    <
    xen:set var="$noOverlay">1</xen:set>
                    <
    xen:set var="$extraTemplate"><xen:if is="{$bigKey}"><span class="bigNumber">{xen:number {$user.{$bigKey}}}</span></xen:if></xen:set>
                </
    xen:include>
                </
    xen:if>
            </
    xen:foreach>
        </
    ol>
    </
    div>
    You can replace the number 2 to whatever value you want. That is the user_group_id in the xf_user_group table.
    PHP:
    <xen:if is="{xen:helper ismemberof, $user, 2}">
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    As posted above, all members should be in the Registered user group as the primary.

    If not, you don't have the user groups and permissions set up correctly.
     
    Amaury likes this.
  6. kingjavo

    kingjavo Member

    What I was trying to do was exclude other groups outside of the Registered users. All groups were showing.
     
  7. kingjavo

    kingjavo Member

    Below is the final code to remove the Staff Users tab and only leave me with the Registered users group...

    PHP:
    <xen:title>{xen:phrase notable_members}</xen:title>

    <
    xen:container var="$head.canonical">
        <
    link rel="canonical" href="{xen:link 'canonical:members'}" /></xen:container>

    <
    xen:require css="member_list.css" />
    <
    xen:require css="xenforo_member_list_item.css" />
       
    <
    xen:if is="{$userNotFound}">
        <
    div class="importantMessage">{xen:phrase specified_member_cannot_be_found_enter_entire_name}</div>
    </
    xen:if>

    <
    ul class="tabs">
        <
    li class="{xen:if '{$type} == "messages"', active}"><a href="{xen:link members}">{xen:phrase most_messages}</a></li>
        <
    li class="{xen:if '{$type} == "likes"', active}"><a href="{xen:link members, '', 'type=likes'}">{xen:phrase most_likes}</a></li>
        <
    li class="{xen:if '{$type} == "points"', active}"><a href="{xen:link members, '', 'type=points'}">{xen:phrase most_points}</a></li>
    </
    ul>

    <
    div class="section">
        <
    ol class="memberList">
            <
    xen:foreach loop="$usersvalue="$user">
            <
    xen:if is="{xen:helper ismemberof, $user, 2} AND !{xen:helper ismemberof, $user, 6} AND !{xen:helper ismemberof, $user, 5}  AND !{xen:helper ismemberof, $user, 4}  AND !{xen:helper ismemberof, $user, 3}">
                <
    xen:include template="member_list_item">
                    <
    xen:set var="$noOverlay">1</xen:set>
                    <
    xen:set var="$extraTemplate"><xen:if is="{$bigKey}"><span class="bigNumber">{xen:number {$user.{$bigKey}}}</span></xen:if></xen:set>
                </
    xen:include>
                </
    xen:if>
            </
    xen:foreach>
        </
    ol>
    </
    div>

    <
    xen:sidebar>
        <
    div class="section">
            <
    form action="{xen:link members}" method="post" class="secondaryContent findMember">
                <
    h3><a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase find_member}</a></h3>
                   
                <
    input type="search" name="username" placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete" data-autoSubmit="true" />
                <
    input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}/>
            </
    form>
        </
    div>

        <
    xen:if is="{$birthdays}">
            <
    div class="section">
                <
    div class="secondaryContent avatarHeap">
                    <
    h3>{xen:phrase todays_birthdays}</h3>
                   
                    <
    ol>
                    <
    xen:foreach loop="$birthdaysvalue="$user">
                        <
    li><xen:avatar user="$usersize="s" text="{$user.username}class="Tooltip" data-tipclass="flipped" title="{$user.username}/></li>
                    </
    xen:foreach>
                    </
    ol>
                </
    div>
            </
    div>
        </
    xen:if>
       
        <
    xen:if is="{$latestUsers}">
            <
    div class="section newestMembers">
                <
    div class="secondaryContent avatarHeap">
                    <
    h3>{xen:phrase newest_members}</h3>
                   
                    <
    ol>
                        <
    xen:foreach loop="$latestUsersvalue="$user">
                            <
    li><xen:avatar user="$usersize="s" text="{$user.username} ({xen:datetime $user.register_date})" class="Tooltip" data-tipclass="flipped" title="{$user.username}, {xen:phrase joined}: {xen:datetime $user.register_date}" /></li>
                        </
    xen:foreach>
                    </
    ol>
                </
    div>
            </
    div>
        </
    xen:if>
    </
    xen:sidebar>
     

Share This Page