From 6a2a2263019463bee956e63f110ada708acac1db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Sep 2008 22:17:43 +0000 Subject: [PATCH] Fix for theme extension update --- inc/databases.php | 2 +- inc/loader/load_cache-refsystem.php | 2 +- inc/loader/load_cache-them.php | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index cac80273e8..3eed131774 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "360"); +define('CURR_SVN_REVISION', "361"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/loader/load_cache-refsystem.php b/inc/loader/load_cache-refsystem.php index ec9b0f5e86..1a6ad2d61e 100644 --- a/inc/loader/load_cache-refsystem.php +++ b/inc/loader/load_cache-refsystem.php @@ -44,7 +44,7 @@ if ($cacheInstance->cache_file("refsystem", true) == true) { $cacheArray['ref_system'] = $cacheInstance->cache_load(); } elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here - $cacheInstance->cache_init("refsystem"); + $cacheInstance->cache_init("REFSYSTEM"); // Load all modules and their data $result = SQL_QUERY("SELECT id, userid, level, counter FROM "._MYSQL_PREFIX."_refsystem ORDER BY userid, level", __FILE__, __LINE__); diff --git a/inc/loader/load_cache-them.php b/inc/loader/load_cache-them.php index 2a6e181a16..f67cc108a5 100644 --- a/inc/loader/load_cache-them.php +++ b/inc/loader/load_cache-them.php @@ -38,7 +38,7 @@ if (!defined('__SECURITY')) { } // Next cached table is the referral system (themes)... -if ($cacheInstance->cache_file("themes", true) == true) { +if (($cacheInstance->cache_file("themes", true) == true) && ($cacheInstance->ext_version_matches("theme"))) { // Load referral system from cache global $cacheArray; $cache = $cacheInstance->cache_load(); @@ -64,10 +64,15 @@ if ($cacheInstance->cache_file("themes", true) == true) { unset($cache); } elseif (($_CONFIG['cache_refsys'] == "Y") && ($CSS != "1") && ($CSS != "-1")) { // Create cache file here - $cacheInstance->cache_init("themes"); + $cacheInstance->cache_init("THEMES"); + $cacheInstance->store_extension_version("theme"); // Load all themes and their data - $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY id", __FILE__, __LINE__); + if (GET_EXT_VERSION("theme") >= "0.0.7") { + $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM "._MYSQL_PREFIX."_themes ORDER BY id", __FILE__, __LINE__); + } else { + $result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver FROM "._MYSQL_PREFIX."_themes ORDER BY id", __FILE__, __LINE__); + } while ($data = SQL_FETCHARRAY($result)) { // Add row to cache file $cacheInstance->add_row($data); -- 2.39.5