From 794c5749696c9fa2595ed3a1d7c836a0d984e11c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 22 Feb 2009 15:29:18 +0000 Subject: remove global and change $user-> to phpbb::$user-> git-svn-id: file:///svn/phpbb/trunk@9334 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'phpBB/includes/bbcode.php') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index d688f660f2..bea6d967ae 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -128,12 +128,10 @@ class bbcode */ function bbcode_cache_init() { - global $user; - if (empty($this->template_filename)) { - $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']); - $this->template_filename = PHPBB_ROOT_PATH . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html'; + $this->template_bitfield = new bitfield(phpbb::$user->theme['bbcode_bitfield']); + $this->template_filename = PHPBB_ROOT_PATH . 'styles/' . phpbb::$user->theme['template_path'] . '/template/bbcode.html'; if (!@file_exists($this->template_filename)) { @@ -163,8 +161,6 @@ class bbcode if (sizeof($sql)) { - global $db; - $sql = 'SELECT * FROM ' . BBCODES_TABLE . ' WHERE ' . $db->sql_in_set('bbcode_id', $sql); @@ -225,7 +221,7 @@ class bbcode break; case 4: - if ($user->optionget('viewimg')) + if (phpbb::$user->optionget('viewimg')) { $this->bbcode_cache[$bbcode_id] = array( 'preg' => array( @@ -304,7 +300,7 @@ class bbcode break; case 11: - if ($user->optionget('viewflash')) + if (phpbb::$user->optionget('viewflash')) { $this->bbcode_cache[$bbcode_id] = array( 'preg' => array( @@ -365,7 +361,7 @@ class bbcode } // Replace {L_*} lang strings - $bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl); + $bbcode_tpl = preg_replace('/{L_([A-Z_]+)}/e', "phpbb::\$user->lang('\$1')", $bbcode_tpl); if (!empty($rowset[$bbcode_id]['second_pass_replace'])) { @@ -398,8 +394,6 @@ class bbcode static $bbcode_hardtpl = array(); if (empty($bbcode_hardtpl)) { - global $user; - $bbcode_hardtpl = array( 'b_open' => '', 'b_close' => '', @@ -407,7 +401,7 @@ class bbcode 'i_close' => '', 'u_open' => '', 'u_close' => '', - 'img' => '' . $user->lang['IMAGE'] . '', + 'img' => '' . phpbb::$user->lang['IMAGE'] . '', 'size' => '$2', 'color' => '$2', 'email' => '$2' @@ -457,8 +451,6 @@ class bbcode */ function bbcode_tpl_replace($tpl_name, $tpl) { - global $user; - static $replacements = array( 'quote_username_open' => array('{USERNAME}' => '$1'), 'color' => array('{COLOR}' => '$1', '{TEXT}' => '$2'), @@ -469,7 +461,7 @@ class bbcode 'email' => array('{EMAIL}' => '$1', '{DESCRIPTION}' => '$2') ); - $tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl); + $tpl = preg_replace('/{L_([A-Z_]+)}/e', "phpbb::\$user->lang('\$1')", $tpl); if (!empty($replacements[$tpl_name])) { -- cgit v1.2.1