Naming convention applied, new API function introduced:
[mailer.git] / mailid_top.php
index f5b64e0866521a66db7d10c2f5707f34153bfcb8..7f1639a085d0e807264da6c23da356f14138fa29 100644 (file)
@@ -67,13 +67,13 @@ $code = '0';
 $mode = '';
 
 // Secure all data
-if (isGetRequestParameterSet('userid'))  $userId = bigintval(getRequestParameter('userid'));
-if (isGetRequestParameterSet('mailid'))  $mailId    = bigintval(getRequestParameter('mailid'));
-if (isGetRequestParameterSet('bonusid')) $bonusId    = bigintval(getRequestParameter('bonusid'));
-if (isGetRequestParameterSet('code'))    $code       = bigintval(getRequestParameter('code'));
-if (isGetRequestParameterSet('mode'))    $mode       = getRequestParameter('mode');
+if (isGetRequestParameterSet('userid'))  $userId  = bigintval(getRequestParameter('userid'));
+if (isGetRequestParameterSet('mailid'))  $mailId  = bigintval(getRequestParameter('mailid'));
+if (isGetRequestParameterSet('bonusid')) $bonusId = bigintval(getRequestParameter('bonusid'));
+if (isGetRequestParameterSet('code'))    $code    = bigintval(getRequestParameter('code'));
+if (isGetRequestParameterSet('mode'))    $mode    = getRequestParameter('mode');
 
-// 01           1        12            2    2            21    1                   22     10
+// 01             2       21    12           2    2            21    1                      2210
 if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalErrorsDetected())) {
        // No image? Then output header
        if ($mode != 'img') loadIncludeOnce('inc/header.php');
@@ -243,7 +243,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                                                $template = 'mailid_points_done';
 
                                                                                // Right code entered add points and remove entry
-                                                                               if ((getUserData('ref_payout') > 0) && (!isDirectPaymentEnabled())) {
+                                                                               if (ifUserPointsLocked($userId)) {
                                                                                        // Don't add points over the referal system
                                                                                        $template = 'mailid_points_locked';
                                                                                } // END - if
@@ -268,7 +268,13 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
 
                                                                                                        // Set template to mailid_points_done2 which contains a link to the ranking list
                                                                                                        $template = 'mailid_points_done2';
-                                                                                                       if ($locked) $template = 'mailid_points_locked2';
+
+                                                                                                       // Different template if user has some mails to confirm
+                                                                                                       if (ifUserPointsLocked($userId)) {
+                                                                                                               $template = 'mailid_points_locked2';
+                                                                                                       } // END - if
+
+                                                                                                       // Assign more data for the template
                                                                                                        $content['userid']  = $userId;
                                                                                                        $content['type']    = $type;
                                                                                                        $content['data']    = $urlId;