Forum Discussion
mcalcaterra
2 years agoKhoros Alumni (Retired)
Hi waldemarhelm something like this will print out a list of the ids of users that have the administrator role with a link to their profile page
<#assign admins = (liql("SELECT id, online_status, href FROM users WHERE roles.id='t:Administrator'").data.items)![] />
<#list admins as admin>
<#if admin.online_status = 'online'>
<a href="${admin.href}">${admin.id}</a>
</#if>
</#list>
you should be able to use this as a base template and query for the avatars as well and display that instead of the ids.
Keep in mind this will return 25 users, you can increase/reduce the limit as needed
- steffenschoene2 years agoExpert
Hi mcalcaterra I think you can improve your liql by ordering by last_visit_time to get a better change to find online users. Sadly we have not the constraint option for online_status so we have to use such a workaround.
SELECT id, online_status, href FROM users WHERE roles.id='t:Administrator' ORDER BY last_visit_time DESC
- waldemarhelm2 years agoDirector
mcalcaterra Thank you. We will try this out.
Related Content
- 4 years ago
- 4 years agoInactive User