]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-bonus.php
A lot more nice improvements!
[mailer.git] / inc / modules / member / what-bonus.php
index f34c4ab80b8fa093166bd6fb8fe2decf83980b2e..9a223e9a2023f2f15f22d1e4e9fc0d4e0c2a92c0 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-}
- elseif (!IS_MEMBER())
-{
+} elseif (!IS_MEMBER()) {
        LOAD_URL("modules.php[5~?module=index");
-}
- elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN()))
-{
+} elseif (!EXT_IS_ACTIVE("bonus"))
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
        return;
 }
 
 // Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
+ADD_DESCR("member", __FILE__);
 
 if (GET_EXT_VERSION("bonus") >= "0.6.9")
 {
@@ -69,11 +64,10 @@ if (GET_EXT_VERSION("bonus") >= "0.6.9")
 
 // Autopurge installed?
 $LAST = "%s"; $ONLINE = "";
-if (EXT_IS_ACTIVE("autopurge"))
-{
+if (EXT_IS_ACTIVE("autopurge")) {
        // Use last online timestamp to keep inactive members away from here
-       $LAST   = " AND last_online >= %s";
-       $ONLINE = bigintval(time() - $_CONFIG['ap_in_since']);
+       $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+       $ONLINE = $_CONFIG['ap_inactive_since'];
 }
 
 // Let's check if there are some points left we can "pay"...