From b44bc16bd02a78752ffefb4bbe3faf7337f17669 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 24 Jun 2003 16:46:30 +0000 Subject: Fix up display of sigs and bbcode for preview git-svn-id: file:///svn/phpbb/trunk@4170 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'phpBB/includes/bbcode.php') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index f187a62b58..318a495858 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -24,7 +24,7 @@ class bbcode var $bbcode_uid = ''; var $bbcode_bitfield = 0; var $bbcode_cache = array(); - var $bbcode_tpl = array(); + var $bbcode_template = array(); function bbcode($bitfield = 0) { @@ -257,27 +257,31 @@ class bbcode function bbcode_tpl($tpl_name, $bbcode_id = -1) { - static $bbcode_hardtpl = array( - 'b_open' => '', - 'b_close' => '', - 'i_open' => '', - 'i_close' => '', - 'u_open' => '', - 'u_close' => '', - 'url' => '\2', - 'img' => '', - 'size' => '\2', - 'color' => '\2', - 'email' => '\2' - ); global $template, $user; + if (empty($bbcode_hardtpl)) + { + static $bbcode_hardtpl = array( + 'b_open' => '', + 'b_close' => '', + 'i_open' => '', + 'i_close' => '', + 'u_open' => '', + 'u_close' => '', + 'url' => '\2', + 'img' => '', + 'size' => '\2', + 'color' => '\2', + 'email' => '\2' + ); + } + if ($bbcode_id != -1 && !($user->theme['bbcode_bitfield'] & pow(2, $bbcode_id))) { return $bbcode_hardtpl[$tpl_name]; } - if (empty($this->bbcode_tpl)) + if (empty($this->bbcode_template)) { $tpl_filename = $template->make_filename('bbcode.html'); @@ -296,13 +300,13 @@ class bbcode $tpl = preg_replace("/\n[\n\r\s\t]*/", '', $tpl); // Turn template blocks into PHP assignment statements for the values of $bbcode_tpl.. - $tpl = preg_replace('#(.*?)#', "\n" . "\$this->bbcode_tpl['\\1'] = \$this->bbcode_tpl_replace('\\1','\\2');", $tpl); + $tpl = preg_replace('#(.*?)#', "\n" . "\$this->bbcode_template['\\1'] = \$this->bbcode_tpl_replace('\\1','\\2');", $tpl); - $this->bbcode_tpl = array(); + $this->bbcode_template = array(); eval($tpl); } - return $this->bbcode_tpl[$tpl_name]; + return $this->bbcode_template[$tpl_name]; } function bbcode_tpl_replace($tpl_name, $tpl) -- cgit v1.2.1