1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-05 12:13:23 +02:00

Updated for generic theming

git-svn-id: file:///svn/phpbb/trunk@203 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2001-04-24 22:32:57 +00:00
parent a624033c5b
commit a8a1ad65fe
6 changed files with 335 additions and 262 deletions

View File

@@ -189,7 +189,9 @@ function theme_select($default)
{
global $db;
$sql = "SELECT theme_id, theme_name FROM ".THEMES_TABLE." ORDER BY theme_name";
$sql = "SELECT themes_id, themes_name
FROM ".THEMES_TABLE."
ORDER BY themes_name";
if($result = $db->sql_query($sql))
{
$num = $db->sql_numrows($result);
@@ -197,7 +199,7 @@ function theme_select($default)
$theme_select = "<select name=\"theme\">\n";
for($i = 0; $i < $num; $i++)
{
if((stripslashes($rowset[$i]["theme_name"]) == $default) || ($rowset[$i]["theme_id"] == $default))
if(stripslashes($rowset[$i]['themes_name']) == $default || $rowset[$i]['themes_id'] == $default)
{
$selected = " SELECTED";
}
@@ -205,7 +207,7 @@ function theme_select($default)
{
$selected = "";
}
$theme_select .= "\t<option value=\"".$rowset[$i]["theme_id"]."\"$selected>".stripslashes($rowset[$i]["theme_name"])."</option>\n";
$theme_select .= "\t<optio value=\"".$rowset[$i]['themes_id']."\"$selected>".stripslashes($rowset[$i]['themes_name'])."</option>\n";
}
$theme_select .= "</select>\n";
}
@@ -223,10 +225,8 @@ function init_userprefs($userdata)
{
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;
global $default_lang, $date_format, $sys_timezone;
global $theme;
if(!$override_user_theme)
{
@@ -243,22 +243,6 @@ function init_userprefs($userdata)
{
$theme = setuptheme($override_user_theme);
}
if($theme)
{
$bgcolor = $theme["bgcolor"];
$table_bgcolor = $theme["table_bgcolor"];
$textcolor = $theme["textcolor"];
$category_title = $theme["category_title"];
$table_header = $theme["table_header"];
$color1 = $theme["color1"];
$color2 = $theme["color2"];
$header_image = $theme["header_image"];
$newtopic_image = $theme["newtopic_image"];
$reply_locked_image = $theme["reply_locked_image"];
$reply_image = $theme["reply_image"];
$linkcolor = $theme["linkcolor"];
$vlinkcolor = $theme["vlinkcolor"];
}
if($userdata["user_lang"] != "")
{
$default_lang = $userdata["user_lang"];
@@ -311,10 +295,10 @@ function setuptheme($theme)
$sql = "SELECT *
FROM ".THEMES_TABLE."
WHERE theme_id = '$theme'";
WHERE themes_id = '$theme'";
if(!$result = $db->sql_query($sql))
return(0);
if(!$myrow = $db->sql_fetchrow($result))
return(0);

View File

@@ -97,6 +97,36 @@ $template->assign_vars(array(
"S_TOPICS_URL" => POST_TOPIC_URL,
"S_USERS_URL" => POST_USERS_URL,
"T_BODY_BACKGROUND" => $theme['body_background'],
"T_BODY_BGCOLOR" => "#".$theme['body_bgcolor'],
"T_BODY_TEXT" => "#".$theme['body_text'],
"T_BODY_LINK" => "#".$theme['body_link'],
"T_BODY_VLINK" => "#".$theme['body_vlink'],
"T_BODY_ALINK" => "#".$theme['body_alink'],
"T_BODY_HLINK" => "#".$theme['body_hlink'],
"T_TR_COLOR1" => "#".$theme['tr_color1'],
"T_TR_COLOR2" => "#".$theme['tr_color2'],
"T_TR_COLOR3" => "#".$theme['tr_color3'],
"T_TH_COLOR1" => "#".$theme['th_color1'],
"T_TH_COLOR2" => "#".$theme['th_color2'],
"T_TH_COLOR3" => "#".$theme['th_color3'],
"T_TD_COLOR1" => "#".$theme['td_color1'],
"T_TD_COLOR2" => "#".$theme['td_color2'],
"T_TD_COLOR3" => "#".$theme['td_color3'],
"T_FONTFACE1" => $theme['fontface1'],
"T_FONTFACE2" => $theme['fontface1'],
"T_FONTFACE3" => $theme['fontface1'],
"T_FONTSIZE1" => $theme['fontsize1'],
"T_FONTSIZE2" => $theme['fontsize2'],
"T_FONTSIZE3" => $theme['fontsize3'],
"T_FONTCOLOR1" => "#".$theme['fontcolor1'],
"T_FONTCOLOR2" => "#".$theme['fontcolor2'],
"T_FONTCOLOR3" => "#".$theme['fontcolor3'],
"T_IMG1" => $theme['img1'],
"T_IMG2" => $theme['img2'],
"T_IMG3" => $theme['img3'],
"T_IMG4" => $theme['img4'],
"PAGE_TITLE" => $page_title,
"LOGIN_STATUS" => $logged_in_status,
"META_INFO" => $meta_tags));
@@ -185,10 +215,6 @@ switch($pagetype)
$template->pparse("header");
break;
case 'login':
$template->set_filenames(array("body" => "login_body.tpl"));
break;
case 'newtopic':
$template->set_filenames(array(
"header" => "newtopic_header.tpl",