From: Roland Häder Date: Thu, 29 Oct 2009 00:13:08 +0000 (+0000) Subject: More fixes for bonus ranking X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=013448f0470ca36ab15b888928e2127e6da7d9b6 More fixes for bonus ranking --- diff --git a/beg.php b/beg.php index c411b85b9e..139a4e633e 100644 --- a/beg.php +++ b/beg.php @@ -206,7 +206,7 @@ if (isGetRequestElementSet('userid')) { $errorCode = generateErrorCodeFromUserStatus($status); } elseif (($userid == '0') || ($status == 'failed')) { // Inalid or locked account, so let's find out - $result = SQL_QUERY_ESC("SELECT userid FROM `{?_MYSQL_PREFIX?}_user_data` WHERE nickname='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE nickname='%s' LIMIT 1", array(getRequestElement('userid')), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Locked account diff --git a/css.php b/css.php index e271b11eca..a2307fb42e 100644 --- a/css.php +++ b/css.php @@ -43,7 +43,7 @@ require('inc/libs/security_functions.php'); $GLOBALS['footer_sent'] = '-1'; // This is a CSS file loader! -$GLOBALS['output_mode'] = '1'; +$GLOBALS['output_mode'] = 1; $GLOBALS['module'] = 'css'; // Load the required file(s) diff --git a/inc/classes/cachesystem.class.php b/inc/classes/cachesystem.class.php index e19c9e8f78..0a58a1dd31 100644 --- a/inc/classes/cachesystem.class.php +++ b/inc/classes/cachesystem.class.php @@ -65,26 +65,14 @@ class CacheSystem { // Check if path exists if (isDirectory(getConfig('CACHE_PATH'))) { - // Make FQFN for dummy file - $FQFN = getConfig('CACHE_PATH') . 'dummy.tmp'; - - // Check if we can create a file inside the path - touch($FQFN, 'w'); - - // Is the file there? - if (isFileReadable($FQFN)) { - // Yes, we can do. So let's remove it - removeFile($FQFN); - - // Is there a .htaccess file? - if (isFileReadable(getConfig('CACHE_PATH') . '.htaccess')) { - // All done! - $this->ret = $this->statusDone; - } else { - // Stop! Set a .htaccess file first - $this->ret = 'htaccess'; - } - } // END - if + // Is there a .htaccess file? + if (isFileReadable(getConfig('CACHE_PATH') . '.htaccess')) { + // All done! + $this->ret = $this->statusDone; + } else { + // Stop! Set a .htaccess file first + $this->ret = 'htaccess'; + } } // END - if } diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 44f5fd4366..e709c8a0d9 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -78,7 +78,7 @@ function SQL_QUERY ($sqlString, $F, $L) { $querytimeBefore = array_sum(explode(' ', microtime())); // Run SQL command - //* DEBUG: */ outputHtml($sqlString."
"); + //* DEBUG: */ print($sqlString . '
'); $result = mysql_query($sqlString, SQL_GET_LINK()) or addFatalMessage(__FUNCTION__, __LINE__, $F . ' (' . $L . '):' . mysql_error() . '
Query string:
diff --git a/inc/footer.php b/inc/footer.php index 9c97434af5..0e9518d91f 100644 --- a/inc/footer.php +++ b/inc/footer.php @@ -61,7 +61,7 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != '1') && } // END - if // Shall we display the parsing time and number of queries? - if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && ($GLOBALS['header_sent'] == '2')) { + if ((((isExtensionInstalledAndNewer('sql_patches', '0.4.1')) && (getConfig('show_timings') == 'Y') && (!isGetRequestElementSet('frame'))) || (isInstallationPhase())) && (getOutputMode() != 0) && ($GLOBALS['header_sent'] == '2')) { // Then display it here displayParsingTime(); } // END - if diff --git a/inc/header.php b/inc/header.php index 9cff89dd58..d248ce7714 100644 --- a/inc/header.php +++ b/inc/header.php @@ -46,7 +46,7 @@ if (!defined('__SECURITY')) { // Is the header already sent? if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) { // If not in CSS mode generate the header - if (getOutputMode() != '1') { + if (getOutputMode() != 1) { // Config and database connection valid? if ((isConfigLocalLoaded()) && (isConfigLoaded()) && (SQL_IS_LINK_UP()) && (isExtensionActive('sql_patches'))) { // Init title @@ -128,7 +128,7 @@ if (($GLOBALS['header_sent'] != '1') && ($GLOBALS['header_sent'] != '2')) { } // END - if // Add BODY tag or not? -if ((getOutputMode() != 1) && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) { +if ((getOutputMode() != 1) && (getOutputMode() != -1) && ($GLOBALS['header_sent'] == 1) && ((getModule() != 'frametester') || (isGetRequestElementSet('frame')))) { loadTemplate('page_body'); $GLOBALS['header_sent'] = 2; } // END - if diff --git a/inc/language/bonus_de.php b/inc/language/bonus_de.php index e723c3878c..349effe354 100644 --- a/inc/language/bonus_de.php +++ b/inc/language/bonus_de.php @@ -69,7 +69,7 @@ addMessages(array( 'BONUS_SHOW_HEADER_LINE_2' => "für die Mail", 'BONUS_SHOW_HEADER_LINE_3' => "erhalten hat", 'BONUS_SHOW_YOU_HAVE_CONFIRMED' => "Sie haben diese Mail am", - 'BONUS_SHOW_CONFIRMED_BONUS_IS' => "Stelle bestätigt. Ihre Gutschrift für diese eMail", + 'BONUS_SHOW_CONFIRMED_BONUS_IS' => "Stelle bestätigt. Ihre Zusatz-Gutschrift für diese Mail", 'BONUS_TOTAL' => "Gesamtbonus", 'BONUS_RALLYE_NO_ONE_JOINED' => "Niemand nimmt an unserer Aktiv-Rallye dran teil. :-(", 'BONUS_RALLYE_NOTE' => "Bitte beachten Sie, dass Ihr Login-Bonus hier nicht mit angezeigt wird. Bei der monatlichen Auswertung wird er Ihnen jedoch gutgeschrieben.", diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 9cbf52d1ff..5b7358917e 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -73,7 +73,7 @@ function addTurboBonus ($mid, $userid, $type) { } // END - if // Check for entry - $rank = countSumTotalData($userid, 'bonus_turbo', 'id', 'userid', true, sprintf(" AND `%s`=%s", $column, $mid)) + 1; + $rank = countSumTotalData($mid, 'bonus_turbo', 'id', $column, true) + 1; // Which rank? if ($rank == 1) { @@ -135,7 +135,7 @@ function addBonusRanks ($data, $type, $userid) { $GLOBALS['ranking_content']['yr_tmark'] = generateDateTime($GLOBALS['ranking_content']['timemark'], '1'); // Load template - $GLOBALS['ranking_content']['rankings'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']); + $GLOBALS['ranking_content']['own'] = loadTemplate('show_bonus_yr', true, $GLOBALS['ranking_content']); } // END - if // Load rankings @@ -151,31 +151,41 @@ function addBonusRanks ($data, $type, $userid) { // Output all ranks (levels) for ($rank = 1; $rank <= $max; $rank++) { // Load data - $result_users = SQL_QUERY_ESC("SELECT `userid`, `points`, `timemark` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s AND level=%s LIMIT 1", + $result_users = SQL_QUERY_ESC("SELECT + `userid`, `points` +FROM + `{?_MYSQL_PREFIX?}_bonus_turbo` +WHERE + `%s`=%s AND + `level`=%s +LIMIT 1", array($type, $data, $rank), __FUNCTION__, __LINE__); // Nothing found by default - $GLOBALS['ranking_content']['userid'] = '---'; - $GLOBALS['ranking_content']['points'] = '---'; + $rows['userid'] = '---'; + $rows['points'] = '---'; // Are you one of them? if (SQL_NUMROWS($result_users) == 1) { // Load data - $GLOBALS['ranking_content'] = merge_array($GLOBALS['ranking_content'], SQL_FETCHARRAY($result_users)); + $rows = merge_array($rows, SQL_FETCHARRAY($result_users)); // Translate comma - $GLOBALS['ranking_content']['points'] = translateComma($GLOBALS['ranking_content']['points']); + $rows['points'] = translateComma($rows['points']); } // END - if + // Free result + SQL_FREERESULT($result_users); + // Add more - $GLOBALS['ranking_content']['rank'] = $rank; - $GLOBALS['ranking_content']['sw'] = $SW; + $rows['rank'] = $rank; + $rows['sw'] = $SW; // Output row $OUT .= " -  ".$GLOBALS['ranking_content']['rank'].". - ".$GLOBALS['ranking_content']['userid']." - ".$GLOBALS['ranking_content']['points']." +  ".$rows['rank'].". + ".$rows['userid']." + ".$rows['points']." \n"; // Switch color diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index eaa939dc58..d799dedfeb 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -77,7 +77,7 @@ if ((!isInstalling()) && (!isInstallationPhase())) { loadIncludeOnce('inc/db/lib.php'); // Set missing module - if (!isModuleSet()) setModule(getRequestElement('module')); + if ((!isModuleSet()) && (isGetRequestElementSet('module'))) setModule(getRequestElement('module')); if (!isModuleSet()) setModule('index'); // Load configuration file(s) here diff --git a/inc/request-functions.php b/inc/request-functions.php index 1320843bd2..5afd40c3df 100644 --- a/inc/request-functions.php +++ b/inc/request-functions.php @@ -150,7 +150,7 @@ function postRequestElement ($element, $subElement=null) { // Checks if an element in $_POST exists function isPostRequestElementSet ($element, $subElement=null) { if (is_null($subElement)) { - return ((isset($GLOBALS['raw_request']['post'][$element])) && (!empty($GLOBALS['raw_request']['post'][$element]))); + return ((isset($GLOBALS['raw_request']['post'][$element])) && (isset($GLOBALS['raw_request']['post'][$element]))); } else { return ((isset($GLOBALS['raw_request']['post'][$element][$subElement])) && (isset($GLOBALS['raw_request']['post'][$element][$subElement]))); } diff --git a/index.php b/index.php index e9a77ff4f3..4eb6036f94 100644 --- a/index.php +++ b/index.php @@ -47,7 +47,7 @@ $GLOBALS['startTime'] = microtime(true); $GLOBALS['module'] = 'index'; // Set 'CSS-Mode' -$GLOBALS['output_mode'] = '0'; +$GLOBALS['output_mode'] = 0; // Load config.php require('inc/config-global.php'); diff --git a/js.php b/js.php index 88ae66ee00..c4e57f9ae3 100644 --- a/js.php +++ b/js.php @@ -46,7 +46,7 @@ require('inc/libs/security_functions.php'); // pattern is given... // // But mxchange 0.3.0 will show that in better way! :D :D :D -$GLOBALS['output_mode'] = '1'; +$GLOBALS['output_mode'] = 1; $GLOBALS['module'] = 'js'; // Load the required file(s) diff --git a/lead-confirm.php b/lead-confirm.php index 6f2b0ef79d..fdaaf12bb8 100644 --- a/lead-confirm.php +++ b/lead-confirm.php @@ -46,7 +46,7 @@ $GLOBALS['startTime'] = microtime(true); $GLOBALS['module'] = 'lead-confirm'; // Set "CSS-Mode" -$GLOBALS['output_mode'] = '0'; +$GLOBALS['output_mode'] = 0; // Load config.php require('inc/config-global.php'); diff --git a/login.php b/login.php index 45fc27fc3d..4266bc4fc2 100644 --- a/login.php +++ b/login.php @@ -43,7 +43,7 @@ require('inc/libs/security_functions.php'); $GLOBALS['module'] = 'login'; // Set 'CSS-Mode' -$GLOBALS['output_mode'] = '0'; +$GLOBALS['output_mode'] = 0; // Load the required file(s) require('inc/config-global.php'); diff --git a/mailid.php b/mailid.php index f87ef349eb..78c1948e26 100644 --- a/mailid.php +++ b/mailid.php @@ -44,7 +44,7 @@ $GLOBALS['startTime'] = microtime(true); // Tell everyone we are in this module $GLOBALS['module'] = 'mailid'; -$GLOBALS['output_mode'] = 1; +$GLOBALS['output_mode'] = -1; $errorCode = ''; // Load the required file(s) @@ -97,7 +97,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr case 'NORMAL': // Is the stats ID valid? $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1", - array($url_mid), __FILE__, __LINE__); + array($url_mid), __FILE__, __LINE__); break; case 'BONUS': @@ -106,7 +106,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr // Bonus-Mails $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1", - array($url_bid), __FILE__, __LINE__); + array($url_bid), __FILE__, __LINE__); break; default: // Invalid mail type @@ -133,8 +133,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr if ($status == 'CONFIRMED') { // User has confirmed his account so we can procede... // @TODO Rewrite this to a filter - switch ($ltype) - { + switch ($ltype) { case 'NORMAL': $result = SQL_QUERY_ESC("SELECT payment_id FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", array(bigintval($pool)), __FILE__, __LINE__); @@ -192,7 +191,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr $errorCode = getCode('POSSIBLE_INVALID'); } } else { - $errorCode = getCode('ACCOUNT_LOCKED'); + $errorCode = getCode('ACCOUNT_' . $status); } } else { SQL_FREERESULT($result); diff --git a/mailid_top.php b/mailid_top.php index f1e83132d4..e60943d5b4 100644 --- a/mailid_top.php +++ b/mailid_top.php @@ -131,14 +131,9 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErr SQL_FREERESULT($result); if ($status == 'CONFIRMED') { - // Update last activity - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `last_online`=UNIX_TIMESTAMP(), `last_module`='mailid_top' WHERE `userid`=%s LIMIT 1", - array($url_userid), __FILE__, __LINE__); - // User has confirmed his account so we can procede... // @TODO Rewrite this to a filter - switch ($ltype) - { + switch ($ltype) { case 'NORMAL': $result = SQL_QUERY_ESC("SELECT `payment_id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1", array(bigintval($pool)), __FILE__, __LINE__); diff --git a/sponsor_confirm.php b/sponsor_confirm.php index d1335e3793..ec0c52d0c2 100644 --- a/sponsor_confirm.php +++ b/sponsor_confirm.php @@ -42,7 +42,7 @@ require('inc/libs/security_functions.php'); $GLOBALS['module'] = 'sponsor_confirm'; // Set 'CSS-Mode' -$GLOBALS['output_mode'] = '0'; +$GLOBALS['output_mode'] = 0; // Load the required file(s) require('inc/config-global.php'); diff --git a/sponsor_ref.php b/sponsor_ref.php index 702b6b505f..5c8de09dc8 100644 --- a/sponsor_ref.php +++ b/sponsor_ref.php @@ -42,7 +42,7 @@ require('inc/libs/security_functions.php'); $GLOBALS['module'] = 'sponsor_ref'; // Set 'CSS-Mode' -$GLOBALS['output_mode'] = '0'; +$GLOBALS['output_mode'] = 0; // Load the required file(s) require('inc/config-global.php'); diff --git a/templates/de/html/admin/admin_config_other.tpl b/templates/de/html/admin/admin_config_other.tpl index a2f6c7295f..7debb5a438 100644 --- a/templates/de/html/admin/admin_config_other.tpl +++ b/templates/de/html/admin/admin_config_other.tpl @@ -81,7 +81,7 @@   - {--ADMIN_OPTION?mt_word?-}: + {--ADMIN_OPTION_MT_WORD--}:   @@ -95,7 +95,7 @@   - {--ADMIN_OPTION?mt_word?--}: + {--ADMIN_OPTION_MT_WORD2--}:   @@ -109,7 +109,7 @@   - {--ADMIN_OPTION?mt_word?--}: + {--ADMIN_OPTION_MT_WORD3--}:   diff --git a/templates/de/html/show_bonus_msg.tpl b/templates/de/html/show_bonus_msg.tpl index 2f8e57ef22..a051b30765 100644 --- a/templates/de/html/show_bonus_msg.tpl +++ b/templates/de/html/show_bonus_msg.tpl @@ -12,7 +12,9 @@ $content[rows] -
 
+ +
$content[own]
+ @@ -20,7 +22,7 @@ $content[rankings] -
+
Wir wünschen allen Gewinnern viel Glück bei der monatlichen Aktiv-Rallye!
Es können nur die ersten {?bonus_ranks?} die Aktiv-Rallye gewinnen. Der Rechtsweg ist ausgeschlossen.