We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    ScottyDelicious Reply #251, 19 years ago
    Ok, ejcross... I figured it out.
    The URL it is generating to view the users page is this:
    http://ejcross.com/ubc/index.php?id=50?service=viewprofile&username=ubctester

    Notice the two question marks in the URL?
    I always have friendly URLs and Friendly Alias Paths "on", so I never noticed this.

    Here is the fix if you are not going to user Friendly URLs.
    Create a new chunk with this content
    [+wlpe.message+]
    <div class="wlpeUserPage">
    	<div class="wlpeUserPagePhoto">
    		<a href = "[~[*id*]~]&service=viewprofile&username=[+view.username+]">
    			<img src="[+view.photo+]" alt="[+view.photo+]" title="[+view.username+]" height="100" width="100" />
    		</a>
    		<a href = "[~[*id*]~]?service=viewprofile&username=[+view.username+]">
    			<p class="wlpeUserPageUsername">[+view.username+]</p>
    		</a>
    	</div>
    	<div class="wlpeUserPageUserContent">
    		<p class="wlpeUserPageAttrUsername">Username: [+view.username+]</p>
    		<p class="wlpeUserPageAttrAge">Age: [+view.age+]</p>
    		<p class="wlpeUserPageAttrLastLogin">Last Login: [+view.thislogin+]</p>
    		<blockquote class="wlpeUserPageAttrComment">[+view.comment+]</blockquote>
    	</div>
    </div>
    

    On your users page, pass this chunks name as the value for &usersTpl.
    The key to this working is replacing
    [~[*id*]~]?service=viewprofile&username=[+view.username+]

    with
    [~[*id*]~]&service=viewprofile&username=[+view.username+]

    so you don’t have two question marks in the url.

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


      I send pointless little messages
      • 8619
      • 229 Posts
      Ok, cool! I have the friendly URL’s turned off right now as when I was testing the site, it would redirect to the root, which is MY site, not the testing one...duh!

      Thanks for the help there, and I’ll get onto the snippet tonight!
        • 28033
        • 925 Posts
        Okay, here’s the table structure that PPP uses...

        modx_web_user_*customnamegoeshere* -> This uses only the webuser field to match the user to the data.

        So, if I remember correctly, you said something about changing that to the "internalkey" value, and it would be WLPE-useable?

        ---------------------------------------------

        One question I have when a field has a list of choices, like in a list of checkboxes/radio inputs --- Let’s say in PPP right now, I have a list of "clubs" a user could belong to (they check off which ones they are a member of). Right now, I have all of them in seperate tables in that database, like this...

        fan_onceuponatime

        PPP puts in the image button file name, which is in the profile page like this...

        <img src="[fan_onceuponatime].png" />


        I can’t remember the exact syntax PPP uses right now, but you get the idea. If that doesn’t exist in the database, it doesn’t "show" in the profile page, because there’s no image link w/out the text.

        Did WLPE have an option for multiple checkboxes/radio inputs, or does it work generally the same as PPP?
          My Snippets
          -> PopUpChunk v1.0
          • 26435
          • 1,193 Posts
          ScottyDelicious Reply #254, 19 years ago
          @ Soshite:
          Each Checkbox should have a separate table column. A checkbox can only have two values, "on" if it is checked, or blank if it is unchecked. If you have an input on your form like this:
          <input type="checkbox" name="fan_group1" />

          if the user checks this box, WebLoginPE will store a value of "on" in the table column. If they did not check the box, the column will have no value.

          Take a look at the parameter &inputHandler in the documentation to see how you can use this for <select> options, checkboxes an radio buttons AND have WebLoginPE automatically check/select the user’s stored values.

          So if the user checked "fan_group1" and you have it in the &inputHandler parameter, the next time the user edits their profile, the checkbox will already be checked for them. It is smart like that.

          For your PPP table, you should be able to just change the name of the ’webuser’ column to ’internalKey’.
          If the PPP table uses the MODx table prefix, then that is good, just pass the table name as the value for &customTable and list all it’s columns in &customFields (separated by commas).

          Example:
          If your tables name is "web_user_customtable", and with the table prefix it is stored in the DB as "modx_web_user_customtable", you would use &customTable=`web_user_customtable`.

          If it was stored in the DB without using the table prefix (i.e. all your MODx tables look like modx_whatever, but the PPP table looks like "my_user_table" without the usual prefix) then you can use the new parameter &prefixTable=`0` (default is 1) and it will not auto append your MODx table prefix when it is looking for the table in &customTable.

          It is really very flexible.

          A lot of this stuff is in 1.3.0 and full documentation will accompany. It is essentially done except the documentation. I am hoping to post it in the repository tonight.

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


            I send pointless little messages
            • 28033
            • 925 Posts
            Oh, okay. So it works just like PPP did, but actually remembers the options. Thanks for clearing that up. smiley
              My Snippets
              -> PopUpChunk v1.0
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              I found this out by mistake:

              I was curious as to why the "Login" button came first, and then the "Forgot Password" button, etc...normally, I prefer "Login" on the right, but of course this is just my personal preference.

              I assumed that "Login" came first for usability, that way when the user "Tabs" from the last text input, they can tab right to the "Login" button...

              Well, I opted to use the tab index attribute to keep "Login" first, but still be able to reposition the button to the end of the line.

              Ultimately, I inadvertently discovered that when I tried submitting the form using the Enter key, it started taking me to the "Forgot Password" page! Turns out when submitting this way, using <button> tags all with the same name, the first <button> occurrence is what gets sent with the form submission.

              I have since moved the "Login" button back to the front of the line smiley
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 26435
                • 1,193 Posts
                ScottyDelicious Reply #257, 19 years ago
                Put this before the first button. It is total hackery and I am disappointed in myself for even suggesting this, but I tried it and it works.
                <button style="display:none" type="submit" id="emptyFormSubmit" name="service" value="login"></button>

                That makes this (hidden) button the first one in the list and the default executed button if the user presses enter.

                I’m sorry I can’t come up with something better than that for you. If you give me a day or two I could probably write some javascript for you to handle it?

                -sD-
                Dr. Scotty Delicious, Scientist DFPA.


                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 23491 ☆ A M B ☆
                  • 1,056 Posts
                  Nah, no worries. I can handle the JS if I wanted a dynamic element as a solution, but it’s not a big deal really. I mainly posted my experience here for others who might come across the same issue...
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.
                    • 26435
                    • 1,193 Posts
                    ScottyDelicious Reply #259, 19 years ago
                    Quote from: pixelchutes at Sep 13, 2007, 02:11 AM

                    ... I mainly posted my experience here for others who might come across the same issue...
                    Well in that case, thanks bro! I was not aware of it before you mentioned it.

                    By the way... just finishing the Docs for 1.3.0. Should be posting in the next 20 minutes! grin

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


                      I send pointless little messages
                      • 26435
                      • 1,193 Posts
                      ScottyDelicious Reply #260, 19 years ago
                      I have updated this snippet to version 1.3.0.
                      Download it from the MODx Repository.

                      09/13/2007 v. 1.3.0
                      1. New Parameter: &disableServices which will accept a comma separated list of services to disable. You can disable individual services like "deleteprofile" and "viewprofile" as well as entire types like "register" and "users".
                      2. New Parameter: &prefixTable If your custom table does not use the MODx table prefix, you can use &prefixTable=`0` (default is 1).
                      3. New Parameter: &usersList lets you specify multiple lists of users and a format for each list on &type=`users` and &type=`manager`.
                      4. New Parameter: &tableCheck When you run WebLoginPE, it checks for the existence of the extra user attributes table and creates it if it does not exist. In 1.3.0 it also creates some new Web Access Service Events for plugins if they do not already exist. By setting &tableCheck to 0 (default is 1) you can skip these checks for a little speed bump.
                      5. New Type: &type=`manager` displays a list of web users with links to edit their profile or delete their profile. Definitely use Access Permissions on this page!
                      6. Added MODx System Events for most services. See the API documentation for full details.
                      7. Print CSS by Dimitri Hilverda (Dimmy) added to documentation
                      8. You can now use MORE THAN ONE WebLoginPE per page!!!

                      BTW... When I uploaded the latest version to my site, I overwrote the "userimages" folder and all the images on my site got reset to the default image. Sorry sad

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


                        I send pointless little messages