* dont add extra <br/> to the TinyMCE news forum posts

This commit is contained in:
slawkens1
2018-01-05 21:44:19 +01:00
parent 2e4321872a
commit 5475bd6b5f
3 changed files with 15 additions and 5 deletions

View File

@@ -88,8 +88,11 @@ if(Forum::canPost($account_logged))
$threads = $db->query("SELECT `players`.`name`, `" . TABLE_PREFIX . "forum`.`post_text`, `" . TABLE_PREFIX . "forum`.`post_topic`, `" . TABLE_PREFIX . "forum`.`post_smile` FROM `players`, `" . TABLE_PREFIX . "forum` WHERE `players`.`id` = `" . TABLE_PREFIX . "forum`.`author_guid` AND `" . TABLE_PREFIX . "forum`.`first_post` = ".(int) $thread_id." ORDER BY `" . TABLE_PREFIX . "forum`.`post_date` DESC LIMIT 5")->fetchAll();
// check if its news written in tinymce
$bb_code = ($thread['post_text'] == strip_tags($thread['post_text'])) || (!$player_account->hasFlag(FLAG_CONTENT_NEWS) && !$player_account->isSuperAdmin());
foreach($threads as &$thread) {
$thread['post'] = Forum::showPost($thread['post_topic'], $thread['post_text'], $thread['post_smile']);
$thread['post'] = Forum::showPost($thread['post_topic'], $thread['post_text'], $thread['post_smile'], $bb_code);
}
echo $twig->render('forum.new_post.html.twig', array(