Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Possible to move Dashboard's Recently Active to Sidebar?

In the Dashboard page there is a Recently Active list. My forum is private and only has 7 members and I want to list that info in the forum's sidebar rather than a meager who's online. Is this possible?
Has anyone done something like this before?

Comments

  • So you want time stamps in addition to their names?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Pretty much and the last x members should be visible at all times.

  • hgtonighthgtonight MVP
    edited May 2013

    You could either code a plugin/module from scratch that displays the last active users (e.g. Rendering out $UserModel->GetActiveUsers(5);).

    Or you could modify the WhosOnline plugin to do what you want.

    Just a quick note, the active user data supplied by the user table is updated on authentication, re-authentication, and a few other update activities. The WhosOnline plugin updates every time any user loads a page containing the module. The distinction is that WhosOnline captures users that are reading the site, not just users that authenticate.

    Both approaches would not be difficult for a developer faintly acquainted with the framework.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • That list is generate by class RecentUserModule. To use it, you have to do the following:

    1- Load the module in your theme

    This can be done in several way. One way you can do it is by implementing (or altering) the Base_Render_Before() handler:

    public function Base_Render_Before($Sender) {
      $RecentUserModule = new RecentUserModule($Sender);
      $RecentUserModule->GetData();
      $Sender->AddModule($RecentUserModule);
    }
    

    That makes the module available to the theme.

    2- Enable module display

    The RecentUserModule won't display anything if configuration setting Garden.Modules.ShowRecentUserModule is set to false, or it doesn't exist. To solve this, add the following line to your configuration file:

    $Configuration['Garden']['Modules']['ShowRecentUserModule'] = true;
    

    Save the changes and refresh your page. The module should now display on your forum. However, it may look ugly, as I think it was not designed to be displayed outside of the admin area.

    3- Adjust CSS for the module

    Modify your theme's CSS so that the module looks nice on your forum.

  • @businessdad Your posts are always awesome and insightful. :D

    @Flam This method still depends on the UserModel->GetActiveUsers() function, so the distinction about last active time still stands.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • FlamFlam New
    edited May 2013

    Sorry I'm a little new to all this but reading the docs and learning...
    I followed @businessdad's advice and the Recently Active Users now shows up (I loaded the module in the Who's Online plugin's Base_render_before function). The last bit missing is that the timestamps don't show up, only the user photos do. Am I missing something?

    Thanks so much for the clear help!

  • The advantage of a proper module is being able to override the view using your theme. This is an example of a view you could use.

    You would need to place that in '/themes/YourThemeNameHere/views/modules/recentuser.php. Note that a lot of themes do not use view overrides, so you may have to create these folders (from/views` on).

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • R_JR_J Admin

    I wanted to learn how to code a great event-app for vanilla but I got stuck real soon. Not only that I know nothing about the garden framework, but I am also no talented coder. Well, to be exact: I'm no experienced coder, but I might be a very talented and gifted coder, not having found my true destiny yet...

    In order to get started with this framework, I've decided to create some simple plugins and so I think this one could be a nice starting point, for there are already helpful hints here.

    What I've got right now are two files: class.recentlyactive.plugin.php and recentlyactivemodule.php. I've uploaded them on github but I've some questions left and it is not working right now. Here is what I've got: https://github.com/R-J/RecentlyActive

    What I'll need next is

    • the information on how to loop through a Gdn_DataSet
    • to find out which information (columns) is in $UserModel->GetActiveUsers
    • what "Gdn_Format::..." is doing

    But I try to find the answers by myself first and ask later on ;-)

  • @R_J Submitted a pull request on github. Let me know if I didn't explain anything properly.

    Welcome to the community!

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • R_JR_J Admin

    Great, many thanks for doing the real work and you have explained everything very well!

    I haven't read anything about the autoloader right now and I've quickly checked some plugins and havn't seen a module subfolder there. But this autoloader feature shouldn't surprise after all, because views were pulled from subfolders, too. But nonetheless this is much more elegant and I wonder why I haven't seen it in the modules I've looked at...

    And now I also now why I haven't found anything about "looping through a Gdn_DataSet", when all that was missing was the "->Result()" :-/

    I found nothing for Gdn_Format or UserAnchor in the wiki. Is there a better place to look things like this up or is it all learning by doing (and looking at someone elses code)?

  • @R_J The wiki and documentation are... a great starting point. Many features of working with the framework aren't documented yet. The forum is great for finding answers to specific questions and issues.

    The source code is the law, so to speak. If you find something in there that isn't documented, it doesn't mean you can't use it. It just means the community at large might not know about it yet.

    This is where the wiki comes in handy. If you find something out that isn't there, put it there. Don't worry about formatting, that is what the editors are for. :D

    P.S. I just learned about the auto-loader system last week. The regulars here are awesome!

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • R_JR_J Admin

    I've written a tutorial for that plugin. Surely it's for real beginners, but I had the impression that it's hard to start with developing for the Garden framework, because there are too few "first steps" tutorial.

    My mother tongue is not English, I'm no developer and I have nearly no experience with Vanilla, so it is absolutely possible that there are false statements in my tutorial. I'd be truly grateful if someone corrects me in that case.

    Beside of that: that was my first active contact with github and to me it was way more complicated than writing that plugin! :-D

  • @R_J That is an excellent tutorial! You should put it up on the wiki. :D I only found a few minor errors that don't detract from the overall thoroughness of it.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.