From 22acbbf113c5568447113e63e9d44d3d40006599 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 31 Aug 2025 15:03:32 +0200 Subject: [PATCH 1/2] style.css: port post body padding to div.report --- stylesheets/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stylesheets/style.css b/stylesheets/style.css index d2130794..741b5ca7 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -808,6 +808,10 @@ hr { div.report { color: #333; + margin-left: 1.4em; + padding-right: 3em; + padding-bottom: 0.3em; + white-space: pre-wrap; } div.top_notice { From e6d188799eaeff566a033e184ee57dca1ee6fa2d Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 31 Aug 2025 15:12:33 +0200 Subject: [PATCH 2/2] pages.php: append dismiss buttons after the post, remove horrendous workaround --- inc/mod/pages.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2d5b87ab..477eeec2 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -3007,8 +3007,10 @@ function mod_reports(Context $ctx) { $po = new Post($post, '?/', $mod); } + $body .= $po->build(true); + // A little messy and inefficient. - $append_html = Element('mod/report.html', array( + $report_html = Element('mod/report.html', array( 'report' => $report, 'config' => $config, 'mod' => $mod, @@ -3016,22 +3018,7 @@ function mod_reports(Context $ctx) { 'token_all' => make_secure_link_token('reports/' . $report['id'] . '/dismissall') )); - // Bug fix for https://github.com/savetheinternet/Tinyboard/issues/21 - $po->body = truncate($po->body, $po->link(), $config['body_truncate'] - substr_count($append_html, '
')); - - if (\mb_strlen($po->body) + \mb_strlen($append_html) > $config['body_truncate_char']) { - // still too long; temporarily increase limit in the config - $__old_body_truncate_char = $config['body_truncate_char']; - $config['body_truncate_char'] = \mb_strlen($po->body) + \mb_strlen($append_html); - } - - $po->body .= $append_html; - - $body .= $po->build(true) . '
'; - - if (isset($__old_body_truncate_char)) { - $config['body_truncate_char'] = $__old_body_truncate_char; - } + $body .= $report_html . '
'; } $count = \count($report_rows);