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";
$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);
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
$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);