Browse Source

Finalized report syste,

pull/40/head
Savetheinternet 13 years ago
parent
commit
dd845f4c7e
  1. 7
      inc/config.php
  2. 13
      mod.php
  3. 5
      post.php
  4. 6
      style.css
  5. 2
      yotsuba.css

7
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.

13
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 .= '<p class="unimportant" style="text-align:center">Showing ' .
($reports == $count['count'] ? 'all ' . $reports . ' reports' : $reports . ' of ' . $count['count'] . ' reports') . '.</p>';
echo Element('page.html', Array(
'index'=>$config['root'],
'title'=>'Report queue',

5
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));
}
}

6
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;
@ -317,3 +320,6 @@ div.boardlist.bottom {
div.boardlist a {
text-decoration: none;
}
div.report {
color: #333;
}

2
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;

Loading…
Cancel
Save