We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24735
    • 33 Posts
    Hello!

    Hopefully this is the right place to post this. I am working with Jot to display user comments after they login using webloginPE. I want to add a small thumb of the users profile image to each one of their posts.

    This is what I have for my jot call
    <div id="commentsAnchor">
    [!Jot? &placeholders=`1` &output=`0` &customfields=`name,email` &subscribe=`1` &pagination=`4` &badwords=`dotNet` &canmoderate=`Site Admins` !]
    [+jot.html.navigation+]
    [+jot.html.comments+]
    [+jot.html.subscribe+]
    [+jot.html.moderate+]
    [+jot.html.form+]
    </div>

    This is what I have for the default chunk.comments.inc.html

    <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>`+]


    Posts: [+comment.userpostcount+]

    </div>



    <div class="jot-content">



    <div class="jot-posticon">

    [+phx:userinfo=`lastlogin`:ifempty=`9999999999`:lt=`[+comment.createdon+]`:then=`

    <img src="[(base_url)]manager/media/style/MODx/images/icons/folder_page_add.gif" width="18" height="18" alt="New comment" border="0" />

    `:else=`

    <img src="[(base_url)]manager/media/style/MODx/images/icons/newdoc.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)]manager/media/style/MODx/images/icons/event3.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)]manager/media/style/MODx/images/icons/add.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)]manager/media/style/MODx/images/icons/delete.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)]manager/media/style/MODx/images/icons/logging.gif" width="16" height="16" alt="Edit Comment" border="0" /></a>

    `:strip+]

    </div>



    <span class="jot-subject">[+comment.title:limit:esc+]</span>


    <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>

    &nbsp;`+] [+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>

    If anyone has any insight and or advise on how to go about adding a small user profile image to each of their comments, I would be most appreciative. Thanks!

      • 28788
      • 79 Posts
      This should do the trick:

      <img src="[+comment.createdby:userinfo=`photo`+]">

        • 24735
        • 33 Posts
        grin Indeed, that did the trick! Thanks suburbiaboy!

        Thanks!

        For folks with a similar question you want to plug in the

        <img src="[+comment.createdby:userinfo=`photo`+]">

        right after
        [+comment.createdby:isnt=`0`:then=``+]

        Here is what my chunk.comments.inc.html looks like

        <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>`+]<img src="[+comment.createdby:userinfo=`photo`+]" width="50" height="50">[+comment.createdby:userinfo=`username`:ifempty=`[+comment.custom.name:ifempty=`[+jot.guestname+]`:esc+]`+][+comment.createdby:isnt=`0`:then=`</b>`+]



        Posts: [+comment.userpostcount+]

        </div>



        <div class="jot-content">



        <div class="jot-posticon">

        [+phx:userinfo=`lastlogin`:ifempty=`9999999999`:lt=`[+comment.createdon+]`:then=`

        <img src="[(base_url)]manager/media/style/MODx/images/icons/folder_page_add.gif" width="18" height="18" alt="New comment" border="0" />

        `:else=`

        <img src="[(base_url)]manager/media/style/MODx/images/icons/newdoc.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)]manager/media/style/MODx/images/icons/event3.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)]manager/media/style/MODx/images/icons/add.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)]manager/media/style/MODx/images/icons/delete.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)]manager/media/style/MODx/images/icons/logging.gif" width="16" height="16" alt="Edit Comment" border="0" /></a>

        `:strip+]

        </div>



        <span class="jot-subject">[+comment.title:limit:esc+]</span>


        <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>

        &nbsp;`+] [+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>
          • 28788
          • 79 Posts
          No worries, it was good timing, I just implemented this myself.

          Just a quick warning admin users don’t have a default photo like WebloginPE users do so if you you post as an admin you’ll get an empty image unless you add one.

          Jamie
            • 37447
            • 6 Posts
            i can help you, in my website i talk about this... and more things about Modx
            In the second part of this tutorial I uploaded a snippet that print user image.

            http://manuales.todolovisto.com/imagen-usuario-jot-modx