is not needed in member-only templates
[mailer.git] / inc / modules / member / what-points.php
index 38ae7595f088fd2ad529288bd355349add8a9663..38065edd7bf3815c9847cfdaca24c3b4a8e0c9ef 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -114,16 +115,8 @@ while ($data = SQL_FETCHARRAY($result_depths)) {
        // Free result
        SQL_FREERESULT($result_refs);
 
-       // Transfer data to array for template
-       $row = array(
-               'level'    => $content['level'],
-               'percents' => translateComma($content['percents']),
-               'points'   => translateComma($content['points']),
-               'refs'     => translateComma($content['counter']),
-       );
-
        // Output row
-       $OUT .= loadTemplate('member_points_row', true, $row);
+       $OUT .= loadTemplate('member_points_row', true, $content);
 } // END - while
 
 // Free memory
@@ -133,14 +126,16 @@ SQL_FREERESULT($result_depths);
 $content['rows'] = $OUT;
 
 // Initialize variables
-$CONFIRMED = '---'; $SENT = '---'; $RECEIVED = '---';
+$CONFIRMED = '---';
+$SENT      = '---';
+$RECEIVED  = '---';
 
 // Only user >= v0.1.2: Fetch confirmed mails counter
 if (isExtensionInstalledAndNewer('user', '0.1.2')) {
        $add = '';
        $CONFIRMED = getUserData('mails_confirmed');
 
-       if (getExtensionVersion('user') >= '0.1.4') {
+       if (isExtensionInstalledAndNewer('user', '0.1.4')) {
                $SENT     = getUserData('emails_sent');
                $RECEIVED = getUserData('emails_received');
        } // END - if
@@ -157,12 +152,12 @@ if (isExtensionInstalledAndNewer('user', '0.1.2')) {
 if ($totalLocked == '0') $totalLocked = '0.00000';
 
 // Remember several values in constants
-$content['sum']   = translateComma($totalPoints - getUserData('used_points'));
+$content['sum']   = ($totalPoints - getUserData('used_points'));
 $content['tref']  = $totalReferals;
-$content['tlock'] = translateComma($totalLocked);
+$content['tlock'] = $totalLocked;
 
 // Fixes a bug when there is no bonus extension installed
-if (isExtensionInstalledAndOlder('bonus', '0.4.4')) setConfigEntry('bonus_active', "X");
+if (isExtensionInstalledAndOlder('bonus', '0.4.4')) setConfigEntry('bonus_active', 'X');
 
 // Members shall see no special rows here
 $content['special_rows'] = '';
@@ -172,30 +167,16 @@ if ((isExtensionInstalledAndNewer('bonus', '0.2.2')) && (isExtensionActive('bonu
        // Fetch some data and init others (to avoid a notice here)
        $content['login'] = getUserData('login_bonus');
        $content['turbo'] = getUserData('turbo_bonus');
-       $content['ref']   = '0.00000';
-       $content['order'] = '0.00000';
-       $content['stats'] = '0.00000';
 
        // Get more data if ext-bonus is newer
-       if (getExtensionVersion('bonus') >= '0.4.4') {
+       if (isExtensionInstalledAndNewer('bonus', '0.4.4')) {
                $content['ref']   = getUserData('bonus_ref');
                $content['order'] = getUserData('bonus_order');
                $content['stats'] = getUserData('bonus_stats');
        } // END - if
 
        // Total bonus points
-       $content['ttotal'] = translateComma($content['turbo'] + $content['login'] + $content['ref'] + $content['order'] + $content['stats']);
-
-       // Translate more data
-       $content['turbo'] = translateComma($content['turbo']);
-       $content['login'] = translateComma($content['login']);
-
-       if (getExtensionVersion('bonus') >= '0.4.4') {
-               // Add referal, stats and order bonys
-               $content['ref']   = translateComma($content['ref']);
-               $content['order'] = translateComma($content['order']);
-               $content['stats'] = translateComma($content['stats']);
-       } // END - if
+       $content['ttotal'] = $content['turbo'] + $content['login'] + $content['ref'] + $content['order'] + $content['stats'];
 
        // Output rows
        $content['special_rows'] = loadTemplate('member_points_bonus_rows', true, $content);