]> git.mxchange.org Git - friendica.git/commitdiff
make supported themes compatible with get_theme_uid
authorrabuzarus <>
Mon, 29 Jun 2015 21:03:44 +0000 (23:03 +0200)
committerrabuzarus <>
Mon, 29 Jun 2015 21:03:44 +0000 (23:03 +0200)
view/theme/duepuntozero/style.php
view/theme/quattro/style.php
view/theme/vier/style.php [new file with mode: 0644]
view/theme/vier/theme.php

index d5f8696a793b525586d731fd1789a5122e37d66b..89f44d9c0454b3e6c7e05d6b5c86bb4c9c44f705 100644 (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;
+
 ?>
index c75091eb5b00f8c4894e871fa2517919767d877f..bf0b1e0428a2961fe8d3720541ba5ae432a82daa 100644 (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;
diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php
new file mode 100644 (file)
index 0000000..e118d1e
--- /dev/null
@@ -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;
+
+
index a7ba561b23cea53f5d4f4c176a127e7a5bec3421..7c94f001aa2ac9570980b027a3daa7915647baa2 100644 (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">