We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32699 ☆ A M B ☆
    • 427 Posts
    I apologize for not taking time to break out the code again. I am hitting a deadline and 18 hours of coding a day for two weeks takes priority.

    Here is the Senario:

    Modx looks for a fullname

    Pay pal asks for a 32 character string for first name and another 32 character string for last name.

    I have already created the extra fields in the extended database.

    I don’t want to play with ereg for last names because of numerous possibilities would just be a pain to deal with at the moment (i.e. suffixes, O’Connel type abbrviations, etc.).

    Without creating a trigger in the database and without doing a sneaky hidden snippet call at the success page using php to pull the current web id number from the session and then combining the strings with a space in the middle to be secretly written to the Modx table, I thought I would check here if WebloginPe already has this ability.




      Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

      Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
      • 26435
      • 1,193 Posts
      Using the &customFields add first_name and last_name (if you haven’t already) and them set them in &regRequired to make them a required field for registrants.

      then to query for that information (sounds like you want it in a form?), use the usersList parameter.
      &usersList=`PayPal is Picky:YourFormOuterChunk:YourFormInputsChunkWithPlaceholders:id:ASC:id($_GET['id'])`
      


      The "YourFormInputsChunkWithPlaceholders" would have <input type="hidden" name="firstname" value="[+user.first_name+]" /> etc...

      the "YourFormOuterChunk" would have the <form action="whatever url" method="post">[+view.list+]</form>

      To populate the userinfo it would be a matter of URL, for example:
      http://mysite.tld/paypalform.html?id=55

      to get the info with the user with the id of 55.

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


        I send pointless little messages
        • 32699 ☆ A M B ☆
        • 427 Posts
        That part I had figured out. Unless I missed it, I was looking at having the user enter the firstname and lastname as part of registration instead of fullname.

        Then combine the two into fullname before webloginPe processes the form and does the database inserts.

        As +user.first_name+ doesn’t exist prior to the registration it would have no value to try and pull off a
        <input type="hidden" name="fullname" value="[+user.first_name+] [+user.last_name+]" />

        I know I have options with Javascript etc, but I prefer to leave your snippet as *pure* as possible and not mess with the calls etc.
          Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

          Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
          • 26435
          • 1,193 Posts
          Well fullname is not a necessary field, just a legacy bit for backwards compatibility with the original weblogin snippet.
          I assume you must already have a bunch of people registered and they already put info in the ’fullname’ column.

          You could change your registration form to get rid of fullname and add the first_name and last_name fields and manually add them to the database for your existing user list??? and phase out your ’fullname’ column. When you need to put them together you could just concatenate the placeholders in the page to show the full name.

          Is there another reason you are using the ’fullname’ column if what you really need is ’first_name’ and ’last_name’?
          Quote from: wshawn at Nov 30, 2007, 08:43 AM

          As +user.first_name+ doesn’t exist prior to the registration it would have no value to try and pull off a
          <input type="hidden" name="fullname" value="[+user.first_name+] [+user.last_name+]" />
          the table column is created as soon as you view a page with the &customFields parameter on it (searches and creates if it doesn’t exist).

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


            I send pointless little messages
            • 32699 ☆ A M B ☆
            • 427 Posts
            The only reason I use it, is for tighter integration with the default modx stuff as other snippets / checks/ may use it.

            I will do what I was thinking of at first (once I get Internet Explorer to stop returning to the registration page instead of where I told it to go).

            I will create a snippet which will pull the first name and last name and then drop them into the modx table.

            No one will be the wiser.
              Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

              Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com