Announcement

Collapse
No announcement yet.

Hiding specific members in memberlist

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hiding specific members in memberlist

    Folks-

    I have a handfull of "utility" accounts that I would like regular members not to see in the members list.

    I need these accounts to be in the primary usergroups that they are in--and those primary groups can be seen in the list. I made a usergroup called "stealth", set it to not display in the lists, and assigned it as a secondary usergroup to those accounts. Problem is the "show" in the primary is more permissive that the "don't show" in the secondary and so they show.

    I'm thinking of putting a conditional into memberlist_resultsbit, but I can't figure out the syntax for "Is the user being listed a member of this group?" Any suggestions?

    --don
    --don

  • #2
    Admin CP -> Styles & Templates -> Style Manager -> « » -> Member's List Templates -> memberlist_resultsbit

    Add the red code:

    Code:
    [color=red]<if condition="!is_member_of($userinfo, [color=blue]X[/color])">[/color]
    
    <tr align="center">
    	<td class="alt1Active" align="$stylevar[left]" id="u$userinfo[userid]">
    		<a href="member.php?$session[sessionurl]u=$userinfo[userid]">$userinfo[musername]</a>
    		<if condition="$show['usertitlecol']"><div class="smallfont">$userinfo[usertitle]</div></if>
    	</td>
    	<if condition="$show['emailcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['emaillink']"><a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$userinfo[userid]" target="_blank"><img src="$stylevar[imgdir_button]/email.gif" alt="email.gif" title="<phrase 1="$userinfo[username]">$vbphrase[click_here_to_email_x]</phrase>" border="0" /></a></if>&nbsp;<if condition="$show['pmlink']"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$userinfo[userid]" target="_blank"><img src="$stylevar[imgdir_button]/sendpm.gif" alt="sendpm.gif" title="<phrase 1="$userinfo[username]">$vbphrase[send_private_message_to_x]</phrase>" border="0" /></a></if></td></if>
    	<if condition="$show['imicons'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[icqicon] $userinfo[aimicon] $userinfo[msnicon] $userinfo[yahooicon]</td></if>
    	<if condition="$show['homepagecol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['homepagelink']"><a href="$userinfo[homepage]" target="_blank"><img src="$stylevar[imgdir_button]/home.gif" alt="home.gif" title="<phrase 1="$userinfo[username]">$vbphrase[visit_xs_homepage]</phrase>"  border="0" /></a><else />&nbsp;</if></td></if>
    	<if condition="$show['searchcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['searchlink']"><a href="search.php?$session[sessionurl]do=finduser&amp;u=$userinfo[userid]"><img src="$stylevar[imgdir_button]/find.gif" alt="find.gif" title="<phrase 1="$userinfo[username]">$vbphrase[find_all_posts_by_x]</phrase>" border="0" /></a><else />&nbsp;</if></td></if>
    	<if condition="$show['datejoinedcol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[datejoined]</td></if>
    	<if condition="$show['postscol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[posts]</td></if>
    	<if condition="$show['lastvisitcol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[lastvisit]</td></if>
    	<if condition="$show['reputationcol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[reputationdisplay]</td></if>
    	<if condition="$show['avatarcol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['avatar']"><img src="$avatarurl" border="0" alt="<phrase 1="$userinfo[username]">$vbphrase[xs_avatar]</phrase>" hspace="4" vspace="4" /><else />&nbsp;</if></td></if>
    	<if condition="$show['profilepiccol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[profilepic]</td></if>
    	<if condition="$show['birthdaycol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[birthday]</td></if>
    	<if condition="$show['agecol'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[age]</td></if>
    	<if condition="$show['customfields']">$customfields</if>
    	<if condition="$show['usergroup'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['hideleader']">&nbsp;<else /><input type="checkbox" name="deletebox[$userinfo[userid]]" value="yes" /></if></td></if>
    </tr>
    
    [color=red]</if>[/color]
    Change X to the usergroupid of the secondary group. That should work.

    Now members of that secondary group will not be shown on the member list.

    Comment


    • #3
      Jake-

      kewl! " !is_member_of($userinfo, X) is exactly what I was looking for!
      --don

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X