Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Do not show "Reply and Send PM links" to logged-in member.

Thank you for this nice plugin and update.
Please is it possible to make the plugin not to show up on a logged in member's discussions and comments? The plugin (Reply and Send PM links) should show only on other members discussion and comments right?
I guess it is not normal for members to Reply their own discussions/comments and also PM themselves.

Tagged:

Comments

  • RiverRiver MVP
    edited July 2016

    @Prosper said:
    Thank you for this nice plugin and update.
    Please is it possible to make the plugin not to show up on a logged in member's discussions and comments? The plugin (Reply and Send PM links) should show only on other members discussion and comments right?
    I guess it is not normal for members to Reply their own discussions/comments and also PM themselves.

    https://github.com/R-J/reply/blob/master/class.reply.plugin.php#L47

    try this

     public function discussionController_replies_handler($sender, $args) {
    echo '<div class="Reply">';
    

    to

     public function discussionController_replies_handler($sender, $args) {
    if (Gdn::Session->User->Name == $args['Author']->Name) return; // do not display reply/pm for author post.
    echo '<div class="Reply">';
    

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @River - thank you for the code. I tried it and it generated "Blank page - HTTP ERROR 500".
    Please could you check the code for mistake?

  • RiverRiver MVP
    edited July 2016

    @Prosper

    @River - thank you for the code. I tried it and it generated "Blank page - HTTP ERROR 500".
    Please could you check the code for mistake?

    you are correct. I will reply to myself :)

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • RiverRiver MVP
    edited July 2016

    @River said:

    @River - thank you for the code. I tried it and it generated "Blank page - HTTP ERROR 500".
    Please could you check the code for mistake?

    you are correct. I will reply to myself :)

    @Prosper , I forgot to add () after Gdn::Session()

          public function discussionController_replies_handler($sender, $args) {
         if (Gdn::Session()->User->Name == $args['Author']->Name) return; // do not display reply/pm for author post.
         echo '<div class="Reply">';
    

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • @River - thanks problem solved.

  • R_JR_J Ex-Fanboy Munich Admin

    In fact I have thought about excluding this for the session user. And I have actively decided against hiding it. While I do not think I would add a config setting, I will add a css class so that it could be hidden.

    I have forgotten to hide the display for guests and need to release a new version anyway.

  • R_JR_J Ex-Fanboy Munich Admin

    Ah, no, that's ridiculous. Since every comment already has a class "Mine" if it is the comment of the session user, all you have to do is to get the CssEditor and add

    .Mine .Reply {
        display: none;
    }
    

    And please use the CssEditor or add it to your custom theme and don't change the plugins css directly.

  • @R_J What about Discussion Item then ? The reply button also comes on ItemDiscussion with Id = Discussion_abc.
    and if you use
    .Mine .Reply { display: none; }
    this only applies to the comments not to the discussion title .

  • R_JR_J Ex-Fanboy Munich Admin
    edited August 2016

    Thanks for the heads up! I think that class should be in discussions, too, so this plugin adds it. That way you can handle the buttons the same way as you can with comments.

    Buttons are now no longer shown to guests.

    You can now download an updated version (0.3), @vanillawhisky

Sign In or Register to comment.