diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-22 10:09:59 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-22 10:09:59 +1100 |
| commit | 41b2990234746b6412ff2140b73ffb771a14a287 (patch) | |
| tree | f43f5cb000b3d2862d636ca50da4ce368861675a /post.php | |
| parent | be860577a9ef34915577145ef830bbfab525484a (diff) | |
syslog() reports and deletions
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -48,7 +48,7 @@ error($config['error']['nodelete']); foreach($delete as &$id) { - $query = prepare(sprintf("SELECT `time`,`password` FROM `posts_%s` WHERE `id` = :id", $board['uri'])); + $query = prepare(sprintf("SELECT `thread`, `time`,`password` FROM `posts_%s` WHERE `id` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); @@ -67,6 +67,10 @@ // Delete entire post deletePost($id); } + + _syslog(LOG_INFO, 'Deleted post: ' . + '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['thread'] ? '#' . $id : '') + ); } } @@ -110,10 +114,19 @@ markup($reason); foreach($report as &$id) { - $query = prepare(sprintf("SELECT 1 FROM `posts_%s` WHERE `id` = :id", $board['uri'])); + $query = prepare(sprintf("SELECT `thread` FROM `posts_%s` WHERE `id` = :id", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT); $query->execute() or error(db_error($query)); + if($config['syslog']) { + $post = $query->fetch(); + + _syslog(LOG_INFO, 'Reported post: ' . + '/' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $id) . ($post['thread'] ? '#' . $id : '') . + ' for "' . $reason . '"' + ); + } + if($post = $query->fetch()) { $query = prepare("INSERT INTO `reports` VALUES (NULL, :time, :ip, :board, :post, :reason)"); $query->bindValue(':time', time(), PDO::PARAM_INT); |
