X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_rallyes.php;h=552acec06f6866bc241511456538897b543e6632;hb=2142149f3f72f1a2476f95a87937c044d63bbaf2;hp=7ef34bd3022dd9fe93ef404b695ea64d2487eba9;hpb=0c030e7ade850b0e42a434f4b02ca69fbffd504f;p=mailer.git
diff --git a/inc/modules/admin/what-list_rallyes.php b/inc/modules/admin/what-list_rallyes.php
index 7ef34bd302..552acec06f 100644
--- a/inc/modules/admin/what-list_rallyes.php
+++ b/inc/modules/admin/what-list_rallyes.php
@@ -32,14 +32,13 @@
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
-{
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
if (empty($_GET['sub'])) $_GET['sub'] = "";
$MSG = "";
@@ -219,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__);
@@ -231,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
@@ -239,11 +236,15 @@ if (isset($_POST['edit']))
if (($opoints > 0) && ($cnt > 0)) { $Bl = ""; $Br = ""; }
if (($old > 0) || ($cnt > 0))
{
- // Insert link to referral list
+ // Insert link to referal list
//* DEBUG: */ echo "-".$uid."/".$cnt."/".$old."-
";
$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}
\n";
$content = array(
'sw' => $SW ,
'uid' => $uid,
@@ -251,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;
@@ -341,7 +342,7 @@ ORDER BY start_time DESC",
// Rallye is active so do not edit it!
$content['select'] = "".$id."";
$content['active_title'] = RALLYE_DEACTIVATE_NOW;
- $content['active'] = "0";
+ $content['active'] = 0;
break;
case 'N':
@@ -355,7 +356,7 @@ ORDER BY start_time DESC",
{
case 'Y':
$content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
- $content['notify'] = "0";
+ $content['notify'] = 0;
break;
case 'N':
@@ -369,7 +370,7 @@ ORDER BY start_time DESC",
{
case 'Y':
$content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
- $content['auto'] = "0";
+ $content['auto'] = 0;
break;
case 'N':