From b666886416f793074669a7e2bc1d7cc3c2b4746a Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Fri, 16 Aug 2013 21:08:01 +1000 Subject: A few modifications: 1. Finally, clean up some of the crappy code in inc/display.php; no more extreme clutter. new Thread() and new Post() take an array as the first parameter now. 2. Poster country flags. Currently requires the "geoip" extension. 3. Give post images a classname. This was also long-overdue. --- inc/mod/pages.php | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'inc/mod') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 932b2ed6..9f8fcc5c 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -780,19 +780,9 @@ function mod_page_ip($ip) { while ($post = $query->fetch(PDO::FETCH_ASSOC)) { if (!$post['thread']) { - // TODO: There is no reason why this should be such a fucking mess. - $po = new Thread( - $post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], $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'], - $post['sage'], $post['embed'], '?/', $mod, false - ); + $po = new Thread($post, '?/', $mod, false); } else { - $po = new Post( - $post['id'], $post['thread'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], - $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], - $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['embed'], '?/', $mod - ); + $po = new Post($post, '?/', $mod); } if (!isset($args['posts'][$board['uri']])) @@ -1907,19 +1897,9 @@ function mod_reports() { if (!$post['thread']) { // Still need to fix this: - $po = new Thread( - $post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], - $post['capcode'], $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'], $post['sage'], $post['embed'], '?/', $mod, false - ); + $po = new Thread($post, '?/', $mod, false); } else { - $po = new Post( - $post['id'], $post['thread'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], - $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], - $post['fileheight'], $post['filesize'], $post['filename'], $post['ip'], $post['embed'], '?/', $mod - ); + $po = new Post($post, '?/', $mod); } // a little messy and inefficient -- cgit v1.3 From 47ddd2f8b24b115a26403d7d7a1d8bdcb0da6c5d Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Fri, 16 Aug 2013 22:18:57 +1000 Subject: Fix editing raw HTML posts --- inc/mod/pages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/mod') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 9f8fcc5c..457f905b 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1283,7 +1283,7 @@ function mod_edit_post($board, $edit_raw_html, $postID) { $query->bindValue(':subject', $_POST['subject']); $query->bindValue(':body', $_POST['body']); if ($edit_raw_html) { - $body_nomarkup = '' . $_POST['body'] . ''; + $body_nomarkup = $_POST['body'] . '1'; $query->bindValue(':body_nomarkup', $body_nomarkup); } $query->execute() or error(db_error($query)); -- cgit v1.3