We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25576
    • 27 Posts
    Maybe I’m missing something, but I would really like to be able to log the IP of anyone (logged in or not) leaving a comment. I know this is easy to do, but would require an extra field in the Jot table. I’m thinking of hacking the version I’m using (1.1.2) to add this, but is there any chance this might be added in the near future - I’d prefer not to use hacked code if I don’t have to.
      • 33337
      • 3,975 Posts
      I believe Jot does it by default.

      Have a look at the default template, and view the sample posted comments as an admin.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 25576
        • 27 Posts
        Quote from: zi at Jun 13, 2008, 05:16 AM

        I believe Jot does it by default.

        Have a look at the default template

        Where do I find that?

        view the sample posted comments as an admin.

        I already did that - couldn’t find anything looking like an IP.

        I guess I could configure IP as a custom field and use a customised form template?

        Where’s the best place to find how to create templates for Jot? I’ve been searching but haven’t found anything yet...

        Thanks for the help.
          • 33337
          • 3,975 Posts
          Goto http://modxcms.com/Jot-998.html

          Preview the screenshot, and you will find IP at the bottom-right corner of the posts in that screenshot. smiley

          For the templates, you will have to study Jot’s default templates. You can find them in /jot dir. (cant recall exact path though).

          hope it helps.
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 25576
            • 27 Posts
            Quote from: zi at Jun 13, 2008, 06:43 AM

            Goto http://modxcms.com/Jot-998.html

            Preview the screenshot, and you will find IP at the bottom-right corner of the posts in that screenshot. smiley

            Hmm. That’s for 0.9.9.8 and I’m on 1.1.2. Like I said, I’ve trawled through the MySQL tables and can’t see IP being stored anywhere. There is a ’secid’ field, but that seems to be used for some default/system entries - maybe it’s used for logged-in users only?

            For the templates, you will have to study Jot’s default templates. You can find them in /jot dir. (cant recall exact path though).

            Thanks, found it. I’m still at square one working out how to record IP against comments though ... :-(
              • 33337
              • 3,975 Posts
              If you line #42 of chunk.comment.inc.html, you will see the following code:
                `+] [+jot.moderation.enabled:is=`1`:then=`<a target="_blank" href="http://www.ripe.net/perl/whois?searchtext=[+comment.secip+]">[+comment.secip+]</a>`+]</div>
              


              Its from latest, 1.1.2. And keep in mind, you will only be able to see the ip if you are logged in as admin user.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 25576
                • 27 Posts
                Quote from: zi at Jun 16, 2008, 03:54 AM

                If you line #42 of chunk.comment.inc.html, you will see the following code:
                  `+] [+jot.moderation.enabled:is=`1`:then=`<a target="_blank" href="http://www.ripe.net/perl/whois?searchtext=[+comment.secip+]">[+comment.secip+]</a>`+]</div>
                


                Its from latest, 1.1.2. And keep in mind, you will only be able to see the ip if you are logged in as admin user.

                Hmm, interesting. The problem is, the ’secip’ column is blank for the comments that have been left on the site. So the IP is not being recorded when the comment is created. This is using the comments chunk that came as default with MODx.
                  • 33337
                  • 3,975 Posts
                  Now this is interesting situation lol....

                  I am no expert at server stuff, but it might be the server config...
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 25576
                    • 27 Posts
                    Quote from: zi at Jun 17, 2008, 03:44 AM
                    I am no expert at server stuff, but it might be the server config...

                    I doubt it, somehow. Using $_SERVER[’REMOTE_ADDR’] in PHP shows the user’s IP with no problem.

                    It seems the CJot class is getting its user info from $modx->getUserData();

                    $this->client = $modx->getUserData(); // in jot.class.inc.php

                    So I guess the IP isn’t being returned by that method for some reason. So it’s a MODx issue rather than a Jot issue, I guess. But I have no idea where to start looking for the answer to that problem :-(


                      • 33337
                      • 3,975 Posts
                      I think its again a cache issue, try uncaching the page itself and call the jot cached.
                        Zaigham R - MODX Professional | Skype | Email | Twitter

                        Digging the interwebs for #MODX gems and bringing it to you. modx.link