PDA

View Full Version : Unapproving Posts


Charlie2009
07-20-2009, 04:05 PM
Like many other forums, the forum I work with has a spam problem. In order to help contain the problem, we decided to open up the ability to "unapprove" posts to a non-moderator group. I have added a checkbox to the report bad post template. If the member checks that they are sure this is a spam post it will be hidden using the unapprove post function.



here is a snip from the report.php page that I modified.

$strAddReason = '';

if($_POST['chkSpam'] == '1')

{

require_once(DIR . '/includes/functions_databuild.php');

$strAddReason = '

This post has been sent to the moderation queue because it was flagged as SPAM';

unapprove_post($postid);

}



It uses a vBulletin function to unapprove the post and adds a line to the report text informing the moderators that a user has hidden a post (or thread). Then they can decide to restore the post or delete it. However, I am having a problem with the latest post display. This method does a great job at removing the offending post/thread. What it doesn't do is remove the post from the latest post in the forum display on the home page. The thread is listed to anyone, but only moderators can actually see the post (everyone else gets an invalid thread). Obviously I need to do something else here. Does anyone have any suggestions?



Thanks for taking a look!

Charlie2009
07-22-2009, 01:16 PM
If anyone is interested, I fixed my problem. I used the postid to obtain postinfo, then threadinfo. Once the forumid was obtained from the threadinfo I used the build_forum_counters($forumid) function. This took care of the issue.

johnbristol
12-24-2010, 07:09 PM
Thank you for adding your second post Charlie, that tells me my problem's solvable.