make supported themes compatible with get_theme_uid

This commit is contained in:
rabuzarus 2015-06-29 23:03:44 +02:00
parent 4463ae11d8
commit 36abf624d8
4 changed files with 57 additions and 26 deletions

View file

@ -2,10 +2,28 @@
if (file_exists("$THEMEPATH/style.css")){
echo file_get_contents("$THEMEPATH/style.css");
}
$uid = get_theme_uid();
$s_colorset = get_config('duepuntozero','colorset');
$uid = local_user();
$colorset = get_pconfig( $uid, 'duepuntozero', 'colorset');
if (!x($colorset))
$colorset = $s_colorset;
if ($colorset) {
if ($colorset == 'greenzero')
$setcss = file_get_contents('view/theme/duepuntozero/deriv/greenzero.css');
if ($colorset == 'purplezero')
$setcss = file_get_contents('view/theme/duepuntozero/deriv/purplezero.css');
if ($colorset == 'easterbunny')
$setcss = file_get_contents('view/theme/duepuntozero/deriv/easterbunny.css');
if ($colorset == 'darkzero')
$setcss = file_get_contents('view/theme/duepuntozero/deriv/darkzero.css');
if ($colorset == 'comix')
$setcss = file_get_contents('view/theme/duepuntozero/deriv/comix.css');
if ($colorset == 'slackr')
$setcss = file_get_contents('view/theme/duepuntozero/deriv/slackr.css');
}
echo $setcss;
?>

View file

@ -1,12 +1,14 @@
<?php
$uid = get_theme_uid();
$color=false;
$quattro_align=false;
$site_color = get_config("quattro","color");
$site_quattro_align = get_config("quattro", "align" );
if (local_user()) {
$color = get_pconfig(local_user(), "quattro","color");
$quattro_align = get_pconfig(local_user(), 'quattro', 'align' );
if ($uid) {
$color = get_pconfig( $uid, "quattro","color");
$quattro_align = get_pconfig( $uid, 'quattro', 'align' );
}
if ($color===false) $color=$site_color;
@ -39,9 +41,9 @@
if ($site_textarea_font_size===false) $site_textarea_font_size="20";
if ($site_post_font_size===false) $site_post_font_size="12";
if (local_user()) {
$textarea_font_size = get_pconfig(local_user(), "quattro","tfs");
$post_font_size = get_pconfig(local_user(), "quattro","pfs");
if ($uid) {
$textarea_font_size = get_pconfig( $uid, "quattro","tfs");
$post_font_size = get_pconfig( $uid, "quattro","pfs");
}
if ($textarea_font_size===false) $textarea_font_size = $site_textarea_font_size;

30
view/theme/vier/style.php Normal file
View file

@ -0,0 +1,30 @@
<?php
if (file_exists("$THEMEPATH//style.css")){
echo file_get_contents("$THEMEPATH//style.css");
}
$uid = get_theme_uid();
$style = get_pconfig( $uid, 'vier', 'style');
if ($style == "")
$style = get_config('vier', 'style');
if ($style == "")
$style = "plus";
if ($style == "flat")
$stylecss = file_get_contents('view/theme/vier/flat.css');
else if ($style == "netcolour")
$stylecss = file_get_contents('view/theme/vier/netcolour.css');
else if ($style == "breathe")
$stylecss = file_get_contents('view/theme/vier/breathe.css');
else if ($style == "plus")
$stylecss = file_get_contents('view/theme/vier/plus.css');
else if ($style == "dark")
$stylecss = file_get_contents('view/theme/vier/dark.css');
echo $stylecss;

View file

@ -16,25 +16,6 @@ $baseurl = $a->get_baseurl();
$a->theme_info = array();
$style = get_pconfig(local_user(), 'vier', 'style');
if ($style == "")
$style = get_config('vier', 'style');
if ($style == "")
$style = "plus";
if ($style == "flat")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/flat.css" type="text/css" media="screen"/>'."\n";
else if ($style == "netcolour")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/netcolour.css" type="text/css" media="screen"/>'."\n";
else if ($style == "breathe")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/breathe.css" type="text/css" media="screen"/>'."\n";
else if ($style == "plus")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/plus.css" type="text/css" media="screen"/>'."\n";
else if ($style == "dark")
$a->page['htmlhead'] .= '<link rel="stylesheet" href="view/theme/vier/dark.css" type="text/css" media="screen"/>'."\n";
$a->page['htmlhead'] .= <<< EOT
<script type="text/javascript">