// Maybe he wants to confirm an email?
if ($mailId > 0) {
- $result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
+ $result_main = SQL_QUERY_ESC("SELECT `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) {
- $result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
+ $result_main = SQL_QUERY_ESC("SELECT `id`,`link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
array($bonusId, $userId), __FILE__, __LINE__);
$type = 'bonusid';
$urlId = $bonusId;
// @TODO Rewrite this to a filter
switch ($ltype) {
case 'NORMAL':
- $result_mailid = SQL_QUERY_ESC("SELECT `pool_id`, `userid`, `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
+ $result_mailid = SQL_QUERY_ESC("SELECT `pool_id`,`userid`,`id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `id`=%s LIMIT 1",
array($mailId), __FILE__, __LINE__);
break;
case 'BONUS':
- $result_mailid = SQL_QUERY_ESC("SELECT `id`, `id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+ $result_mailid = SQL_QUERY_ESC("SELECT `id`,`id`,`is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array($bonusId), __FILE__, __LINE__);
break;
list($pool, $sender, $notify) = SQL_FETCHROW($result_mailid);
// Correct notification switch in non-bonus mails
- if (($notify != 'Y') && ($notify != 'N')) $notify = 'N';
+ if (($notify != 'Y') && ($notify != 'N')) {
+ $notify = 'N';
+ } // END - if
// Set sender to 0 when we have a bonus mail
- if ($ltype == 'BONUS') $sender = '0';
+ if ($ltype == 'BONUS') {
+ $sender = '0';
+ } // END - if
// Is the user id valid?
if (fetchUserData($userId) === true) {
break;
case 'BONUS':
- $result = SQL_QUERY_ESC("SELECT `time`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `time`,`points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval($pool)), __FILE__, __LINE__);
// Entry found?
} // END - if
// Insert stats record
- //insertUserStatsRecord($userId, $type, $stats_data);
+ insertUserStatsRecord($userId, $type, $stats_data);
// Right code entered?
if (bigintval(postRequestParameter('gfx_check')) == $realCode) {
loadTemplate($template, false, $content);
} elseif (isValidUserId($sender)) {
// Wrong image code! So add points to sender's account
+ initReferalSystem();
addPointsThroughReferalSystem('mailid_payback', $sender, $payment);
// Add payment points