]> git.mxchange.org Git - mailer.git/blobdiff - mailid_top.php
New naming convention applied to many functions, see #118 for details
[mailer.git] / mailid_top.php
index 9a6c54cc648eed1f1d77c439864d6377b0d984ef..a02e39ffbd815905cf3266b623f6e7be04440a42 100644 (file)
@@ -65,15 +65,15 @@ if (isInstalled()) {
        // 01        1        12            2    2            21    1                   22     10
        if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
                // No image? Then output header
-               if ($mode != 'img') LOAD_INC_ONCE('inc/header.php');
+               if ($mode != 'img') loadIncludeOnce('inc/header.php');
 
                // Maybe he wants to confirm an email?
                if ($url_mid > 0) {
-                       $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
+                       $result = 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_uid), __FILE__, __LINE__);
                        $type = 'mailid'; $urlId = $url_mid;
                } elseif ($url_bid > 0) {
-                       $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
+                       $result = 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_uid), __FILE__, __LINE__);
                        $type = 'bonusid'; $urlId = $url_bid;
                }
@@ -85,12 +85,12 @@ if (isInstalled()) {
                        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($url_mid), __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($url_bid), __FILE__, __LINE__);
                                break;
                        }
@@ -134,8 +134,8 @@ if (isInstalled()) {
                                                        // Entry found?
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($pay) = SQL_FETCHROW($result);
-                                                               $time      = GET_PAY_POINTS($pay, 'time');
-                                                               $payment   = GET_PAY_POINTS($pay, 'payment');
+                                                               $time      = getPaymentPoints($pay, 'time');
+                                                               $payment   = getPaymentPoints($pay, 'payment');
                                                                $isValid   = true;
                                                        } // END - if
 
@@ -144,7 +144,7 @@ if (isInstalled()) {
                                                        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?
@@ -176,7 +176,7 @@ if (isInstalled()) {
                                                                        switch ($ltype)
                                                                        {
                                                                        case 'NORMAL':
-                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
+                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET clicks=clicks + 1 WHERE `id`=%s LIMIT 1",
                                                                                        array($url_mid), __FILE__, __LINE__);
 
                                                                                // Update mediadata as well
@@ -188,7 +188,7 @@ if (isInstalled()) {
                                                                                break;
 
                                                                        case 'BONUS':
-                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
+                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET clicks=clicks + 1 WHERE `id`=%s LIMIT 1",
                                                                                        array($url_bid), __FILE__, __LINE__);
 
                                                                                // Update mediadata as well
@@ -201,7 +201,7 @@ if (isInstalled()) {
                                                                        }
 
                                                                        // Export data into constants for the template
-                                                                       define('_POINTS_VALUE'   , TRANSLATE_COMMA($payment));
+                                                                       define('_POINTS_VALUE'   , translateComma($payment));
                                                                        define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
 
                                                                        // Only when user extension = v0.1.2: Update mails-confirmed counter
@@ -220,7 +220,7 @@ if (isInstalled()) {
                                                                        } // END - if
 
                                                                        // Insert stats record
-                                                                       USER_STATS_INSERT_RECORD($url_uid, $type, $stats_data);
+                                                                       insertUserStatsRecord($url_uid, $type, $stats_data);
 
                                                                        // Right code entered?
                                                                        if (bigintval(REQUEST_POST('gfx_check')) == $img_code) {
@@ -257,13 +257,13 @@ if (isInstalled()) {
                                                                                                        if ($locked) $template = 'mailid_points_locked2';
                                                                                                        define('_UID_VALUE' , $url_uid);
                                                                                                        define('_TYPE_VALUE', $type);
-                                                                                                       define('_DATA_VALUE', TRANSLATE_COMMA($urlId));
+                                                                                                       define('_DATA_VALUE', translateComma($urlId));
                                                                                                } // END - if
                                                                                        } // END - if
                                                                                } // END - if
 
                                                                                // Load total points
-                                                                               define('__TOTAL_POINTS', TRANSLATE_COMMA(
+                                                                               define('__TOTAL_POINTS', translateComma(
                                                                                        GET_TOTAL_DATA($url_uid, 'user_points', 'points') -
                                                                                        GET_TOTAL_DATA($url_uid, 'user_data', 'used_points'))
                                                                                );
@@ -273,14 +273,14 @@ if (isInstalled()) {
                                                                        } else {
                                                                                // Wrong image code! So add points to sender's account
                                                                                unset($GLOBALS['ref_level']);
-                                                                               ADD_POINTS_REFSYSTEM('mailid_payback', $sender, $payment, false, 0, false, 'direct');
+                                                                               ADD_POINTS_REFSYSTEM_DIRECT('mailid_payback', $sender, $payment);
 
                                                                                // Load template
                                                                                LOAD_TEMPLATE('mailid_points_failed');
                                                                        }
 
                                                                        // Remove link from table
-                                                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE id=%s LIMIT 1",
+                                                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `id`=%s LIMIT 1",
                                                                                array(bigintval($lid)), __FILE__, __LINE__);
                                                                        break;
 
@@ -298,7 +298,7 @@ if (isInstalled()) {
                                                                                define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
                                                                                if (getConfig('code_length') > 0) {
                                                                                        // Generate Code
-                                                                                       define('_IMAGE_CODE', IMG_CODE($code, $type, $urlId, $url_uid));
+                                                                                       define('_IMAGE_CODE', generateCaptchaCode($code, $type, $urlId, $url_uid));
                                                                                        $templ = 'mailid_enter_code';
                                                                                } else {
                                                                                        // Disabled code
@@ -351,12 +351,12 @@ if (isInstalled()) {
                // Insert footer if no image
                if ($mode != 'img') {
                        // Write footer
-                       LOAD_INC_ONCE('inc/footer.php');
+                       loadIncludeOnce('inc/footer.php');
                } // END - if
        }
 } elseif ($mode != 'img') {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)