]> git.mxchange.org Git - mailer.git/blobdiff - mailid.php
New naming convention applied to many functions, see #118 for details
[mailer.git] / mailid.php
index 5a176e4410fa06ab59ac4537a65f4656bf8cdf80..d61a17441aab468a3b59b12cc0741db2d21876d5 100644 (file)
@@ -67,17 +67,17 @@ if (isInstalled()) {
                // Maybe he wants to confirm an email?
                if ($url_mid > 0) {
                        // Normal-Mails
-                       $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT 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) {
                        // Bonus-Mail
-                       $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT 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;
                } else {
                        // Problem: No ID entered
-                       LOAD_URL('index.php');
+                       redirectToUrl('index.php');
                }
 
                if (SQL_NUMROWS($result) == 1) {
@@ -91,7 +91,7 @@ if (isInstalled()) {
                        {
                        case 'NORMAL':
                                // Is the stats ID valid?
-                               $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `id`=%s LIMIT 1",
                                        array($url_mid), __FILE__, __LINE__);
                                break;
 
@@ -100,7 +100,7 @@ if (isInstalled()) {
                                REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
 
                                // Bonus-Mails
-                               $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                        array($url_bid), __FILE__, __LINE__);
                                break;
                        }
@@ -130,8 +130,8 @@ if (isInstalled()) {
                                                                array(bigintval($pool)), __FILE__, __LINE__);
                                                        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;
                                                        }
 
@@ -140,7 +140,7 @@ if (isInstalled()) {
                                                        break;
 
                                                case 'BONUS':
-                                                       $result = SQL_QUERY_ESC("SELECT points, time FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                                                       $result = SQL_QUERY_ESC("SELECT points, time FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                                                array($url_bid), __FILE__, __LINE__);
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($points, $time) = SQL_FETCHROW($result);
@@ -154,7 +154,7 @@ if (isInstalled()) {
                                                }
 
                                                // Add header
-                                               LOAD_INC_ONCE('inc/header.php');
+                                               loadIncludeOnce('inc/header.php');
 
                                                // Was that mail a valid one?
                                                if ($isValid === true) {
@@ -200,7 +200,7 @@ if (isInstalled()) {
        if (!empty($msg)) {
                switch (getConfig('mailid_error_redirect')) {
                        case 'INDEX': // Redirect to index page
-                               LOAD_URL('modules.php?module=index&msg='.$msg.'&ext=mailid');
+                               redirectToUrl('modules.php?module=index&msg='.$msg.'&ext=mailid');
                                break;
 
                        case 'REJECT': // Redirect to rejection page
@@ -209,16 +209,16 @@ if (isInstalled()) {
 
                        default:
                                DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", getConfig('mailid_error_redirect')));
-                               LOAD_URL('modules.php?module=index&msg=' . getCode('UNKNOWN_STATUS') . '&ext=mailid');
+                               redirectToUrl('modules.php?module=index&msg=' . getCode('UNKNOWN_STATUS') . '&ext=mailid');
                                break;
                }
        } else {
                // Include footer
-               LOAD_INC_ONCE('inc/footer.php');
+               loadIncludeOnce('inc/footer.php');
        }
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Shutdown