]> git.mxchange.org Git - mailer.git/commitdiff
More fixes, thanks to rasty's debug.log
authorRoland Häder <roland@mxchange.org>
Mon, 22 Dec 2008 17:26:41 +0000 (17:26 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 22 Dec 2008 17:26:41 +0000 (17:26 +0000)
inc/databases.php
inc/modules/member/what-order.php
inc/modules/member/what-unconfirmed.php

index a1eb89f4d174ee426102b79e583ba204eee9c621..77d3bd19aa11a3c4d8d7633b8940a2c2d78fd974 100644 (file)
@@ -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);
index b9593dfbb7b3ba9b3cec15c81f535bb737ceae06..9c42dcfce178f62a2d2aeeaf7ddf1bdaa2dca20a 100644 (file)
@@ -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
index 0d010865aeb908cff548dc0fd419723c919a5187..e24ad158ad3c04b4d34da243be9f552f82cf5912 100644 (file)
@@ -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);
 }