diff --git a/inc/config.php b/inc/config.php index 27352b5a..abfc38e3 100644 --- a/inc/config.php +++ b/inc/config.php @@ -227,6 +227,8 @@ $config['mod']['ip_banform'] = true; // How many recent posts, per board, to show in the IP summary page $config['mod']['ip_recentposts'] = 5; + // How many posts to display on the reports page + $config['mod']['recent_reports'] = 5; // Probably best not to change these: if(!defined('JANITOR')) { @@ -328,7 +330,10 @@ 'subject', 'post', 'body', - 'password' + 'password', + 'sticky', + 'lock', + 'raw' ); // A small file in the main directory indicating that the script has been ran and the board(s) have been generated. diff --git a/mod.php b/mod.php index 2e8a993e..04c17ac9 100644 --- a/mod.php +++ b/mod.php @@ -107,8 +107,12 @@ ); } elseif(preg_match('/^\/reports$/', $query)) { $body = ''; + $reports = 0; + + $query = prepare("SELECT `reports`.*, `boards`.`uri` FROM `reports` INNER JOIN `boards` ON `board` = `boards`.`id` ORDER BY `time` DESC LIMIT :limit"); + $query->bindValue(':limit', $config['mod']['recent_reports'], PDO::PARAM_INT); + $query->execute() or error(db_error($query)); - $query = query("SELECT `reports`.*, `boards`.`uri` FROM `reports` INNER JOIN `boards` ON `board` = `boards`.`id` ORDER BY `time` DESC") or error(db_error()); if($query->rowCount() < 1) $body = '(Empty.)'; else { @@ -124,6 +128,7 @@ $p_query->execute() or error(db_error($query)); } + $reports++; openBoard($report['uri']); if(!$post['thread']) { @@ -148,6 +153,12 @@ } } + $query = query("SELECT COUNT(`id`) AS `count` FROM `reports`") or error(db_error()); + $count = $query->fetch(); + + $body .= '

Showing ' . + ($reports == $count['count'] ? 'all ' . $reports . ' reports' : $reports . ' of ' . $count['count'] . ' reports') . '.

'; + echo Element('page.html', Array( 'index'=>$config['root'], 'title'=>'Report queue', diff --git a/post.php b/post.php index 5b1268da..23196c06 100644 --- a/post.php +++ b/post.php @@ -111,6 +111,9 @@ if(count($report) > $config['report_limit']) error($config['error']['toomanyreports']); + $reason = $_POST['reason']; + markup($reason); + foreach($report as &$id) { $query = prepare(sprintf("SELECT 1 FROM `posts_%s` WHERE `id` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); @@ -122,7 +125,7 @@ $query->bindValue(':ip', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR); $query->bindValue(':board', $board['id'], PDO::PARAM_INT); $query->bindValue(':post', $id, PDO::PARAM_INT); - $query->bindValue(':reason', htmlentities($_POST['reason']), PDO::PARAM_STR); + $query->bindValue(':reason', $reason, PDO::PARAM_STR); $query->execute() or error(db_error($query)); } } diff --git a/style.css b/style.css index 0b00f14e..c04cba83 100644 --- a/style.css +++ b/style.css @@ -140,6 +140,9 @@ div.post.op { margin-right: 20px; margin-bottom: 5px; } +div.post.op hr { + border-color: #D9BFB7; +} p.intro { margin: 0.5em 0; padding: 0; @@ -316,4 +319,7 @@ div.boardlist.bottom { } div.boardlist a { text-decoration: none; +} +div.report { + color: #333; } \ No newline at end of file diff --git a/yotsuba.css b/yotsuba.css index a3809209..8a150157 100644 --- a/yotsuba.css +++ b/yotsuba.css @@ -46,7 +46,7 @@ div.pages a.selected { color: #800; } hr { - border-color: 1px solid #D9BFB7; + border-color: #D9BFB7; } div.boardlist { color: #B86;