XF 2.0 Beginner questions about *right* way to do things

Tipmoose

Member
Licensed customer
First off, I apologize in advance for the basic/dumb questions I am likely to ask. I'm a newcomer to the world of php and XF and am trying to learn how to do things the right way. I'm proficient at C++, C# and Ruby so coding isn't something new.

I got scotchbox set up and running and started tinkering. The first simple add-on I created was one that would sort the Members Online alphabetically. I followed the examples in the XF2 dev docs and extended XF\Repository\SessionActivity via XFCP_SessionActivity and overrode the getOnlineUsersList method to order the finder query to be by User.username.

Is that the correct way to implement that solution?


My next add-on, if I can figure it out, is going to be to keep a running track of the most users online and display that info in the ForumStatistics widget. Ive figured out the back end code to do this. But I can't figure out the widget. How can I add another entry to the widget that will display Most Users Online, the number of users and guests, and the date it happened?
 
Your implementation sounds correct to me. Regarding your widget question : /admin.php?widgets/add&definition_id=php_callback
 
Back
Top Bottom