]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_rallyes.php
More fixes, thanks to Piter01
[mailer.git] / inc / modules / admin / what-list_rallyes.php
index ea81f49ffc776c039c17f5bd561781300a86c16b..552acec06f6866bc241511456538897b543e6632 100644 (file)
@@ -38,7 +38,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
 
 if (empty($_GET['sub'])) $_GET['sub'] = "";
 $MSG = "";
@@ -218,9 +218,7 @@ if (isset($_POST['edit']))
                // Nothing selected to edit
                LOAD_TEMPLATE("admin_settings_saved", false, LOAD_TEMPLATE("admin_list_rallye_noselect", true));
        }
-}
- elseif (($_GET['sub'] == "users") && ($_GET['rallye'] > 0))
-{
+} elseif (($_GET['sub'] == "users") && ($_GET['rallye'] > 0)) {
        // List users and their refs before start and current
        $result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s ORDER BY userid",
         array(bigintval($_GET['rallye'])), __FILE__, __LINE__);
@@ -230,7 +228,7 @@ if (isset($_POST['edit']))
                define('__RALLYE_VALUE', $_GET['rallye']);
                while (list($uid, $old, $opoints) = SQL_FETCHROW($result))
                {
-                       // Check for referral count
+                       // Check for referal count
                        $cnt = RALLYE_GET_REFCOUNT($uid, $old);
 
                        // Output row
@@ -238,11 +236,15 @@ if (isset($_POST['edit']))
                        if (($opoints > 0) && ($cnt > 0)) { $Bl = "<STRONG>"; $Br = "</STRONG>"; }
                        if (($old > 0) || ($cnt > 0))
                        {
-                               // Insert link to referral list
+                               // Insert link to referal list
                                //* DEBUG: */ echo "-".$uid."/".$cnt."/".$old."-<br />";
                                $cnt = ADMIN_USER_PROFILE_LINK($uid, $cnt, "list_refs");
                                $old = ADMIN_USER_PROFILE_LINK($uid, $old, "list_refs");
                        }
+
+                       // Get user points
+                       $points = GET_TOTAL_DATA($uid, "user_points", "points", "userid", false, " AND ref_depth=1 LIMIT 1");
+                       //* DEBUG: */ echo basename(__FILE__).":uid={$uid},points={$points},opoints={$opoints}<br />\n";
                        $content = array(
                                'sw'      => $SW ,
                                'uid'     => $uid,
@@ -250,7 +252,7 @@ if (isset($_POST['edit']))
                                'bold_r'  => $Br ,
                                'old'     => $old,
                                'cnt'     => $cnt,
-                               'opoints' => TRANSLATE_COMMA($opoints),
+                               'opoints' => TRANSLATE_COMMA($points - $opoints),
                        );
                        $OUT .= LOAD_TEMPLATE("admin_list_rallye_usr_row", true, $content);
                        $SW = 3 - $SW;