We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    This is an auto-generated support/comment thread for UserPlaceholders.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Sets placeholders of user attributes for the currently logged in user.
    These placeholders are identical to the ones WebLoginPE sets.

    [+user.username+] = the logged in user’s username.
    [+user.fullname+] = the logged in user’s full name.
    [+user.internalkey+] = the logged in user’s internal key.
    [+user.email+] = the logged in user’s email address.
    [+user.phone+] = the logged in user’s phone number.
    [+user.moblilephone+] = the logged in user’s mobile phone number.
    [+user.dob+] = the logged in user’s date of birth.
    [+user.gender.integer+] = the logged in user’s gender code.
    [+user.gender+] = the logged in user’s gender.
    [+user.country.integer+] = the logged in user’s country code.
    [+user.country+] = the logged in user’s country.
    [+user.state+] = the logged in user’s state.
    [+user.zip+] = the logged in user’s zip code.
    [+user.fax+] = the logged in user’s fax number.
    [+user.photo+] = the url to the logged in user’s photo.
    [+user.comment+] = the logged in user’s comment / signature.
    [+user.logincount+] = how many times the user has logged in.
    [+user.lastlogin+] = the date of the logged in user’s last login.
    [+user.thislogin+] = the time the logged in user’s current login began.

    -sD-
    Dr. Scotty Delicious, Scientist DFPA
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
    • Very cool Scotty ... laugh

      It’d be way handy to have a version of this that outputs the data directly rather than setting the placeholders so it could be used within an eform.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • Quote from: rthrash at Aug 15, 2007, 07:03 PM

        It’d be way handy to have a version of this that outputs the data directly rather than setting the placeholders so it could be used within an eform.
        Be much handier if you had a version of eform that could make use of the placeholders. tongue
          • 26435
          • 1,193 Posts
          Quote from: OpenGeek at Aug 15, 2007, 07:08 PM

          Quote from: rthrash at Aug 15, 2007, 07:03 PM

          It’d be way handy to have a version of this that outputs the data directly rather than setting the placeholders so it could be used within an eform.
          Be much handier if you had a version of eform that could make use of the placeholders. tongue

          I will have to take a look into eForm then. grin

          -sD-
          Dr. Scotty Delicious, Scientist DFPA
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
          • Quote from: OpenGeek at Aug 15, 2007, 07:08 PM

            Quote from: rthrash at Aug 15, 2007, 07:03 PM

            It’d be way handy to have a version of this that outputs the data directly rather than setting the placeholders so it could be used within an eform.
            Be much handier if you had a version of eform that could make use of the placeholders. tongue

            If I’m not mistaken, eForm can handle placeholders as parameters OK, and I’m pretty sure they can be used within the chunks as well? However, getting the values into the form fields doesn’t quite work as you might expect...Using eForm’s event functions should allow for a nice mash-up though.

            It’s when PHx gets thrown into the mix that it gets a little interesting...
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
              • 3143
              • 46 Posts
              Hello, thanks for this snippet.

              Here’s my question : I am a newbie with modx and I put [!UserPlaceholders!] before the doctype of the page, and [+user.username+] in the further content but it doesn’t display.

              I’ve tried to change the location of the snippet call, to use [*UserPlaceholders*] instead of [!UserPlaceholders!] but does’nt work too.

              Could someone please help ?

              EDIT : thanks mrhaw it works
                • 20413
                • 2,877 Posts
                Try this:
                In the content of a document created in manager paste this:
                [[UserPlaceholders]]
                
                [+user.username+]
                [+user.fullname+]


                Then log in with a webuser and visit page
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 32380
                  • 137 Posts
                  Does anyone know if this will work with eForm?

                  EG. hidden field with user name?
                  • Quote from: wiggy at Jun 23, 2009, 11:26 AM

                    Does anyone know if this will work with eForm?

                    EG. hidden field with user name?

                    I am using a custom version of WebLoginPE, which I modified to invoke the internal Placeholders() method upon login, forcing all of the webuser information into $_SESSION. Then, in a custom plugin used for session management, I loop through and create the actual "User Placeholders". This way, I have access to user placeholders from any page without having to run [[UserPlaceholders]] or [[WebLoginPE]] on every page.

                    Both methods work great with eForm. You can use the placeholders themselves as long as they exist prior to your eForm call. If you want to access the data within you form validation/processing layer, you can access via $_SESSION or the $modx object itself... I believe it is $modx->placeholders
                      Mike Reid - www.pixelchutes.com
                      MODx Ambassador / Contributor
                      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                      ________________________________
                      Where every pixel matters.
                      • 32380
                      • 137 Posts
                      @pixelchutes Sounds good but i’m not that able when creating custom snippets, though there might be a downloadable snippet, ie this one UserPlaceholders that functions with eform (must be a common request?) grin