• torley

    (@torley)


    Hello, I’m looking for a plugin that allows highlighting comments by multiple authors to make them stand out when there are many other comments.

    I’ve seen several that allow highlighting comments made by the author of a post, or otherwise, an individual, but not one I can add a list to — under WP-Admin > Users, where there are multiple names.

    In concept, it’d be like:

    https://dev.wp-plugins.org/wiki/AuthorHighlight

    but for more than one person. ??

    Does such a thing exist? Any help graciously appreciated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • vkaryl

    (@vkaryl)

    Might want to check the available crop of plugins at https://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.

    vkaryl

    (@vkaryl)

    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:

    https://www.ads-software.com/support/topic/9536?replies=2
    https://www.ads-software.com/support/topic/27045?replies=12

    and it appears Jennifer from scriptygoddess does mention multiple authors can work:

    https://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!

    vkaryl

    (@vkaryl)

    Maybe Kafkaesquí will have a solution….

    Kafkaesqui

    (@kafkaesqui)

    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:
    >
    > https://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.

    vkaryl

    (@vkaryl)

    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?

    Kafkaesqui

    (@kafkaesqui)

    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; ?>">

    Kafkaesqui

    (@kafkaesqui)

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Plugin that allows highlighting posts by multiple authors?’ is closed to new replies.