Hi Greg - I was indeed trying to check whether the user posting the comment was a member or a non-member. That tip seems to have got me 80% of the way there - thanks!
This all seems to be working now, with the member profile picture and location shown for logged in users, and with the correct styling applied if the comment is written by author of the original author, but with one problem: the link associated with the registered member points to my (logged in) profile, not that of the commenter - i.e. the
tag isn’t parsing properly. When logged out, that link points to
<a href="http://mysite.com/bios/{username}">http://mysite.com/bios/{username}</a>
(the word ‘username’, surrounded by curly braces, ends up in the URL itself.
Here’s what I have so far - working perfectly apart from the fact that the username in the URL doesn’t work:
{exp:weblog:entries limit="1" require_entry="yes" status="not pending|closed"}
<div id="comments">
{if allow_comments}<h3 class="sectiontitle first">{if comment_total <=1} {comment_total} commentaire{if:else} {comment_total} commentaires{/if}</h3>{/if}
{/exp:weblog:entries}
{exp:comment:entries sort="asc" require_entry="yes"}
<div class="comment-wrap group{if entry_author_id == author_id} auteur{/if}">
<div class="commentator group">
{if author_id != "0"}
<a href="http://{path=%22class=%22thumb" title="{author} profil" class="thumb">{if photo}{photo_url}{if:else}/images/member_photos/thumb.gif{/if}</a>
<span class="auteur-name">
<a href="http://{path=" title="Profil de {author}"><strong>{author}</strong></a>
{if location}<span class="location">{location}</span>{/if}
<span class="comment-date">{comment_date format='%D %d %M %Y'}</span>
</span>
{if:else}
<span class="auteur-name full">
<strong>{name}</strong>
<span class="comment-date">{comment_date format='%D %d %M %Y'}</span>
</span>
{/if}
</div>
<div class="comment">
{comment}
</div>
<a href="http://{comment_url_title_auto_path}#c{comment_id}%22class=%22comment-id" title="lien permanent de ce commentaire" class="comment-id">#{comment_id}</a>
</div>{!-- /.comment-wrap !--}
{/exp:comment:entries}
</div>{!-- /#comments !--}
Compared to the following (repositioned weblog:entries tags), in which the usernames work, and the comments are displayed properly, but the wrong author information is being pulled (seems to think the entry author has posted all the comments):
{exp:weblog:entries limit="1" require_entry="yes" status="not pending|closed"}
<div id="comments">
{if allow_comments}<h3 class="sectiontitle first">{if comment_total <=1} {comment_total} commentaire{if:else} {comment_total} commentaires{/if}</h3>{/if}
{exp:comment:entries sort="asc" require_entry="yes"}
<div class="comment-wrap group{if entry_author_id == author_id} auteur{/if}">
<div class="commentator group">
{if author_id != "0"}
<a href="http://{path=%22class=%22thumb" title="{author} profil" class="thumb">{if photo}{photo_url}{if:else}/images/member_photos/thumb.gif{/if}</a>
<span class="auteur-name">
<a href="http://{path=" title="Profil de {author}"><strong>{author}</strong></a>
{if location}<span class="location">{location}</span>{/if}
<span class="comment-date">{comment_date format='%D %d %M %Y'}</span>
</span>
{if:else}
<span class="auteur-name full">
<strong>{name}</strong>
<span class="comment-date">{comment_date format='%D %d %M %Y'}</span>
</span>
{/if}
</div>
<div class="comment">
{comment}
</div>
<a href="http://{comment_url_title_auto_path}#c{comment_id}%22class=%22comment-id" title="lien permanent de ce commentaire" class="comment-id">#{comment_id}</a>
</div>{!-- /.comment-wrap !--}
{/exp:comment:entries}
</div>{!-- /#comments !--}
{/exp:weblog:entries}