diff -r e3d7322305bf -r 5e1f1e916419 punbb/admin/reports.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/punbb/admin/reports.php Sat Apr 05 23:56:45 2008 -0400
@@ -0,0 +1,254 @@
+ $_ )
+{
+ $$key =& $GLOBALS[$key];
+}
+
+($hook = get_hook('arp_start')) ? eval($hook) : null;
+
+if (!$pun_user['is_admmod'])
+ message($lang_common['No permission']);
+
+// Load the admin.php language file
+require PUN_ROOT.'lang/'.$pun_user['language'].'/admin.php';
+$GLOBALS['lang_admin'] = $lang_admin;
+
+
+// Mark reports as read
+if (isset($_POST['mark_as_read']))
+{
+ if (empty($_POST['reports']))
+ message($lang_admin['No reports selected']);
+
+ ($hook = get_hook('arp_mark_as_read_form_submitted')) ? eval($hook) : null;
+
+ $reports_to_mark = array_map('intval', array_keys($_POST['reports']));
+
+ $query = array(
+ 'UPDATE' => 'reports',
+ 'SET' => 'zapped='.time().', zapped_by='.$pun_user['id'],
+ 'WHERE' => 'id IN('.implode(',', $reports_to_mark).') AND zapped IS NULL'
+ );
+
+ ($hook = get_hook('arp_qr_mark_reports_as_read')) ? eval($hook) : null;
+ $pun_db->query_build($query) or error(__FILE__, __LINE__);
+
+ pun_redirect(pun_link($pun_url['admin_reports']), $lang_admin['Reports marked read'].' '.$lang_admin['Redirect']);
+}
+
+$pun_page['fld_count'] = $pun_page['set_count'] = 0;
+
+// Setup breadcrumbs
+$pun_page['crumbs'] = array(
+ array($pun_config['o_board_title'], pun_link($pun_url['index'])),
+ array($lang_admin['Forum administration'], pun_link($pun_url['admin_index'])),
+ $lang_admin['Reports']
+);
+
+($hook = get_hook('arp_pre_header_load')) ? eval($hook) : null;
+
+define('PUN_PAGE_SECTION', 'management');
+define('PUN_PAGE', 'admin-reports');
+require PUN_ROOT.'header.php';
+
+?>
+
+
+
+
+
+
{ }
+
+
+
+
+
+
+ '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' => 'reports AS r',
+ 'JOINS' => array(
+ array(
+ 'LEFT JOIN' => 'topics AS t',
+ 'ON' => 'r.topic_id=t.id'
+ ),
+ array(
+ 'LEFT JOIN' => 'forums AS f',
+ 'ON' => 'r.forum_id=f.id'
+ ),
+ array(
+ 'LEFT JOIN' => 'users AS u',
+ 'ON' => 'r.reported_by=u.id'
+ )
+ ),
+ 'WHERE' => 'r.zapped IS NULL',
+ 'ORDER BY' => 'r.created DESC'
+);
+
+($hook = get_hook('arp_qr_get_new_reports')) ? eval($hook) : null;
+$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
+if ($pun_db->num_rows($result))
+{
+
+?>
+
+
+
+
+
+
+
+
+
+
+ 'r.id, r.post_id, r.topic_id, r.forum_id, r.reported_by, r.created, 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' => 'reports AS r',
+ 'JOINS' => array(
+ array(
+ 'LEFT JOIN' => 'topics AS t',
+ 'ON' => 'r.topic_id=t.id'
+ ),
+ array(
+ 'LEFT JOIN' => 'forums AS f',
+ 'ON' => 'r.forum_id=f.id'
+ ),
+ array(
+ 'LEFT JOIN' => 'users AS u',
+ 'ON' => 'r.reported_by=u.id'
+ ),
+ array(
+ 'LEFT JOIN' => 'users AS u2',
+ 'ON' => 'r.zapped_by=u2.id'
+ )
+ ),
+ 'WHERE' => 'r.zapped IS NOT NULL',
+ 'ORDER BY' => 'r.zapped DESC',
+ 'LIMIT' => '10'
+);
+
+($hook = get_hook('arp_qr_get_last_zapped_reports')) ? eval($hook) : null;
+$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
+if ($pun_db->num_rows($result))
+{
+ $i = 1;
+ $pun_page['num_items'] = 0;
+ while ($cur_report = $pun_db->fetch_assoc($result))
+ {
+ $reporter = ($cur_report['reporter'] != '') ? '
'.htmlspecialchars($cur_report['reporter']).'' : $lang_admin['Deleted user'];
+ $forum = ($cur_report['forum_name'] != '') ? '
'.htmlspecialchars($cur_report['forum_name']).'' : $lang_admin['Deleted forum'];
+ $topic = ($cur_report['subject'] != '') ? '
'.htmlspecialchars($cur_report['subject']).'' : $lang_admin['Deleted topic'];
+ $post = ($cur_report['post_id'] != '') ? str_replace("\n", '
', htmlspecialchars($cur_report['message'])) : $lang_admin['Deleted post'];
+ $post_id = ($cur_report['post_id'] != '') ? '
Post #'.$cur_report['post_id'].'' : $lang_admin['Deleted post'];
+ $zapped_by = ($cur_report['zapped_by'] != '') ? '
'.htmlspecialchars($cur_report['zapped_by']).'' : $lang_admin['Deleted user'];
+
+?>
+
+
+
+
+
+
+
+