Fixes for rallye extension, refs are now no longer removed from rallye if ref was...
[mailer.git] / inc / modules / admin / what-list_rallyes.php
index ea81f49ffc776c039c17f5bd561781300a86c16b..d4e61658fa286837de54baa8440820531e89ed66 100644 (file)
@@ -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__);
@@ -243,6 +241,9 @@ if (isset($_POST['edit']))
                                $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")  - GET_TOTAL_DATA($uid, "user_data", "used_points");
                        $content = array(
                                'sw'      => $SW ,
                                'uid'     => $uid,
@@ -250,7 +251,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;