We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34017
    • 898 Posts
    What are you wanting to accomplish? I dont think i understood your request at first.

    Chuck
      Chuck the Trukk
      ProWebscape.com :: Nashville-WebDesign.com
      - - - - - - - -
      What are TV's? Here's some info below.
      http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
      http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
      • 36451
      • 264 Posts
      I’ll have to improve my english.

      When editing profiles there are not only text fields in the form, there are also some <textareas> for longer descriptions. Let’s say "comments" from the table webuser_attributes. I provide my users with the possibility to insert <strong>bold</strong> text and outline the text with paragraphs, unordered or ordered lists and such.

      I do this with a very lightweight RTE called "widgEditor", which is a simple JS replacement for textareas (like TinyMCE). Works fine when my users use the form to put their data in. I use Susan Ottwells "WebEditProfile" snippet for that. Why? The input gets stored in MySQL with all the html tags.

      I use ppp to administrate/maintain these profiles. When I output the data to the ppp admin form, ppp destroys all html tags. I want ppp to output (and store) these fields "as they are", without stripping html tags! What now happens:


      <p>First paragraph.</p><p>Second paragraph.</p>
      becomes
      First paragraph.Second paragraph


      ppp strips all html tags. Do you know what I mean?
        • 34017
        • 898 Posts
        So the database is saving the text into the database with the HTML tags?

        I wonder if $modx->getChunk or $modx->setPlaceHolder strips the HTML from the output??

        I know the function where ppp outputs the information as an advanced list is ppp_listUsersAdvanced in ppp.resources.php. The lines that do all of the populating are:
        $rs = $modx->db->query($sql.$where.$groupBy.$orderBy.$limit);
        
                // For each row found
        	while($row = $modx->db->getRow($rs)) {
        	$key = '';
        	$value = '';
        
        		//Get the chunk specified
        		$chunkTpl = $modx->getChunk($chunk_tpl);
        
        
        			//For each attribute found (email, zipcode, dogs name, etc., populate that placeholder with the value (ie [+dogs_name+] becomes "sparky"
        			foreach($row as $key => $value) {
        				$chunkTpl = str_replace('[+' . $key . '+]', $value, $chunkTpl);
        			}	
        
        		// Add this users info into the list being created
        		$createList .= 	$chunkTpl;
        	}
        
        //Populate the placeholder on the page (turn [+ppp_list+] into the output previously created
        $modx->setPlaceHolder($listName, $createList);	
        
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 28033
          • 925 Posts
          EDIT: I finally got rid of the file upload bug. However, I found another bug.

          It seems ppp.inc.php overrides whatever value you have for saving files in the server. I had to manually edit it get it to save in the directory I wanted it to be in.

          On another note, is there a way to make the server give 777 CHMOD permissions to folders when it creates the folders for each user (for avatar purposes). My server HAS to be 777 for programs to access it (for uploading stuff), so I’ll get a 404 error if it can’t do it.

          (On a side note, could there be a way to have it where if a user ONLY edits a non-required field, it can still show the "Information edited successfully" text, instead of the "This form was already submitted successfully. There is no need to submit your information multiple times."?)

          EDIT 2: Can someone give me an example of how to create a radio list using this snippet and EForm?
            My Snippets
            -> PopUpChunk v1.0
            • 28033
            • 925 Posts
            Another issue I noticed...

            If some has FURL set up to where it rewrites the page name, as well as the folder structure (modx/index.php instead of something like modx_index.php), in the EForm template, it needs to be like this...

            <form method="post" id="inputForm" name="inputForm" action="/[~[*id*]~]" enctype="multipart/form-data"> 


            This also affects other forms and whatnot, so keep an eye out if you use both of the FURL rewrites.

            EDIT: This also affects the INPUT link in the "Admin" page (need to edit the ppp.inc.resources file).
              My Snippets
              -> PopUpChunk v1.0
              • 4385
              • 372 Posts
              I kinda solved my problem, with the missing wuid value.

              I was getting this error.

              SQL: SELECT * FROM `modx`.modx_web_user_profile WHERE webuser = ;


              I had already tried using

              <input style="display:none;" type="text" name="wuid" value="[+id+]" />


              But when I view source on the rendered page wuid value was empty, in fact all the placholder values were empty.

              I copied the chunk and pasted the form in to the template directly and the placeholders work and the form submitted. But I had to forms on the page!
              You can not use eForm with out a valid tpl value. So I put in an "empty" chunk for the tpl. That doesn’t work, the placeholders still render but the form does not get submitted.

              The only way it seem to work is like this

              <h3>Edit your profile</h3>
              [[ppp? &useTable=`web_user_profile`]]
              // used to check if id matched wuid
              <p>I am webuser [+webuser+].</p>
              
              // extra chunk include to get form to work
              {{profileContact}}
              
              [!eForm? &formid=`inputForm` &noemail=`true` &formid=`inputForm` &tpl=`profileContact` eFormOnBeforeFormMerge=`populate` &eFormOnBeforeMailSent=`updatetable` &thankyou=`profileContactConfirm` !]


              Here is the chunk:

              	<p><span style="color:#900;">[+validationmessage+]</span></p>
              
              	<form method="post" id="inputForm" action="[~[*id*]~]">
                      <input style="display:none;" type="text" name="wuid" value="[+id+]" /> 
              	<p><label accesskey="f" for="fullname">Your full name:</label>
              	<input type="text" name="fullname" value="[+fullname+]" maxlength="60" eform="Fullname::1" /></p>
              	<p><label accesskey="a" for="address">Address :</label>
              	<input type="text" name="address" value="[+address+]" maxlength="60" eform="Address::1" /></p>
              	<p><label accesskey="c" for="city">City:</label>
              	<input type="text" name="city" value="[+city+]" maxlength="60" eform="City::1" /></p>
              	<p><input type="submit" name="submit" value="Send"></p>
              	</form>


              So is it a problem with PPP or eForm ? Or a combination of both?

                DropboxUploader -- Upload files to a Dropbox account.
                DIG -- Dynamic Image Generator
                gus -- Google URL Shortener
                makeQR -- Uses google chart api to make QR codes.
                MODxTweeter -- Update your twitter status on publish.
                • 34017
                • 898 Posts
                Bwente,

                Are you logged in as a manager during this time? If you are only logged in as manager user and not a web user, there will not be a wuid? right?
                  Chuck the Trukk
                  ProWebscape.com :: Nashville-WebDesign.com
                  - - - - - - - -
                  What are TV's? Here's some info below.
                  http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                  http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                  • 4385
                  • 372 Posts
                  ProWebscape,

                  I use two browsers Firefox and Safari. I use Firefox to manage and Safari to preview/test. I am sure I am logged in as a webuser, because the placeholder renders when I use it in the template outside of the chunk. And all the placeholders in the chunk, (when used with eForm) do not render.
                    DropboxUploader -- Upload files to a Dropbox account.
                    DIG -- Dynamic Image Generator
                    gus -- Google URL Shortener
                    makeQR -- Uses google chart api to make QR codes.
                    MODxTweeter -- Update your twitter status on publish.
                    • 28033
                    • 925 Posts
                    http://www.symphonicheaven.com

                    If anyone wants to see how the advanced options like the User List Reports by Field, etc. work, feel free to take a look. Not one major glitch yet, so I’d say it’s pretty stable code. smiley

                    (Still need to figure out how to get Option/Radio to work on the Account field, though. xd)

                    And a major thanks to the author for coding this. It is SUCH a big help on my website. ^.^
                      My Snippets
                      -> PopUpChunk v1.0
                      • 4385
                      • 372 Posts
                      It looks like I having the same problems as others were having earlier in the thread. But I did not see any solution.
                        DropboxUploader -- Upload files to a Dropbox account.
                        DIG -- Dynamic Image Generator
                        gus -- Google URL Shortener
                        makeQR -- Uses google chart api to make QR codes.
                        MODxTweeter -- Update your twitter status on publish.