We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26401
    • 247 Posts
    I’m using a simple jot call (for now)
    [!Jot? &moderated=`1` &canview=`People` &canmoderate=``!]


    I want the form to not be visible to users not signed in, that is it should only be visible for ’People’ and the moderator.

    I don’t know why the form is showing up when no user is logged in.
      • 19298
      • 76 Posts
      MichaelHarringtonDesigns Reply #2, 16 years, 8 months ago
      HI I think we are having the same problem. I need the comments people have made to be visible be everyone. But only allow visitor who registered the ability to make comment..

      In the book Modx web development this code should work
      [!Jot? &canpost=`Registered Users`!] this call should only allow registered users to see the comment form but this does not work for me I don’t know why!

      I just want the visitors to see the comments on certain pages which is why I have put my code in a chunk and called that chunk on the pages I want the comments to go. where have you placed your Jot call?

      My full code is

      [!Jot? &canpost=`Registered Users` &captcha=`2` &moderated=`1` &customfields=`name,email` &validate=`name:Please enter your name,email:Please enter a valid e-mail address.:email` &pagination=`5` &placeholders=`1` &output=`0`!]

      <h3> Comments</h3>
      [+jot.html.comments+]
      [+jot.html.navigation+]
      [+jot.html.moderate+]
      [+jot.html.form+]

      With placeholders This does not work the way I want..I have created a web group and seeing if this will work...
      If you have any progress on this do post and tell us about it thanks
        • 4041
        • 788 Posts
        Are you still logged in to the manager at the same time when you preview the front end page with the Jot call on it? If so, log out of the manager and see if that helps.
          xforum
          http://frsbuilders.net (under construction) forum for evolution
          • 26401
          • 247 Posts
          I’m checking it inside another browser, this is definitely not the issue.
            • 22840
            • 1,572 Posts
            Could member check do this ??

            Try putting the call in a chunk and add the following where you want the chunk to go:

            [[MemberCheck? &groups=`Contractor` &chunk=`privateNav` &debug=`true`]]


            Change the groups to the user group the members are in and the chunk to the name of the chunk your call is in.

            I use this with webloginPE to call a extra menu if the user is logged in and it works great.
              • 19298
              • 76 Posts
              MichaelHarringtonDesigns Reply #6, 16 years, 8 months ago
              I thought the problem was I was viewing the site in preview mode but thats not it thanks for the suggestion tho.

              I am wondering if it is because I am placing the call in a chunk and not the template itself... (just throwing things in the air lol)

              If you look in the book the example uses &tplForm=`comments` comments being a name of another chunk you have to add the contents from the file chunk.form.inc.html from assests/snippets/jot/templates/... I have also tried this which means I am calling two chunks..

              Has anyone followed the directions from the book and got this to work?
                • 22840
                • 1,572 Posts
                Have you tried what I suggested above ??
                  • 26401
                  • 247 Posts
                  That works

                  I’ve also used this snippet to redirect to the login page
                  <?php
                  	// check if the user is logged in
                  	if (!isset($_SESSION['webInternalKey']) && !isset($_SESSION['mgrInternalKey'])) {
                  		// if not logged in, return redirection template chunk
                  		$redirectID = isset($redirectID) ? $redirectID : 0;
                  		$url = $modx->makeURL($redirectID);
                  		$modx->sendRedirect($url);
                  	}
                  ?>


                  would be nice if membercheck had that option built in


                    • 19298
                    • 76 Posts
                    MichaelHarringtonDesigns Reply #9, 16 years, 8 months ago
                    HI Paul
                    Thanks for your post im going to install the snippet MemberCheck1.2 and give it a go now.
                    One question once a user registered and logs in can they add comments straight away, or do I have to add them to the web user group first every time?

                    Also daspoda could you show us the code you used to call that snippet code to redirect users to the login page thanks
                      • 19298
                      • 76 Posts
                      MichaelHarringtonDesigns Reply #10, 16 years, 8 months ago
                      I cannot get this to work!!!
                      ok I have installed the snippet MemberCheck, I have a chunk with my Jot code in it called Services_Comments. I have created a user group called friends which has one registered user.

                      I am then adding your code
                      [[MemberCheck? &amp;groups=`Friends` &amp;chunk=`Services_Comments` &amp;debug=`true`]]

                      To the pages I want the comments to appear but only registered users access to, to comment but now nothing appear on the pages I have added this code to does anyone know what I am doing wrong?