X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Floader%2Fload-refsystem.php;h=dab0a40d145960ef2fe0d30646c5dac61a7a112a;hb=0ed9eaa5aea8db1f690a983a39ff4b2074faf6c5;hp=1d3625053d75705ab251ea250ec848653583e65b;hpb=0f3a135204757cc8750262871c8e62c42300acb4;p=mailer.git diff --git a/inc/loader/load-refsystem.php b/inc/loader/load-refsystem.php index 1d3625053d..dab0a40d14 100644 --- a/inc/loader/load-refsystem.php +++ b/inc/loader/load-refsystem.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -39,20 +39,31 @@ if (!defined('__SECURITY')) { die(); } elseif (isInstallationPhase()) { - // Use this code if you don't want to run this cache loader on installation phase - return; + // Do not run in installation phase + return FALSE; } -// Next cached table is the referal system (refsystem)... +// Next cached table is the referral system (refsystem)... if (($GLOBALS['cache_instance']->loadCacheFile('refsystem')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) { - // Load referal system from cache + // Load referral system from cache $GLOBALS['cache_array']['refsystem'] = $GLOBALS['cache_instance']->getArrayFromCache(); -} elseif (isHtmlOutputMode()) { +} elseif ((isHtmlOutputMode()) || (isRawOutputMode())) { // Create cache file here $GLOBALS['cache_instance']->init(); - // Load all modules and their data - $result = SQL_QUERY('SELECT `id`,`userid`,`level`,`counter` FROM `{?_MYSQL_PREFIX?}_refsystem` ORDER BY `userid` ASC, `level` ASC', __FILE__, __LINE__); + // Query for all referrals + $result = SQL_QUERY('SELECT + `id`, + `userid`, + `level`, + `counter` +FROM + `{?_MYSQL_PREFIX?}_refsystem` +ORDER BY + `userid` ASC, + `level` ASC', __FILE__, __LINE__); + + // Load all entries while ($content = SQL_FETCHARRAY($result)) { // Add row to cache file $GLOBALS['cache_instance']->addRow($content);