]> git.wh0rd.org Git - tt-rss.git/commitdiff
get_user_theme_path: cache data
authorAndrew Dolgov <fox@bah.org.ru>
Thu, 14 Jan 2010 09:04:38 +0000 (12:04 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Thu, 14 Jan 2010 09:04:38 +0000 (12:04 +0300)
functions.php

index 2156d8f9f69cc4f92021205a74635e7b25a92524..71f3cbb16a03e7339f84c6f072d87dd41cf5d0a7 100644 (file)
                        $theme_id = 1;
                }
 
-               $result = db_query($link, "SELECT theme_path 
-                       FROM ttrss_themes       WHERE id = '$theme_id'");
-               if (db_num_rows($result) != 0) {
-                       return db_fetch_result($result, 0, "theme_path");
+               if (!$_SESSION["theme_path"][$theme_id]) {
+                       $result = db_query($link, "SELECT theme_path 
+                               FROM ttrss_themes       WHERE id = '$theme_id'");
+                       if (db_num_rows($result) != 0) {
+                               $theme = db_fetch_result($result, 0, "theme_path");
+                               $_SESSION["theme_path"][$theme_id] = $theme;
+                               return $theme;
+                       } else {
+                               return null;
+                       }
                } else {
-                       return null;
+                       return $_SESSION["theme_path"][$theme_id];
                }
        }