On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Important:

    There is now a new snippet (WebLoginPE) that does almost everything PPP does, and more... Check out:

    http://modxcms.com/forums/index.php/topic,17359.0.html

    =====================================================

    Updated Jan 2, 2007: PPP 0.3 beta - Extended user profiling with custom fields

    Check the demo site for example use of the new functionality

    WARNING: I made this snippet as a project for learning MODx, php and MySql. Please note that this is a beta and that it could be unsafe to use it on a live site.

    FEATURES:

    User profiles:
    Let your web users have their own profile with any standard or custom field of your choice
    The user can edit anything he/she wants on his/her profile
    No need to create separate documents for each user
    Anyone can see other people’s profiles
    Makes placeholders automatically - style your users profile pages as you want
    Full validation available through the use of eForm
    New in 0.3: Admins can edit any users data.

    Admin page:
    List available fields/placeholders
    Create custom table without any knowledge of MySql - just specify your desired table name in the snippet call
    Easily add any field to your custom table - no MySql here either
    New fields are automatically added as placeholders to use in profiles and in eForm
    Use multiple custom tables / multiple admin pages

    User lists /reports::
    Creates customizable link lists of web users - click link to see the user profile for that person.
    User link list is in a placeholder, place it where you want.
    List online users, users per group, choose field to order by, list user forgotten to fill in certain fields, list only users with pictures or with complete profiles and lots more.

    Other:
    Enables use of any user field from standard table web_user_attributes in eForm as a placeholder for updating (and for populating fields from database)
    Could be used for other purposes besides user profiles, use it for anything where you need a custom table and automatic creation of placeholders that could be used together with eForm.

    Requirements:
    eForm 1.4.1+
    MODx 0.95 (Should work with earlier versions.)

    Known errors, limitations and troubleshooting:
    Please check the attached instruction file

    Available parameters:
    Included in the instructions

    Instructions and tutorial:
    Download instructions attached to this post. Also included in the snippet zip.

    Demo:
    See a simple unstyled demo with limited functionality at http://www.learningmodx.com
    Too see the snippet in full action you should create an account.
    When going through the tutorial the demo page will help you understand what to do, as the tutorial pretty much is based on the creation of the demo.

    [i]Instructions attached are also in the zip-file. I’ve put them here if you just want to read some more about ppp before testing it.

    Use eFreg snippet (http://modxcms.com/forums/index.php/topic,15674.0.html) to enable input to ppp tables at register time.

    NOTE! - Before install, read this:
    There are some information missing in the instructions attached (I’ll update them soon). Please read http://modxcms.com/forums/index.php/topic,8922.msg73417.html#msg73417 for more info before making a new install (or before upgrading to ppp 0.3)

    NOTE! - Use WebLoginPE instead of PPP (0.1 beta 1: DL 14+19)(0.2 DL=35)
    • Great project Uncle68 !

      You didn’t start small wink That’s a feature which get a lot interrest, given the reccuring inquiry about this kind of feature.
      I am sure you’ll get help from the coding community and learn along the way...
      Congrats on this first (of hopefully many) baby smiley

      I’ll give this a test sometimes next week !
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
      • Thank you David! smiley

        Yes, I’ve seen a lot of people asking for this functionality, and also I need it my self, so it was the perfect project for me.

        And yes, I sure hope that I’ll get some help, there are plenty of stuff where I don’t know what the best solution would be.

        I think I’m going to rewrite almost all of the code as I expand PPP. smiley

        • This could basically take care of anything from a directory to a paypal store. Thanks Uncle.

          edit: For the image/user avatar, could you do the following (what I’ve done for a Joomla site):

          1. on eForm, set &format=file for one of the fields
          a. I don’t know where it would be uploaded
          b. You would need to save the name in the db
          2. wherever you want the image to be shown, do a (could you make this a seperate snippet or a parameter)?

          //if there is a user image... I dont know the correct call
          if ($user->image) {
          
               //show users image
              echo '<img src="directory/to/user/images/[+user_image+]" alt="[+user_name+] image" />';
          } else {
          
              // show default no image
              echo '<img src="directory/to/user/noimage.jpg" alt="User has not uploaded an image" />';
          }
          


          If some code was created to generate a thumbnail, that thumbnail could be saved to the db as well and you could do:

          //if there is a user image... I dont know the correct call
          if ($user->image != '' ) {
          
              //show users image
              echo '<img src="directory/to/user/images/[+user_image+]" alt="[+user_name+] image" />';
          } elseif (user->thumb_image != ''  {
          
              //show users thumbnail image
              echo '<img src="directory/to/user/images/[+user_thumb_image+]" alt="[+user_name+] thumbnail image" />';
          } else {
          
              // show default no image
              echo '<img src="directory/to/user/noimage.jpg" alt="User has not uploaded an image" />';
          }
          


          And I guess it would probably return the output as a placeholder? I havent looked at modx in a few months so dont remember all of what i knew. This and 9.5 and all the improvements look great tho.

          Chuck
            Chuck the Trukk
            ProWebscape.com :: Nashville-WebDesign.com
            - - - - - - - -
            What are TV's? Here's some info below.
            http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
            http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • Hi uncle68,

            That’s a nice first snippe.
            I’ve created a test account on your website.
            Everything was fine until I decided to create a new field.
            After submitting the new one, I’ve had a 404 error.

            :-)
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • @ProWebscape:

              I don’t know how you would use this snippet for a paypal store, but if you manage I hope you’ll let us know how! laugh

              About pictures... I’ll look into that soon, I guess that will be pretty important for a profile page. I must design it so everyone can see eachothers pictures, otherwise it would be pretty useless. I’ll have a look at it later tonight.

              And thanks for the code example.

              @heliotrope:
              That’s strange, it should just reload the page, that’s handled by eForm. I did try add one more fields, and it worked fine for me.

              I’ll guess it could be a temporary problem, but if any one else have the same problem, please let me know.

              And thank you all for your kind words! smiley
              • Great start Uncle68! smiley

                Best of luck with it.

                regards.

                zi
                  Zaigham R - MODX Professional | Skype | Email | Twitter

                  Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • hey thanks for the great snippet really needed it but there is one little thing when i output the menu and click on one of the links it redirects to my first page does any body no why and i have called the snippet both cached and uncached
                  • @Zi

                    Thank you smiley

                    @ SynthX!

                    When you say output the menu, do you mean the list of links to user pages?

                    If so, be sure that you have created the template document for showing user pages, and that you in your "make-list-call" to ppp add &listUsersDirectTo=`###` where the ### should be replaced with the document id of the template document.

                    On the page where you want to output the list the call to ppp it should look something like this:

                    [[ppp? &useTable=`web_user_test` &listUsers=`1` &listUsersLimit=`15` &listUsersDirectTo=`###`]]

                    If that wasn’t your problem, could you give me a link to your site where I can "see the problem in action"?
                    • This looks like a really cool snippet. Very mature for a beta. I can see myself using this in an upcoming project that I just closed today.

                      Thanks for your effort!

                      All the best,
                      Jay
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub