We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15987
    • 786 Posts
    bS,
    I am getting a javascript error and am not sure of the cause.

    Here is the error msg:
    Error: syntax error
    Source File: http://www.muddydogpaws.com/notebook/ajax-search-snippet.html
    Line: 408, Column: 6
    Source Code:
    	if ( == 1 && 0 == 1) { b.style.display="inline"; } else { a.style.display="inline"; }
    


    I traced this back to the chunk.subscribe.inc.html file on line 16, for some reason the placeholder [+jot.subscription.status+] is not getting set.

    Here is my snippet call for reference

    [!Jot?subscribe=`0` &pagination=`10` &customfields=`name,url` &tplForm=`commentform` &tplComments=`comment`!]


    any help on fixing this would be appreciated.
      • 7923
      • 4,213 Posts
      @bunk58:

      I don’t actually know what do you want. Do you want that the urls entered in comment text are automagically turned in to links or do you want to be able to use Jot to post a list of links your self or what?

      If you want to use it to build a list of links, you would do it like this (i think):

      Put &customfields=`linkurl,linktitle,linktext` to the snippet call and you can get three extra fields to use in the "comment" posting form. Then add &tplForm=`commentform` &tplComments=`comment` parameters to the call to define your on templates to use.

      Create a new chunk called commentform to display the form and put this content to it (by default, Jot uses code from file chunk.form.inc.html):
      <form method="post" action="[+jot.link.current+]">
      	<input name="JotForm" type="hidden" value="[+jot.id+]" />
      	
      	Link url:<br />
      	<input tabindex="1" name="linkurl" type="text" size="40" value="[+submit.linkurl+]" /><br />
      	Link title:<br />
      	<input tabindex="2" name="linktitle" type="text" size="40" value="[+submit.linktitle+]" /><br />
      	Link text:<br />
      	<input tabindex="3" name="linktext" type="text" size="40" value="[+submit.linktext+]" /><br />
      
      	Subject:<br />
      	<input tabindex="4" name="subject" type="text" size="40" value="[+submit.subject+]" /><br />
      	Comment:<br />
      	<textarea tabindex="5" name="message" cols="50" rows="8">[+submit.message+]</textarea><br />
      	
      	<input tabindex="6" name="submit" type="submit" value="Post Comment" />
      </form><br />
      


      Then create a chunk called comment with the following content (by default Jot uses chunk.comment.inc.php) to show the links:
      	<a name="jc[+jot.id+]-[+comment.id+]"></a>
      	<div class="jot-row [+chunk.rowclass+]">
      	 <div class="jot-comment">
      	   <span class="jot-subject">[+comment.title:esc+]</span>
      	   <div class="jot-message">
      	   		<a href="[+comment.custom.linkurl+]" title="[+comment.custom.linktitle+]">[+comment.custom.linktext+]</a><br/>
      	   		[+comment.content:esc:nl2br+]
      	   	</div>
      	 </div>
      	 <div class="jot-poster">
      	  by [+comment.createdby:userinfo=`username`+]
      	  on [+comment.createdon:date=`%a %B %d, %Y at %H:%M`+]
      	 </div>
      	</div>
      


      If you want to use captcha or moderation etc, the chunks get more complicated. Check the default chunks to see examples.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 6778
        • 20 Posts
        Great work, but I still have some feature request wink
        - It should be possible to place content (and other fields) of the comment in the chunk for the moderator email (tplNotifyModerator)
        - Some fields in the comment view should only be visible for moderators. (&hiddenfields=`email,secip`)
          • 4310
          • 2,310 Posts
          doze,
          Thanks for that.
          I’m not very good on PHP but when it’s mixed with XML I’m lost!
          To see wat I wanted follow this link
          Again many thanks I can roll it out for the school
          David
            • 7923
            • 4,213 Posts
            Quote from: bunk58 at Oct 07, 2006, 09:25 PM

            doze,
            Thanks for that.
            I’m not very good on PHP but when it’s mixed with XML I’m lost!
            To see wat I wanted follow this link
            Again many thanks I can roll it out for the school
            David
            Hello David,

            I don’t know what I should see from that url? grin If you want to be able to input the Lecky and Search links when posting a comment, it goes like I posted above.. but if you are also using the name and email fields that are there if you do the default install, you should just put the extra fields to the default templates (the .html files in Jot folder).

            eg. these to the form template (chunk.form.inc.html):

            Link url:

            <input tabindex="1" name="linkurl" type="text" size="40" value="[+submit.linkurl+]" />

            Link title:

            <input tabindex="2" name="linktitle" type="text" size="40" value="[+submit.linktitle+]" />

            Link text:

            <input tabindex="3" name="linktext" type="text" size="40" value="[+submit.linktext+]" />


            and this to the comment template (chunk.comment.inc.html):

            <a href="[+comment.custom.linkurl+]" title="[+comment.custom.linktitle+]">[+comment.custom.linktext+]</a>

            and you need to add the form fields to the other templates too if you want to be able to edit the content etc..


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 4195
              • 398 Posts
              Quote from: dazze at Oct 07, 2006, 08:22 PM

              Great work, but I still have some feature request wink
              - It should be possible to place content (and other fields) of the comment in the chunk for the moderator email (tplNotifyModerator)
              - Some fields in the comment view should only be visible for moderators. (&hiddenfields=`email,secip`)

              This will be possible in the next version.

              - I will add the extra fields to the email templates
              - This will be possible by using template modifiers so stay tuned smiley
                Armand Pondman
                MODx Coding Team
                :: Jot :: PHx
                • 4195
                • 398 Posts
                Quote from: kylej at Oct 07, 2006, 06:59 PM

                bS, I am getting a javascript error and am not sure of the cause.

                I’ll fix the code so it returns 0 and not nothing .. but i’m loosing the javascript anyway in new version..
                  Armand Pondman
                  MODx Coding Team
                  :: Jot :: PHx
                  • 4310
                  • 2,310 Posts
                  Hi Doze,
                  The link in my previous post was to the test page that I had successfully used Jot and your suggestions.
                  That’s what I wanted to achieve, a comment that you could insert a clickable link into.
                  I didn’t bother with the text description of the link as it’s not required as yet.
                  Just thought I’d show that we’d got their in the end!
                  Regards
                  David
                    • 4310
                    • 2,310 Posts
                    I’ve discovered a small problem wuth my set up of Jot
                    Everyone can view, my registered users can post, as manager I can delete, unpublish etc.
                    I want my registered usersto be able to delete etc.
                    I used the &canmoderate=`Registered Users` call but they don’t get the delete etc. options.
                    Any thoughts anyone?
                    David
                      • 4195
                      • 398 Posts
                      Quote from: bunk58 at Oct 08, 2006, 09:38 AM

                      I’ve discovered a small problem wuth my set up of Jot
                      Everyone can view, my registered users can post, as manager I can delete, unpublish etc.
                      I want my registered usersto be able to delete etc.
                      I used the &canmoderate=`Registered Users` call but they don’t get the delete etc. options.
                      Any thoughts anyone?
                      David

                      hmm.. i really tested the "access" groups thoroughly.. are you sure you dind’t make a typo somewhere?
                      I will check if i didn’t corrupt something somewhere in the line of my updates.

                      There are some "big" changes on the way... so stay tuned.
                        Armand Pondman
                        MODx Coding Team
                        :: Jot :: PHx

                      This discussion is closed to further replies. Keep calm and carry on.