MoMan |
08-18-2011 09:31 PM |
FYI with this mod you get a database error if you try to report a PM/VM/picture comment.
In order to fix this, change the plugin code to the following:
PHP Code:
if ($_POST['do'] == 'sendemail' AND isset($postinfo['postid']) AND !empty($_POST['reason'])) { $reports = $vbulletin->db->query_first("SELECT reports FROM " . TABLE_PREFIX . "post WHERE postid = " . $postinfo['postid']); if ($reports['reports'] + 1 >= $vbulletin->options['unapprove_reported_posts_num_reports'] OR is_member_of($vbulletin->userinfo, unserialize($vbulletin->options['unapprove_reported_posts_bypass_usergroups']))) { $modinfo = fetch_userinfo($postinfo['userid']); $uglist = $modinfo['usergroupid'] . iif(trim($modinfo['membergroupids']), ",$modinfo[membergroupids]"); if (!can_moderate(0, '', $modinfo['userid'], $uglist) OR ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) { require_once(DIR. '/includes/functions_databuild.php'); unapprove_post($postinfo['postid'], ($foruminfo['countposts'] AND !$postinfo['skippostcount']), true, $postinfo, $threadinfo, false); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET reports = 0 WHERE postid = " . $postinfo['postid']); } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET reports = reports + 1 WHERE postid = " . $postinfo['postid']); } } else { $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET reports = reports + 1 WHERE postid = " . $postinfo['postid']); } }
Essentially you are adding isset($postinfo['postid']) to the main conditional.
|