We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    Quote from: sottwell at Aug 06, 2008, 09:41 AM

    Or the correct Default%20User, maybe. It is considered very bad practice to use an underscore in a URL, since the underscore can get hidden by the border of the browser’s address bar. Hyphens are preferred, or an appropriate URL encoding.

    Sure, that works. smiley

    Also, I found another issue. WLPE inserts in...

    <option selected="selected" value =""></option>


    for the first value. Now, that gives a warning. Is there a way to make that say...

    <option selected="selected" value ="">-----</option>


    ...or something similar? I can’t seem to find how to edit it.

    (This is in the profile editor, btw.)
      My Snippets
      -> PopUpChunk v1.0
      • 3749
      • 24,544 Posts
      Quote from: Soshite at Aug 06, 2008, 09:38 AM

      Something else I noticed. In HTML Tidy, WLPE gives an warning when a username has a space in it.

      Is there a way to have WLPE rewrite the URL so something like Default User = Default_User?

      Easy enough, but you have to modify it in the same way during the login process or it won’t match.

      Another solution would be to disallow usernames with spaces.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It’s all in the WebLoginPE templates. You can make your own form template (the documentation that comes in the docs folder with WebLoginPE calls them "views") in a chunk, and use a parameter in the snippet call to tell it to use your chunk instead of the default template.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 3749
          • 24,544 Posts
          Quote from: vhollo at Aug 06, 2008, 05:35 AM

          Hi BobRay!
          I needed two user lists on the same page, both with working viewProfile links (each with its own tpl).
          Did you try this?
          In every tpl’s and forms belonging to an instance modify every placeholder this way: [+instname.view/post.placeholder+] and in the <a href> tags add &instance=instname to the links. Plus add <input type="hidden" name="instance" value="instname" /> in the forms to let the instancename been posted. So the form doesn’t get processed two times.

          No, because what I did was so much quicker and easier. wink

          If you let the snippet write instancename in the form/tpl, it would end up with the second instance’s name in both forms/tpls. That’s why you must hardcode the instname to your forms and tpls.

          Hmmm.... didn’t I just say that? wink

          Alternatively give a try to not "instancing" both snippets, only one of them.

          I can’t, because I don’t know which one I want to turn off until after the user clicks on one. Also, there could easily be more than two WLPE calls on the page. The method I used will work no matter how many there are.

          I’m sorry if my post wasn’t clear. The method I used works perfectly and I posted as an easy solution for others with the same problem. It might be a worthy addition to the code since I don’t think it will break any existing implementations, but we won’t know how well it will solve other problems with multiple snippet calls until people try 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
            • 31471
            • 206 Posts
            shocked

            Aren’t those placeholders that appear in both instance show the same value?
            Maybe I did "overwork" my solution with differentiating the placeholders...
              • 3749
              • 24,544 Posts
              Quote from: vhollo at Aug 06, 2008, 12:36 PM

              shocked

              Aren’t those placeholders that appear in both instance show the same value?
              Maybe I did "overwork" my solution with differentiating the placeholders...

              In my method, you don’t alter any of the placeholders. You just set the &wlpeInstance parameter in the snippet call and also set it as a parameter in any form call or link so it will show up in the $_REQUEST. Then you compare the two in the snippet code to find out which snippet call is executing.
                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
                • 31471
                • 206 Posts
                The fun with my method is it’s only working because I altered every placeholders.
                Otherwise my switch case leaves the processing toward the class in every instances when no service is set. grin
                  • 3749
                  • 24,544 Posts
                  Quote from: Soshite at Aug 05, 2008, 12:12 PM


                  http://code.google.com/p/webloginpe/

                  Just set that up. I’ve never messed around with that, so anyone that wants to help with it, feel free to PM/post your Google account, and I’ll add you.

                  BTW, how do you add code to that? Can you do it via the browser, or do you need a program?

                  (Looks like this will allow us to track the bugs/fixes, so multiple people can help out. smiley)

                  Shoshite,

                  Here’s some information about importing an SVN archive to google Code: http://www.therightstuff.de/2008/05/12/Importing+Subversion+Repositories+To+Google+Code.aspx

                  You first need to create an SVN repository on your local machine with Subversion, either at the command line or using an SVN client like TortoiseSVN . Then you need to dump it to file using the command line SVN dump command. Then follow the instructions here.

                  Using SVN is pretty easy once it’s set up, but creating and moving SVN archives is something of a challenge.

                  Let me know if you want me to give it a shot.
                    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
                    • 28033
                    • 925 Posts
                    So I would create C:\Subversion\projects\WebLoginPE, and then click Create Repository here... with TortoiseSVN, right?

                    Then do I run the commands, get things set up, then upload the WLPE files?
                      My Snippets
                      -> PopUpChunk v1.0
                      • 3749
                      • 24,544 Posts
                      Quote from: Soshite at Aug 06, 2008, 08:50 PM

                      So I would create C:\Subversion\projects\WebLoginPE, and then click Create Repository here... with TortoiseSVN, right?

                      Then do I run the commands, get things set up, then upload the WLPE files?

                      Right. But it’s a little more complicated than that.

                      Before doing anything else, it’s important to first set the eol property in TSVN to "native" so the files will always have the proper end-of-line characters no matter what system the user is on
                      .
                      Go to TSVN menu | Settings | General | Edit

                      That will pop up the config file for editing.

                      Make sure this line is *not* commented out:
                      enable-auto-props = yes

                      Then add this at the end of the file:

                      *.php = svn:eol-style=native
                      *.txt = svn:eol-style=native
                      etc. for other file types of files in the collection

                      Also add (or uncomment if it’s there)

                      svn:keywords Date Author Revision

                      In case we want to use them later.

                      Now you’re done with the config file. Save it and exit TSVN.

                      Then go to an empty folder and create the repository ("create repository here").

                      Then create a temporary folder to hold the files. Make three subdirectories: trunk, tags, branches.

                      Put your wlpe files in the trunk subdirectory.

                      Go up one level to the temp directory.

                      Right click there and select "import" from the TSVN menu. Enter the path to the *repository* you created above (not where the files are). You should see the files being imported. BTW, this step failed for me because the wlpe php files have inconsistent line endings. I loaded them into my editor, PhpEd, which normalizes the eol characters and and is set to give Unix line endings (kind of a MODx standard). and saved them. That fixed it.

                      Now the files are in the repository. If you select "repo browser" and give the path to the repository, you should be able to see them.

                      You can go to another temp directory (empty) and select "checkout" to get version-controlled versions of the files back out of the repository. This isn’t necessary but it’s a comfort to see them. Select the trunk directory in the repository when you do this. Note that neither of these directories will be the official working directory you use in the future. To get that, you’ll go to the directory, click "checkout" and give the URL of the Google code repository (after you get the files there). If you right click on the files and select "properties" on the TSVN menu (not the windows menu if you’re on windows) you should see the properties you set earlier.

                      You can delete or empty this dir. now since you don’t need it.

                      Now, you want to do the dump of the repository using the directions here: http://www.shokhirev.com/nikolai/programs/SVN/backup_load.html

                      This creates the file you’ll upload to Google Code after setting the rev number to 0 at the bottom of the page.

                      Hope this all makes sense.

                      Bob




                        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