Online users template in a page


Active member

I have a custom page where I'm trying to show the online users, and I'm able to do it by putting this:

<xen:include template="sidebar_online_users"></xen:include>

inside the pagenode_container template. It shows but the problem is I get this error:

Invalid argument supplied for foreach() in E:\home\www\library\XenForo\Template\Abstract.php(265) : eval()'d code, line 274:
273:                     ';
274: foreach ($onlineUsers['records'] AS $user)
275: {

Any ideas on the error and how I can properly include the online users in a page?

You can't just include the template. You'd need to add custom PHP code to your controller to fetch the data that the template uses.
Top Bottom