]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-bonus.php
Previous fix fixed, a lot constants rewritten (unfinished)
[mailer.git] / inc / modules / member / what-bonus.php
index 9d340d18e7a50bffe9ced1f003742e3fa6e82254..3b01a6f21027d39a9d6dd016b82c64afddfc7a03 100644 (file)
@@ -37,8 +37,8 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        LOAD_URL("modules.php[5~?module=index");
-} elseif (!EXT_IS_ACTIVE("bonus")) {
-       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
+} elseif ((!EXT_IS_ACTIVE("bonus")) && (!IS_ADMIN())) {
+       addFatalMessage(EXTENSION_PROBLEM_EXT_INACTIVE, "bonus");
        return;
 }
 
@@ -49,11 +49,11 @@ 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 (getConfig('bonus_click_yn') == "Y") $USE .= " + turbo_bonus";
+       if (getConfig('bonus_login_yn') == "Y") $USE .= " + login_bonus";
+       if (getConfig('bonus_order_yn') == "Y") $USE .= " + bonus_order";
+       if (getConfig('bonus_stats_yn') == "Y") $USE .= " + bonus_stats";
+       if (getConfig('bonus_ref_yn')   == "Y") $USE .= " + bonus_ref";
        $USE .= ")";
 }
  else
@@ -67,15 +67,15 @@ $LAST = "%s"; $ONLINE = "";
 if (EXT_IS_ACTIVE("autopurge")) {
        // Use last online timestamp to keep inactive members away from here
        $LAST   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
-       $ONLINE = $_CONFIG['ap_inactive_since'];
+       $ONLINE = getConfig('ap_inactive_since');
 }
 
 // Let's check if there are some points left we can "pay"...
-$result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM "._MYSQL_PREFIX."_user_data
+$result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM `{!_MYSQL_PREFIX!}_user_data`
 WHERE ".$USE." > 0 AND status='CONFIRMED'".$LAST."
 ORDER BY points DESC, last_online DESC, userid
 LIMIT %s",
array($ONLINE, $_CONFIG['bonus_ranks']), __FILE__, __LINE__);
      array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__);
 
 // Reset temporary variable and check for users
 $OUT = "";