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
    @pixelchutes: Errmmm... That was a long post.
    I gotta admit that I don’t agree with your table logic. that looks like either a separate table for each user to keep the tables clean (but cluster fuck the DB) or a huge tangle of an unorganized table. I don’t like either option and I am probably not going to implement this. The current way is easy if you think about it logically. Pick a custom table name (like "my_web_users_stuff") and pass it as a parameter in &customTable. Then all the fields you could possibly want can be passed as parameters (comma separated list) in &customFields. any time you need to access them in a form or template just use [+user.fieldname+]. Any time you want to store the value, post it in a form input <input type="text" name="fieldname" />

    That keeps the tables nice and clean and easy to retrieve.

    Every column is created as a VARCHAR(255). if you need something different, you gotta do it manually for now. That is where you cross the line between ease of use and ultimate customability. I will work on customizing the MYSQL field creation (and just making the default varchar(255) )

    Quote from: JaMeS420 at Aug 24, 2007, 04:29 PM

    Im having a hard time getting the viewprofile service to work. If anyone has any pointers they would be greatly appreciated.
    If your profile page ( [!WebLoginPE? &type=`profile`!] ) is doc ID 54 (example) you need to make a link like this
    <a href="[~54~]?service=viewprofile&username=theUsersName">theUsersName</a>


    Quote from: Konsum at Aug 24, 2007, 04:47 PM

    Quote from: Dr. at Aug 19, 2007, 03:26 AM


    TODO.
    1. Fix DOB and Last Login so the unset value is not the UNIX epoch.
    2. Add TOS agreement which can now be set as "REQUIRED" with the new &regRequired parameter.

    We’ll see about finishing those tomorrow, I just forgot about them and didn’t remember until after I posted the update and looked at this thread again.

    Just a little reminder for the TOS grin

    And there’s another question: what about a possibility to force the user to enter his e-mail address twice in order to prevent typing errors?
    The TOS is in there. has been since 1.0.2!

    email idea sounds good.

    -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
      Quote from: Dr. at Aug 24, 2007, 05:13 PM

      @pixelchutes: Errmmm... That was a long post.
      I gotta admit that I don’t agree with your table logic. that looks like either a separate table for each user to keep the tables clean (but cluster fuck the DB) or a huge tangle of an unorganized table. I don’t like either option and I am probably not going to implement this. The current way is easy if you think about it logically. Pick a custom table name (like "my_web_users_stuff") and pass it as a parameter in &customTable. Then all the fields you could possibly want can be passed as parameters (comma separated list) in &customFields. any time you need to access them in a form or template just use [+user.fieldname+]. Any time you want to store the value, post it in a form input <input type="text" name="fieldname" />

      That keeps the tables nice and clean and easy to retrieve.

      @sD-

      Thank you for your feedback. In retrospect, I can agree with your position. Logically, it still makes more sense to store in a custom defined table, complete with proper data types to boot! However, I still think that leveraging the table in some fashion could be doable/beneficial, maybe just not for WLPE.

      Really, my idea was sparked thinking of possible ways to handling profile attributes outside of just TEXT inputs...

      For example, how would you suggest handling predefined profile options with WLPE (e.g. timezone, favorite music, etc ).

      There are times when you may need to define a select menu, radios, or checkboxes opposed to simply "text" inputs. Do you think something like this could even be possible with this great snippet you’ve created? In addition, what if you wanted TEXTAREA opposed to just TEXT type?

      This may be outside the bounds of what WebLoginPE aims to accomplish, but since you were so quick to integrate "extended profiling", I was curious to know the limitations.
        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
        Quote from: pixelchutes at Aug 24, 2007, 05:47 PM

        @sD-

        Thank you for your feedback. In retrospect, I can agree with your position. Logically, it still makes more sense to store in a custom defined table, complete with proper data types to boot! However, I still think that leveraging the table in some fashion could be doable/beneficial, maybe just not for WLPE.

        Really, my idea was sparked thinking of possible ways to handling profile attributes outside of just TEXT inputs...
        What comes to your mind when you think of an example where this would be beneficial? What are you going to pass in a form that does not conform to VARCHAR (int or string)?

        Quote from: pixelchutes at Aug 24, 2007, 05:47 PM

        For example, how would you suggest handling predefined profile options with WLPE (e.g. timezone, favorite music, etc ).
        I would suggest doing it in your form template chunk with a <select>.

        Quote from: pixelchutes at Aug 24, 2007, 05:47 PM

        There are times when you may need to define a select menu, radios, or checkboxes opposed to simply "text" inputs. Do you think something like this could even be possible with this great snippet you’ve created?
        if you need to predefine these, do it in a chunk, or better yet, make some TVs, then put that chunk in the form template (easy code reuse) Check boxes are going to have a value of "on" or null which can be stored in a VARCHAR column, radio inputs have a value of the item selected or null which can be stored in a VARCHAR column.

        Quote from: pixelchutes at Aug 24, 2007, 05:47 PM

        In addition, what if you wanted TEXTAREA opposed to just TEXT type?
        The only issue ATM is if the textarea contained more than 255 chars.

        Quote from: pixelchutes at Aug 24, 2007, 05:47 PM

        This may be outside the bounds of what WebLoginPE aims to accomplish, but since you were so quick to integrate "extended profiling", I was curious to know the limitations.
        I don’t think "WHAT you want to do" is outside the limitations, it is just "HOW you want to do it".

        -sD-
        Dr. Scotty Delicious, Scientist.
          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
          Quote from: Dr. at Aug 24, 2007, 06:06 PM

          What comes to your mind when you think of an example where this would be beneficial? What are you going to pass in a form that does not conform to VARCHAR (int or string)?
          By "TEXT inputs", I was implicitly referencing HTML input type of ’text’:
          <input type="text" ... />
          I was not implying the need for storing BINARY in BLOB datatypes or anything along those lines, etc. Sorry for the confusion.
          It is obviously MUST be Friday, for some reason I thought WebLoginPE was restricted to input="text"... don’t ask me why!

          Quote from: Dr. at Aug 24, 2007, 06:06 PM

          I would suggest doing it in your form template chunk with a <select>.
          Again, TGIF smiley This makes perfect sense. I assume this would also account for:
          <select multiple>...</select>


          Quote from: Dr. at Aug 24, 2007, 06:06 PM

          The only issue ATM is if the textarea contained more than 255 chars.

          ...Even if web_user_attributes_extended custom column is of type TEXT? I’m not sure I see the issue?

          Quote from: Dr. at Aug 24, 2007, 06:06 PM

          I don’t think "WHAT you want to do" is outside the limitations, it is just "HOW you want to do it".

          HOW do you store multiple values in the extended table? Do you use some form of delimiter? Does WLPE allow for editing "extended" profile columns as well? Just curious how, if you are Editing your profile, WLPE handles the mapping of said checkboxes/radios when pre-populating
            Mike Reid - www.pixelchutes.com
            MODx Ambassador / Contributor
            [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
            ________________________________
            Where every pixel matters.
            • 16194
            • 103 Posts
            Allright, I added now a chunk named TOS which contains - right - my Terms. Then I put &tosChunk=`TOS` to the snippet call (after looking into the snippet code, it’s not yet in the docs). Well, all I’m gettin displayed is "TOS" ... is this the supposed behaviour?
              Impossible is nothing - with ModX
              • 26435
              • 1,193 Posts
              Quote from: pixelchutes at Aug 24, 2007, 06:51 PM

              Again, TGIF smiley This makes perfect sense. I assume this would also account for:
              <select multiple>...</select>

              Well... no.
              A multiple select is going to post as an array. I suppose I could add an if (is_array($field)) clause, but then what is WebLoginPE supposed to do with that info? implode it into a CSV? What do you do with array data that is now a comma separated string? It is just a script and can’t predict that type of usage.
              The good news is that since we have had interactions in the last week or two I have been reading your posts here. You are a clever and very helpful dude. I am positive you can think of a more clever way to post multiple choices than with a <select multiple> form input.

              Quote from: pixelchutes at Aug 24, 2007, 06:51 PM

              Quote from: Dr. at Aug 24, 2007, 06:06 PM

              The only issue ATM is if the textarea contained more than 255 chars.
              ...Even if web_user_attributes_extended custom column is of type TEXT? I’m not sure I see the issue?
              I am just saying, there is no problem except that the field would be limited to 255 characters. if a user filled out a textarea with like 300 characters, anything after 255 would be truncated.

              Quote from: pixelchutes at Aug 24, 2007, 06:51 PM

              Quote from: Dr. at Aug 24, 2007, 06:06 PM

              I don’t think "WHAT you want to do" is outside the limitations, it is just "HOW you want to do it".

              HOW do you store multiple values in the extended table? Do you use some form of delimiter? Does WLPE allow for editing "extended" profile columns as well? Just curious how, if you are Editing your profile, WLPE handles the mapping of said checkboxes/radios when pre-populating
              You don’t store multiple values in a column. That is just poor organization. each value should have it’s own column to facilitate accurate and predictable retrieval of data.

              Editing "extended" profile columns? Of course! grin
              Lets say you have this call on your profile page:
              [!WebLoginPE? &type=`profile` &customFields=`city,timezone,url,favorite_color` &profileTpl=`myProfileChunk`!]

              then myProfileChunk would include:
              {...}
              City:<br />
              <input type="text" name="city" value="[+user.city+]" /><br />
              Time Zone:<br />
              <select name="timezone">
                  <option selected="selected" value=[+user.timezone+]></option>
                  <option value="EST">Eastern Standard Time</option>
                  <option value="CST">Central Standard Time</option>
                  <...>
              </select><br />
              Your Website:<br />
              <input type="text" name="url" value="[+user.url+] /><br />
              Favorite Color:<br />
              Red <input type="radio" name="favorite_color" value="Red">
              Blue <input type="radio" name="favorite_color" value="Blue">
              Black <input type="radio" name="favorite_color" value="Black">
              Spoon <input type="radio" name="favorite_color" value="Spoon">
              <br />
              You last chose [+user.favorite_color+] <input type="radio" name="favorite_color" value="+user.favorite_color+]" checked="checked">
              {...}

              The important part is the &profileTpl !
              If it contains inputs with your custom fields, they are editable. Devilishly clever isn’t it?
              Mapping of checkboxes and radios is not perfected yet. The main problem is that there is no way WebLoginPE can know what type of data you might be using. My best suggestion is to map them with javascript, and have a hidden field containing the value in case they don’t change it or javascript is disabled. Otherwise, the hackneyed trick above for radio options, albeit stupid, works.

              -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
                Quote from: Konsum at Aug 24, 2007, 07:30 PM

                Allright, I added now a chunk named TOS which contains - right - my Terms. Then I put &tosChunk=`TOS` to the snippet call (after looking into the snippet code, it’s not yet in the docs). Well, all I’m gettin displayed is "TOS" ... is this the supposed behaviour?
                Ahhrrggg.... crap!
                I must have slapped it together too quickly.
                in the WebLoginPE snippet code, change line 56 from:
                $tosChunk = isset($tosChunk) ? $tosChunk : $wlpeTos;

                to this:
                $tosChunk = isset($tosChunk) ? $wlpe->Template($tosChunk) : $wlpeTos;


                -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
                  Pixelchutes!!!
                  I might have a solution for you! laugh
                  I am at work right now, but I will give it a try when I get home and let you know how it works.

                  -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
                    Really? Let’s hear it!
                      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
                      Quote from: pixelchutes at Aug 25, 2007, 12:57 PM

                      Really? Let’s hear it!
                      Still working out the details in my head (I will get the fine details done in TextMate when I get home).
                      Something like
                      if (is_array($_POST[$field])
                      {
                          $field = implode('||', $_POST[$field])
                          {...}
                      }

                      The multiple data could be stored in the database as value1||value2||value3||etc...
                      Then I would make another function that can be passed in the snippet as a parameter, something like &input or whatever.
                      The basic syntax would be name:fieldtype:option1,option2,option3.
                      &input[0]=`inmypocket:select:change,pendrive,knife,widget,phone`
                      &input[1]=`color:radio:red,blue,black,spoon,rainbow`

                      WLPE would loop through those and instead of setting a placeholder for [+user.inmypocket+] that contains the value, it would loop over all your options that were set and put them in an <option> block, then explode the list stored in the column and add into the <option> tag a selected="selected".
                      With color, it would loop over input[1] and put each option in an<input type="radio" name="color" value ="$value" /> and add a checked="checked" to the ones corresponding to the column data.

                      THEN, set the placeholders for the entire chunk of HTML in [+user.inmypocket+], so in your profileTpl, you would put [+user.inmypocket+] where you wanted the whole select block to show up.

                      This is just an idea for now, but I am sure I can get it worked out in a few hours when I get home later 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