We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28513
    • 53 Posts
    Modx 1.0.1 / Jot 1.1.4

    Hey guys, I have jot up and running on my page but I would like to do two things before I publish it:

    1.) Is there an easy way to remove the author post count?

    2.) How do I add another field for website url that will parse as a link when submited?

    This is the jot call I have in my template:
    [!Jot? &subscribe=`0` &notify=`2` &notifyAuthor=`1` &subjectAuthor=`Comment From Website` &pagination=`0` &sortby=`createdon:a` &css=`0` !]


    I have been looking at this page for a while and I am still not sure how to do these two things. http://wiki.modxcms.com/index.php/Jot

    Thanks,
    -Steve
      • 20413
      • 2,877 Posts
      1. &tplComments=`nameofyourchunk`
      2. nameofyourchunk:
      <a name="jc[+jot.link.id+][+comment.id+]"></a>
      	<div class="jot-row [+chunk.rowclass+] [+comment.published:is=`0`:then=`jot-row-up`+]">
      	 <div class="jot-comment">
       		 
      		 <div class="jot-user">
      		 [+comment.createdby:isnt=`0`:then=`<b>`+][+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=`</b>`+]
      		 </div> 
      		
      		 <div class="jot-content">
      			 
      			 <div class="jot-posticon">
      					[+phx:userinfo=`lastlogin`:ifempty=`9999999999`:lt=`[+comment.createdon+]`:then=`
      				 <img src="[(base_url)]assets/snippets/jot/templates/comment.gif" width="16" height="16" alt="New comment" border="0" />
      				 `:else=`
      				 <img src="[(base_url)]assets/snippets/jot/templates/comment_trans.gif" width="16" height="16" alt="Comment" border="0" />
      				 `:strip+]
      			 </div>		 
      			 
      			 <div class="jot-mod">
      			 [+jot.moderation.enabled:is=`1`:then=`
      				<a href="[+jot.link.delete:esc+][+jot.querykey.id+]=[+comment.id+]#jotmod[+jot.link.id+]" onclick="return confirm('Are you sure you wish to delete this comment?')" title="Delete Comment"><img src="[(base_url)]assets/snippets/jot/templates/delete.gif" width="16" height="16" alt="Delete Comment" border="0" /></a>
      				[+comment.published:is=`0`:then=`
      				<a href="[+jot.link.publish:esc+][+jot.querykey.id+]=[+comment.id+]#jotmod[+jot.link.id+]" onclick="return confirm('Are you sure you wish to publish this comment?')" title="Publish Comment"><img src="[(base_url)]assets/snippets/jot/templates/publish.png" width="16" height="16" alt="Publish Comment" border="0" /></a>
      				`+]
      				[+comment.published:is=`1`:then=`
      				<a href="[+jot.link.unpublish:esc+][+jot.querykey.id+]=[+comment.id+]#jotmod[+jot.link.id+]" onclick="return confirm('Are you sure you wish to unpublish this comment?')" title="Unpublish Comment"><img src="[(base_url)]assets/snippets/jot/templates/unpublish.png" width="16" height="16" alt="Unpublish Comment" border="0" /></a>
      				`+]
      			 `:strip+]
      			 [+jot.user.canedit:is=`1`:and:if=`[+comment.createdby+]`:is=`[+jot.user.id+]`:or:if=`[+jot.moderation.enabled+]`:is=`1`:then=`
      				 <a href="[+jot.link.edit:esc+][+jot.querykey.id+]=[+comment.id+]#jf[+jot.link.id+]" onclick="return confirm('Are you sure you wish to edit this comment?')" title="Edit Comment"><img src="[(base_url)]assets/snippets/jot/templates/edit.gif" width="16" height="16" alt="Edit Comment" border="0" /></a>
         		 `:strip+]
      			 </div>	
      			  
      			 <span class="jot-subject">[+comment.title:limit:esc+]</span><br />
      			 <span class="jot-poster"><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>
      		 </div>
      		 
      	 </div>
      	
      	</div>

      http://svn.modxcms.com/svn/tattoo/tattoo/releases/1.0.2/assets/snippets/jot/templates/chunk.comment.inc.html

      We removed:
      Posts: [+comment.userpostcount+]

      2. Have no time to show you at the moment tongue
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 28513
        • 53 Posts
        Thank you for posting that chunk code. That helps a lot.
          • 20413
          • 2,877 Posts
          Number 2 - making links of urls inside comment
          1. Backup your http://svn.modxcms.com/svn/tattoo/tattoo/releases/1.0.2/assets/snippets/jot/includes/phx.parser.class.inc.php
          And add under:
          #####  String Modifiers

          this:
          case "parselink":
          $search = array('|(http://[a-zA-Z0-9 \.\/]+)|');
          $replace = array('<a href="$1" title="title">» link</a>');
          $output = preg_replace($search, $replace, $output);
          break;
          

          Just an example. You can use this code: http://wiki.modxcms.com/index.php/PHx/CustomModifiers#phx:parseLinks

          2. In your &tplComments
          replace
          <div class="jot-message">[+comment.content:wordwrap:esc:nl2br+]</div>

          with:
          <div class="jot-message">[+comment.content:wordwrap:esc:nl2br:parselink+]</div>


          // Untested approach so try it.
          Jot uses PHx, you can have it sitewide as well: http://modxcms.com/forums/index.php/topic,40839.msg246407.html#msg246407
          and then install the modifiers as snippets. WAY BETTER - if Jot gets upgraded for EVO and you just overwrite the files.

          // If you want to add a custom field just see the name and email fields in the form tpl, copy e.g. the email input field and just change
          the instances of "email". Then in comments tpl call the field by [+comment.custom.email+]. Now add PHx built in modifiers or
          add new ones (as we did above) and call them after: [+comment.custom.email:esc+] etc.
          You could then make a link out of it like this
          [+phx:if=`[+comment.custom.email:esc+]`:ne=``:then=`<a href="[+comment.custom.email:esc+]">link</a>`:else=``+]

          That would output a link if the the field isn’t empty.

          // Be aware of typos in this post... Happy MODxing! grin


            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower