// Run this function only when a new member has confirmed his email address!
function RALLYE_AUTOADD_USER ($uid) {
global $DATA;
- $ADD = "";
+ $add = "";
// Updated extension?
if (GET_EXT_VERSION("rallye") >= "0.2.0") {
- $ADD .= ", min_users, min_prices";
+ $add .= ", min_users, min_prices";
} // END - if
// Check for an auto-add rallye
- $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$ADD." FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT id, title, start_time, end_time, send_notify".$add." FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE is_active='Y' AND notified='Y' AND auto_add_new_user='Y' AND expired='N' LIMIT 1", __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Init variables
$min_users = 0; $min_prices = 0;
$DATA['now_t'] = MAKE_DATETIME(time(), "1");
// Just count...
- $TOTAL = 0;
+ $total = 0;
foreach($prices['uid'] as $key => $uid) {
// Check status
// active = 1: account is still confirmed
// Allow valid and active users with at least one ref to get points
if (($uid > 0) && ($prices['ref'][$key] > 0) && ($active == 1) && ($prices['cpoints'][$key] > 0)) {
- $TOTAL++;
+ $total++;
} // END - if
} // END - foreach
- if (($TOTAL < $min_prices) || ($TOTAL == 0)) {
+ if (($total < $min_prices) || ($total == 0)) {
// Do not end this rallye!
unset($DATA);
return;
}
// Add row
- $ADD = "";
+ $add = "";
$OUT .= "<tr>
- <td class=\"switch_sw".$SW." bottom2".$ADD."\"> ".($idx+1).".</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
+ <td class=\"switch_sw".$SW." bottom2".$add."\"> ".($idx+1).".</td>
+ <td align=\"center\" class=\"switch_sw".$SW." bottom2".$add."\">";
if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['uid'][$idx];
if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
+ <td align=\"center\" class=\"switch_sw".$SW." bottom2".$add."\">";
if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['ref'][$idx];
if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";
$OUT .= "</td>
- <td align=\"center\" class=\"switch_sw".$SW." bottom2".$ADD."\">";
+ <td align=\"center\" class=\"switch_sw".$SW." bottom2".$add."\">";
if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "<strong>";
$OUT .= $DATA['infos'][$idx];
if (($DATA['uid'][$idx] == $default) && ($default > 0)) $OUT .= "</strong>";