Might want to check the available crop of plugins at http://guff.szub.net/ – Kafkaesquí always has a bunch that don’t seem to show up on the plugins pages.
And do a search here – I remember (but can’t at present find) a thread about this not long back….
Thread Starter
torley
(@torley)
Thanx vkaryl, I had a look on that website and didn’t see anything more. Also tried some searches, but perhaps I’m looking for the wrong keywords, as I didn’t yield anything.
I don’t think the thread I’m remembering was one I posted in, so that’s no help.
What keywords did you try? I’d try multiple highlight, multiple author, highlight more than one author….
Good luck!
Thread Starter
torley
(@torley)
Yup, I did a bunch like those. I found these:
http://wordpress.org/support/topic/9536?replies=2
http://wordpress.org/support/topic/27045?replies=12
and it appears Jennifer from scriptygoddess does mention multiple authors can work:
http://www.scriptygoddess.com/archives/2004/06/21/comment-highlighting-based-on-author/
I had some followup questions but that form is closed. I’ll keep digging, thanx!
Maybe Kafkaesquí will have a solution….
Just when I think I’m done with author-related stuff, they drag me back in…
Ok, confusing part of request:
> In concept, it’d be like:
>
> http://dev.wp-plugins.org/wiki/AuthorHighlight
>
> but for more than one person. 🙂
I think I get that. But, how do you want to select these more than one? Do you just want all Authors (or Authors/Contributors, or something like that) on the blog highlighted, or a group pre-selected in some way, or… ?
Thread Starter
torley
(@torley)
Thanks vkaryl and Kafkaesqui! I really appreciate the help.
I’d like *all Authors* to have their comments highlighted, please. Everyone who’s ever made a post.
But…. um…. wouldn’t that be really confusing unless you assign special colors or something?
I’m sorry – I’m just not getting the point maybe?
Well, it does simplify the task enormously.
You can insert this code just before you declare the class for the commment div (i.e. <div class="authorcomment" ...) in your comments.php template:
<?php
$authposts = get_usernumposts($comment->user_id);
$class = ($authposts) ? 'authorcomment' : 'comment';
?>
The first line passes the user ID from the comment record (let’s hope they’re logged in when they comment!) to collect a post count for that author. The second does a little PHP magic to assign a value to $class, depending on whether or not the user is a published author on your blog. Feel free to replace the values for ‘authorcomment’ and ‘comment’.
Then where we need $class to actually be put to work:
<div class="<?php echo $class; ?>">
Oh, for a three-tiered method (post author, general author, and nobody commenter), this should work:
<?php
if ( get_the_author_ID() == $comment->user_id ) {
$class = 'postauthorcomment';
} else {
$authposts = get_usernumposts($comment->user_id);
$class = ($authposts) ? 'authorcomment' : 'comment';
}
?>
Thread Starter
torley
(@torley)
Great, I’ve got this page bookmarked for future reference. Thank you SO much for spending time on this and helping me figure it out, I’m really grateful!
And me too! Thanks Kafkaesque : )