We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    Well, after much effort and assistance from BobRay, it has been determined there there is *no* date registered value in Discuss at all. This is not...good to be honest, its a standard value that should be there and quite necessary I think. It lets other users know how long someone has been around, and helps long time users get some respect for their longevity.

    So this value would have to be created when creating the account, and there are some unused values in user profile that could be used here, such as mobile phone. But, how to create this? It needs to be a time stamp, set when making the account. I personally have zero idea how this could be done.

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      Wait. In our other exchange, I missed the fact that you were using Discuss. Discuss extends the modUser object and adds some extra fields. That field is, in fact, called 'createdon', but you won't get it with the standard created on tag (which gets the Resource createdon field).

      You might try this snippet and see if you get anything:

      $userId = 12; // set this to the ID of a registered Discuss User
      $usr = $modx->getObject('disUser', array('user' => $userId));
      if ($usr) {
          return $usr->get('createdon');
      } else {
          return 'User Not Found';
      }


      The Discuss schema is kind of funky (and you have to go to GitHub to see it), so I'm not sure if this is right.

        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
        • 46886
        • 1,154 Posts
        Thanks BobRay. You and Susan have been so helpful, others too.

        Its been a bit tough lately, but finally workable solutions will be found, its just a matter of time wink

        I have searched better recently and found some useful things, especially about the dob, stuff I should have found earlier to be honest. Might be able to craft a workable solution.

        I will bring up some interesting issues from the Discuss schema soon in this thread, as there are some specifics that are important, in terms of accessing user data. You mention that Discuss handles some of this, but its not in extended fields, necessarily...for instance createdon will not be found in extended fields. So accessing this data is a little weird, and even accessing extended fields is something which hasn't been documented well.

        Pls give me a little time, I will be back soon with this info about the scheme. Because all these terms are apparently set by the Discuss system, everything from createdon to page views to what what is in that schema,...and no idea how to access that data...no examples to work from...

        If no reply I shall go to the Revo 2.2 forums to get more attention smiley
          • 3749
          • 24,544 Posts
          Discuss creates a custom DB table to hold the extra fields. The object name for that table is 'disUser' so it's confusing that in the Discuss code, the variable $profile is used for that object's data, even though it's not data from the modx_user_attributes (user profile) table. Adding to the confusion, the user's real ID is stored in the disUser object as 'user'.

          I have no way to test it, but my code above should work, assuming that the disUser class is loaded. I'm fairly sure it's specified in the extension_packages System Setting (you can check), which means it's loaded on every page request.

          If not, you can load it manually at the top of the code.
            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
            • 46886
            • 1,154 Posts
            Yeah I felt pretty confused for awhile there, but its all good. The info you provided is more than enough to get the basics done, and then more attention can be put on whatever is still elusive. I just tend to be a bit obsessive, and want everything to be as perfect as possible. Lose the forest for the trees sometimes wink

            In truth, the profile is hardly the most important part, so that aspect may be put aside for now if it refuses to play nice. I will get some basic parts of the solution done and in the forums, then address other issues later.

            Thanks again for the help, its made a huge difference. I hope to turn that into working solutions for all the basics, so that eventually picking up Discuss will be a very easy thing to do.