Results 1 to 5 of 5
  1. #1
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0

    Comment Count Update

    I think there is a bug with the way the link_comments field is updated in the links table. I have several stories where the comment count has been reset when a comment has been added (example - 2 comments already there, 3rd added, count now at 1).

    This is will pligg b9.5, shared host running on linux.

    The update seems to happen in libs/comment.php, at the line $link->adjust_comment(1). For now (after a couple of attempts) I've let it re-calculate the comment count everytime a new comment is posted:

    Code:
    $comment_count = $db->get_var("SELECT count(*) FROM " . table_comments . " WHERE comment_link_id='$comment_link'");
    $sql = "UPDATE " . table_links . " SET link_comments='$comment_count' WHERE link_id='$comment_link'";
    $db->query($sql);

  2. #2
    Pligg Donor dollars5's Avatar
    Joined
    Dec 2006
    Posts
    1,960
    Thanks
    Received:0
    Given: 0
    I think you refer to this and is alredy mentioned at http://forums.pligg.com/showpost.php...01&postcount=4

  3. #3
    Constant Pligger Simon's Avatar
    Joined
    Mar 2006
    Posts
    537
    Thanks
    Received:0
    Given: 0
    It's something more than that. I made that change, along with a re-calculation of the comment number when posting a new comment to minimise errors. However, I just posted a new comment in a pligg installation, and when I returned to the front page, several other stories (random seemingly) had their comment count reset to zero. Very strange...

    The other bug is that when a story gets published, its comment count is also reset to zero. Does anyone know where resets like this could be occuring?

  4. #4
    Pligg Donor dollars5's Avatar
    Joined
    Dec 2006
    Posts
    1,960
    Thanks
    Received:0
    Given: 0
    This is very strange - I will comment on it after I could confirm on this issue. Is that this happens only on 9.5 or older ones too?

  5. #5
    New Pligger DarrenS's Avatar
    Joined
    May 2007
    Posts
    17
    Thanks
    Received:0
    Given: 0
    This seems to be happening to me, as well. I've just installed the latest Pligg and have my first thread to reach three comments. I posted the third comment and revisited the home page, only to notice that the comment count is at 1.

    I'll continue watching to see if all stories with comments behave this way ... And is it only triggered by comment #3?

Similar Threads

  1. How to Replace Pligg Comment Box to Facebook Comment Box ?
    By 12kerala in forum Questions & Comments
    Replies: 4
    Last Post: 04-24-2012, 01:24 PM
  2. Story Comment Count not working
    By aaronpais in forum Questions & Comments
    Replies: 6
    Last Post: 04-12-2010, 11:14 AM
  3. 9.8.1 upgrade: comment count not showing up
    By nothingman in forum Questions & Comments
    Replies: 2
    Last Post: 02-21-2008, 07:01 PM
  4. Voting resets comment count to zero (b9.6)
    By Simon in forum Questions & Comments
    Replies: 7
    Last Post: 06-22-2007, 06:01 PM
  5. story comment count
    By daone in forum Questions & Comments
    Replies: 0
    Last Post: 03-06-2007, 07:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg