]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-bonus.php
Direct registration added, typo fixed, admin session on missing/failed login fixed...
[mailer.git] / inc / modules / member / what-bonus.php
index 48fbd70980181c865e6c0d098c27cc2e1afebd6e..bd2ee2fe93ce27fc07336a3b7d2dcaa7fdce5fd7 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_LOGGED_IN())
-{
+} elseif (!IS_MEMBER()) {
        LOAD_URL("modules.php[5~?module=index");
-}
- elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN()))
-{
+} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
        ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
        return;
 }
 
 // Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
-OUTPUT_HTML("</FONT><br />");
+ADD_DESCR("member", __FILE__);
 
 if (GET_EXT_VERSION("bonus") >= "0.6.9")
 {
        // Add more bonus points here
        $USE = "(0";
-       if ($_CONFIG['bonus_click_yn'] == 'Y') $USE .= " + turbo_bonus";
-       if ($_CONFIG['bonus_login_yn'] == 'Y') $USE .= " + login_bonus";
-       if ($_CONFIG['bonus_order_yn'] == 'Y') $USE .= " + bonus_order";
-       if ($_CONFIG['bonus_stats_yn'] == 'Y') $USE .= " + bonus_stats";
-       if ($_CONFIG['bonus_ref_yn']   == 'Y') $USE .= " + bonus_ref";
+       if ($_CONFIG['bonus_click_yn'] == "Y") $USE .= " + turbo_bonus";
+       if ($_CONFIG['bonus_login_yn'] == "Y") $USE .= " + login_bonus";
+       if ($_CONFIG['bonus_order_yn'] == "Y") $USE .= " + bonus_order";
+       if ($_CONFIG['bonus_stats_yn'] == "Y") $USE .= " + bonus_stats";
+       if ($_CONFIG['bonus_ref_yn']   == "Y") $USE .= " + bonus_ref";
        $USE .= ")";
 }
  else
@@ -70,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"...