]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-bonus.php
Rewritten to use functions, query updated to a 'join'
[mailer.git] / inc / modules / member / what-bonus.php
index d44f96177622a75828fc8877debba5a6d326cb10..6fd3e4410bb5ed0bafcc999b5c2bd13fe787a385 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 } elseif (!IS_MEMBER()) {
        redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bonus')) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bonus'));
+       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveMessage('bonus'));
        return;
 }
 
@@ -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'] = translateComma($content['points']);
-               $content['last']   = generateDateTime($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" ! :-(