We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2912
    • 315 Posts
    Found a typo in the snippet file.

    Line 118 reads:
    if ($loHomeId === '') $loHomeId = $modx->config['site_start'];


    should be:
    if ($loHomeId == '') $loHomeId = $modx->config['site_start'];


    I was finding the cancel button on my register page wasnt working unless I made the &loHomeId parameter and active document.
      BBloke
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Quote from: BBloke at Aug 27, 2007, 11:19 AM

      Found a typo in the snippet file.

      @BBloke,

      PHP’s Comparison Operators allow for Identical type comparison:
      http://us2.php.net/manual/en/language.operators.comparison.php


      $a == $b Equal TRUE if $a is equal to $b.
      $a === $b Identical TRUE if $a is equal to $b, and they are of the same type. (introduced in PHP 4)

      @sD,

      Is the use of such operator intentional? Sounds like this is conflicting in BBloke’s case?
        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
        @BBloke:
        As Pixelchutes said, it is not necessarily a typo as "===" is a PHP operator, but It was an unintentional slip of my fingers and, as you found out, needs to be "==" to function properly.

        There are 3 instances of this (lines 118, 170, & 176).
        They should all be "==". I have committed this change and it will reflect in the next release.

        @Pixelchutes:
        No, it was not intentional. As BBloke points out, this can break the script.

        -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
          @sD, Your continuous turn-around is both quick and exciting! Thank you!
            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 27, 2007, 12:50 PM

            @sD, Your continuous turn-around is both quick and exciting! Thank you!
            That is the beauty, AND tragedy of FOSS.
            Peer review means that bugs can be fixed quickly and feature requests can be added as quickly, but keeping up with the most current version can be a challenge while things are being fixed and added. undecided

            -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
              • 2912
              • 315 Posts
              @pixelchutes
              Thanks for that info. I’m not that deep into php although I do take a small interest. Any knowledge is great knowledge. I’ll try and behave myself a little more ;

              @sD
              Great and quick turn around smiley Its greatly appreciated. I do feel some guilt on breaking things..
                BBloke
                • 26435
                • 1,193 Posts
                LOL laugh
                BBloke! you didn’t break anything, you just helped me find something that was not working that I did not know about.
                Please don’t feel guilty.
                I thank you for helping me with this. People like you make this snippet more useful to everyone. 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
                  • 20289
                  • 958 Posts
                  After the avatar issue i tried to upload a new *.JPG file as of my avatar but it gave me the error:

                  File user photo must be of mime-type "image/jpeg", "image/gif", or "image/png".

                  so i just changed the file type to GIF and it worked... the first avatar aslo was in .JPG format. maybe its something related to the file types that crashes the db or maybe its because of numerical name of the first avata namer? or something else?... sometime stupidest things cause the error that makes confusion! lol
                    [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                    [td][Wiki] [Persian support forum]
                    [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                    [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
                    • 26435
                    • 1,193 Posts
                    Ok, just working on the last details, but here is what is in store for WebLoginPE 1.2.0 (coming 8/28).

                    1. Case insensitive login.
                    2. Veryify ANY field in your form. Any field with the name attribute name="[fieldname]confirm" is checked against [fieldname].
                    <input type="text" name="email" value="[+post.email+]" />
                    <input type="text" name="emailconfirm" value="[+post.emailconfirm+]" />
                    
                    <input type="password" name="password" value="" />
                    <input type="password" name="passwordconfirm" value="" />

                    3. New &type. &type=`users`. The default display will show all the web users with a usersTpl template. in the default usersTpl, the user’s image and username are links to view their full profile where you can send the user a message.
                    4. New parameter for super-fine control of inputs. &inputHandler=`Label:domID:fieldname:field type:Option(value),Option2(value2)`. Use double bars to separate inputs (for inputs that are not in the standard web_user_attributes table, remember to specify them in &cutomFields:
                    &customFields=`website,aim,msn,address1,city,favorite_color,demographic,emailprivate,aimprivate,msnprivate`
                    
                    &inputHandler=`Favorite Colors:userProfileFavoriteColor:favorite_color:select multiple:Red(red),Blue(blue),Green(green),Black(black),Orange(orange),Yellow(yellow)||Age Group:userDemographic:demographic:radio:Less than 13(1),14 - 18(2),19 - 30(3),31 - 40(4),41-50(5),51-65(6),65 or older(7)||Keep my email private:userProfileEmailPrivate:emailprivate:checkbox:()||Keep my AIM account private:userProfileAIMPrivate:aimprivate:checkbox:()||Keep my MSN account private:userProfileMSNPrivate:msnprivate:checkbox:()`
                    

                    &inputHandler loops over every option in the form field (select, select multiple, radio, or checkbox) and compares it to the entries stored in the user’s table. If the user has any of the options, radios or checkboxes selected, it will output selected="selected" or checked="checked" in the fields. You can see in the code below that I had "red" and "black" selected as my favorite_colors. &inputHander also sets a placeholder [+form.fieldname+] (example [+form.favorite_color+]) which includes the entire label, field, options and all. One of the placeholders the code above will generate is [+form.favorite_color+]. that will output:
                    <label for="userProfileFavoriteColor" id="userProfileFavoriteColorLabel">Favorite Colors
                    <select multiple id="userProfileFavoriteColor" name="favorite_color[]">
                    	<option selected="selected" value ="red">Red</option>
                    	<option value ="blue">Blue</option>
                    	<option value ="green">Green</option>
                    	<option selected="selected" value ="black">Black</option>
                    	<option value ="orange">Orange</option>
                    	<option value ="yellow">Yellow</option>
                    </select>
                    </label>
                    

                    So in your form where you would put your label->input->etc... you just put the form placeholder. You have to use this placeholder if you want the checks checked and the selects selected.
                    5. You may have noticed the xxxprivate fields above. That is also a new feature. Lets take the email column in the attributes table for example. if you put `emailconfirm` in your &customFields and then assign it a checkbox in &inputHandler, when a user checks that checkbox on their profile, any time another user views their profile, it will say "Private" instead of their actual email. You can do this for ANY field. The demo site will have an example of this.
                    6. New parameter &userImage. Set Max upload size (in bytes), width(px), and height(px). Format is &userImage=`MAXFILESIZE,WIDTH,HEIGHT`. Example: &userImage=`105000,250,250`

                    There are a lot of small efficiency improvements as well, hopefully to pick up some speed.

                    -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
                      • 25663 MODX Staff
                      • 12,272 Posts
                      I like the confirm bit, but I’d prefer to see it labelled ".confirm" ... picky I know...

                      How about validations? tongue
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me