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.

(Easy) How to move NewCommentCount to Meta Meta-Discussion

polkipolki New
edited January 2016 in Vanilla 2.0 - 2.8

Hello here !

Vanilla : 2.2
Theme : Bootstrap

I've been searching for hours now, trying to move the function that display new comment counts to the Meta-Discussion.
Since my Php skills aren't that great, I can't find a way to do so.

What I'd like :

I've been searching all around the forum, found some guy saying that I must surround it by span but the post is from 2012 and it doesn't seem to work.

I know the solution is in here : /applications/vanilla/views/discussions/helper_functions.php
but can't manage to make it work :/

Thanks in advance for your help :)


  • Options

    anyone, really?

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    It is not easy at all. You've found the correct file and the answer lies within, but there is one thing you should never do and that is: you should never change core files!

    That said, you have to look for other possibilities. The part of Vanilla that creates this piece of HTML markup is the writeDiscussion() function in the file you've found. You can copy that function to your own theme and change the code there (by commenting out the line echo NewComments($Discussion); and insert this code somewhere below, where you would like to see it.)

    The other solution would be to hide the NewCommentCount with CSS and add something like that to your themehooks file:

    public function discussionsController_discussionMeta_handler($sender, $args) {
        require_once $sender->fetchViewLocation('helper_functions', 'Discussions');
        echo newComments($args['Discussion']);

    Since you have to hide one .NewCommentCount but not the other, you would have to be quite specific. Maybe a.Title + span.NewCommentCount { display: none; } will do the trick...

    See what works better for you. Each solution has pros and cons.

  • Options

    Thanks, gonna try it out and let you know

Sign In or Register to comment.