]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-bonus.php
Old config.php is now automatically updated to new config-local.php format, several...
[mailer.git] / inc / modules / member / what-bonus.php
index 8b13ded196e1674a96c90653740c5857c954093e..0344efecca1179f53e941b17be6bc5dd0f57c615 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bonus')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bonus'));
        return;
@@ -69,7 +69,7 @@ if (GET_EXT_VERSION('bonus') >= '0.6.9') {
 $lastOnline = "%s"; $ONLINE = '';
 if (EXT_IS_ACTIVE('autopurge')) {
        // Use last online timestamp to keep inactive members away from here
-       $lastOnline   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+       $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
        $ONLINE = getConfig('ap_inactive_since');
 }
 
@@ -78,7 +78,7 @@ $result = SQL_QUERY_ESC("SELECT userid, ".$USE." AS points, last_online FROM `{!
 WHERE ".$USE." > 0 AND `status`='CONFIRMED'".$lastOnline."
 ORDER BY points DESC, last_online DESC, userid
 LIMIT %s",
-       array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__);
+array($ONLINE, getConfig('bonus_ranks')), __FILE__, __LINE__);
 
 // Reset temporary variable and check for users
 $OUT = '';
@@ -88,17 +88,18 @@ if (SQL_NUMROWS($result) > 0) {
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the template
                $content = array(
-               $content['sw']     = $SW;
-               $content['cnt']    = $cnt;
-               $content['uid']    = bigintval($content['uid']);
-               $content['points'] = TRANSLATE_COMMA($content['points']);
-               $content['last']   = MAKE_DATETIME($content['last'], "2");
+                       'sw'     => $SW,
+                       'cnt'    => $cnt,
+                       'uid'    => bigintval($content['uid']),
+                       'points' => translateComma($content['points']),
+                       'last'   => generateDateTime($content['last'], '2')
+               );
 
                // Load row template
                $OUT .= LOAD_TEMPLATE("member_bonus_row", true, $content);
 
                // Count one up and switch colors
-               $cnt++;$SW = 3 - $SW;
+               $cnt++; $SW = 3 - $SW;
        }
 } else {
        // No one is interested in our "active rallye" ! :-(