We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26029
    • 15 Posts
    Hi All,

    Does anyone know how i can make it so that when a member is logged in they can edit there own members page that is displayed in a "members section" container page on the main site. would all need to be done in the front end and not in manager!

    Cheers,

    Sam
      • 31037
      • 358 Posts
      I think you’ll find some good examples if you google something like:

      site:modxcms.com/forums How do i create members pages

      You could also try looking in the rtfm if it is for Revo:

      http://rtfm.modx.com/display/revolution20/Making+Member-Only+Pages

      Mostly about the security part, but anyway, that together with the Login snippet should be a good start.

      Perhaps somthing similar exists for Evo.
        • 26029
        • 15 Posts
        Hi Uncle68,

        Thanks for that, I had found the members section on rtfm and have done some searching. What I’m stuck on isn’t creating the members section but what I want to do is make it so that each member has there own page on the website and so that they can change the information on that page! The members pages need to be on the main site but all in one container, also each member only wants to be able to edit there own page!

        Does that make sense?

        Cheers
          • 31037
          • 358 Posts
          With Login.Profile and Login.Updateprofile you could both display (any) user(s) specific data and also let the user edit (only) their own data. That together with the extended fields I think would be a pretty good solution for most cases.

          There is also another snippet (don’t remember it’s name) that can show lists of users, perhaps those could be link to the specific users profile.

          You could also perhaps use the extended fields for setting things like special css, chunk names or what ever that you would want to make specific for a user or users. That could of course be done in other ways too.

          If I’m totally misunderstanding you, perhaps you could tell what would not work with the solution above.

          All this is of course for Revolution, but for Evo there are similar solutions.
            • 26029
            • 15 Posts
            Quote from: Uncle68 at Nov 19, 2010, 04:25 PM

            With Login.Profile and Login.Updateprofile you could both display (any) user(s) specific data and also let the user edit (only) their own data. That together with the extended fields I think would be a pretty good solution for most cases.

            There is also another snippet (don’t remember it’s name) that can show lists of users, perhaps those could be link to the specific users profile.

            You could also perhaps use the extended fields for setting things like special css, chunk names or what ever that you would want to make specific for a user or users. That could of course be done in other ways too.

            If I’m totally misunderstanding you, perhaps you could tell what would not work with the solution above.

            All this is of course for Revolution, but for Evo there are similar solutions.

            That sounds spot on, thanks very much! Have you got any good reference sites u know of for these? And yes its revo im using!

            Cheers
              • 26029
              • 15 Posts
              Does anyone know of the name of the snippet to display a list of all of your users and or user info? Can you use getResources?

              Cheers
                • 20178
                • 82 Posts
                is there a way to sort search user extended field data - say for instance i have an extended field for users favourite color - is there a way to search for all the the users that favourite color is blue? - and if so what is the best way to approach this and where can i read up on how to achieve this?

                thanks in advance.
                  • 3749
                  • 24,544 Posts
                  Quote from: monsterwatt at Feb 16, 2011, 04:50 PM

                  is there a way to sort search user extended field data - say for instance i have an extended field for users favourite color - is there a way to search for all the the users that favourite color is blue? - and if so what is the best way to approach this and where can i read up on how to achieve this?

                  thanks in advance.

                  I assume you mean for Revolution. In that case this would be one way to do it (change zip to color):

                  <?php
                  $zip = '55147';
                  $zipUsers = array();
                  /* get all active users */
                  $users = $modx->getCollection('modUser',array('active' => '1'));
                  foreach ($users as $user) {
                      /* get the user's profile */
                      $profile = $user->getOne('Profile');
                      /* get the user's zip code */
                      $userZip = $profile->get('zip');
                      /* if the user has the zip code, add them to the array */
                     if ($userZip == $zip) {
                          $zipUsers[] = $user->get('username');
                      }
                  }
                  
                  foreach($zipUsers as $zipUser) {
                  
                      $output .= '<p>User: ' . $zipUser->get('username') . '</p>';
                  
                  }
                  return $output;


                  There’s a more efficient way to do it, probably with getCollectionGraph(), and/or an innerJoin, but I’m too tired to work it out.

                    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
                    • 20178
                    • 82 Posts
                    hi bob thanks, yes im using revolution.

                    ive tried to implement your code but cannot get it to work, i created the snippet MySearch and placed the code you provided in it and then called the snippet [[MySearch]] from within my resource but it’s not outputting anything.

                    What i would like to be able to do it have this running in conjuction with a form, with drop down menus so you can filter the users by the data they had already input to their profile in the extended fields, for example;

                    do you like cake? = y/n

                    do you like chips = y/n

                    do you like apples = y/n


                    i would like to have a form where i can search for users that like apples & chips but not cake...

                    Need to get learning PHP!

                    thanks, t.
                      • 3749
                      • 24,544 Posts
                      Sorry, I forgot that your data is in an extended field. I think this would do it:


                      <?php
                      /* same code up to here */
                      
                      $profile = $user->getOne('Profile');
                      $extendedFields = $profile->get('extended');
                      
                          /* get the user's zip code */
                          $userZip = $extendedFields->get('zip');
                      
                      /* same code after here */
                        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