All database names are now 'back-ticked' and constant _MYSQL_PREFIX is wrapped. Partl...
[mailer.git] / beg.php
diff --git a/beg.php b/beg.php
index b0ecebb6ded9eed8b3c43fac0beee4d3c482c32e..d1c103f6118b75a6bb45700d64df167d561ecb4c 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -70,7 +70,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                if ("".($_GET['uid'] + 0)."" !== "".$_GET['uid']."") {
                        if (EXT_IS_ACTIVE("nickname")) {
                                // Maybe we have found a nickname?
-                               $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
                                        array($_GET['uid']), __FILE__, __LINE__);
                        } else {
                                // Nickname entered but nickname is not active
@@ -79,7 +79,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                        }
                } else {
                        // Direct userid
-                       $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `"._MYSQL_PREFIX."_user_data` WHERE userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT userid, beg_clicks, ref_payout, status, last_online FROM `{!MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
                                array(bigintval($_GET['uid'])), __FILE__, __LINE__);
                }
 
@@ -121,11 +121,11 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                // User id valid and not webmaster's id?
                if (($uid > 0) && (getConfig('beg_uid') != $uid)) {
                        // Update counter
-                       SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_user_data` SET beg_clicks=beg_clicks+1 WHERE userid=%s AND status='CONFIRMED' LIMIT 1",
                                array($uid), __FILE__, __LINE__);
 
                        // Check for last entry for userid w/o IP number
-                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM `{!MYSQL_PREFIX!}_beg_ips` WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
                                array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__);
 
                        // Entry not found, points set and not logged in?
@@ -136,7 +136,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                        // Remember remote address, userid and timestamp for next click
                                        // but only when there is no admin begging.
                                        // Admins shall be able to test it!
-                                       SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_beg_ips (userid, remote_ip,sid, timeout) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
+                                       SQL_QUERY_ESC("INSERT INTO `{!MYSQL_PREFIX!}_beg_ips` (userid, remote_ip,sid, timeout) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
                                                array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__);
 
                                        // Was is successfull?
@@ -211,7 +211,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                        $msg = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
                } elseif (($uid == "0") || ($status == "failed")) {
                        // Inalid or locked account, so let's find out
-                       $result = SQL_QUERY_ESC("SELECT userid FROM `"._MYSQL_PREFIX."_user_data` WHERE nickname='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT userid FROM `{!MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
                                array($_GET['uid']), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Locked account
@@ -235,7 +235,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                LOAD_URL("modules.php?module=index");
        }
 } else {
-       // You have to configure first!
+       // You have to install first!
        LOAD_URL("install.php");
 }