- // Init variables
- $data['title'] = '';
- $result = false;
-
- // Is the script installed?
- if ((isInstalled()) && ($module != 'error')) {
- // Check if cache is valid
- if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($module, $GLOBALS['cache_array']['modules']['module']))) {
- // Load from cache
- $data['title'] = $GLOBALS['cache_array']['modules']['title'][$module];
-
- // Update cache hits
- incrementStatsEntry('cache_hits');
- } elseif (!isExtensionActive('cache')) {
- // Load from database
- $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
- array($module), __FUNCTION__, __LINE__);
-
- // Is the entry there?
- if (SQL_NUMROWS($result) == 1) {
- // Get the title from database
- $data = SQL_FETCHARRAY($result);
- } // END - if
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__][$module])) {
+ // Init variables
+ $data['title'] = '';
+ $result = false;
+
+ // Is the script installed?
+ if ((isInstalled()) && ($module != 'error')) {
+ // Check if cache is valid
+ if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isset($GLOBALS['cache_array']['modules']['module'])) && (in_array($module, $GLOBALS['cache_array']['modules']['module']))) {
+ // Load from cache
+ $data['title'] = $GLOBALS['cache_array']['modules']['title'][$module];
+
+ // Update cache hits
+ incrementStatsEntry('cache_hits');
+ } elseif (!isExtensionActive('cache')) {
+ // Load from database
+ $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
+ array($module), __FUNCTION__, __LINE__);
+
+ // Is the entry there?
+ if (SQL_NUMROWS($result) == 1) {
+ // Get the title from database
+ $data = SQL_FETCHARRAY($result);
+ } // END - if
+
+ // Free the result
+ SQL_FREERESULT($result);
+ }
+ } // END - if