if (isGetRequestParameterSet('mode')) $mode = getRequestParameter('mode');
// 01 1 12 2 2 21 1 22 10
-if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
// No image? Then output header
if ($mode != 'img') loadIncludeOnce('inc/header.php');
if ($url_mid > 0) {
$result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s AND `userid`=%s LIMIT 1",
array($url_mid, $url_userid), __FILE__, __LINE__);
- $type = 'mailid'; $urlId = $url_mid;
+ $type = 'mailid';
+ $urlId = $url_mid;
} elseif ($url_bid > 0) {
$result_main = SQL_QUERY_ESC("SELECT `id`, `link_type` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s AND `userid`=%s LIMIT 1",
array($url_bid, $url_userid), __FILE__, __LINE__);
- $type = 'bonusid'; $urlId = $url_bid;
+ $type = 'bonusid';
+ $urlId = $url_bid;
}
if (SQL_NUMROWS($result_main) == 1) {
} // END - switch
// Export data into constants for the template
- $content['points'] = translateComma($payment);
$content['banner'] = loadTemplate('mailid_banner', true);
// Only when user extension = v0.1.2: Update mails-confirmed counter
// Right code entered?
if (bigintval(postRequestParameter('gfx_check')) == $img_code) {
// Add points over referal system is the default
- $locked = false;
$template = 'mailid_points_done';
// Right code entered add points and remove entry
- if ((getUserData('ref_payout') > 0) && (getConfig('allow_direct_pay') != 'Y')) {
+ if ((getUserData('ref_payout') > 0) && (!isDirectPaymentAllowed())) {
// Don't add points over the referal system
- $locked = true;
$template = 'mailid_points_locked';
} // END - if
// Add points
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment, false, 0, $locked);
+ addPointsThroughReferalSystem('mailid_okay', $url_userid, $payment);
// Shall I add bonus points for "turbo clickers" ?
if (isExtensionInstalledAndNewer('bonus', '0.2.2')) {
// Is an active-rallye running and this is not a notification mail?
- if ((ifBonusRallyeActive()) && ($notify != 'Y')) {
+ if ((isBonusRallyeActive()) && ($notify != 'Y')) {
// Shall I exclude the webmaster's own userid from the active-rallye?
- if ((((getConfig('bonus_userid') == $url_userid) && (getConfig('bonus_include_own') == 'Y')) || (getConfig('bonus_userid') != $url_userid)) && (getConfig('def_refid') != $url_userid)) {
+ if ((((getBonusUserId() == $url_userid) && (getConfig('bonus_include_own') == 'Y')) || (getBonusUserId() != $url_userid)) && (getConfig('def_refid') != $url_userid)) {
// Add points and remember ranking are done in this function....
addTurboBonus($urlId, $url_userid, $type);
} // END - if
// Load total points
- $content['total'] = translateComma(
- countSumTotalData($url_userid, 'user_points', 'points') -
- countSumTotalData($url_userid, 'user_data', 'used_points')
- );
+ $content['total'] = getTotalPoints($url_userid);
// Load template
loadTemplate($template, false, $content);
- } elseif ($sender > 0) {
+ } elseif (isValidUserId($sender)) {
// Wrong image code! So add points to sender's account
addPointsDirectly('mailid_payback', $sender, $payment);