CMS Articles Unmatched Number of Commenents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • silynnie
    Member
    • May 2011
    • 30
    • 4.2.X

    [CMS] CMS Articles Unmatched Number of Commenents

    I have normally just had my forums as the main page but recenly installed the CMS and inherited some articles from my forum to the CMS.

    All of the Articles have the wrong number of comments attched.

    Click image for larger version

Name:	1.jpg
Views:	1
Size:	32.3 KB
ID:	3723998 This article shows 5 comments but.



    On when you click on the article is actually has 54 comments:

    Click image for larger version

Name:	2.jpg
Views:	1
Size:	33.2 KB
ID:	3723999

    This is on all of my CMS articles:


    I.E On the main page Admins adsense method shows 1 comment: but when I open up the article it actually has 112 Comments ?

    How can this be updated so it is showig the actualy number of comments on the articles ?

    I have also run a few maintance updates with no success.

    Regards Si
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    Did you promote this article from a thread? On that promotion page is an option on whether to count the comments from the beginning or only since promoting that thread - did you select Yes for All Comments? https://www.vbulletin.com/forum/entr...ost-as-article

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools <- awesome site for html/css help

    Comment

    • silynnie
      Member
      • May 2011
      • 30
      • 4.2.X

      #3
      Yes I did, select yes for all comments, its just showing the wrong number of comments

      Comment

      • Farshid.T
        New Member
        • Jan 2011
        • 8
        • 4.1.x

        #4
        I have the same problem.
        Counter on the article preview and above article page defers from the counter below article page.

        This happens for some articles only. All Comments option is enabled and the original thread is promoted once only.

        - - - Updated - - -

        More details:
        {vb:raw comment_count} returns the wrong value at vbcms_content_article_preview and vbcms_content_article_page.

        Only the comment counter in {vb:raw comment_block} has the correct number of comments.

        The strange part is that the counter may be correct for few hours or a day but changes to 1 afterward. :-s
        HandheldUsers.com : The community of handheld users

        Comment

        • Robbed
          Member
          • Oct 2005
          • 98
          • 4.2.X

          #5
          Same problem all promoted articles display 1 comments when that's not the case

          http://tracker.vbulletin.com/browse/VBIV-14568 - this was closed but the issue isn't fixed.

          - - - Updated - - -

          Made these 2 changes and cleared system cache and it works now.

          fix was in bug report

          His quick fix was to edit the function getReplyCount in packages/vbcms/item/content/article.php and change the return value $count['comment_count'] to just $count as $count appears to be an integer

          diff:

          563c563
          < vB_Cache::instance()->write($hashkey, $count['comment_count'], 1440,

          > vB_Cache::instance()->write($hashkey, $count, 1440,
          565c565
          < return $count['comment_count'];

          > return $count;

          Comment

          • Farshid.T
            New Member
            • Jan 2011
            • 8
            • 4.1.x

            #6
            Originally posted by Robbed
            Made these 2 changes and cleared system cache and it works now.

            fix was in bug report

            His quick fix was to edit the function getReplyCount in packages/vbcms/item/content/article.php and change the return value $count['comment_count'] to just $count as $count appears to be an integer

            diff:

            563c563
            < vB_Cache::instance()->write($hashkey, $count['comment_count'], 1440,

            > vB_Cache::instance()->write($hashkey, $count, 1440,
            565c565
            < return $count['comment_count'];

            > return $count;
            I'm using vB 4.2.0 and the implementation of getReplyCount function is different.
            Code:
            	public function getReplyCount()
            	{
            		$this->Load();
            		return $this->replycount;
            	}
            What version are you using?
            HandheldUsers.com : The community of handheld users

            Comment

            • Robbed
              Member
              • Oct 2005
              • 98
              • 4.2.X

              #7
              VB 4.2.0 as well

              look for line 563 that shows

              vB_Cache::instance()->write($hashkey, $count['comment_count'], 1440,

              change to

              vB_Cache::instance()->write($hashkey, $count, 1440,

              line 565 find

              return $count['comment_count'];

              change to

              return $count;

              Clear system cache under maintenance and it worked for me.

              Comment

              • Farshid.T
                New Member
                • Jan 2011
                • 8
                • 4.1.x

                #8
                That worked!

                I was looking at content.php instead of /content/article.php.

                Thanks a lot.
                HandheldUsers.com : The community of handheld users

                Comment

                • silynnie
                  Member
                  • May 2011
                  • 30
                  • 4.2.X

                  #9
                  I dont understand where do I change these file sguys, in the style and templates ?

                  Comment

                  • silynnie
                    Member
                    • May 2011
                    • 30
                    • 4.2.X

                    #10
                    thanks got it works great

                    Comment

                    • Zachery
                      Former vBulletin Support
                      • Jul 2002
                      • 59097

                      #11
                      Originally posted by Robbed
                      VB 4.2.0 as well

                      look for line 563 that shows

                      vB_Cache::instance()->write($hashkey, $count['comment_count'], 1440,

                      change to

                      vB_Cache::instance()->write($hashkey, $count, 1440,

                      line 565 find

                      return $count['comment_count'];

                      change to

                      return $count;

                      Clear system cache under maintenance and it worked for me.
                      You should report this as a bug, if you haven't already.

                      Comment

                      • Robbed
                        Member
                        • Oct 2005
                        • 98
                        • 4.2.X

                        #12
                        I opened a new bug but it was closed.

                        It's still in pettition to reopen.



                        Sebastiano Vassellatti added a comment - 11/Jul/12 02:35 PM

                        This bug is in Petition to Reopen status and it will be reopened when the Petition to Reopen queue is reviewed. It is not necessary to create another issue.

                        Hopefully it will be fixed for the next update.

                        Comment

                        • Morrus
                          Senior Member
                          • Jan 2002
                          • 138
                          • 3.0.0 Beta 6

                          #13
                          We have a new 4.2.0 upgrade, and we're having exactly the same problem with thread promotions. Comment count on CMS page does not match comment count when you click through. Yes, all options were selected correctly as above. The above file edit solved the problem perfectly.
                          EN World

                          Comment

                          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                          Working...