// Transfer all neccessary data to the $DATA array
$DATA['userid_cnt'] = countSumTotalData('CONFIRMED','user_data','userid','status',true);
- $DATA['start'] = generateDateTime($start, '2');
- $DATA['end'] = generateDateTime($end , '2');
- $DATA['now_t'] = generateDateTime(time(), '2');
+ $DATA['start'] = generateDateTime($start, 2);
+ $DATA['end'] = generateDateTime($end , 2);
+ $DATA['now_t'] = generateDateTime(time(), 2);
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
if ($notify == 'Y') $templ = 'admin_rallye_notify';
// Send email to admin
- sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, '0');
+ sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, 0);
// Free memory
SQL_FREERESULT($result_user);
$_userid = '---';
// List only users with at least one ref!
- //* DEBUG: */ outputHtml("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
+ //* DEBUG: */ print("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_userid = $content['userid']; } else { $cnt = ''; }
// Save values to array
if (SQL_NUMROWS($result) == 0) {
// Add userid and his ref count to table
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_users` (`rallye_id`, `userid`, `refs`)
-VALUES ('%s','%s','0')",
+VALUES ('%s','%s',0)",
array(bigintval($id), bigintval($userid)), __FUNCTION__, __LINE__);
} // END - if
if ($notify == 'Y') {
// Transfer all neccessary data to the global $DATA array
- $DATA['start'] = generateDateTime($start, '2');
- $DATA['end'] = generateDateTime($end , '2');
- $DATA['now_t'] = generateDateTime(time(), '2');
+ $DATA['start'] = generateDateTime($start, 2);
+ $DATA['end'] = generateDateTime($end , 2);
+ $DATA['now_t'] = generateDateTime(time(), 2);
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
$DATA['ref'] = 0;
$DATA = array(); $cnt = 0;
$users = array();
$DATA['title'] = $title;
- $DATA['start'] = generateDateTime($start, '1');
- $DATA['end'] = generateDateTime($end , '1');
- $DATA['now_t'] = generateDateTime(time(), '1');
+ $DATA['start'] = generateDateTime($start, 1);
+ $DATA['end'] = generateDateTime($end , 1);
+ $DATA['now_t'] = generateDateTime(time(), 1);
// Just count...
$total = 0;
//
function getArrayFromReferalRallyeUsers ($rallye) {
// Fix zero points to 0.00000
- if (getConfig('ref_payout') == '0') setConfigEntry('ref_payout', '0.00000');
+ if (getConfig('ref_payout') == 0) setConfigEntry('ref_payout', '0.00000');
// Init multi array
$users = array(
$active = countSumTotalData($DATA['userid'][$idx], 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
if (empty($DATA['userid'][$idx])) $DATA['userid'][$idx] = '---';
- if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == '0') || (empty($DATA['cpoints'][$idx]))) {
+ if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == 0) || (empty($DATA['cpoints'][$idx]))) {
// Allow valid and active users with at least one ref to get points
$DATA['ref'][$idx] = '---';
$DATA['userid'][$idx] = '---';
// Expire found rallyes and notify admin
while ($content = SQL_FETCHARRAY($result_rallye)) {
// Prepare data for mail template
- $content['start_time'] = generateDateTime($content['start_time'], '1');
- $content['end_time'] = generateDateTime($content['end_time'] , '1');
- $content['now_time'] = generateDateTime(time(), '1');
+ $content['start_time'] = generateDateTime($content['start_time'], 1);
+ $content['end_time'] = generateDateTime($content['end_time'] , 1);
+ $content['now_time'] = generateDateTime(time(), 1);
// Send mail to admin
sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), 'admin_rallye_purged', $content, 0);
$cnt = 0;
foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
// Do we have a ref for this user?
- //* DEBUG: */ outputHtml("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
+ //* DEBUG: */ print("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
if (($userid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
- //* DEBUG: */ outputHtml("userid matches!<br />");
- foreach ($GLOBALS['cache_array']['ref_depths']['level'] as $level) {
+ //* DEBUG: */ print("userid matches!<br />");
+ foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
// Level does exist so abort here
$cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
- //* DEBUG: */ outputHtml("*".$userid.'/'.$cnt."*<br />");
+ //* DEBUG: */ print("*".$userid.'/'.$cnt."*<br />");
break;
} elseif ($level > 1) {
// Not interesting here...
} // END - if
} // END - foreach
- //* DEBUG: */ outputHtml("<pre>");
- //* DEBUG: */ outputHtml(print_r($GLOBALS['cache_array']['refsystem'], true));
- //* DEBUG: */ outputHtml("</pre>");
+ //* DEBUG: */ print("<pre>");
+ //* DEBUG: */ print(print_r($GLOBALS['cache_array']['refsystem'], true));
+ //* DEBUG: */ print("</pre>");
//* DEBUG: */ shutdown();
if ($cnt > 0) {
incrementStatsEntry('cache_hits');
// Remove old refs
- //* DEBUG: */ outputHtml('+'.$cnt.'/'.$old."+<br />");
+ //* DEBUG: */ print('+'.$cnt.'/'.$old."+<br />");
$cnt -= $old;
} // END - if
} else {
}
// Return count
- //* DEBUG: */ outputHtml("*".$userid.'/'.$old.'/'.$cnt."*<br />");
+ //* DEBUG: */ print("*".$userid.'/'.$old.'/'.$cnt."*<br />");
return $cnt;
}