]> git.wh0rd.org - tt-rss.git/commitdiff
force required theme version
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Nov 2010 12:14:31 +0000 (15:14 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Nov 2010 12:14:31 +0000 (15:14 +0300)
functions.php

index 6b938f9c9108d44fd224e9188daa360176c5279c..756cf223282a6ecef66a3052f81e2b0199b885b9 100644 (file)
@@ -15,6 +15,8 @@
                define('SUBSTRING_FOR_DATE', 'SUBSTRING');
        }
 
+       define('THEME_VERSION_REQUIRED', 1.1);
+
        /**
         * Return available translations names.
         * 
                        $theme_path = '';
                }
 
-               return $theme_path;
+               if ($theme_path) {
+                       if (is_file("$t/theme.ini")) {
+                               $ini = parse_ini_file("$t/theme.ini", true);
+                               if ($ini['theme']['version'] > THEME_VERSION_REQUIRED) {
+                                       return $theme_path;
+                               }
+                       }
+               }
+               return '';
        }
 
        function get_user_theme_options($link) {
                foreach ($themes as $t) {
                        if (is_file("$t/theme.ini")) {
                                $ini = parse_ini_file("$t/theme.ini", true);
-                               if ($ini['theme']['version'] && !$ini['theme']['disabled']) {
+                               if ($ini['theme']['version'] > THEME_VERSION_REQUIRED && 
+                                                       !$ini['theme']['disabled']) {
                                        $entry = array();
                                        $entry["path"] = $t;
                                        $entry["base"] = basename($t);