]> git.mxchange.org Git - mailer.git/blobdiff - beg.php
More queries now depends on UNIX_TIMESTAMP() SQL function, wrong index in autopurge...
[mailer.git] / beg.php
diff --git a/beg.php b/beg.php
index e402809626df492982bd4b35c509954abd416bfd..fa82cafebef842886c2a9b62ed62d69034caddd6 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -75,7 +75,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
 
                // Check if locked in so don't pay points
                $login = false; $status = "failed";
 
                // Check if locked in so don't pay points
                $login = false; $status = "failed";
-               if (IS_LOGGED_IN()) {
+               if (IS_MEMBER()) {
                        // Logged in user detected!
                        $login = true;
                }
                        // Logged in user detected!
                        $login = true;
                }
@@ -103,7 +103,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                define('__BEG_POINTS', TRANSLATE_COMMA($points));
                        } else {
                                // Other status
                                define('__BEG_POINTS', TRANSLATE_COMMA($points));
                        } else {
                                // Other status
-                               $uid = "0";
+                               $uid = 0;
                        }
                }
 
                        }
                }
 
@@ -116,7 +116,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                         array($uid), __FILE__, __LINE__);
 
                        // Check for last entry for userid w/o IP number
                         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 > ".(time() - $_CONFIG['beg_timeout'])." OR (timeout > ".(time() - $_CONFIG['beg_uid_timeout'])." AND userid=%s)) AND remote_ip='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_beg_ips WHERE (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_timeout'].") OR (timeout > (UNIX_TIMESTAMP() - ".$_CONFIG['beg_uid_timeout'].") AND userid=%s)) AND remote_ip='%s' LIMIT 1",
                         array($uid, getenv('REMOTE_ADDR')), __FILE__, __LINE__);
                        if ((SQL_NUMROWS($result) == 0) && ($points > 0) && (!$login)) {
                                // Free memory
                         array($uid, getenv('REMOTE_ADDR')), __FILE__, __LINE__);
                        if ((SQL_NUMROWS($result) == 0) && ($points > 0) && (!$login)) {
                                // Free memory