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

User Group

OverHere

Active member
#1
Hi All,

In site admin if I set up a new user group and i allot certain members to that new user group, will that user group show up as a separate block on the main forum page?

Or, will the members in that specific group only show up in the block 'Members Online Now'?

Are there only ever 2 blocks > Staff Online & Members Online Now?

Thanks.
 

Jake Bunce

XenForo moderator
Staff member
#2
There are only two blocks. Adding another separate block for a separate group requires editing this template:

Admin CP -> Appearance -> Templates -> sidebar_online_users

Add the red code in the middle:

Code:
<xen:edithint template="sidebar.css" />

<!-- block: sidebar_online_staff -->
<xen:if hascontent="true">
	<div class="section staffOnline avatarList">
		<div class="secondaryContent">
			<h3>{xen:phrase staff_online_now}</h3>
			<ul>
				<xen:contentcheck>
					<xen:foreach loop="$onlineUsers.records" value="$user">
						<xen:if is="{$user.is_moderator} OR {$user.is_admin}">
							<li>
								<xen:avatar user="$user" size="s" img="true" />
								<xen:username user="$user" rich="true" />
								<div class="userTitle">{xen:helper userTitle, $user}</div>
							</li>
						</xen:if>
					</xen:foreach>
				</xen:contentcheck>
			</ul>
		</div>
	</div>
</xen:if>
<!-- end block: sidebar_online_staff -->

<xen:if hascontent="true">
	<div class="section avatarList">
		<div class="secondaryContent">
			<h3>SPECIAL GROUP</h3>
			<ul>
				<xen:contentcheck>
					<xen:foreach loop="$onlineUsers.records" value="$user">
						<xen:if is="{xen:helper ismemberof, $user, 3}">
							<li>
								<xen:avatar user="$user" size="s" img="true" />
								<xen:username user="$user" rich="true" />
								<div class="userTitle">{xen:helper userTitle, $user}</div>
							</li>
						</xen:if>
					</xen:foreach>
				</xen:contentcheck>
			</ul>
		</div>
	</div>
</xen:if>

<!-- block: sidebar_online_users -->
<div class="section membersOnline userList">		
	<div class="secondaryContent">
		<h3><a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase members_online_now}</a></h3>
		
		<xen:if is="{$onlineUsers.records}">
		
			<xen:if is="{$visitor.user_id}">
				<xen:if hascontent="true">
				<h4 class="minorHeading"><a href="{xen:link account/following}">{xen:phrase people_you_follow}:</a></h4>
				<ul class="followedOnline">
					<xen:contentcheck>
						<xen:foreach loop="$onlineUsers.records" value="$user">
							<xen:if is="{$user.followed}">
								<li title="{$user.username}" class="Tooltip"><xen:avatar user="$user" size="s" img="true" class="_plainImage" /></li>
							</xen:if>
						</xen:foreach>
					</xen:contentcheck>
				</ul>
				<h4 class="minorHeading"><a href="{xen:link members}">{xen:phrase members}:</a></h4>
				</xen:if>
			</xen:if>
			
			<ol class="listInline">
				<xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
					<xen:if is="{$i} <= {$onlineUsers.limit}">
						<li>
						<xen:if is="{$user.user_id}">
							<a href="{xen:link members, $user}"
								class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
						<xen:else />
							{xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
						</xen:if>
						</li>
					</xen:if>
				</xen:foreach>
				<xen:if is="{$onlineUsers.recordsUnseen}">
					<li class="moreLink">... <a href="{xen:link online}" title="{xen:phrase see_all_visitors}">{xen:phrase and_x_more, 'count={xen:number $onlineUsers.recordsUnseen}'}</a></li>
				</xen:if>
			</ol>
		</xen:if>
		
		<div class="footnote">
			{xen:phrase online_now_x_members_y_guests_z, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}'}
		</div>
	</div>
</div>
<!-- end block: sidebar_online_users -->
Replace the blue pieces to give the block a title and to specify the id of the usergroup.

Here is the result:

Screen shot 2013-03-31 at 10.54.25 PM.png