From 11ea39a22c87bb7cdd4f158e1376eee9c4c09c7d Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sun, 20 Feb 2011 18:42:00 +1100 Subject: [PATCH] Removed pointless text --- mod.php | 66 +++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/mod.php b/mod.php index 04c17ac9..224b149d 100644 --- a/mod.php +++ b/mod.php @@ -113,44 +113,40 @@ $query->bindValue(':limit', $config['mod']['recent_reports'], PDO::PARAM_INT); $query->execute() or error(db_error($query)); - if($query->rowCount() < 1) - $body = '(Empty.)'; - else { - while($report = $query->fetch()) { - $p_query = prepare(sprintf("SELECT * FROM `posts_%s` WHERE `id` = :id", $report['uri'])); + while($report = $query->fetch()) { + $p_query = prepare(sprintf("SELECT * FROM `posts_%s` WHERE `id` = :id", $report['uri'])); + $p_query->bindValue(':id', $report['post'], PDO::PARAM_INT); + $p_query->execute() or error(db_error($query)); + + if(!$post = $p_query->fetch()) { + // Invalid report (post has since been deleted) + $p_query = prepare("DELETE FROM `reports` WHERE `post` = :id"); $p_query->bindValue(':id', $report['post'], PDO::PARAM_INT); $p_query->execute() or error(db_error($query)); - - if(!$post = $p_query->fetch()) { - // Invalid report (post has since been deleted) - $p_query = prepare("DELETE FROM `reports` WHERE `post` = :id"); - $p_query->bindValue(':id', $report['post'], PDO::PARAM_INT); - $p_query->execute() or error(db_error($query)); - } - - $reports++; - openBoard($report['uri']); - - if(!$post['thread']) { - $po = new Thread($post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['sticky'], $post['locked'], '?/', $mod, false); - } else { - $po = new Post($post['id'], $post['thread'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], '?/', $mod); - } - - $po->body .= - '
' . - '
' . - 'Board: ' . sprintf($config['board_abbreviation'], $report['uri']) . '
' . - 'Reason: ' . $report['reason'] . '
' . - 'Reported by: ' . $report['ip'] . '
' . - '
' . - ($mod['type'] >= $config['mod']['report_dismiss'] ? - 'Dismiss | ' : '') . - ($mod['type'] >= $config['mod']['report_dismiss_ip'] ? - 'Dismiss+' : '') . - '
'; - $body .= $po->build(true) . '
'; } + + $reports++; + openBoard($report['uri']); + + if(!$post['thread']) { + $po = new Thread($post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['sticky'], $post['locked'], '?/', $mod, false); + } else { + $po = new Post($post['id'], $post['thread'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], '?/', $mod); + } + + $po->body .= + '
' . + '
' . + 'Board: ' . sprintf($config['board_abbreviation'], $report['uri']) . '
' . + 'Reason: ' . $report['reason'] . '
' . + 'Reported by: ' . $report['ip'] . '
' . + '
' . + ($mod['type'] >= $config['mod']['report_dismiss'] ? + 'Dismiss | ' : '') . + ($mod['type'] >= $config['mod']['report_dismiss_ip'] ? + 'Dismiss+' : '') . + '
'; + $body .= $po->build(true) . '
'; } $query = query("SELECT COUNT(`id`) AS `count` FROM `reports`") or error(db_error());