From 641ca2a3526aa0612781dddf83dd77dbb003adff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 19 Dec 2008 15:41:36 +0000 Subject: [PATCH] Several bugfixes, getMessage() introduced - Bugfix in doubler, "send new password" and mail order page - getMessage() introduced, see http://bugs.mxchange.org/view.php?id=4 - Several minor improvements --- doubler.php | 45 ++++++++++-------- inc/databases.php | 69 ++++++++++++++-------------- inc/extensions.php | 2 - inc/functions.php | 22 +++++++++ inc/language/de.php | 5 +- inc/language/en.php | 3 +- inc/modules/guest/action- | 4 +- inc/modules/guest/action-admin.php | 20 ++++---- inc/modules/guest/action-main.php | 6 +-- inc/modules/guest/action-members.php | 4 +- inc/modules/guest/action-sponsor.php | 4 +- inc/modules/guest/what-login.php | 28 ++++++++--- inc/modules/index.php | 10 ++-- inc/modules/member/what-order.php | 25 +++------- 14 files changed, 141 insertions(+), 106 deletions(-) diff --git a/doubler.php b/doubler.php index 34c7c7380c..060102a398 100644 --- a/doubler.php +++ b/doubler.php @@ -59,24 +59,31 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Probe for referal ID if (!empty($_GET['refid'])) $GLOBALS['refid'] = SQL_ESCAPE($_GET['refid']); - // Probe for nickname extension and if a nickname was supplied by URL - $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($GLOBALS['refid'])."") != $GLOBALS['refid'])); - if ($probe_nickname) { - // Nickname in URL, so load the ID - $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' LIMIT 1", - array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); - } else { - // Direct userid entered - $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); - } + // Only check this if refid is provided! + if ($GLOBALS['refid'] > 0) { + // Probe for nickname extension and if a nickname was supplied by URL + $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($GLOBALS['refid'])."") != $GLOBALS['refid'])); + + // Do we have nickname or userid set? + if ($probe_nickname) { + // Nickname in URL, so load the ID + $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' LIMIT 1", + array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); + } else { + // Direct userid entered + $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", + array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__); + } - // Load data - list($rid, $status_ref) = SQL_FETCHROW($result); - $GLOBALS['refid'] = bigintval($rid); + // Load data + list($rid, $status_ref) = SQL_FETCHROW($result); + $GLOBALS['refid'] = bigintval($rid); + + // Free memory + SQL_FREERESULT($result); + } // END - if - // Free memory - SQL_FREERESULT($result); + // Init userid $uid = 0; // If no account was found set default refid and status to CONFIRMED @@ -97,11 +104,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { if ($probe_nickname) { // Nickname in URL, so load the ID $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' LIMIT 1", - array($_POST['userid']), __FILE__, __LINE__); + array($_POST['userid']), __FILE__, __LINE__); } else { // Direct userid entered $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", - array(bigintval($_POST['userid'])), __FILE__, __LINE__); + array(bigintval($_POST['userid'])), __FILE__, __LINE__); } // Load data @@ -131,7 +138,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Enough points are left so let's continue with the doubling process // Create doubling "account" width *DOUBLED* points $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_doubler (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".GET_REMOTE_ADDR()."', UNIX_TIMESTAMP(), 'N','N')", - array($uid, bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2)), __FILE__, __LINE__); + array($uid, bigintval($GLOBALS['refid']), bigintval($_POST['points'] * 2)), __FILE__, __LINE__); // Subtract entered points SUB_POINTS("doubler", $uid, $_POST['points']); diff --git a/inc/databases.php b/inc/databases.php index 94869b2265..7ca5b789e7 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -38,39 +38,40 @@ if (!defined('__SECURITY')) { } // END - if // System-wide return codes -define('CODE_WRONG_PASS' , 1); -define('CODE_WRONG_ID' , 2); -define('CODE_ID_LOCKED' , 3); -define('CODE_ID_UNCONFIRMED' , 4); -define('CODE_UNKNOWN_STATUS' , 5); -define('CODE_NO_COOKIES' , 6); -define('CODE_CNTR_FAILED' , 8); -define('CODE_LOGOUT_DONE' , 8); -define('CODE_LOGOUT_FAILED' , 9); -define('CODE_URL_TLOCK' , 10); -define('CODE_URL_FOUND' , 11); -define('CODE_OVERLENGTH' , 12); -define('CODE_SUBJ_URL' , 13); -define('CODE_BLIST_URL' , 14); -define('CODE_NO_RECS_LEFT' , 15); -define('CODE_INVALID_TAGS' , 16); -define('CODE_MORE_POINTS' , 18); -define('CODE_COOKIES_DISABLED' , 18); -define('CODE_DATA_INVALID' , 19); -define('CODE_POSSIBLE_INVALID' , 20); -define('CODE_ACCOUNT_LOCKED' , 21); -define('CODE_USER_404' , 22); -define('CODE_STATS_404' , 23); -define('CODE_ALREADY_CONFIRMED', 24); -define('CODE_ERROR_MAILID' , 25); -define('CODE_EXTENSION_PROBLEM', 26); -define('CODE_MORE_RECEIVERS1' , 28); -define('CODE_MORE_RECEIVERS2' , 28); -define('CODE_MORE_RECEIVERS3' , 29); -define('CODE_INVALID_URL' , 30); -define('CODE_MENU_NOT_VALID' , 31); -define('CODE_LOGIN_FAILED' , 32); -define('CODE_BEG_SAME_AS_OWN' , 33); +define('CODE_WRONG_PASS' , 0x001); +define('CODE_WRONG_ID' , 0x002); +define('CODE_ID_LOCKED' , 0x003); +define('CODE_ID_UNCONFIRMED' , 0x004); +define('CODE_UNKNOWN_STATUS' , 0x005); +define('CODE_NO_COOKIES' , 0x006); +define('CODE_CNTR_FAILED' , 0x008); +define('CODE_LOGOUT_DONE' , 0x008); +define('CODE_LOGOUT_FAILED' , 0x009); +define('CODE_URL_TLOCK' , 0x00A); +define('CODE_URL_FOUND' , 0x00B); +define('CODE_OVERLENGTH' , 0x00C); +define('CODE_SUBJ_URL' , 0x00D); +define('CODE_BLIST_URL' , 0x00E); +define('CODE_NO_RECS_LEFT' , 0x00F); +define('CODE_INVALID_TAGS' , 0x010); +define('CODE_MORE_POINTS' , 0x011); +define('CODE_COOKIES_DISABLED' , 0x012); +define('CODE_DATA_INVALID' , 0x013); +define('CODE_POSSIBLE_INVALID' , 0x014); +define('CODE_ACCOUNT_LOCKED' , 0x015); +define('CODE_USER_404' , 0x016); +define('CODE_STATS_404' , 0x017); +define('CODE_ALREADY_CONFIRMED', 0x018); +define('CODE_ERROR_MAILID' , 0x019); +define('CODE_EXTENSION_PROBLEM', 0x01A); +define('CODE_MORE_RECEIVERS1' , 0x01B); +define('CODE_MORE_RECEIVERS2' , 0x01C); +define('CODE_MORE_RECEIVERS3' , 0x01D); +define('CODE_INVALID_URL' , 0x01E); +define('CODE_MENU_NOT_VALID' , 0x01F); +define('CODE_LOGIN_FAILED' , 0x020); +define('CODE_BEG_SAME_AS_OWN' , 0x020); +define('CODE_UNHANDLED_STATUS' , 0x020); // Full version string: /([0-9]){1}\.([0-9]){1}\.([0-9]){1}(-(alpha|beta|pre|rc([1-3]))([0-9]+))?/ // If you understand regular expressions ^^^ you may know how I versionize... ;-) @@ -114,7 +115,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "658"); +define('CURR_SVN_REVISION', "659"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions.php b/inc/extensions.php index 4cc56fb5b6..ccd38d91f2 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -140,8 +140,6 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr $NOTES = ""; $INC_POOL = array(); - // By default the language prefix is the extension's name - // @TODO: Do we really need this one anymore? Can't we just take $ext_name and done? // By default we have no failtures $EXT_REPORTS_FAILURE = false; diff --git a/inc/functions.php b/inc/functions.php index a1d9b344f6..cb7e4c1536 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2868,6 +2868,28 @@ function getConfig ($entry) { return $value; } +// @TODO Rewrite all language constants to the function getLanguage(). +// "Getter" for language strings +function getMessage ($messageId) { + // Default is not found! + $return = "!".$messageId."!"; + + // Is the language string found? + if (isset($GLOBALS['msg'][$messageId])) { + // Language array element found + $return = $GLOBALS['msg'][$messageId]; + } elseif (defined($messageId)) { + // @DEPRECATED Deprecated constant found + $return = constant($messageId); + } else { + // Missing language constant + DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Missing message string %s detected.", $messageId)); + } + + // Return the string + return $return; +} + ////////////////////////////////////////////////// // // // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS // diff --git a/inc/language/de.php b/inc/language/de.php index eeb1e50985..dda9ec3c97 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -284,9 +284,8 @@ define('ADMIN_THANX', "Mit freundlichem Gruss,"); define('SCRIPT', "Script"); define('ADMIN_NEW_ACCOUNT', "Neue Anmeldung zu Ihrem {!MT_WORD!}"); define('REGISTRATION_DONE', "Vielen Dank für die Anmeldung. Ein Bestätigungslink ist zur angemeldeten EMail-Adresse unterwegs!"); -define('GUEST_404_ACTION_1', "Das angegeben Aktionsmodul "); -define('GUEST_404_ACTION_2', " existiert leider nicht, oder dieses Script hat einen Fehler gemacht!"); -define('GUEST_LOCKED_ACTION', "Aktionsmodul wurde gesperrt!"); +define('GUEST_404_ACTION', "Das angegeben Aktionsmodul %s existiert leider nicht, oder dieses Script hat einen Fehler gemacht!"); +define('GUEST_LOCKED_ACTION', "Aktionsmodul %s wurde gesperrt!"); define('FATAL_REPORT_ERRORS', "Es wurde ein Problem während der Abarbeitung von Anweisungen festgestellt. Wenn ein Modul gesperrt sein sollte, so wird vermutlich gerade dran gearbeitet, anderfalls melden Sie sich bitte bei uns!"); define('TEMPLATE_404', "Template nicht gefunden!"); define('EDIT_GUEST_MENU', "Gästemenü bearbeiten"); diff --git a/inc/language/en.php b/inc/language/en.php index ca7aeb2a99..52329ef52c 100644 --- a/inc/language/en.php +++ b/inc/language/en.php @@ -289,8 +289,7 @@ define('ADMIN_THANX', "Best regards,"); define('SCRIPT', "Script"); define('ADMIN_NEW_ACCOUNT', "New registration for your email exchange"); define('REGISTRATION_DONE', "Registration is done. An email is on its way to you."); -define('GUEST_404_ACTION_1', "The action module "); -define('GUEST_404_ACTION_2', " does not exist or this script makes a boo-boo!"); +define('GUEST_404_ACTION', "The action module %s does not exist or this script makes a boo-boo!"); define('GUEST_LOCKED_ACTION', "Action module is locked."); define('FATAL_REPORT_ERRORS', "A fatal error ocurs while runtime. If a module is locked we are working on it othervice please contact us!"); define('TEMPLATE_404', "Template not found."); diff --git a/inc/modules/guest/action- b/inc/modules/guest/action- index a31675b174..6b8b39bc5d 100644 --- a/inc/modules/guest/action- +++ b/inc/modules/guest/action- @@ -51,8 +51,10 @@ $INC = sprintf(PATH."inc/modules/guest/what-%s.php", $GLOBALS['what']); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module include($INC); +} elseif ($IS_VALID) { + ADD_FATAL(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2); + ADD_FATAL(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/action-admin.php b/inc/modules/guest/action-admin.php index d62329fd1a..efbbf18c97 100644 --- a/inc/modules/guest/action-admin.php +++ b/inc/modules/guest/action-admin.php @@ -40,16 +40,16 @@ if (!defined('__SECURITY')) { return; } -if (GET_ACTION("guest", $GLOBALS['what']) == "admin") { - // Only when one admin link is clicked... - $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); - if (FILE_READABLE($INC)) { - // Ok, we finally load the guest action module - include($INC); - } else { - ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2); - } -} // END - if +// Only when one admin link is clicked... +$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); +if (FILE_READABLE($INC)) { + // Ok, we finally load the guest action module + include($INC); +} elseif ($IS_VALID) { + ADD_FATAL(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); +} else { + ADD_FATAL(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); +} // ?> diff --git a/inc/modules/guest/action-main.php b/inc/modules/guest/action-main.php index 3177c10227..94592b2f4f 100644 --- a/inc/modules/guest/action-main.php +++ b/inc/modules/guest/action-main.php @@ -45,15 +45,15 @@ ADD_DESCR("guest", __FILE__); // Load the include file $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what'])); -$IS_VALID = WHAT_IS_VALID(GET_ACTION("guest", $GLOBALS['what']), $GLOBALS['what'], "guest"); +$IS_VALID = WHAT_IS_VALID($GLOBALS['action'], $GLOBALS['what'], "guest"); if ((FILE_READABLE($INC)) && ($IS_VALID)) { // Ok, we finally load the guest action module require_once($INC); } elseif ($IS_VALID) { - ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2); + ADD_FATAL(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - ADD_FATAL(GUEST_LOCKED_ACTION); + ADD_FATAL(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/action-members.php b/inc/modules/guest/action-members.php index 75779be80c..78362718dc 100644 --- a/inc/modules/guest/action-members.php +++ b/inc/modules/guest/action-members.php @@ -48,8 +48,10 @@ $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['wha if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module include($INC); +} elseif ($IS_VALID) { + ADD_FATAL(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2); + ADD_FATAL(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/action-sponsor.php b/inc/modules/guest/action-sponsor.php index 1b7b18db34..df18e40597 100644 --- a/inc/modules/guest/action-sponsor.php +++ b/inc/modules/guest/action-sponsor.php @@ -50,8 +50,10 @@ $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['wha if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module include($INC); +} elseif ($IS_VALID) { + ADD_FATAL(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2); + ADD_FATAL(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/what-login.php b/inc/modules/guest/what-login.php index 6035504fb8..1cd74d3e09 100644 --- a/inc/modules/guest/what-login.php +++ b/inc/modules/guest/what-login.php @@ -241,16 +241,26 @@ if (IS_MEMBER()) { // Set ID number when left empty if (empty($_POST['id'])) $_POST['id'] = 0; + // Init result + $result = false; + // Probe userid/nickname - $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($_POST['id'])."") != $_POST['id'])); - if ($probe_nickname) { + if ((EXT_IS_ACTIVE("nickname")) && (("".round($_POST['id'])."") != $_POST['id'])) { // Nickname entered $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' OR email='%s' LIMIT 1", array($uid, $_POST['email']), __FILE__, __LINE__); - } else { + } elseif (($uid > 0) && (empty($_POST['email']))) { // Direct userid entered - $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s OR email='%s' LIMIT 1", - array(bigintval($uid), $_POST['email']), __FILE__, __LINE__); + $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1", + array(bigintval($uid)), __FILE__, __LINE__); + } elseif (!empty($_POST['email'])) { + // Email entered + $result = SQL_QUERY_ESC("SELECT userid, status FROM `"._MYSQL_PREFIX."_user_data` WHERE email='%s' LIMIT 1", + array($_POST['email']), __FILE__, __LINE__); + } else { + // Userid not set! + DEBUG_LOG(__FILE__, __LINE__, "Userid is not set! BUG!"); + $ERROR = CODE_WRONG_ID; } // Any entry found? @@ -275,8 +285,12 @@ if (IS_MEMBER()) { } else { // Account is locked or unconfirmed switch ($status) { - case "LOCKED" : $MSG = CODE_ID_LOCKED; break; - case "UNCONFIRMED": $MSG = CODE_ID_UNCONFIRMED; break; + case "LOCKED" : $ERROR = CODE_ID_LOCKED; break; + case "UNCONFIRMED": $ERROR = CODE_ID_UNCONFIRMED; break; + default: // Unhandled account status! + $ERROR = CODE_UNHANDLED_STATUS; + DEBUG_LOG(__FILE__, __LINE__, sprintf("Undhandled account status %s detected.", $status)); + break; } // Load URL diff --git a/inc/modules/index.php b/inc/modules/index.php index 06fd11d42f..6180e3e941 100644 --- a/inc/modules/index.php +++ b/inc/modules/index.php @@ -92,11 +92,11 @@ if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home'); // Adding the main content module here if (empty($GLOBALS['action'])) { // Get action value from what value - $act = GET_ACTION("guest", $GLOBALS['what']); -} else { - // Get action value directly from URL - $act = COMPILE_CODE($GLOBALS['action']); -} + $GLOBALS['action'] = GET_ACTION("guest", $GLOBALS['what']); +} // END - if + +// Get action value directly from URL +$act = COMPILE_CODE($GLOBALS['action']); // Add the guest's menu here... if ((getConfig('guest_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) { diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 7753510fa8..7af82df446 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -59,13 +59,10 @@ if (IS_ADMIN()) $whereStatement = ""; define('__MIN_VALUE', getConfig('order_min')); // Count unconfirmed mails -$result_links = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_links WHERE userid=%s", - array($GLOBALS['userid']), __FILE__, __LINE__); -$links = SQL_NUMROWS($result_links); -SQL_FREERESULT($result_links); +$links = GET_TOTAL_DATA($GLOBALS['userid'], "user_links", "id", "userid", true); // Does the user has more than 0 mails per day set? -$HOLIDAY="userid"; +$HOLIDAY = "userid"; if (GET_EXT_VERSION("holiday") >= "0.1.3") { // Fetch also holiday activation data $HOLIDAY = "holiday_active"; @@ -74,7 +71,7 @@ if (GET_EXT_VERSION("holiday") >= "0.1.3") { $result_mmails = SQL_QUERY_ESC("SELECT userid, receive_mails, mail_orders, ".$HOLIDAY." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s AND max_mails > 0 LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__); + array($GLOBALS['userid']), __FILE__, __LINE__); $mmails = SQL_NUMROWS($result_mmails); list($DMY, $MAXI, $ORDERS, $HOLIDAY) = SQL_FETCHROW($result_mmails); @@ -85,19 +82,10 @@ $ALLOWED = $MAXI - $ORDERS; if (getConfig('order_max_full') == "MAX") $ALLOWED = $MAXI; // Now check his points amount -$TOTAL = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points"); - -if ($TOTAL > 0) { - // And subtract his used points... - $TOTAL -= GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points"); - - // Add (maybe) missing three zeros - if (!ereg(".", $TOTAL)) $TOTAL .= ".00000"; -} // END - if +$TOTAL = GET_TOTAL_DATA($GLOBALS['userid'], "user_points", "points") - GET_TOTAL_DATA($GLOBALS['userid'], "user_data", "used_points");; if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3")) { // Holiday is active! - SQL_FREERESULT($result_p); LOAD_TEMPLATE("admin_settings_saved", false, HOLIDAY_ORDER_NOT_POSSIBLE); } elseif ((!empty($_POST['frametester'])) && ($ALLOWED > 0) && ($_POST['receiver'] > 0)) { // Continue with the frametester, we first need to store the data temporary in the pool @@ -106,12 +94,13 @@ if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3")) { $result = SQL_QUERY_ESC("SELECT id, data_type FROM "._MYSQL_PREFIX."_pool WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1", - array($GLOBALS['userid'], $_POST['url'], getConfig('url_tlock')), __FILE__, __LINE__); + array($GLOBALS['userid'], $_POST['url'], getConfig('url_tlock')), __FILE__, __LINE__); $type = "TEMP"; $id = 0; if (SQL_NUMROWS($result) == 1) { + // Load id and mail type list($id, $type) = SQL_FETCHROW($result); - } + } // END - if // Free result SQL_FREERESULT($result); -- 2.39.5