1 Users appreciate this thread.
Thread comment count fix
carlos11 (2014-05-21 14:10:57)wat
What about the old threads from 2012 that don't even have a post count? Can they be fixed?
Language is a tool for efficient communication. The internet is a tool for fast communication. Do not defy both intents by posting incoherent writing.
angelrulez7 (2014-05-22 06:55:59)wataw
2014-05-22 13:57:54
a
Log in to submit a comment
Back to forum: Feature suggestions
New registered users today: 8
Newest registered user: Dolce21dsisBack

I haven't exactly seen this suggested, but here it is.
So, ever since 2012, after the "ugly" forum design, the post count hasn't been the same, as it doesn't update when something is deleted.
Even I could make a fix for this, as it's very simple.
ON DELETE PAGE:
[code=*php]<?php
$count = mysqli_num_rows(mysqli_query($con, "SELECT * FROM forum_comments WHERE forum = '$forum'" ));
$math = $count - 1;
mysqli_query($con, "UPDATE forums SET comments = '$math' WHERE forum = '$forum'" );
?>
[/code]
wat
This gets the current post count, subtracts one from it, and puts it in the DB. This will mean an accurate post count, and there can be a code on the main thread page that updates it to the correct postcount.
This is a bit more complex than the usual suggestion, so I will get plenty of "wat"s
2014-05-21 11:56:52