Heacy rewrite/cleanup:
[mailer.git] / inc / loader / load-earning.php
index d6a8e67d41788df6b2f3b65745d674c3ad94b43b..ab31866453517dee012abe4dcc35ae39c62bcc5d 100644 (file)
@@ -38,8 +38,9 @@
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-} elseif (isInstallationPhase()) {
+} elseif (isInstaller()) {
        // Do not run in installation phase
+       //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Run from installation phase.');
        return FALSE;
 } elseif (!isExtensionInstalled('earning')) {
        // Do not cache if not installed!
@@ -50,15 +51,15 @@ if (!defined('__SECURITY')) {
 if (($GLOBALS['cache_instance']->loadCacheFile('earning')) && ($GLOBALS['cache_instance']->extensionVersionMatches('earning'))) {
        // Load cache
        $GLOBALS['cache_array']['earning'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif ((isHtmlOutputMode()) && (isExtensionInstalled('earning'))) {
+} elseif ((isHtmlOutputMode()) || (isAjaxOutputMode()) || (isRawOutputMode())) {
        // Create cache file
        $GLOBALS['cache_instance']->init();
 
        // Query the database about this
        $result = sqlQuery('SELECT * FROM `{?_MYSQL_PREFIX?}_earning_data` ORDER BY `earning_id` ASC', __FILE__, __LINE__);
-       while ($dummy = sqlFetchArray($result)) {
+       while ($data = sqlFetchArray($result)) {
                // Save row
-               $GLOBALS['cache_instance']->addRow($dummy);
+               $GLOBALS['cache_instance']->addRow($data);
        } // END - while
 
        // Free memory