We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36591
    • 38 Posts
    That's it! But there is an error in line 8. It should look like this:
           $output .= "\n    <li>" . $aUser->get('username') . '</li>';


    If you use "userName" you won't get the username displayed and it's working really fast. So thanks very much! smiley

    Edit: But this Snippet only shows your own username when you are logged in, not other users.
    [ed. note: waivor last edited this post 15 years ago.]
      • 28215
      • 4,149 Posts
      This code *should* work:

      https://gist.github.com/1234763

      Note there's a Snippet and a Chunk there.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 36591
        • 38 Posts
        Quote from: splittingred at Sep 22, 2011, 08:28 AM
        This code *should* work:

        https://gist.github.com/1234763

        Note there's a Snippet and a Chunk there.

        Yes it does: Great work! Perhaps it would be useful to integrate the "fullname".
          • 3749
          • 24,544 Posts
          That's a great solution and should be guaranteed to give an accurate list of currently logged-in users.
          [ed. note: BobRay last edited this post 15 years ago.]
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 36720
            • 20 Posts
            giannirapetti Reply #15, 15 years ago
            Thanks to all of you, guys.

            @Splittingred: regarding the parameters of your snippet, &limit I guess is max number of users to show, but what's &offset ?
            From my test (with Revo 2.1.3, online server not localhost), the snippets shows also users logged in the back-end (manager). I was logged in with the Super User in the back end + 2 users in the front end (2 different browsers) and the snippet showed all the 3.
            What about a flag for front-end users only in a future release ? (Snippet just published and soon modxers call for improvements...)

            Many thanks again
            bye

            gianni


              • 28215
              • 4,149 Posts
              Gianni, I'll add the Snippet to the Login component. Can you file that as an issue here?

              http://bugs.modx.com/projects/login/issues
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 36591
                • 38 Posts
                Quote from: splittingred at Sep 23, 2011, 08:50 AM
                Gianni, I'll add the Snippet to the Login component. Can you file that as an issue here?

                http://bugs.modx.com/projects/login/issues

                Done: http://bugs.modx.com/issues/5787
                  • 36720
                  • 20 Posts
                  giannirapetti Reply #18, 15 years ago
                  Tnx Splittingred and Waivor !
                  Ciao
                    • 42146
                    • 73 Posts
                    Went to use the snippet listed here as i stumbled across this post, and noticed revo wouldn't let me save it due to name already existed, looked at login, and there is already one there...... never saw any documentation on http://rtfm.modx.com/display/ADDON/Login about it. Oh well it's being used now...
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Well, they do say that they've added it to the login package wink

                      The rtfm has been updated, at least the list of snippets and their purpose has been updated. [ed. note: sottwell last edited this post 13 years, 10 months ago.]
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org