]> git.wh0rd.org Git - tt-rss.git/commitdiff
probable fix for schema 63 updating problem
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 13 Jan 2010 18:25:44 +0000 (21:25 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 13 Jan 2010 18:25:44 +0000 (21:25 +0300)
functions.php

index 369a3bcf7cde963f7827a84025dedafd054d9a7f..f6ce227f036a3a294d792e82b6fdc5f1d2b5c70c 100644 (file)
        }
 
        function get_user_theme_path($link) {
-               $theme_id = get_pref($link, "_THEME_ID");
+
+               if (get_schema_version($link) >= 63) {
+                       $theme_id = get_pref($link, "_THEME_ID");
+               } else {
+                       $theme_id = 1;
+               }
 
                $result = db_query($link, "SELECT theme_path 
                        FROM ttrss_themes       WHERE id = '$theme_id'");
                        return "even";
        }
 
+       function get_schema_version($link) {
+               $result = db_query($link, "SELECT schema_version FROM ttrss_version");
+               return (int) db_fetch_result($result, 0, "schema_version");
+       }
+
        function sanity_check($link) {
 
                error_reporting(0);