We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6991
    • 15 Posts
    im using jot for commenting, how its ppossible to have the url/website address of those who comment?

    Thanks smiley
      • 6991
      • 15 Posts
      Custom fields

      The custom fields you specify with &customfields will have to be added to your form chunk manually. The default templates holds an example of how a guest form looks (added fields here are: name and email)
      the above quote is from: http://wiki.modxcms.com/index.php/Jot

      my jot chunk code:
      <div id="commentsAnchor">
      [!Jot? &customfields=`name,email,url` &subscribe=`1` &pagination=`4` &badwords=`dotNet` &canmoderate=`Site Admins` !]
      </div>

      thats not making another field for url, could someone point me in right direction?

      Thanks smiley
        • 7455
        • 2,204 Posts
        you need to edit the jot chunk and add a input field in the form there.
          follow me on twitter: @dimmy01
          • 10449
          • 956 Posts
          Also, to actually show the extra fields after posting, you need to edit assets/snippets/jot/templates/chunk.comment.inc.html

          e.g.

          <div class="jot-message"><i>[+comment.custom.url+] &nbsp;&nbsp;&nbsp; [+comment.custom.email+]</i></div>
            • 6991
            • 15 Posts
            Quote from: Dimmy at Dec 16, 2007, 12:47 AM

            you need to edit the jot chunk and add a input field in the form there.

            Thanks Dimmy but i’v actualy done that before, mentioned my chunk code, but thats not adding another field ie: url/website.

            Quote from: ganeshXL at Dec 16, 2007, 01:31 AM

            Also, to actually show the extra fields after posting, you need to edit assets/snippets/jot/templates/chunk.comment.inc.html
            <div class="jot-message"><i>[+comment.custom.url+] &nbsp;&nbsp;&nbsp; [+comment.custom.email+]</i></div>

            Thanks Ganesh, thats not resolved the issue too!, the right file to be edited is chunk.form.inc.html to show the input field and i have inserted the below code in the mentioned file:
            	<label for="web">Web:<br />
            	<input tabindex="[+jot.seed:math=`?+5`+]" name="web" type="text" size="40" value="[+form.field.web:esc+]" />
            	</label>

            Upto this stage the form is showing the input field as it should but there is two problems:
            - im not sure whether the value is added to the database?.
            - i can’t seem to find the right path to display the url/address in comments?.

            Any Comments or suggestions are welcome.
            Thanks smiley
              • 10449
              • 956 Posts
              Check table jot_fields in phpMyAdmin: the id there links to the id of table jot_content.
                • 36416
                • 589 Posts
                Quote from: DeLL at Dec 17, 2007, 08:04 AM

                - i can’t seem to find the right path to display the url/address in comments?.

                Field name is comment.custom.{fieldname}, example:
                [+comment.custom.website:isnot=``:then=`<a href="http://[+comment.custom.website:nohttp+]" target="_blank"><img src="[(base_url)]manager/media/style/MODx/images/icons/globe.gif" width="16" height="16" alt="Web site" title="[+comment.custom.website:nohttp+]" border="0" /></a>`+]
                
                  • 6991
                  • 15 Posts
                  Seems its working now, Below codes are the effective parts of these two pages:

                  1- chunk.comment.inc.html:
                  			 <span class="jot-subject">[+comment.title:limit:esc+]</span><br />
                  			 <span class="jot-poster">[+comment.custom.web+]     [+comment.custom.email+]   <b>Reply #[+comment.postnumber+] on :</b> [+comment.createdon:date=`%a %B %d, %Y, %H:%M:%S`+]</span>
                  			 <hr />
                  			 <div class="jot-message">[+comment.content:wordwrap:esc:nl2br+]</div>
                  			 <div class="jot-extra">
                  			 [+comment.editedon:isnt=`0`:then=`
                  			  <span class="jot-editby">Last Edit: [+comment.editedon:date=`%B %d, %Y, %H:%M:%S`+] by [+comment.editedby:userinfo=`username`:ifempty=` * `+]</span>
                  			   `+] [+jot.moderation.enabled:is=`1`:then=`<a target="_blank" href="http://www.ripe.net/perl/whois?searchtext=[+comment.secip+]">[+comment.secip+]</a>`+]</div>


                  2- chunk.form.inc.html:
                  <form method="post" action="[+form.action:esc+]#jf[+jot.link.id+]" class="jot-form">
                  	<fieldset>
                  	<input name="JotForm" type="hidden" value="[+jot.id+]" />
                  	<input name="JotNow" type="hidden" value="[+jot.seed+]" />
                  	<input name="parent" type="hidden" value="[+form.field.parent+]" />
                  	
                  	[+form.moderation:is=`1`:then=`
                  		<div class="jot-row">
                  			<b>Created on:</b> [+form.field.createdon:date=`%a %B %d, %Y at %H:%M`+]<br />
                  			<b>Created by:</b> [+form.field.createdby:userinfo=`username`:ifempty=`[+jot.guestname+]`+]<br />
                  			<b>IP address:</b> [+form.field.secip+]<br />
                  			<b>Published:</b> [+form.field.published:select=`0=No&1=Yes`+]<br />
                  			[+form.field.publishedon:gt=`0`:then=`
                  				<b>Published on:</b> [+form.field.publishedon:date=`%a %B %d, %Y at %H:%M`+]<br />
                  				<b>Published by:</b> [+form.field.publishedby:userinfo=`username`:ifempty=` - `+]<br />
                  			`+]
                  			[+form.field.editedon:gt=`0`:then=`
                  				<b>Edited on:</b> [+form.field.editedon:date=`%a %B %d, %Y at %H:%M`+]<br />
                  				<b>Edited by:</b> [+form.field.editedby:userinfo=`username`:ifempty=` -`+]<br />
                  			`+]
                  		</div>
                  	`:strip+]
                  	
                  	[+form.guest:is=`1`:then=`
                  		<label for="name">Name:<br />
                  		<input tabindex="[+jot.seed:math=`?+1`+]" name="name" type="text" size="40" value="[+form.field.custom.name:esc+]" />
                  		</label>
                  		<label for="email">Email:<br />
                  		<input tabindex="[+jot.seed:math=`?+2`+]" name="email" type="text" size="40" value="[+form.field.custom.email:esc+]" />
                  		</label>
                  	`:strip+]
                  	
                  	<label for="title">Subject:<br />
                  	<input tabindex="[+jot.seed:math=`?+3`+]" name="title" type="text" size="40" value="[+form.field.title:esc+]" />
                  	</label>
                  	<label for="web">Web:<br />
                  	<input tabindex="[+jot.seed:math=`?+6`+]" name="web" type="text" size="40" value="[+form.field.web:esc+]" />
                  	</label>
                  	<label for="content">Comment: *<br />
                  	<textarea tabindex="[+jot.seed:math=`?+4`+]" name="content" cols="50" rows="8">[+form.field.content:esc+]</textarea>
                  	</label><br />
                  


                  Now, how i can make the web field hyperlinked to the url entered?
                    • 6991
                    • 15 Posts
                    Many thanks Eol, you have just answered my question before asking! grin

                    next: is it possible to encode the e-mail addresses? so e-mail sniffers dont spam those who have commented.

                    Many Thanks smiley
                      • 10449
                      • 956 Posts
                      There’s two plugins in the repository that do that:
                      http://modxcms.com/Anti-Spam-Email-Plugin-893.html
                      http://modxcms.com/Email-Link-Obfuscator-604.html

                      Haven’t tried it out yet, but worth a try...