We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22221
    • 283 Posts
    I discover jot and I’m very impressed. Good job.

    I look in the template and in PHx but I don’t realy know how to have in the form template a message for Unregistered User to say : "Only Registerd Users can post comments"
    Can you help me to do that ?
      • 4195
      • 398 Posts
      There is currently no template in Jot that will be displayed that will do that... but.. if you have PHx installed as a plugin (version 1.4.2 was just released today in the repository) you can place the following code anywhere in your template.

      [+phx:userinfo:inrole=`YourAllowedToPostGroupName`:is=`0`:then=`
      Only Registered Users can post comments!
      `+]
      


      or better yet.. create a chunk for the Jot call and put it in there like:

      
      [+phx:userinfo:inrole=`YourAllowedToPostGroupName`:is=`0`:then=`
      Only Registered Users can post comments!
      `+]
      
      [[Jot? .. your parameters.. ]]
      
      


      and then include the chunk where you would like your comments to appear smiley
        Armand Pondman
        MODx Coding Team
        :: Jot :: PHx
        • 22221
        • 283 Posts
        Thanks for the solution : it’s exactly what I need grin.

        Notice that the good syntax seems to be :
        [+phx:userinfo:inrole:isnot=`YourAllowedToPostGroupName`:is=`0`:then=`
        Only Registered Users can post comments!
        `+]
        
        [[Jot? .. your parameters.. ]]
        
          • 4195
          • 398 Posts
          i stand corrected smiley
            Armand Pondman
            MODx Coding Team
            :: Jot :: PHx
            • 22221
            • 283 Posts
            I don’t know if this is a phx or a jot feature, but how to have the date in french in my Comment template.
            Actualy I have "Saturday 21 October 2006" but I want "Samedi 21 Octobre 2006"

            I see the phx call in the template but I don’t know how to specify the language, like Ditto huh
              • 22221
              • 283 Posts
              Quote from: OncleBen31 at Oct 25, 2006, 10:06 AM

              I don’t know if this is a phx or a jot feature, but how to have the date in french in my Comment template.
              Actualy I have "Saturday 21 October 2006" but I want "Samedi 21 Octobre 2006"

              I see the phx call in the template but I don’t know how to specify the language, like Ditto huh
              Forget that. I reload my page and the date is now in French. I don’t know why huh
                • 4195
                • 398 Posts
                the date format in PHx makes use of PHP’s strftime() function that depends on setlocale. If you want to display french you have to execute the php command
                setlocale (LC_TIME, "fr_FR");
                somewhere in your site .

                PHx assumes that if you have another language this value is set to the correct locale.

                ... and yes please continue in PHx support for other questions concerning PHx wink
                  Armand Pondman
                  MODx Coding Team
                  :: Jot :: PHx
                  • 22221
                  • 283 Posts
                  Quote from: OncleBen31 at Oct 25, 2006, 08:52 AM

                  Thanks for the solution : it’s exactly what I need grin.

                  Notice that the good syntax seems to be :
                  [+phx:userinfo:inrole:isnot=`YourAllowedToPostGroupName`:then=`
                  Only Registered Users can post comments!
                  `+]
                  
                  [[Jot? .. your parameters.. ]]
                  

                  I don’t know if I modify something but my chunk doesn’t work anymore :
                  <div id="commentsAnchor">
                  [+phx:userinfo:inrole:isnot=`Registered Users`:then=`<p><strong>La rédaction de commentaires est réservée aux utilisateurs enregistrés !</strong>. Veuillez <a href="[~5~]">créer un compte</a> ou, si vous en avez déjà un, vous connecter</p>`+]
                  
                  [+phx:userinfo:inrole:esc+]
                  [*createdby:date=`%a %B %d, %Y at %H:%M`*]
                  
                  [!Jot? &customfields=`name,email` &subscribe=`1` &pagination=`4` &tplForm=`jotTplForm` &tplComments=`jotTplComments` &tplModerate=`jotTplModerate` &tplSubscribe=`jotTplSubscribe` &tplNav=`jotTplNav` &tplNotify=`jotTplNotify` &tplNotifyModerator=`jotTplNotifyModerator` &canmoderate=`Site Admins` &notify=`2` &canpost=`Registered Users` !]
                  </div>

                  If I’m logged out, I see the message and I don’t see the commentaire form (This is normal). If I’m logged in I see the form AND the message huh
                  I’ve add two calls of phx to be sure it works. But the [+phx:userinfo:inrole:esc+] return always 0. Is this normal ?
                    • 4195
                    • 398 Posts
                    my bad my bad... I gave a wrong example... the corrext syntax should be:

                    [+phx:userinfo:inrole=`Registered Users`:is=`0`:then=`
                    <p><strong>La rédaction de commentaires est réservée aux utilisateurs enregistrés !</strong>. 
                    Veuillez <a href="[~5~]">créer un compte</a> ou, si vous en avez déjà un, vous connecter</p>
                    `+]
                    


                    notice that the inrole condition takes a webgroup name as input and returns 0 (if the user is not in the group) and 1 if the user is in the group. you could also use :isnot=`1` in the above example.

                    note: i updated my posts above to reflect these changes to avoid confusion.
                      Armand Pondman
                      MODx Coding Team
                      :: Jot :: PHx
                      • 22221
                      • 283 Posts
                      Thanks to take the time to help me, but the solution doesn’t work.

                      I don’t know why but the [+phx:userinfo:inrole=`Registered Users`+] return always `0`. I’ve check the name of the user group name and it seems to be good