Could someone give me a tutorial on how to expose online members and members count data to a custom template? I'm pretty sure it has something to do with viewparams...
There is a table called xf_session which logs the sessions of users online currently.Use that table to join with users and grabs the data about members you require.