diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2005-01-20 20:57:45 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-01-20 20:57:45 +0000 |
| commit | 9c1a4bdac16945c7d616b3449cc7d97a2548fc22 (patch) | |
| tree | 27e35d979f7b8fd6b7844a6cba941b5b04a438bd /phpBB/includes/session.php | |
| parent | a7ef13c639e048e9ee9edc25e7f7d9a5bf155812 (diff) | |
| download | forums-9c1a4bdac16945c7d616b3449cc7d97a2548fc22.tar forums-9c1a4bdac16945c7d616b3449cc7d97a2548fc22.tar.gz forums-9c1a4bdac16945c7d616b3449cc7d97a2548fc22.tar.bz2 forums-9c1a4bdac16945c7d616b3449cc7d97a2548fc22.tar.xz forums-9c1a4bdac16945c7d616b3449cc7d97a2548fc22.zip | |
- bugfixes
- default sort options for posts too
- adjusted format_date to remove the (time intensive) preg_ calls
- temporary style.php code.
git-svn-id: file:///svn/phpbb/trunk@5068 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
| -rw-r--r-- | phpBB/includes/session.php | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 46a99c2d38..f71d133378 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -590,6 +590,24 @@ class user extends session $this->theme[$style_priority]['pagination_sep'] = ', '; } + // TEMP + $this->theme['primary']['parse_css_file'] = false; + if (!$this->theme['primary']['theme_storedb'] && $this->theme['primary']['parse_css_file']) + { + $this->theme['primary']['theme_storedb'] = 1; + + $sql_ary = array( + 'theme_data' => implode('', file("{$phpbb_root_path}styles/" . $this->theme['primary']['theme_path'] . '/theme/stylesheet.css')), + 'theme_mtime' => time(), + 'theme_storedb' => 1 + ); + + $db->sql_query('UPDATE ' . STYLES_CSS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE theme_id = ' . $style); + + unset($sql_ary); + } + $template->set_template(); $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['primary']['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang']; @@ -703,17 +721,20 @@ class user extends session $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $this->timezone - $this->dst; } - if ($gmepoch > $midnight && !$forcedate) + if (strpos($format, '|') === false || (!($gmepoch > $midnight && !$forcedate) && !($gmepoch > $midnight - 86400 && !$forcedate))) { - return preg_replace('#\|.*?\|#', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); + return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); } - else if ($gmepoch > $midnight - 86400 && !$forcedate) + + if ($gmepoch > $midnight && !$forcedate) { - return preg_replace('#\|.*?\|#', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); + $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); + return str_replace('||', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); } - else + else if ($gmepoch > $midnight - 86400 && !$forcedate) { - return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); + $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); + return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); } } |
