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 #1, 19 years ago
    This thread should be used by advanced users providing code patches and fixes for WebLoginPE 1.3.0.

    -sD-
    Dr. Scotty Delicious, 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 #2, 19 years ago
      password confirm mismatch, OnWebChangePassword error, and Password activation error handling.
      Submitted by Pixelchutes:
      http://modxcms.com/forums/index.php/topic,18271.msg114872.html#msg114872

      -sD-
      Dr. Scotty Delicious, 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 #3, 19 years ago
        &notifyTpl is sending "[+post.whatever+]" instead of the expected value.
        Submitted by Dr. Scotty Delicious:
        http://modxcms.com/forums/index.php/topic,18351.msg114964.html#msg114964

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


          I send pointless little messages
          • 18619
          • 8 Posts
          In function ShowUserProfile, on appropriate places
          $modx->setPlaceholder(’form.’.$name, $ph);
          shold be replaced by:
          $modx->setPlaceholder(’form.’.stripslashes($name), $ph);
          Otherwise, it makes a mess with non-ASCII chars.
          Matija
            • 28033
            • 925 Posts
            Quote from: matija at Nov 01, 2007, 05:06 AM

            In function ShowUserProfile, on appropriate places
            $modx->setPlaceholder(’form.’.$name, $ph);
            shold be replaced by:
            $modx->setPlaceholder(’form.’.stripslashes($name), $ph);
            Otherwise, it makes a mess with non-ASCII chars.
            Matija

            This should go in the Bug Fixes topic. This is only for Scotty to post fixes to his script inbetween major/minor releases.
              My Snippets
              -> PopUpChunk v1.0
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I have added the ability to use an external config file instead of long involved parameter lists in the snippet call.

              I added this block of code at the very beginning of the snippet code:
              **
                      * Dec 3 2007 sottwell
                      * Use an external file instead of parameters in the snippet call
                      * Add "config" folder to the assets/snippets/webloginpe folder
                      * Put your name.config.php file there with a list of parameters
                      * $lang = 'de';
                      * $type = 'users';
                      * etc...
                      * Use &config=`name` in the snippet call
                      * [!WebLoginPE? &config=`usersde`!]
                      * The file 'assets/snippets/webloginpe/config/usersde.config.php' will be loaded.
                      */
                      
                      if(isset($config)) {
                          if(file_exists('assets/snippets/webloginpe/config/'.$config.'.config.php')) {
                              include_once 'assets/snippets/webloginpe/config/'.$config.'.config.php';
                          }
                      }

              This has not been tested extensively, but if the lines in the config file follow the same pattern as the snippet parameters there should be no difference. The parameter processing code in the snippet should just see the variables as if they had come from the parameter list.

              @Soshite - from the first post:

              This thread should be used by advanced users providing code patches and fixes for WebLoginPE 1.3.0.

              -sD-
              Dr. Scotty Delicious, DFPA.
                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
                • 32699 ☆ A M B ☆
                • 427 Posts
                Symptom:
                During User Registration date was being saved as a single int instead of a full unix time stamp as expected.

                Cause:
                After reading the register function I noticed that MakeDateForDb was never called

                Snippet call:
                WebLoginPE? &type=`register` &regType=`instant`


                Quick Fix:

                Open webloginpe.class.php

                Around line 583 look for:
                	// If all that crap checks out, now we can create the account.


                Just above it place:
                ///credit: W. Shawn Wilkerson: process dates into proper unix timestamp 
                if ($dob!='') // don't try to format an empty string.
                {
                	$dob = $this->MakeDateForDb($dob);
                }
                


                There may be a better place for this change, but I’ll leave that up to Scotty for the next version.

                If this was already mentioned, 45 minutes of searching did not show it.

                Hope this helps someone
                  Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                  Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Problem with that is that a Unix timestamp only goes as far back as 1970. I was born in... shall we say several years before that. Dating a document or a transaction using a timestamp is OK (that’s the definition of a "timestamp", after all), but birthdates or other historical events don’t work too well as Unix timestamps.
                    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
                    • 32699 ☆ A M B ☆
                    • 427 Posts
                    Done this way it counts backwards and is negative. As it is NOT stored in the database as a time stamp but as an int it solves the issue.

                    My birthdate is correctly shown as -121546800

                    I was born in 66.

                    This works fine. If the timestamp was stored as an actual time stamp it would not work, which is probably why modx core does not actually use timestamps in the db either.

                      Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

                      Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
                      • 31471
                      • 206 Posts
                      With this simple patch you can keep the image’s proportions after uploading.
                      In the snippet call you don’t tell the exact parameters of the userimage, but the maximum width and maximum height for it.
                      Using the &userImage=`500000,150,150` parameter, the snippet fits the image in these limits. If the picture is a portrait, it’s height will be 150px and the width will be less. If your image’s dimensions are both less than 150px, it remaines untouched.

                      In webloginpe.class.php find this:
                      // Get dimensions and set new ones.
                      		list($width, $height) = getimagesize($userImage);
                      		$new_width = $imageAttributes[1];
                      		$new_height = $imageAttributes[2];
                      
                      		// Resample

                      After it paste this:
                      $xpercent = $new_width / $width;
                      $ypercent = $new_height / $height;
                      if ($xpercent < 1 || $ypercent < 1) {
                      	if ($xpercent < $ypercent) $new_height = $height * $xpercent;
                      	else $new_width = $width * $ypercent;
                      	}
                      else { $new_width = $width; $new_height = $height; }


                      That’s it.

                      Of course in your templates you can’t have width and height stuff in the <img> tags!