Username:
Password:
Remember me:
Register

Back to forum: Feature suggestions


Search forums via Google


1 Users appreciate this thread.

Thread comment count fix
Started by angelrulez7
(2014-05-21 04:55:44)
angelrulez7 (2014-05-21 04:55:44)
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

This post has been edited one or more times, the last time was:
2014-05-21 11:56:52

a
ConnorRonnoc (2014-05-21 06:56:55)
wat
bite za dusto
DrakeJericho (2014-05-21 13:11:07)
<- noob at PHP

so yeh I approve for no reason at all
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-21 20:33:58)
Yeah, just using the same code. @carlos11
a
Perfect_Chaos (2014-05-21 23:22:46)
taw
angelrulez7 (2014-05-22 06:55:59)
wataw

This post has been edited one or more times, the last time was:
2014-05-22 13:57:54

a
angelrulez7 (2014-05-22 23:48:25)
Well, the deleter 2000 should delete anyway... @mega
a
AgurettiLeaf (2014-05-23 13:01:29)
Agreed. 1+.
 

Log in to submit a comment

This topic's ID: 69925

Back to forum: Feature suggestions




Total registered users: 8322
New registered users today: 8
Newest registered user: Dolce21dsisBack

©  Copyright 2026 3DSPlaza. All Rights Reserved