From 2fa463cdeb5d8e4f2373aa834154ca27ea21c97a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 16 Sep 2004 18:33:22 +0000 Subject: - more updates, mostly bugfixes to the bbcode parser - changed current_user in sessions (please review) - give more flexibility to style authors in regard to the pagination elements - profile fields updates (included a sample constuct into viewtopic_body.html - have to be documented extensivly) - code optimizations (use of strpos, sizeof, loops not iterating functions on every call, memory savings...) - and last but not least --- hopefully not introduced more bugs than healthy (*cough*) git-svn-id: file:///svn/phpbb/trunk@4984 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/template.php') diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 60cab6bd6c..71ab2bbc45 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -350,7 +350,7 @@ class template } $compile_blocks = array(); - for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++) + for ($curr_tb = 0, $tb_size = sizeof($text_blocks); $curr_tb < $tb_size; $curr_tb++) { switch ($blocks[1][$curr_tb]) { @@ -427,7 +427,7 @@ class template } $template_php = ''; - for ($i = 0; $i < count($text_blocks); $i++) + for ($i = 0, $size = sizeof($text_blocks); $i < $size; $i++) { $trim_check_text = trim($text_blocks[$i]); $trim_check_block = trim($compile_blocks[$i]); @@ -450,7 +450,7 @@ class template // This one will handle varrefs WITH namespaces preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)(\$)?([A-Z0-9\-_]+?)\}#', $text_blocks, $varrefs); - for ($j = 0; $j < sizeof($varrefs[1]); $j++) + for ($j = 0, $size = sizeof($varrefs[1]); $j < $size; $j++) { $namespace = $varrefs[1][$j]; $varname = $varrefs[4][$j]; @@ -541,7 +541,7 @@ class template $tokens = $match[0]; $is_arg_stack = array(); - for ($i = 0; $i < count($tokens); $i++) + for ($i = 0, $size = sizeof($tokens); $i < $size; $i++) { $token = &$tokens[$i]; -- cgit v1.2.1