1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

- fixed some problems with themes

- added support for {IMG_NAME_SRC}, {IMG_NAME_WIDTH} and {IMG_NAME_HEIGHT}
- fulltext_native has to use group by in a few more quries


git-svn-id: file:///svn/phpbb/trunk@6254 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann
2006-08-08 19:02:44 +00:00
parent 2ed25800c5
commit c69a6f7acd
5 changed files with 136 additions and 43 deletions

View File

@@ -2904,49 +2904,54 @@ pagination_sep = \'{PAGINATION_SEP}\'
$mode . '_path' => $path,
);
if ($mode != 'imageset')
switch ($mode)
{
switch ($mode)
{
case 'template':
// We set a pre-defined bitfield here which we may use further in 3.2
$sql_ary += array(
'bbcode_bitfield' => TEMPLATE_BITFIELD,
'template_storedb' => $store_db
);
break;
case 'template':
// We set a pre-defined bitfield here which we may use further in 3.2
$sql_ary += array(
'bbcode_bitfield' => TEMPLATE_BITFIELD,
'template_storedb' => $store_db
);
break;
case 'theme':
$sql_ary += array(
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? (($root_path) ? $this->db_theme_data($sql_ary, false, $root_path) : '') : '',
'theme_mtime' => filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
);
break;
}
}
else
{
$cfg_data = parse_cfg_file("$root_path$mode/imageset.cfg");
case 'theme':
// We are only interested in the theme configuration for now
$theme_cfg = parse_cfg_file("{$phpbb_root_path}styles/$path/theme/theme.cfg");
$imageset_definitions = array();
foreach ($this->imageset_keys as $topic => $key_array)
{
$imageset_definitions = array_merge($imageset_definitions, $key_array);
}
foreach ($cfg_data as $key => $value)
{
if (strpos($key, 'img_') === 0)
if (isset($theme_cfg['parse_css_file']) && $theme_cfg['parse_css_file'])
{
$key = substr($key, 4);
if (in_array($key, $imageset_definitions))
$store_db = 1;
}
$sql_ary += array(
'theme_storedb' => $store_db,
'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
'theme_mtime' => filemtime("{$phpbb_root_path}styles/$path/theme/stylesheet.css")
);
break;
case 'imageset':
$cfg_data = parse_cfg_file("$root_path$mode/imageset.cfg");
$imageset_definitions = array();
foreach ($this->imageset_keys as $topic => $key_array)
{
$imageset_definitions = array_merge($imageset_definitions, $key_array);
}
foreach ($cfg_data as $key => $value)
{
if (strpos($key, 'img_') === 0)
{
$sql_ary[$key] = str_replace('{PATH}', "styles/$path/imageset/", trim($value));
$key = substr($key, 4);
if (in_array($key, $imageset_definitions))
{
$sql_ary[$key] = str_replace('{PATH}', "styles/$path/imageset/", trim($value));
}
}
}
}
unset($cfg_data);
unset($cfg_data);
break;
}
$db->sql_transaction('begin');

View File

@@ -370,11 +370,13 @@ class fulltext_native extends search_backend
}
$title_match = '';
$group_by = true;
// Build some display specific sql strings
switch ($fields)
{
case 'titleonly':
$title_match = 'title_match = 1';
$group_by = false;
// no break
case 'firstpost':
$sql_array['FROM'][TOPICS_TABLE] = 't';
@@ -383,6 +385,7 @@ class fulltext_native extends search_backend
case 'msgonly':
$title_match = 'title_match = 0';
$group_by = false;
break;
}

View File

@@ -1080,8 +1080,33 @@ class user extends session
{
$this->theme['theme_storedb'] = 1;
$stylesheet = file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/stylesheet.css");
// Match CSS imports
$matches = array();
preg_match_all('/@import url\(["\'](.*)["\']\);/i', $stylesheet, $matches);
if (sizeof($matches))
{
$content = '';
foreach ($matches[0] as $idx => $match)
{
if ($content = @file_get_contents("{$phpbb_root_path}styles/{$this->theme['theme_path']}/theme/" . $matches[1][$idx]))
{
$content = trim($content);
}
else
{
$content = '';
}
$stylesheet = str_replace($match, $content, $stylesheet);
}
unset ($content);
}
$stylesheet = str_replace('./', 'styles/' . $this->theme['theme_path'] . '/theme/', $stylesheet);
$sql_ary = array(
'theme_data' => implode('', file("{$phpbb_root_path}styles/" . $this->theme['theme_path'] . '/theme/stylesheet.css')),
'theme_data' => $stylesheet,
'theme_mtime' => time(),
'theme_storedb' => 1
);