Mod Name / Version: Decrease Post Count When Post Is Deleted
Description: If a user, admin, or moderator deletes a user's post with the 'Delete this post' button, their post count will decrease by 1.
This prevents people from padding their count by making bogus posts, which either they or an admin/moderator end up deleting afterwards.
Working Under: UBB.Threads 6.3
Mod Status: Finished
Any pre-requisites: Author(s): Twisty
Date: 08/25/04
Credits: Files Altered: deletepost.php
New Files: Database Altered: no
Info/Instructions: In deletepost.php...
CHANGE THIS:
// ----------------------------------------------------------------<br />// Find out if there are any file attachments so we can delete them.<br /> if ($File) {<br /> unlink("{$config['files']}/$File");<br /> }
TO THIS:
// ----------------------------------------------------------------<br />// Find out if there are any file attachments so we can delete them.<br /> if ($File) {<br /> unlink("{$config['files']}/$File");<br /> }<br /><br /> // Hack - Decrease their post count by 1 <br /> $query = "<br /> UPDATE {$config['tbprefix']}Users<br /> SET U_Totalposts = U_Totalposts - 1,<br /> U_Laston = '$date'<br /> WHERE U_Number = '$Postedby'<br /> ";<br /><br /> $dbh -> do_query($query);
Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.