diff -r 000000000000 -r f9ffdbd96607 punbb/admin_reports.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/punbb/admin_reports.php Wed Jul 11 21:01:48 2007 -0400 @@ -0,0 +1,161 @@ + PUN_MOD) + message($lang_common['No permission']); + + +// Zap a report +if (isset($_POST['zap_id'])) +{ + confirm_referrer('admin_reports.php'); + + $zap_id = intval(key($_POST['zap_id'])); + + $result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error()); + $zapped = $db->result($result); + + if ($zapped == '') + $db->query('UPDATE '.$db->prefix.'reports SET zapped='.time().', zapped_by='.$pun_user['id'].' WHERE id='.$zap_id) or error('Unable to zap report', __FILE__, __LINE__, $db->error()); + + redirect('admin_reports.php', 'Report zapped. Redirecting …'); +} + + +$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Reports'; +require PUN_ROOT.'header.php'; + +generate_admin_menu('reports'); + +?> +
+

New reports

+
+
+query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, r.message, t.subject, f.forum_name, u.username AS reporter FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id WHERE r.zapped IS NULL ORDER BY created DESC') or error('Unable to fetch report list', __FILE__, __LINE__, $db->error()); + +if ($db->num_rows($result)) +{ + while ($cur_report = $db->fetch_assoc($result)) + { + $reporter = ($cur_report['reporter'] != '') ? ''.pun_htmlspecialchars($cur_report['reporter']).'' : 'Deleted user'; + $forum = ($cur_report['forum_name'] != '') ? ''.pun_htmlspecialchars($cur_report['forum_name']).'' : 'Deleted'; + $topic = ($cur_report['subject'] != '') ? ''.pun_htmlspecialchars($cur_report['subject']).'' : 'Deleted'; + $post = ($cur_report['post_id'] != '') ? str_replace("\n", '
', pun_htmlspecialchars($cur_report['message'])) : 'Deleted'; + $postid = ($cur_report['post_id'] != '') ? 'Post #'.$cur_report['post_id'].'' : 'Deleted'; + +?> +
+
+ Reported +
+ + + + + + + + + +
Forum » Topic » Post »  » 
Report by
+
+
+
+There are no new reports.

'."\n"; + +?> +
+
+
+ +
+

10 last zapped reports

+
+
+query('SELECT r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.message, r.zapped, r.zapped_by AS zapped_by_id, t.subject, f.forum_name, u.username AS reporter, u2.username AS zapped_by FROM '.$db->prefix.'reports AS r LEFT JOIN '.$db->prefix.'topics AS t ON r.topic_id=t.id LEFT JOIN '.$db->prefix.'forums AS f ON r.forum_id=f.id LEFT JOIN '.$db->prefix.'users AS u ON r.reported_by=u.id LEFT JOIN '.$db->prefix.'users AS u2 ON r.zapped_by=u2.id WHERE r.zapped IS NOT NULL ORDER BY zapped DESC LIMIT 10') or error('Unable to fetch report list', __FILE__, __LINE__, $db->error()); + +if ($db->num_rows($result)) +{ + while ($cur_report = $db->fetch_assoc($result)) + { + $reporter = ($cur_report['reporter'] != '') ? ''.pun_htmlspecialchars($cur_report['reporter']).'' : 'Deleted user'; + $forum = ($cur_report['forum_name'] != '') ? ''.pun_htmlspecialchars($cur_report['forum_name']).'' : 'Deleted'; + $topic = ($cur_report['subject'] != '') ? ''.pun_htmlspecialchars($cur_report['subject']).'' : 'Deleted'; + $post = ($cur_report['post_id'] != '') ? str_replace("\n", '
', pun_htmlspecialchars($cur_report['message'])) : 'Post deleted'; + $post_id = ($cur_report['post_id'] != '') ? 'Post #'.$cur_report['post_id'].'' : 'Deleted'; + $zapped_by = ($cur_report['zapped_by'] != '') ? ''.pun_htmlspecialchars($cur_report['zapped_by']).'' : 'N/A'; + +?> +
+
+ Zapped +
+ + + + + + + + + +
Forum » Topic » Post »  » 
Reported by
Zapped by
+
+
+
+There are no zapped reports.

'."\n"; + +?> +
+
+
+
+ +