From 0d45fbc7992b8e55bc4a9df079f9ae0ed3b85e64 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 03:39:58 +1000 Subject: [PATCH 1/3] Add \n before post modifiers. Add flag alt for country flags. --- inc/mod/pages.php | 2 +- post.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 457f905b..fe55b513 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'] . '1'; + $body_nomarkup = $_POST['body'] . "\n1"; $query->bindValue(':body_nomarkup', $body_nomarkup); } $query->execute() or error(db_error($query)); diff --git a/post.php b/post.php index 92035f77..49f569f4 100644 --- a/post.php +++ b/post.php @@ -422,7 +422,7 @@ if (isset($_POST['delete'])) { $post['body'] = escape_markup_modifiers($post['body']); if ($mod && isset($post['raw']) && $post['raw']) { - $post['body'] .= '1'; + $post['body'] .= "\n1"; } if ($config['country_flags']) { @@ -430,7 +430,8 @@ if (isset($_POST['delete'])) { error('GeoIP not available: ' . geoip_db_filename(GEOIP_COUNTRY_EDITION)); } if ($country_code = @geoip_country_code_by_name($_SERVER['REMOTE_ADDR'])) { - $post['body'] .= '' . strtolower($country_code) . ''; + $post['body'] .= "\n" . strtolower($country_code) . "" . + "\n" . @geoip_country_name_by_name($_SERVER['REMOTE_ADDR']) . ""; } } From 885812749880c970505a51132704600690b5e2f5 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 04:07:32 +1000 Subject: [PATCH 2/3] Bugfix: post.filex => post.fileheight, etc. --- templates/post_reply.html | 4 ++-- templates/post_thread.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/post_reply.html b/templates/post_reply.html index 518a8edf..65fd576c 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -62,8 +62,8 @@ Spoiler Image, {% endif %} {{ post.filesize|filesize }} - {% if post.filex and post.filey %} - , {{ post.filex}}x{{ post.filey }} + {% if post.filewidth and post.fileheight %} + , {{ post.filewidth}}x{{ post.fileheight }} {% if config.show_ratio %} , {{ post.ratio }} {% endif %} diff --git a/templates/post_thread.html b/templates/post_thread.html index fa8495d5..23a05e81 100644 --- a/templates/post_thread.html +++ b/templates/post_thread.html @@ -14,8 +14,8 @@ {% trans %}Spoiler Image{% endtrans %}, {% endif %} {{ post.filesize|filesize }} - {% if post.filex and post.filey %} - , {{ post.filex}}x{{ post.filey }} + {% if post.filewidth and post.fileheight %} + , {{ post.filewidth}}x{{ post.fileheight }} {% if config.show_ratio %} , {{ post.ratio }} {% endif %} From e5103b543ad76c2809ed5ea15e55e0d04d7a36da Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 04:11:24 +1000 Subject: [PATCH 3/3] fix aspect ratio displaying --- inc/display.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/display.php b/inc/display.php index c573db44..23794052 100644 --- a/inc/display.php +++ b/inc/display.php @@ -348,6 +348,10 @@ class Post { return $built; } + public function ratio() { + return fraction($this->filewidth, $this->fileheight, ':'); + } + public function build($index=false) { global $board, $config; @@ -464,6 +468,10 @@ class Thread { return $built; } + public function ratio() { + return fraction($this->filewidth, $this->fileheight, ':'); + } + public function build($index=false) { global $board, $config, $debug;