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.
Options

wrong comments count?

hi, i just installed vanilla 2.0.18.10, on my first post, with NO COMMENTS, but it always show 1 comment on mainpage. any help would be appricated. thanks.

Best Answer

«1

Answers

  • Options
    peregrineperegrine MVP
    edited April 2014

    sinner said:

    hi, i just installed vanilla 2.0.18.10, on my first post, with NO COMMENTS, but it always show 1 comment on mainpage. any help would be appricated. thanks.

    you could change the word comments to posts. and it will be correct.

    If I Recall Correclty
    that is the default behavior in 2.0.18.10 - discussion counts as 1 in the comment count.

    where as in 2.1x discussions without comments are 0 comments.

    P.S. IIRC (you can always qualify anything you say with an IIRC :)

    you could try statsbox plugin. I think there is a fix there.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    hi, thanks for the quick reply. which file do i edit ? and where is it located? thanks.

  • Options
    peregrineperegrine MVP
    edited April 2014

    changing comments to posts.

    http://vanillaforums.org/discussion/comment/163542/#Comment_163542

    http://vanillaforums.org/addon/1104/stats-box

    you can search the forum for this previousl asked question "comment count" as well as I can, there are numerous answers. pick the one most approprate to what you want to do. The ones that recommend changing the core files are the ones you should avoid.

    http://vanillaforums.org/search?adv=&search=comment+count

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    hi, i'm using the stats-box plugin, but it still shows wrong comment count. i like the idea of changing comments to posts as stated in the first link you provide, but i dont know which files to edit, it doesnt say in that post, can you please advise. thanks.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited April 2014

    For that you need to add those definitions to your conf/locale.php file ... >:)

    $Definition['%s comment']='%s post';
    $Definition['%s comments']='%s posts';
    
  • Options

    @vrijvlinder said:
    For that you need to add those definitions to your conf/locale.php file ... >:)

    $Definition['%s comment']='%s post';
    $Definition['%s comments']='%s posts';
    

    still doesnt work :(

  • Options
    peregrineperegrine MVP
    edited April 2014

    still doesnt work :(

    what "still doesn't work"

    delete your ini files in /cache folder . read some other discussions to get some insights

    how do I change this text ... etc. etc. etc.

    • on how to work with vanilla. with locales.php and definitions and localization.

    http://vanillaforums.org/discussion/comment/199091/#Comment_199091

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    sinnersinner New
    edited April 2014

    i've researched about this topic for a week now. and couldn't find a way to correct it. anyway, there's something in my mind might be pose a problem. i'm using the BrandFriend theme, plus a different locale definition.php file for the forum for a different language than english. also, i've deleted the cache ini files everytime i insert new code and upload them back.

    i've also tried to put the code above inside the new definition.php file, but it still doesnt work.

  • Options
    peregrineperegrine MVP
    edited April 2014

    the /conf/locale.php is the last one checked and will override the other ones.

    did you delete the ini files in your cache?

    • post the contents of your conf/locale.php file and
    • post the contents of cache/locale_map.ini

    if you do that, we can troubleshoot.

    if you don't post the contents of the two files, you can drag this thread on for another week or two.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    yes, i did delete ini files in my cache everytime i changed a file & re-upload it, here it is:

    conf/locale.php :

    <?php if (!defined('APPLICATION')) exit();

    cache/locale_map.ini :

    [vi-VN]
    0 = "/home4/giesu/public_html/forum/locales/ViVN/definitions.php"
    1 = "/home4/giesu/public_html/forum/conf/locale.php"

  • Options
    peregrineperegrine MVP
    edited April 2014

    make your /conf/locale.php

    <?php if (!defined('APPLICATION')) exit();
    
    $Definition['%s comment']='%s post';
    $Definition['%s comments']='%s posts';
    $Definition['Comments'] = "Posts";
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited April 2014

    the first two definitions will change comments without the use of statsbox plugin

    and the

    $Definition['Comments'] = "Posts"; // will change "Comments" to "Posts".

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    sinnersinner New
    edited April 2014

    hi, i just did that ealier, and it didnt work. i just tried it again, here are the current contents:

    /conf/locale.php

    <?php if (!defined('APPLICATION')) exit();

    $Definition['%s comment']='%s post';

    $Definition['%s comments']='%s posts';

    ****cache/locale_map.ini ****

    0 = "/home4/giesu/public_html/forum/locales/ViVN/definitions.php"

    1 = "/home4/giesu/public_html/forum/conf/locale.php"

  • Options

    re-read my post.

    http://vanillaforums.org/discussion/comment/205594/#Comment_205594

    and do as exactly as it says.

    then post a screenshot of your site.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    did exactly what you said, still counting 1 post as 1 comment, attached screenshot of forum.

  • Options
    peregrineperegrine MVP
    edited April 2014

    ok you changed Comments to Posts. as you asked for and said it won't work but it does indeed work as noted in your screenshot.

    Your second issue is changing count to subtract 1 from the comment count.

    change the line 98 in class.statsbox.plugin.php

    from

       Wrap(T('Comments')) . Gdn_Format::BigNumber($Discussion->CountComments), 'span', array('class' => 'StatsBox AnswersBox'));
    
    to
    
    
                  Wrap(T('Comments')) . Gdn_Format::BigNumber(($Discussion->CountComments) -1), 'span', array('class' => 'StatsBox AnswersBox'));
        }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    sinnersinner New
    edited April 2014

    WOW! IT'S WORKING NOW! what a releive! , thanks a millionnss...

    ok, the 2nd question i want to ask is, how do i translate the word "Posts" in that column to my language? where do i define it?

    and one last thing, there's a yellow tag flying on the right of the categories space, how do i move it to the post, or remove it for good?

    thanks.

  • Options

    YOU'RE AWSOME! the translation works!

  • Options

    i dont know why the "new" yellow tag is flying around on top of the categories, do you have any ideas? attached screenshot.

Sign In or Register to comment.