summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-20 23:21:03 +0100
committermsquare <msquare@notrademark.de>2017-12-20 23:21:03 +0100
commita0f70d9819532bca9def088e1089940b2696abf3 (patch)
tree43d79762b557a13ffdd12758cb0fbaba98041d2d /includes
parenta1c032642fb1ca16779de125c690a77b8e25e737 (diff)
solve problem with autobreaks in news text when building html tables
Diffstat (limited to 'includes')
-rw-r--r--includes/pages/user_news.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/includes/pages/user_news.php b/includes/pages/user_news.php
index b51b0a4c..0da49c8e 100644
--- a/includes/pages/user_news.php
+++ b/includes/pages/user_news.php
@@ -72,6 +72,18 @@ function user_meetings()
}
/**
+ * Renders the text content of a news entry
+ *
+ * @param array $news
+ * @return string HTML
+ */
+function news_text($news) {
+ $text = ReplaceSmilies($news['Text']);
+ $text = str_replace("\n\n", '<br><br>', $text);
+ return $text;
+}
+
+/**
* @param array $news
* @return string
*/
@@ -84,7 +96,7 @@ function display_news($news)
$html .= '<div class="panel-heading">';
$html .= '<h3 class="panel-title">' . ($news['Treffen'] == 1 ? '[Meeting] ' : '') . ReplaceSmilies($news['Betreff']) . '</h3>';
$html .= '</div>';
- $html .= '<div class="panel-body">' . ReplaceSmilies(nl2br($news['Text'])) . '</div>';
+ $html .= '<div class="panel-body">' . news_text($news) . '</div>';
$html .= '<div class="panel-footer text-muted">';
if (in_array('admin_news', $privileges)) {