aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/style.php
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2007-04-08 17:40:36 +0000
committerDavid M <davidmj@users.sourceforge.net>2007-04-08 17:40:36 +0000
commit887863e5c5ba80cd1bcbcd6097719afe2178c672 (patch)
treee8b433b0b9aaf9266315448c96aa6ac6a0be2f6c /phpBB/style.php
parent0be22140b2338b4b77f257fd3c2928d5038287fd (diff)
downloadforums-887863e5c5ba80cd1bcbcd6097719afe2178c672.tar
forums-887863e5c5ba80cd1bcbcd6097719afe2178c672.tar.gz
forums-887863e5c5ba80cd1bcbcd6097719afe2178c672.tar.bz2
forums-887863e5c5ba80cd1bcbcd6097719afe2178c672.tar.xz
forums-887863e5c5ba80cd1bcbcd6097719afe2178c672.zip
- overhaul of imagesets
imagesets are now "intelligently" multilingual, one may use imagesets inside of CSS files now (as well as properties like the width and height of an imageset's image) all previous styles should change their imageset.cfg to be like prosilver and subsilver2 (notice how there is now an imageset.cfg in the /en folder, there should be one for each language) git-svn-id: file:///svn/phpbb/trunk@7304 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/style.php')
-rw-r--r--phpBB/style.php42
1 files changed, 23 insertions, 19 deletions
diff --git a/phpBB/style.php b/phpBB/style.php
index 8a190ed520..433a41e3e9 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -90,6 +90,19 @@ if ($id && $sid)
$theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+ $sql = 'SELECT *
+ FROM ' . STYLES_IMAGESET_DATA_TABLE . '
+ WHERE imageset_id = ' . $id . "
+ AND image_lang IN('" . $db->sql_escape($user['user_lang']) . "', '')";
+ $result = $db->sql_query($sql, 3600);
+
+ $img_array = array();
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $img_array[$row['image_name']] = $row;
+ }
+
if (!$theme)
{
exit;
@@ -140,49 +153,40 @@ if ($id && $sid)
foreach ($matches[1] as $i => $img)
{
$img = strtolower($img);
- if (!isset($theme[$img]))
+ if (!isset($img_array[$img]))
{
continue;
}
if (!isset($imgs[$img]))
{
- // Do not include dimensions?
- if (strpos($theme[$img], '*') === false)
- {
- $imgsrc = trim($theme[$img]);
- $width = $height = null;
- }
- else
- {
- list($imgsrc, $height, $width) = explode('*', $theme[$img]);
- }
-
+ $img_data = &$img_array[$img];
+ $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename'];
$imgs[$img] = array(
- 'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . str_replace('{LANG}', $user['user_lang'], $imgsrc),
- 'width' => $width,
- 'height' => $height,
+ 'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc,
+ 'width' => $img_data['image_width'],
+ 'height' => $img_data['image_height'],
);
}
switch ($matches[2][$i])
{
case 'SRC':
- $replace = $imgs[$img]['src'];
+ $replace[] = $imgs[$img]['src'];
break;
case 'WIDTH':
- $replace = $imgs[$img]['width'];
+ $replace[] = $imgs[$img]['width'];
break;
case 'HEIGHT':
- $replace = $imgs[$img]['height'];
+ $replace[] = $imgs[$img]['height'];
break;
default:
continue;
}
- $find = $matches[0][$i];
+ $find[] = $matches[0][$i];
}
if (sizeof($find))