From 0395bd3cd7a78b41d476936b08b182ed33197ed8 Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Wed, 23 Oct 2013 10:39:30 +0000 Subject: [PATCH] Only show reports from the board you're from --- inc/mod/pages.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 07a7b96a..bc66f797 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -100,7 +100,12 @@ function mod_dashboard() { cache::set('pm_unreadcount_' . $mod['id'], $args['unread_pms']); } - $query = query('SELECT COUNT(*) FROM ``reports``') or error(db_error($query)); + $query = prepare('SELECT COUNT(*) FROM ``reports``' . ($mod["type"] == "20" ? "WHERE board = :board" : "")); + + if ($mod['type'] == '20') + $query->bindValue(':board', $mod['boards'][0]); + + $query->execute() or error(db_error($query)); $args['reports'] = $query->fetchColumn(); if ($mod['type'] >= ADMIN && $config['check_updates']) { @@ -1995,8 +2000,12 @@ function mod_reports() { if (!hasPermission($config['mod']['reports'])) error($config['error']['noaccess']); - $query = prepare("SELECT * FROM ``reports`` ORDER BY `time` DESC LIMIT :limit"); + $query = prepare("SELECT * FROM ``reports`` " . ($mod["type"] == "20" ? "WHERE board = :board" : "") . " ORDER BY `time` DESC LIMIT :limit"); $query->bindValue(':limit', $config['mod']['recent_reports'], PDO::PARAM_INT); + + if ($mod['type'] == '20') + $query->bindValue(':board', $mod['boards'][0]); + $query->execute() or error(db_error($query)); $reports = $query->fetchAll(PDO::FETCH_ASSOC);