if (isGetRequestElementSet('code')) $code = bigintval(getRequestElement('code'));
if (isGetRequestElementSet('do')) $do = getRequestElement('do');
-// 01 2 21 12 2 2 21 1 2210
-if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidId($userId)) && ((isValidId($mailId)) || (isValidId($bonusId))) && (!ifFatalErrorsDetected())) {
// No image?
if ($do != 'img') {
// ... then output header
} // END - fi
// Maybe he wants to confirm an email?
- if ($mailId > 0) {
+ if (isValidId($mailId)) {
$result_main = SQL_QUERY_ESC("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
array($mailId, $userId), __FILE__, __LINE__);
$type = 'mailid';
$urlId = $mailId;
- } elseif ($bonusId > 0) {
+ } elseif (isValidId($bonusId)) {
$result_main = SQL_QUERY_ESC("SELECT `id` AS `link_id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
array($bonusId, $userId), __FILE__, __LINE__);
$type = 'bonusid';
break;
case 'BONUS':
- $result_mailid = SQL_QUERY_ESC("SELECT `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+ $result_mailid = SQL_QUERY_ESC("SELECT `id` AS `pool_id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array($urlId), __FILE__, __LINE__);
break;
// Set sender to 0 when we have a bonus mail
if ($data['link_type'] == 'BONUS') {
- $data['sender'] = '0';
+ $data['sender'] = NULL;
} // END - if
// Is the user id valid?
// Entry found?
if (SQL_NUMROWS($result) == 1) {
- list($pay) = SQL_FETCHROW($result);
- $time = getPaymentData($pay, 'time');
- $payment = getPaymentData($pay, 'payment');
+ list($paymentId) = SQL_FETCHROW($result);
+ $time = getPaymentData($paymentId, 'time');
+ $payment = getPaymentData($paymentId, 'payment');
$isValid = TRUE;
} // END - if
// Is this entry valid?
if ($isValid === TRUE) {
+ // Run at least one second
if (($time == '0') && ($payment > 0)) $time = 1;
+
+ // Is time and payment set?
if (($time > 0) && ($payment > 0)) {
$realCode = '0';
if (!empty($code)) {
// Is an active-rallye running and this is not a notification mail?
if ((isBonusRallyeActive()) && ($data['is_notify'] != 'Y')) {
// Shall I exclude the webmaster's own userid from the active-rallye?
- if ((((getBonusUserid() == $userId) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserid() != $userId)) && (getDefRefid() != $userId)) {
+ if ((((getBonusUserid() == $userId) && (isBonusIncludeOwnEnabled())) || (getBonusUserid() != $userId)) && (getDefRefid() != $userId)) {
// Add points and remember ranking are done in this function....
addTurboBonus($urlId, $userId, $type);
// Load template
loadTemplate($template, FALSE, $content);
- } elseif (isValidUserId($data['sender'])) {
+ } elseif (isValidId($data['sender'])) {
// Wrong image code! So add points to sender's account
initReferralSystem();
addPointsThroughReferralSystem('mailid_payback', $data['sender'], $payment);
$content['userid'] = $userId;
$content['type'] = $type;
$content['data'] = $urlId;
- $content['rand'] = getRandomTan();
$content['banner'] = loadTemplate('mailid_banner', TRUE);
// Load template