]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
enable triple-pane theme; fix theme system not working
[tt-rss.git] / functions.php
index 6d72c687399cd355e5b443062ae774283150afbe..a6977b2a21b7f93374d34a231a242a398a1ccf45 100644 (file)
                }
 
                if ($theme_path) {
-                       if (is_file("$t/theme.ini")) {
-                               $ini = parse_ini_file("$t/theme.ini", true);
-                               if ($ini['theme']['version'] > THEME_VERSION_REQUIRED) {
+                       if (is_file("$theme_path/theme.ini")) {
+                               $ini = parse_ini_file("$theme_path/theme.ini", true);
+                               if ($ini['theme']['version'] >= THEME_VERSION_REQUIRED) {
                                        return $theme_path;
                                }
                        }
                return '';
        }
 
+       function print_theme_includes($link) {
+
+               $t = get_user_theme_path($link);
+               $time = time();
+
+               if ($t) {
+                       print "<link rel=\"stylesheet\" type=\"text/css\" 
+                               href=\"$t/theme.css?$time \">";
+                       if (file_exists("$t/theme.js")) {
+                               print "<script type=\"text/javascript\" src=\"$t/theme.js?$time\">
+                                       </script>";
+                       }
+               }
+       }
 
        function get_all_themes() {
                $themes = glob("themes/*");
                foreach ($themes as $t) {
                        if (is_file("$t/theme.ini")) {
                                $ini = parse_ini_file("$t/theme.ini", true);
-                               if ($ini['theme']['version'] > THEME_VERSION_REQUIRED && 
+                               if ($ini['theme']['version'] >= THEME_VERSION_REQUIRED && 
                                                        !$ini['theme']['disabled']) {
                                        $entry = array();
                                        $entry["path"] = $t;