From 83574a6475896fbdc231e685e2ebb0ee4f3e6eba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 6 Nov 2009 16:49:36 +0000 Subject: [PATCH] Unknown module in non-HTML mode, debug comments removed :( --- inc/filters.php | 7 ++++-- inc/mails/beg_mails.php | 26 ++++++++++++--------- inc/mails/bonus_mails.php | 4 ++-- inc/mails/doubler_mails.php | 44 +++++++++++++++++++++++++---------- inc/reset/reset_100_bonus.php | 4 +++- inc/reset/reset_beg.php | 2 +- 6 files changed, 58 insertions(+), 29 deletions(-) diff --git a/inc/filters.php b/inc/filters.php index 40fb713d99..20dae9fdb5 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -591,9 +591,12 @@ function FILTER_DETERMINE_WHAT_ACTION () { if (isGetRequestElementSet('module')) { // Set module from request setModule(getRequestElement('module')); - } else { + } elseif (getOutputMode() == '0') { // Set default module 'index' setModule('index'); + } else { + // Unknown module + setModule('unknown'); } } // END - if @@ -850,7 +853,7 @@ function FILTER_FLUSH_TEMPLATE_CACHE () { // Now flush all foreach ($GLOBALS['template_eval'] as $template=>$eval) { // Flush the cache (if not yet found) - //flushTemplateCache($template, $eval); + flushTemplateCache($template, $eval); } // END - if } // END - if } diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 4f61d180fa..0cd50f820f 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -51,13 +51,13 @@ $mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', ti $sql = ''; $mode = ''; // Shall I sent activation or deactivation mail? -$sql = "SELECT userid, email FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (beg_ral_notify "; +$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`beg_ral_notify` "; switch (getConfig('beg_rallye')) { case 'Y': // Begging rallye is activated if (getConfig('beg_ral_en_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= "= 0 OR (beg_ral_notify > 0 AND beg_ral_en_notify < beg_ral_di_notify)"; - $mode = "en"; + $sql .= '= 0 OR (`beg_ral_notify` > 0 AND `beg_ral_en_notify` < `beg_ral_di_notify`)'; + $mode = 'en'; } else { // Do not notify! $sql = ''; @@ -67,14 +67,14 @@ switch (getConfig('beg_rallye')) { case 'N': // Begging rallye is deactivated if (getConfig('beg_ral_di_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= " > 0 AND beg_ral_di_notify < beg_ral_en_notify"; - $mode = "di"; + $sql .= ' > 0 AND `beg_ral_di_notify` < `beg_ral_en_notify`'; + $mode = 'di'; } else { - // Do not notify! - $sql = ''; + // Do not notify! + $sql = ''; } break; -} +} // END - switch if (!empty($sql)) { // The SQL command needs to be finisched here (only confirmed accounts!) @@ -109,9 +109,13 @@ if (!empty($sql)) { // Okay lets notify all users! while ($content = merge_array($content, SQL_FETCHARRAY($result_main))) { // Update account - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` -SET `beg_ral_notify`=UNIX_TIMESTAMP(),` beg_ral_%s_notify`=UNIX_TIMESTAMP() -WHERE `userid`=%s + SQL_QUERY_ESC("UPDATE + `{?_MYSQL_PREFIX?}_user_data` +SET + `beg_ral_notify`=UNIX_TIMESTAMP(), + `beg_ral_%s_notify`=UNIX_TIMESTAMP() +WHERE + `userid`=%s LIMIT 1", array( $mode, diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 568a2f0f98..1dc632d675 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -57,7 +57,7 @@ switch (getConfig('bonus_active')) case 'Y': // Active rallye is activated if (getConfig('bonus_en_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= "= 0 OR (`bonus_ral_notify` > 0 AND `bonus_ral_en_notify` < `bonus_ral_di_notify`)"; + $sql .= '= 0 OR (`bonus_ral_notify` > 0 AND `bonus_ral_en_notify` < `bonus_ral_di_notify`)'; $mode = 'en'; } else { // Do not notify! @@ -68,7 +68,7 @@ switch (getConfig('bonus_active')) case 'N': // Active rallye is deactivated if (getConfig('bonus_di_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= " > 0 AND `bonus_ral_di_notify` < `bonus_ral_en_notify`"; + $sql .= ' > 0 AND `bonus_ral_di_notify` < `bonus_ral_en_notify`'; $mode = 'di'; } else { // Do not notify! diff --git a/inc/mails/doubler_mails.php b/inc/mails/doubler_mails.php index 6279fd213d..69852389dd 100644 --- a/inc/mails/doubler_mails.php +++ b/inc/mails/doubler_mails.php @@ -64,24 +64,44 @@ setSession('DOUBLER_UID', ''); if (empty($GLOBALS['doubler_userid'])) $GLOBALS['doubler_userid'] = '0'; // Check for doubles which we can pay out -$result_total = SQL_QUERY_ESC("SELECT d.id, d.userid, d.points, d.remote_ip, d.timemark -FROM `{?_MYSQL_PREFIX?}_doubler` AS d -LEFT JOIN `{?_MYSQL_PREFIX?}_user_data` AS u -ON d.userid=u.userid -WHERE u.`status`='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N' -ORDER BY d.timemark", +$result_total = SQL_QUERY_ESC("SELECT + d.id, d.userid, d.points, d.remote_ip, d.timemark +FROM + `{?_MYSQL_PREFIX?}_doubler` AS d +LEFT JOIN + `{?_MYSQL_PREFIX?}_user_data` AS u +ON + d.userid=u.userid +WHERE + u.`status`='CONFIRMED' AND + d.points <= %s AND + d.points >= %s AND + d.completed='N' AND + d.is_ref='N' +ORDER BY + d.timemark ASC", array( $DOUBLER_POINTS, getConfig(('doubler_min') * 2) ), __FILE__, __LINE__); // Check for accounts with limitation -$result_main = SQL_QUERY_ESC("SELECT d.id, d.userid, d.points, d.remote_ip, d.timemark -FROM `{?_MYSQL_PREFIX?}_doubler` AS d -LEFT JOIN `{?_MYSQL_PREFIX?}_user_data` AS u -ON d.userid=u.userid -WHERE u.`status`='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N' -ORDER BY d.timemark +$result_main = SQL_QUERY_ESC("SELECT + d.id, d.userid, d.points, d.remote_ip, d.timemark +FROM + `{?_MYSQL_PREFIX?}_doubler` AS d +LEFT JOIN + `{?_MYSQL_PREFIX?}_user_data` AS u +ON + d.userid=u.userid +WHERE + u.`status`='CONFIRMED' AND + d.points <= %s AND + d.points >= %s AND + d.completed='N' AND + d.is_ref='N' +ORDER BY + d.timemark ASC LIMIT %d", array( $DOUBLER_POINTS, diff --git a/inc/reset/reset_100_bonus.php b/inc/reset/reset_100_bonus.php index 511b107a2f..860af31134 100644 --- a/inc/reset/reset_100_bonus.php +++ b/inc/reset/reset_100_bonus.php @@ -53,7 +53,9 @@ $result_bonus = SQL_QUERY("SELECT FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE - `max_rec`=`clicks` AND `clicks` > 0 AND `bonus_stats_active`='N' + `max_rec`=`clicks` AND + `clicks` > 0 AND + `bonus_stats_active`='N' ORDER BY `userid` ASC", __FILE__, __LINE__); diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index dc59885448..04124255e0 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -48,7 +48,7 @@ if ((getOutputMode() != 0) || (!isResetModeEnabled()) || (getConfig('beg_rallye' //* DEBUG: */ outputHtml(basename(__FILE__)."
"); // Reset accounts -$result = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET beg_points=0.00000 WHERE beg_points > 0", +$result = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_points`=0.00000 WHERE `beg_points` > 0", __FILE__, __LINE__); // [EOF] -- 2.39.2