We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15003
    • 85 Posts
    Hello

    Is it possible to increase the number of characters of the Manager and Web Users "comment" field --and if so how would I go about it?

    Thanks in advance for any help offered

    Jules
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use a MySQL client (such as phpMyAdmin) and open the web_user_attributes and user_attributes tables. In "Structure" mode, edit the comments field and change its data type from varchar to text.

      While this should not have any harmful result, please do make sure to back up the tables before making any changes to the structure! Better to be safe than sorry.
        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
        • 15003
        • 85 Posts
        Sottwell, thank you so much! Worked like a charm. I’m such a front end coder, it never even occurred to me to go to the tables.

        I’m hoping you have the time for an additional question. Would it be possible to use the TinyMCE instead of <textarea>? I believe I found where the code for each user is located (see below), but I don’t know if there are other places that need changing as well. Nor do I know how to implement the code for TinyMCE. I went to http://wiki.modxcms.com/index.php/TinyMCE but I didn’t see a way to call it the way you do with snippets.
        LINE 418 in: mutate_user.dynamic.php
        <textarea type="text" name="comment" class="inputBox"  rows="5" style="width:300px" onchange='documentDirty=true;'><?php echo htmlspecialchars($userdata['comment']); ?></textarea>
        
        LINE 379 in: mutate_web_user.dynamic.php
        <textarea type="text" name="comment" class="inputBox"  rows="5" style="width:300px" onchange='documentDirty=true;'><?php echo htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea>
        

        If it helps to know the context here is my situation:
        My client is a consultant with anywhere from 5 to 20 clients at a time. I have set up membership groups for 4 different packages he offers. He would like to leave individual messages and document links for each client he works with. To achieve this I am using the comment field. He can enter his messages through the Web Users panel and using css to display:none I can prevent his clients from being able to edit the field in the update-profile section. Using a webloginPE call I can place this comment with in each service package he offers so a customized message will be seen by each client. See code below for an example.
        [!WebLoginPE? &type=`profile` &profileTpl=`view-profile-comment` &profileHomeID=`24` &disableServices=`deleteprofile,register`!]
        
        [+phx:if=`[+user.comment+]`:is=``:then=``:else=`<div class="comment-container">
                                                           <div class="comment">
                                                               <h3>Hello [+user.username+] </h3>
                                                               <p>Below is some info and links for your review</p>
                                                                  [+user.comment+]
                                                           </div>
                                                        </div>`+] 

        If I enter html code in the Web Users panel of the admin interface it is saved and renders correctly in browser window. If a user goes in and updates their profile webloginPE replaces code characters within the <textarea> field with HTML Entities.

        This is why using the TinyMCE plugin for the comment area would be best; my client wouldn’t have to learn html and the code wouldn’t be replace with HTML Entities when a user updates their profile. I realize that this is a much more complicated question than the one I originally posted and I really appreciate any help you can offer.

        Thanks ~Jules