diff --git a/library/ajax/view_post.php b/library/ajax/view_post.php index 51929cc4f..916ce6cb6 100644 --- a/library/ajax/view_post.php +++ b/library/ajax/view_post.php @@ -15,7 +15,7 @@ global $user, $lang, $bb_cfg; $post_id = isset($this->request['post_id']) ? (int)$this->request['post_id'] : null; $topic_id = isset($this->request['topic_id']) ? (int)$this->request['topic_id'] : null; -$return_text = $bb_cfg['show_post_bbcode_button'] && isset($this->request['return_text']) && (bool)$this->request['return_text']; +$return_text = $bb_cfg['show_post_bbcode_button']['enabled'] && isset($this->request['return_text']) && (bool)$this->request['return_text']; if (is_null($post_id)) { $post_id = DB()->fetch_row("SELECT topic_first_post_id FROM " . BB_TOPICS . " WHERE topic_id = $topic_id", 'topic_first_post_id'); diff --git a/library/config.php b/library/config.php index a6b52527e..c4417242e 100644 --- a/library/config.php +++ b/library/config.php @@ -521,7 +521,10 @@ $bb_cfg['sf_on_first_page_only'] = true; // Show subforums only on the first pag $bb_cfg['allowed_topics_per_page'] = [50, 100, 150, 200, 250, 300]; // Allowed number of topics per page // Topics -$bb_cfg['show_post_bbcode_button'] = true; // Show "Code" button in topic to display BBCode of topic +$bb_cfg['show_post_bbcode_button'] = [ // Show "Code" button in topic to display BBCode of topic + 'enabled' => true, + 'only_for_first_post' => true, +]; $bb_cfg['show_quick_reply'] = true; // Show quick reply forim $bb_cfg['show_rank_text'] = false; // Show user rank name in topics $bb_cfg['show_rank_image'] = true; // Show user rank image in topics diff --git a/src/Censor.php b/src/Censor.php index 9f8001713..b28aec723 100644 --- a/src/Censor.php +++ b/src/Censor.php @@ -46,10 +46,6 @@ class Censor $censoredWords = $datastore->get('censor'); } - if (isset($censoredWords['no_words'])) { - return; - } - foreach ($censoredWords as $word) { $this->words[] = '#(?replacements[] = $word['replacement']; diff --git a/src/Legacy/BBCode.php b/src/Legacy/BBCode.php index 622718974..b191e8f51 100644 --- a/src/Legacy/BBCode.php +++ b/src/Legacy/BBCode.php @@ -19,7 +19,7 @@ class BBCode public array $tpl = []; /** @var array $smilies Replacements for smilies */ - public $smilies; + public array $smilies; /** @var array $tidy_cfg Tidy preprocessor configuration */ public array $tidy_cfg = [ @@ -336,7 +336,8 @@ class BBCode { global $datastore; - if (null === $this->smilies) { + if (!$this->smilies = $datastore->get('smile_replacements')) { + $datastore->update('smile_replacements'); $this->smilies = $datastore->get('smile_replacements'); } diff --git a/styles/templates/default/viewtopic.tpl b/styles/templates/default/viewtopic.tpl index 09fdbc871..c69be6cd1 100644 --- a/styles/templates/default/viewtopic.tpl +++ b/styles/templates/default/viewtopic.tpl @@ -16,7 +16,7 @@ - +