X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Frallye_functions.php;h=e67677e419cd6082706fbbc28e779f21cbe559a2;hb=61bddb167e29e7275f5a1c9fa8cb80431fa5ee6f;hp=b4985782130466c6f8941ab4d03de1b6a2bdc8fe;hpb=4d6226782aa4ba157dca8c3891412ba50159481f;p=mailer.git
diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php
index b498578213..e67677e419 100644
--- a/inc/libs/rallye_functions.php
+++ b/inc/libs/rallye_functions.php
@@ -42,7 +42,7 @@ function RALLYE_AUTOSTART_RALLYES($result)
{
// Global data array for LOAD_EMAIL_TEMPLATE()
$DATA = array();
- global $DATA, $CONFIG;
+ global $DATA, $_CONFIG;
// Load all rallyes (usally we have only one rallye active per time!
list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
@@ -110,7 +110,7 @@ FROM "._MYSQL_PREFIX."_user_points AS p
LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
ON p.userid=d.userid
WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%d",
- array($CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
+ array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
list($cpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
@@ -127,7 +127,7 @@ VALUES ('%s', '%s', '%s', '%s')",
$DATA['refs'] = $cnt;
// Shall I notify this member?
- if (($notify == 'Y') && ($un))
+ if (($notify == "Y") && ($un))
{
// Load email template and send it to the user
$msg = LOAD_EMAIL_TEMPLATE("member_rallye_notify", $prices, $uid);
@@ -137,7 +137,7 @@ VALUES ('%s', '%s', '%s', '%s')",
// Send email to admin
$templ = "admin_rallye_no_notify";
- if ($notify == 'Y') $templ = "admin_rallye_notify";
+ if ($notify == "Y") $templ = "admin_rallye_notify";
if (GET_EXT_VERSION("admins") < "0.4.1")
{
// Use old method to send out
@@ -160,7 +160,7 @@ function RALLYE_ADD_PRICES($rallye,$mode="email")
switch($mode)
{
case "email": $mode = "\n"; break;
- case "html" : $mode = "
\n"; break;
+ case "html" : $mode = "
\n"; break;
}
// Load prices
@@ -201,8 +201,8 @@ function RALLYE_ADD_PRICES($rallye,$mode="email")
//
function RALLYE_ADD_TOPUSERS($rallye,$default=0)
{
- global $CONFIG;
- $since = (time() - $CONFIG['ap_in_since']);
+ global $_CONFIG;
+ $since = (time() - $_CONFIG['ap_in_since']);
// First check how many prices are set
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%d ORDER BY price_level",
@@ -234,7 +234,7 @@ WHERE u.rallye_id=%d AND r.counter > 0 ORDER BY u.refs DESC",
LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
ON p.userid=d.userid
WHERE d.userid=%d AND d.status='CONFIRMED' AND p.ref_depth=1 AND d.max_mails > 0 AND d.mails_confirmed >= %s AND d.last_online >= %s
-LIMIT 1", array(bigintval($uid), $CONFIG['ref_payout'], $since), __FILE__, __LINE__);
+LIMIT 1", array(bigintval($uid), $_CONFIG['ref_payout'], $since), __FILE__, __LINE__);
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
@@ -316,7 +316,7 @@ VALUES ('%s', '%s', '0')",
SQL_FREERESULT($result);
}
- if ($notify == 'Y')
+ if ($notify == "Y")
{
// Transfer all neccessary data to the global $DATA array
$DATA['start'] = MAKE_DATETIME($start, "2");
@@ -338,10 +338,10 @@ VALUES ('%s', '%s', '0')",
//
function RALLYE_EXPIRE_RALLYES($result)
{
- global $DATA, $CONFIG;
+ global $DATA, $_CONFIG;
// Latest online time
- $since = (time() - $CONFIG['ap_in_since']);
+ $since = (time() - $_CONFIG['ap_in_since']);
// Load rallye data
list($id, $title, $start, $end, $notify, $min_users, $min_prices) = SQL_FETCHROW($result);
@@ -417,7 +417,7 @@ LIMIT 1", array(bigintval($uid), $since), __FILE__, __LINE__);
}
}
- if ($notify == 'Y')
+ if ($notify == "Y")
{
// Prepare infos for the mail template
if (!empty($DATA['info']))
@@ -462,7 +462,7 @@ LIMIT 1", array(bigintval($uid), $since), __FILE__, __LINE__);
}
// Select template depending on notfication is switch on / off
- if ($notify == 'Y')
+ if ($notify == "Y")
{
$templ = "admin_rallye_expired";
}
@@ -539,10 +539,10 @@ function RALLYE_LOAD_PRICES_ARRAY($rallye)
//
function RALLYE_LOAD_USERS_ARRAY($rallye)
{
- global $CONFIG;
+ global $_CONFIG;
// Fix zero points to 0.00000
- if ($CONFIG['ref_payout'] == "0") $CONFIG['ref_payout'] = "0.00000";
+ if ($_CONFIG['ref_payout'] == "0") $_CONFIG['ref_payout'] = "0.00000";
// Init multi array
$users = array(
@@ -565,7 +565,7 @@ FROM "._MYSQL_PREFIX."_user_points AS p
LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
ON p.userid=d.userid
WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p.ref_depth=1 AND p.points > 0 AND d.userid=%d",
- array($CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
+ array($_CONFIG['ref_payout'], bigintval($uid)), __FILE__, __LINE__);
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
@@ -673,7 +673,7 @@ function RALLYE_LIST_WINNERS($rallye,$default=0)
//
function RALLYE_DELETE_EXPIRED_RALLYES()
{
- global $DATA, $CONFIG;
+ global $DATA, $_CONFIG;
// Check for expired rallyes
$EXPIRE = time() - ONE_DAY * 3; // The hard-coded value...
$result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time FROM "._MYSQL_PREFIX."_rallye_data WHERE end_time <= %s AND expired='Y'",
@@ -770,7 +770,7 @@ function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
//
function RALLYE_GET_REFCOUNT($uid, $old=0)
{
- global $REF_SYSTEM, $REF_DEPTHS, $CONFIG;
+ global $REF_SYSTEM, $REF_DEPTHS, $_CONFIG;
// Check current refs
if (GET_EXT_VERSION("cache") >= "0.1.2")
{
@@ -786,7 +786,7 @@ function RALLYE_GET_REFCOUNT($uid, $old=0)
{
// Level does exist so abort here
$cnt = $REF_SYSTEM['counter'][$id];
- //* DEBUG: */ echo "*".$uid."/".$cnt."*
";
+ //* DEBUG: */ echo "*".$uid."/".$cnt."*
";
break;
}
elseif ($level > 0)
@@ -807,10 +807,10 @@ function RALLYE_GET_REFCOUNT($uid, $old=0)
if ($cnt > 0)
{
// Count cache hits
- $CONFIG['cache_hits']++;
+ $_CONFIG['cache_hits']++;
// Remove old refs
- //* DEBUG: */ echo "+".$cnt."/".$old."+
";
+ //* DEBUG: */ echo "+".$cnt."/".$old."+
";
$cnt -= $old;
}
}
@@ -835,7 +835,7 @@ WHERE s.userid=%d AND s.level=0", array(bigintval($uid)), __FILE__, __LINE__);
}
// Return count
- //* DEBUG: */ echo "*".$uid."/".$old."/".$cnt."*
";
+ //* DEBUG: */ echo "*".$uid."/".$old."/".$cnt."*
";
return $cnt;
}
//