On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi all,
    I am trying to build something for my clients web users to update and modify their user information from the main site and was looking into using TV's to accomplish this.

    My question is how can I use a etomite function ($etomite->getLoginUserID() ) within a query if using @SELECT (SQL query
    I would like to be able to do something like this:

    @SELECT email FROM etomite_web_user_attributes WHERE id=$etomite->getLoginUserID()

    does this make any sense?

    Thanks in advance!

    Todd
      www.detroitunderground.net
      www.dtwaudi.com
      www.greymatterhosting.com
      new flash site in the works
    • Hi,

      I would use the @EVAL binding instead:

      @EVAL return $etomite->dbQuery("SELECT email FROM ".$etomite->dbConfig['dbase'].".".$etomite->dbConfig['table_prefix']."web_user_attributes WHERE internalkey='".$etomite->getLoginUserID()."'");
      


      Note the changes to the SQL. Also remember to add email inside the "Field names" property.

      The @EVAL binding will allow you to use php scripts inside your TVs. This way you can program your TV to display anything smiley


      Hi all,
      I am trying to build something for my clients web users to update and modify their user information from the main site and was looking into using TV's to accomplish this.

      My question is how can I use a etomite function ($etomite->getLoginUserID() ) within a query if using @SELECT (SQL query
      I would like to be able to do something like this:

      @SELECT email FROM etomite_web_user_attributes WHERE id=$etomite->getLoginUserID()

      does this make any sense?

      Thanks in advance!

      Todd
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
      • Please share your code when you finished the hack smiley
          patagonia, argentina
        • Thanks! i would be happy to share whatever this come out to be. it will be however most definatley a quick hack... so far I have built a couple different chunks for viewing / updating user profile information and passwords. I added a few fields to the web_user_attributes table for company name, city, state. I now have the view profile page working perfect thanks to the above post. thanks again!!

          please check out http://d7942.u23.greymatterhosting.com/

          login with test/wordpass and it will redirect you to my user mgmt area

          you can see the view profile page is fuctioning, and i am able to populate the text boxes with the current info on the update page but I am feeling like a moron trying to figure how to link the submit button into the system to update the database without using an external php file.

          if anyone can help point me in the right direction it would be awesome!

          thx,

          todd
            www.detroitunderground.net
            www.dtwaudi.com
            www.greymatterhosting.com
            new flash site in the works
          • Who is Hello cheryl rentschler

            when I press login on your page listed above it logs me in as Hello cheryl rentschler I left the fields black to see what would happen. I thing there is a bug somewhere

            Greets Dimmy
              follow me on twitter: @dimmy01
            • thanks good looking out, added some validation to make sure they enter a username when creating an account.
                www.detroitunderground.net
                www.dtwaudi.com
                www.greymatterhosting.com
                new flash site in the works