The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Is there a way to show a single author's response in a topic?

    Sin_Ger
    Sin_Ger
    New Member


    Posts : 16
    Reputation : 1
    Language : Chinese

    Solved Is there a way to show a single author's response in a topic?

    Post by Sin_Ger June 12th 2020, 5:34 am

    First topic message reminder :

    In other forums, I've seen it possible to display only one author's message in a topic post. Are there any mod that can do that?
    Sin_Ger
    Sin_Ger
    New Member


    Posts : 16
    Reputation : 1
    Language : Chinese

    Solved Re: Is there a way to show a single author's response in a topic?

    Post by Sin_Ger June 12th 2020, 8:55 am

    tikky
    tikky
    Forumember


    Posts : 922
    Reputation : 160
    Language : 🇵🇹

    Solved Re: Is there a way to show a single author's response in a topic?

    Post by tikky June 12th 2020, 9:27 am

    So hide all comments less the author. Create a new JavaScript page with investment in the topics (go to Adminstration Panel > Modules > HTML & JAVASCRIPT > Javascript codes management) with the following code:
    Code:
    (function ($) {
      'use strict';
     
      $(function () {
       
      var $author = $('.post').first().find('.postprofile-name').text();
       
        $('.post:not(:first)').each(function () {
          var $this = $(this);
         
          var $pauthor = $this.find('.postprofile-name').text();
         
          if(new RegExp($author, 'i').test($pauthor)) return;
         
            $this.fadeOut();
         
          });
        });
    })(jQuery);
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    Solved Re: Is there a way to show a single author's response in a topic?

    Post by skouliki June 12th 2020, 2:11 pm

    Sin_Ger since you are using pedxz's code can't mark this as solved?

    thank you @Pedxz for your help

    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    Solved Re: Is there a way to show a single author's response in a topic?

    Post by skouliki June 15th 2020, 3:32 am

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules


      Current date/time is November 11th 2024, 3:17 pm