We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    Post any template issues you have with the 1.3.1 release here.
      My Snippets
      -> PopUpChunk v1.0
      • 16550
      • 23 Posts
      I had a problem for saving profile in the simple mode that i don’t have with the profile mode. Maybe the description of the save button in the template used for editing templates in simple mode in not correct.

      Now i am stucked with other problems:
      -The "status" is not answering
      -The "country" cannot be changed in "profile mode"
      -Photo: When using this "profile" mode if you dont change anything concerning the user photo and you save, your picture disepar from the database, so, each time you want to update to profile, you have to download a new picture of yourself...
      -The age stuff is not working, when the birth date in unix mode is stored in the sql database.
        • 16550
        • 23 Posts
        I had another problem and i found a bug:

        when i lost my password everything works fine till the e mail and when i click on the link i found
        XXX/le-site/connection.html&service=activate&userid=21&activationkey=EuKeu7JprM

        instead of
        XXX/le-site/connection.html?service=activate&userid=21&activationkey=EuKeu7JprM

        So :
        in webloginclass.php

        around line 1639

        replace:

        // build activation url
        if($_SERVER[’SERVER_PORT’]!=’80’)
        {
        $url = $modx->config[’server_protocol’].’://’.$_SERVER[’SERVER_NAME’].’:’.$_SERVER[’SERVER_PORT’].$modx->makeURL($modx->documentIdentifier,’’,"&service=activate&userid=".$this->User[’id’]."&activationkey=".$newPasswordKey);
        }
        else
        {
        //$url = $modx->config[’server_protocol’].’://’.$_SERVER[’SERVER_NAME’].$modx->makeURL($modx->documentIdentifier,’’,"&service=activate&userid=".$this->User[’id’]."&activationkey=".$newPasswordKey);
        $url = $_SERVER[’HTTP_REFERER’]."&service=activate&userid=".$this->User[’id’]."&activationkey=".$newPasswordKey;
        }


        by

        // build activation url
        if($_SERVER[’SERVER_PORT’]!=’80’)
        {
        $url = $modx->config[’server_protocol’].’://’.$_SERVER[’SERVER_NAME’].’:’.$_SERVER[’SERVER_PORT’].$modx->makeURL($modx->documentIdentifier,’’,"?service=activate&userid=".$this->User[’id’]."&activationkey=".$newPasswordKey);
        }
        else
        {
        //$url = $modx->config[’server_protocol’].’://’.$_SERVER[’SERVER_NAME’].$modx->makeURL($modx->documentIdentifier,’’,"?service=activate&userid=".$this->User[’id’]."&activationkey=".$newPasswordKey);
        $url = $_SERVER[’HTTP_REFERER’]."?service=activate&userid=".$this->User[’id’]."&activationkey=".$newPasswordKey;
        }

        Am i Right??
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          This is a bit tricky; it all depends on if you’re using friendly URLs or not. If you’re not, the ? is already being used by the ?id=xx, while if you are then you need to start with the ?.
            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
            • 16550
            • 23 Posts
            Ok wink

            And so... Is anyone able to list all the changes you should do when you are using friendly url in the main webloginpe files. Is it listed elsewhere?
            I think it should help low-skilled guys like me...
            Well maybe i can try to do that if you help me finding where are the differents post dealing whith that.
              • 4041
              • 788 Posts
              This example is how I deal with that issue in my snippets and it may help you.

              // url and page link placeholders ///////////////////////////////
              if($modx->config['friendly_urls'] =="1"){
               $seperator ="?";
              }else{
               $seperator ="&";
              }
              $forum_page_link ="[~".$modx->documentIdentifier."~]";
              $modx->setPlaceholder('forumpagelink',$forum_page_link);  // [+forumpagelink+]
              $forum_page_link_wSep =$forum_page_link.$seperator;
              $modx->setPlaceholder('forumpagelink_wSep',$forum_page_link_wSep);  // [+forumpagelink_wSep+]
              //////////////////////////////////////////////////////////////////


              I then call my links and forms like so:
              forms:
              <form action=’[+forumpagelink_wSep+]view=admin&act=pruneadmin’ method=’post’>

              links:
              <a href=’[+forumpagelink_wSep+]view=admin&act=catadmin’>Categories Index</a> =
              w/o FURL: index.php?id=XX&view=admin&act=catadmin
              w/FURL: forum.html?view=admin&act=catadmin
                xforum
                http://frsbuilders.net (under construction) forum for evolution
                • 16550
                • 23 Posts
                Hi again thank you breezer for yopur help... i will try.

                Another bug in the webloginpe.class.php:
                around line 923
                the modx of Mike Reid have been copied twice... you should delete one:

                {
                // CREDIT: Mike Reid (aka Pixelchutes) for the string escape code.
                $charset=$modx->config[’modx_charset’];
                $generalElementsUpdate[] = " `".$field."` = ’".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES, $modx->config[’modx_charset’]))). "’";
                }
                  • 18878
                  • 210 Posts
                  Quote from: labourlingue at Aug 11, 2008, 06:48 AM

                  I had a problem for saving profile in the simple mode that i don’t have with the profile mode. Maybe the description of the save button in the template used for editing templates in simple mode in not correct.

                  Now i am stucked with other problems:
                  -The "status" is not answering
                  -The "country" cannot be changed in "profile mode"
                  -Photo: When using this "profile" mode if you dont change anything concerning the user photo and you save, your picture disepar from the database, so, each time you want to update to profile, you have to download a new picture of yourself...
                  -The age stuff is not working, when the birth date in unix mode is stored in the sql database.

                  labourlingue:

                  About updating the country:
                  I also tried changing the country in profile mode, but after you save it the initial country is displayed again. I thought the country was not being saved, but after I loaded the profile again, the new country was saved indeed. So I think the bug here is the output after you click on the save button. In my case, I changed the value from "Antartica" to "United States" and after saving the profile Antartica showed up again, and the html output was:
                  <option selected="selected" value ="223">United States</option>
                  ...
                  <option selected="selected" value ="8">Antarctica</option>

                  Really odd that 2 values appear as selected. This issue is also happening to the Gender field. Any suggestions on how to solve this one?

                  About the Photo being erased:
                  Your sugesstion mentioned here: http://modxcms.com/forums/index.php/topic,27858.msg170339.html#msg170339 was the solution. Some code was being duplicated.

                  In line 916, the buggy code:
                  {
                  	// CREDIT: Mike Reid (aka Pixelchutes) for the string escape code.
                  	$charset='"'.$modx->config['modx_charset'].'"';
                  	$generalElementsUpdate[] = " `".$field."` = '".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES, $modx->config['modx_charset'])))."'";
                  }
                  			{
                  				// CREDIT: Mike Reid (aka Pixelchutes) for the string escape code.
                  				$charset=$modx->config['modx_charset'];
                  				$generalElementsUpdate[] = " `".$field."` = '".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES, $modx->config['modx_charset']))).	"'";
                  			} 
                  		}  


                  should be changed to this:
                  {
                  	// CREDIT: Mike Reid (aka Pixelchutes) for the string escape code.
                  	$charset='"'.$modx->config['modx_charset'].'"';
                  	$generalElementsUpdate[] = " `".$field."` = '".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES, $modx->config['modx_charset'])))."'";
                  }
                  		}