Way to indicate comments made by (logged in) user/admin
Re: Way to indicate comments made by (logged in) user/admin
Now ALL comment entries have the custom class, because $commentform_entry.email is ALWAYS the same mail address (= the blog owners).
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
I think we need to see a URL to your site....
Why would all comments be using the blog owner's email address?
Why would all comments be using the blog owner's email address?
=Don=
Re: Way to indicate comments made by (logged in) user/admin
http://www.bernhard-runzheimer.de/blog/ ... l#comments
At the moment, I'm checking the commenters url to set the custom css class...so this is actually how it should look like (blue user icons = "normal" comments, black user icon = blog owner comment).
At the moment, I'm checking the commenters url to set the custom css class...so this is actually how it should look like (blue user icons = "normal" comments, black user icon = blog owner comment).
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
Let me ask again - Why does every comment author have the same email address, and why are those identical email addresses the same as the blog owner (you)? Each person submitting a comment should be using their own email address, and therefore not triggering the custom author class. Having said that, I see nothing wrong with testing the URL field for a match either.Bernardo wrote:Now ALL comment entries have the custom class, because $commentform_entry.email is ALWAYS the same mail address (= the blog owners).
=Don=
Re: Way to indicate comments made by (logged in) user/admin
Well, maybe because I used it in the wrong place. I have to use a template variable in comments.tpl, not in commentform.tpl. If I use $commentform_entry.email in comments.tpl (which seems to be wrong imo), it shows the same address for all user comments (which would result in three black user icons for the given example url).Don Chambers wrote:Let me ask again - Why does every comment author have the same email address, and why are those identical email addresses the same as the blog owner (you)? Each person submitting a comment should be using their own email address, and therefore not triggering the custom author class. Having said that, I see nothing wrong with testing the URL field for a match either.
I have the constant feeling that there is some kind of miscommunication happening here...or maybe I'm just to blind to see...
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
commentform.tpl is the actual comment form... comments.tpl displays the comments that have already been posted.
Is it possible that your logical test is occuring in the wrong location, such as the wrong place in a loop? Can you post the entire comments.tpl?
Is it possible that your logical test is occuring in the wrong location, such as the wrong place in a loop? Can you post the entire comments.tpl?
=Don=
Re: Way to indicate comments made by (logged in) user/admin
I know...Don Chambers wrote:commentform.tpl is the actual comment form... comments.tpl displays the comments that have already been posted.
Maybe that's the point where we're talking about different things. I render the custom class in comments.tpl, when the comments are generated for viewing. Why would I put the test in the commentform.tpl?Don Chambers wrote:Is it possible that your logical test is occuring in the wrong location, such as the wrong place in a loop?
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
Bernardo wrote:Maybe that's the point where we're talking about different things. I render the custom class in comments.tpl, when the comments are generated for viewing. Why would I put the test in the commentform.tpl?
You don't put it in commentform.tpl... put it in comments.tpl.
=Don=
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
Are we having fun yet??!!
OK, some where in your comments.tpl, you are setting one of two classes:
Either this:
or this:
This is how I think it SHOULD work, based solely on the email address provided when the comment is submitted:
I have not yet seen your actual comments.tpl, but this SHOULD work provided it is placed in the proper location within the foreach loop.
OK, some where in your comments.tpl, you are setting one of two classes:
Either this:
Code: Select all
<div class="serendipity_comment_source icon_link">
Code: Select all
<div class="serendipity_comment_source_admin icon_link">
Code: Select all
<div class="serendipity_comment_source{if $commentform_entry.email =='YOUR_EMAIL_ADDRESS HERE'}_admin{/if} icon_link">
=Don=
Re: Way to indicate comments made by (logged in) user/admin
Actually, no... ...I'm getting confused more and more...Don Chambers wrote:Are we having fun yet??!!
That's exactly what I did after you mentioned it for the first time. The result is what I have described earlier: All user comments have a black user (because they seem to have the same mail address). See attached pic. The displayed mail address is the output of $commentform_entry.email.Don Chambers wrote:This is how I think it SHOULD work, based solely on the email address provided when the comment is submitted:
- Attachments
-
- screenshot.gif (10.32 KiB) Viewed 7969 times
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
Please post the entire code for comments.tpl
=Don=
Re: Way to indicate comments made by (logged in) user/admin
And the commentform.tpl. It's possibly you set this email-adress there.
Re: Way to indicate comments made by (logged in) user/admin
I don't think so...but here you go:onli wrote:And the commentform.tpl. It's possibly you set this email-adress there.
Code: Select all
<div id="serendipityCommentFormC" class="serendipityCommentForm">
<div id="serendipity_replyform_0"></div>
<a id="serendipity_CommentForm"></a>
<form id="serendipity_comment" action="{$commentform_action}#feedback" method="post">
<div><input type="hidden" name="serendipity[entry_id]" value="{$commentform_id}" /></div>
<table border="0" width="100%" cellpadding="3" summary="commentform">
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_name">{$CONST.NAME}</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_name" name="serendipity[name]" value="{$commentform_name}" size="30" /></td>
</tr>
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_email">{$CONST.EMAIL}</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_email" name="serendipity[email]" value="{$commentform_email}" /></td>
</tr>
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_url">{$CONST.HOMEPAGE}</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_url" name="serendipity[url]" value="{$commentform_url}" /></td>
</tr>
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_replyTo">{$CONST.IN_REPLY_TO}</label></td>
<td class="serendipity_commentsValue">{$commentform_replyTo}</td>
</tr>
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_comment">{$CONST.COMMENT}</label></td>
<td class="serendipity_commentsValue">
<textarea rows="10" cols="40" id="serendipity_commentform_comment" name="serendipity[comment]">{$commentform_data}</textarea><br />
{serendipity_hookPlugin hook="frontend_comment" data=$commentform_entry}
</td>
</tr>
{if $is_commentform_showToolbar}
<tr>
<td> </td>
<td class="serendipity_commentsLabel">
<input id="checkbox_remember" type="checkbox" name="serendipity[remember]" {$commentform_remember} /><label for="checkbox_remember">{$CONST.REMEMBER_INFO}</label>
{if $is_allowSubscriptions}
<br />
<input id="checkbox_subscribe" type="checkbox" name="serendipity[subscribe]" {$commentform_subscribe} /><label for="checkbox_subscribe">{$CONST.SUBSCRIBE_TO_THIS_ENTRY}</label>
{/if}
</td>
</tr>
{/if}
{if $is_moderate_comments}
<tr>
<td class="serendipity_commentsValue serendipity_msg_important" colspan="2">{$CONST.COMMENTS_WILL_BE_MODERATED}</td>
</tr>
{/if}
<tr>
<td> </td>
<td><input type="submit" name="serendipity[submit]" value="{$CONST.SUBMIT_COMMENT}" /> <input type="submit" id="serendipity_preview" name="serendipity[preview]" value="{$CONST.PREVIEW}" /></td>
</tr>
</table>
</form>
</div>
Re: Way to indicate comments made by (logged in) user/admin
Well...now I'm curious:Don Chambers wrote:Please post the entire code for comments.tpl
Code: Select all
{foreach from=$comments item=comment name="comments"}
<a id="c{$comment.id}"></a>
<div id="serendipity_comment_{$comment.id}" class="serendipity_comment serendipity_comment_author_{$comment.author|@makeFilename} {if $entry.author == $comment.author}serendipity_comment_author_self{/if} {cycle values="comment_oddbox, comment_evenbox"}" style="padding-left: {$comment.depth*20}px">
<div class="serendipity_commentBody">
{if $comment.body == 'COMMENT_DELETED'}
{$CONST.COMMENT_IS_DELETED}
{else}
{$comment.body}
{/if}
<div class="comment_arrow"><!-- arrow --></div>
</div>
<div class="serendipity_comment_source{if $comment.url == 'http://www.bernhard-runzheimer.de/blog'}_admin{/if} icon_link">
<div class="fleft">
<span class="comment_source_author">
{if $comment.email}
<a href="mailto:{$comment.email}">{$comment.author|@default:$CONST.ANONYMOUS}</a>
{else}
{$comment.author|@default:$CONST.ANONYMOUS}
{/if}
</span>
{$CONST.ON}
<span class="comment_source_date">{$comment.timestamp|@formatTime:$CONST.DATE_FORMAT_SHORT}</span>
</div>
<div class="fright" style="width:100px">
{if $entry.allow_comments AND $comment.body != 'COMMENT_DELETED'}
<a title="{$CONST.REPLY}" class="comment_reply icon_link icon_comment_reply fright" href="#feedback" id="serendipity_reply_{$comment.id}" onclick="document.getElementById('serendipity_replyTo').value='{$comment.id}'; {$comment_onchange}"><!-- reply --></a>
<div id="serendipity_replyform_{$comment.id}"></div>
{/if}
{if $entry.is_entry_owner}
<a title="{$CONST.DELETE}" class="comment_source_ownerlink icon_link icon_comment_delete fright" href="{$comment.link_delete}" onclick="return confirm('{$CONST.COMMENT_DELETE_CONFIRM|@sprintf:$comment.id:$comment.author}');"><!-- delete --></a>
{/if}
{if $comment.url}
<a class="comment_source_url icon_link icon_website fright" href="{$comment.url}" title="{$comment.url|@escape}"><!-- website --></a>
{/if}
<div class="clear"><!-- clear --></div>
</div>
<div class="clear"><!-- clear --></div>
</div>
</div>
{foreachelse}
<div class="serendipity_left nocomments">{$CONST.NO_COMMENTS}</div>
{/foreach}
Code: Select all
{if $comment.url == 'http://www.bernhard-runzheimer.de/blog'}_admin{/if}
Still curious what I may have done wrong...
-
- Regular
- Posts: 3652
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Way to indicate comments made by (logged in) user/admin
Before I review these tpls, can you verify that these three comments are saved with different email addresses, and that all three do not actually have the same email address?
=Don=