diff options
author | Chad Little <clittle@users.sourceforge.net> | 2004-05-19 03:45:07 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2004-05-19 03:45:07 +0000 |
commit | 0696d5967469f46c14bf1cdbc8c9ed0ad3fe3aff (patch) | |
tree | 47101492ee8db3d9f6c1c0128783e8a5734fd307 /functions/template.php | |
parent | afcfa0c4ab39291d30ded5e111c5537698e7c84e (diff) | |
download | phpicalendar-0696d5967469f46c14bf1cdbc8c9ed0ad3fe3aff.tar.gz phpicalendar-0696d5967469f46c14bf1cdbc8c9ed0ad3fe3aff.tar.bz2 phpicalendar-0696d5967469f46c14bf1cdbc8c9ed0ad3fe3aff.zip |
Code optimization: Specifically replace each language variable instead of
looking for any.
Diffstat (limited to 'functions/template.php')
-rw-r--r-- | functions/template.php | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/functions/template.php b/functions/template.php index 1ad8e3f..6d7134c 100644 --- a/functions/template.php +++ b/functions/template.php @@ -785,7 +785,7 @@ class Page { } } while ($whole_month == TRUE); - $return = preg_replace('!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!is', $weekday_loop, $template_p); + $return = str_replace('<!-- loop weekday on -->'.$match1[1].'<!-- loop weekday off -->', $weekday_loop, $template_p); $return = preg_replace('!<\!-- loop monthweeks on -->(.*)<\!-- loop monthweeks off -->!is', $middle, $return); $return = str_replace('{MONTH_TITLE}', $month_title, $return); $return = str_replace('{CAL}', $cal, $return); @@ -909,16 +909,11 @@ class Page { } } - // Replace any languages - foreach ($lang as $tag => $data) { - $this->page = str_replace('{' . strtoupper($tag) . '}', $data, $this->page); - } - $php_ended = @getmicrotime(); $generated = number_format(($php_ended-$php_started),3); $this->page = str_replace('{GENERATED}', $generated, $this->page); if ($enable_rss != 'yes') { - $this->page = preg_replace('!<\!-- switch rss_powered on -->(.*)<\!-- switch rss_powered off -->!is', '', $this->page); + $this->page = preg_replace('!<\!-- switch rss_powered on -->(.*)<\!-- switch rss_powered off -->!is', '', $this->page); } else { $this->page = str_replace('{BASE}', BASE, $this->page); } |