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

Displaying staff side by side?

Nasr

Well-known member
#1
How do I display staff side by side? I've removed avatars and titles and would like to display staff side by side instead of on top of each other.
 

Nasr

Well-known member
#3
That code did not work at all. It outputs some HTML. Plus, I dont want to use avatars. I want to use Usernames instead seperated by commas just like the members online.
 

Jake Bunce

XenForo moderator
Staff member
#4
I played with the code and achieved this:

Screen shot 2010-11-18 at 1.01.57 PM.png

You can see it looks just like the list of regular users. However, I can't find a count for the number of staff so you end up with a trailing comma after the last staffer (unless all online users are staff like in my picture).

I edited this template:

Admin CP -> Appearance -> Templates -> sidebar_online_users

Replace this code:

Code:
<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" />
								<a href="{xen:link members, $user}" class="username">{xen:helper richUserName, $user}</a>
								<div class="userTitle">{xen:helper userTitle, $user}</div>
							</li>
						</xen:if>
					</xen:foreach>
				</xen:contentcheck>
			</ul>
		</div>
	</div>
</xen:if>
...with this:

Code:
<xen:if hascontent="true">
	<div class="section membersOnline userList">
		<div class="secondaryContent">
			<h3>{xen:phrase staff_online_now}</h3>
			<ol class="listInline">
				<xen:contentcheck>
					<xen:foreach loop="$onlineUsers.records" value="$user" i="$i">
						<xen:if is="{$user.is_moderator} OR {$user.is_admin}">
							<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:if>
							</li>
						</xen:if>
					</xen:foreach>
				</xen:contentcheck>
			</ol>
		</div>
	</div>
</xen:if>
Hopefully that helps. But like I said, it has the comma problem.
 

Nasr

Well-known member
#5
thank you very much jake. that did it. I tried to move <ol class="listInline"> as you did but couldnt find the right place.
 

Forsaken

Well-known member
#6
That code did not work at all. It outputs some HTML. Plus, I dont want to use avatars. I want to use Usernames instead seperated by commas just like the members online.
How did the code output HTML?

I just tried it on a new template, it its still working perfectly fine.
 

Nasr

Well-known member
#7
How did the code output HTML?

I just tried it on a new template, it its still working perfectly fine.
When I used that code It didnt align staff side by side, rather it just showed them on top of each other and some HTML code and when i hover over that HTML it would display the name in a tooltip. it could be something in my template though, i have a heavely modified style.

What Jake did worked perfect for me though.