From e7d431eed63b49fd02f8ae968b0fc830070fe5dc Mon Sep 17 00:00:00 2001 From: quix0r Date: Mon, 22 Dec 2008 17:26:41 +0000 Subject: [PATCH] More fixes, thanks to rasty's debug.log --- inc/databases.php | 2 +- inc/modules/member/what-order.php | 6 ++++-- inc/modules/member/what-unconfirmed.php | 16 +++++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index a1eb89f4d1..77d3bd19aa 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -115,7 +115,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "699"); +define('CURR_SVN_REVISION', "700"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index b9593dfbb7..9c42dcfce1 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -601,10 +601,9 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); if (SQL_NUMROWS($result) == 1) { // Old order found list($subject, $text, $payment, $tstamp, $url, $target, $cat, $zip) = SQL_FETCHROW($result); - SQL_FREERESULT($result); // Fix max receivers when it is too much - if ($target > $CATS['uids'][$cat]) $target = $CATS['uids'][$cat]; + if ((isset($CATS['uids'][$cat])) && ($target > $CATS['uids'][$cat])) $target = $CATS['uids'][$cat]; // Old order is grabbed $OLD_ORDER = true; @@ -613,6 +612,9 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); $url = "http://"; } + // Free result + SQL_FREERESULT($result); + // 01 2 21 12 2 23 443 3 3210 if ((!empty($_POST['data'])) || ((getConfig('order_multi_page') == "N") && ((!IS_ADMIN()) && (!EXT_IS_ACTIVE("html_mail"))))) { // Pre-output categories diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 0d010865ae..e24ad158ad 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -114,11 +114,11 @@ WHERE s.id=%s LIMIT 1", if (EXT_IS_ACTIVE("bonus")) { // Load bonus ID $result = SQL_QUERY_ESC("SELECT stats_id, bonus_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY bonus_id DESC, stats_id DESC", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FILE__, __LINE__); } else { // Don't load bonus ID $result = SQL_QUERY_ESC("SELECT stats_id, stats_id, link_type FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s ORDER BY stats_id DESC", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FILE__, __LINE__); } // Mails left for confirmation? @@ -127,7 +127,7 @@ if (SQL_NUMROWS($result) > 0) { $sum = 0; $SW = 2; $OUT = ""; while (list($id, $id2, $type) = SQL_FETCHROW($result)) { // Load data from stats table... - $cat = ""; + $cat = ""; $result_data = false; switch ($type) { case "NORMAL": @@ -137,7 +137,7 @@ LEFT JOIN "._MYSQL_PREFIX."_pool AS p ON s.pool_id=p.id WHERE s.id=%s LIMIT 1", - array(bigintval($id)), __FILE__, __LINE__); + array(bigintval($id)), __FILE__, __LINE__); $type = "mailid"; $DATA = $id; $PROBLEM = NORMAL_MAIL_PROBLEM; break; @@ -146,6 +146,10 @@ LIMIT 1", array(bigintval($id2)), __FILE__, __LINE__); $type = "bonusid"; $DATA = $id2; $PROBLEM = BONUS_MAIL_PROBLEM; break; + + default: // Unknown type detected! + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown mail type %s detected.", $type)); + break; } // Data found to this mail? @@ -234,9 +238,7 @@ LIMIT 1", } else { LOAD_TEMPLATE("member_unconfirmed_table_nopoints"); } -} - else -{ +} else { // No mails left to confirm... :) LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_NO_MAILS_TO_CONFIRM); } -- 2.39.5