1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 08:47:45 +02:00

Added user selectable templates, and put the system template into the config database. Updated mysql_schema as well

git-svn-id: file:///svn/phpbb/trunk@200 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson
2001-04-20 07:30:45 +00:00
parent e150b48726
commit 42039bc31a
7 changed files with 94 additions and 58 deletions

View File

@@ -140,6 +140,31 @@ function make_jumpbox()
return($boxstring);
}
// NOTE: This function should check is_dir($file), however the is_dir function seems to be buggy on my
// system so its not currently implemented that way
// - James
function template_select($default)
{
$dir = opendir("templates");
$template_select = "<select name=\"selected_template\">\n";
while($file = readdir($dir))
{
unset($selected);
if($file != "." && $file != ".." && $file != "CVS")
{
if($file == $default)
{
$selected = " SELECTED";
}
$template_select .= "<option value=\"$file\"$selected>$file</option>\n";
}
}
$template_select .= "</select>";
closedir($dir);
return($template_select);
}
function language_select($default, $name="language", $dirname="language/")
{
global $phpEx;
@@ -163,7 +188,7 @@ function language_select($default, $name="language", $dirname="language/")
function theme_select($default)
{
global $db;
$sql = "SELECT theme_id, theme_name FROM ".THEMES_TABLE." ORDER BY theme_name";
if($result = $db->sql_query($sql))
{
@@ -197,7 +222,7 @@ function theme_select($default)
function init_userprefs($userdata)
{
global $override_user_theme;
global $override_user_theme, $template, $sys_template;
global $bgcolor, $table_bgcolor, $textcolor, $category_title, $table_header;
global $color1, $color2, $header_image, $newtopic_image;
global $reply_locked_image, $reply_image, $linkcolor, $vlinkcolor;
@@ -247,6 +272,16 @@ function init_userprefs($userdata)
$sys_timezone = $userdata["user_timezone"];
}
// Setup user's Template
if($userdata['user_template'] != '')
{
$template = new Template("templates/".$userdata['user_template']);
}
else
{
$template = new Template("templates/".$sys_template);
}
// Include the appropriate language file ... if it exists.
if(!strstr($PHP_SELF, "admin"))
{