From b48d7492a207f1d0ba4cd1435f189cf9e1c54301 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 20 May 2003 13:24:23 +0000 Subject: Enable view limiting functions ... Ashe, not sure if this is compatible with your thinking for bbcode but it seems the "logical" way to handle disabling of bbcode/flash in this manner. Fixed issue with automatic url handling of local links git-svn-id: file:///svn/phpbb/trunk@4028 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 48 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'phpBB/includes/bbcode.php') diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 601150aed8..3564fc04bf 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -96,6 +96,8 @@ class bbcode // function bbcode_cache_init() { + global $user; + $sql = ''; $bbcode_ids = array(); @@ -173,12 +175,23 @@ class bbcode ); break; case 4: - $this->bbcode_cache[$bbcode_id] = array( - 'preg' => array( - '#\[img:$uid\](.*?)\[/img:$uid\]#s' => '' - ) - ); - break; + if ($user->data['user_viewimg']) + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[img:$uid\](.*?)\[/img:$uid\]#s' => '' + ) + ); + } + else + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[img:$uid\](.*?)\[/img:$uid\]#s' => '[ img ]' + ) + ); + } + break; case 5: $this->bbcode_cache[$bbcode_id] = array( 'preg' => array( @@ -232,12 +245,23 @@ class bbcode ); break; case 11: - $this->bbcode_cache[$bbcode_id] = array( - 'preg' => array( - '#\[flash:$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash') - ) - ); - break; + if ($user->data['user_viewimages']) + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[flash:$uid\](.*?)\[/flash:$uid\]#' => $this->bbcode_tpl('flash') + ) + ); + } + else + { + $this->bbcode_cache[$bbcode_id] = array( + 'preg' => array( + '#\[flash:$uid\](.*?)\[/flash:$uid\]#s' => '[ flash ]' + ) + ); + } + break; default: if (isset($rowset[$bbcode_id])) { -- cgit v1.2.1