list($cpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
- if (empty($cpoints)) $cpoints = "0.00000";
+ if (empty($cpoints)) $cpoints = '0.00000';
// Add info line
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_users` (rallye_id, userid, refs, curr_points)
// Init userid for list
$_uid = '---';
// List only users with at least one ref!
- //* DEBUG: */ echo "*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_uid = $content['userid']; } else { $cnt = ''; }
// Save values to array
array_pk_sort($DATA, array('ref', 'cpoints'), 0, 1, true);
// Generate table
- $OUT = LOAD_TEMPLATE("guest_rallye_header", true);
+ $OUT = LOAD_TEMPLATE('guest_rallye_header', true);
$SW = 2;
for ($idx = 0; $idx < $prices; $idx++) {
if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = '---';
//
function RALLYE_LOAD_USERS_ARRAY ($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(
$cnt = 0;
foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $uid) {
// Do we have a ref for this user?
- //* DEBUG: */ echo "id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("id={$id},uid={$uid},uid={$uid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
if (($uid == $uid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
- //* DEBUG: */ echo "uid matches!<br />\n";
+ //* DEBUG: */ OUTPUT_HTML("uid matches!<br />");
foreach ($GLOBALS['cache_array']['ref_depths']['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: */ echo "*".$uid.'/'.$cnt."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$cnt."*<br />");
break;
} elseif ($level > 1) {
// Not interesting here...
} // END - if
} // END - foreach
- //* DEBUG: */ echo "<pre>";
- //* DEBUG: */ print_r($GLOBALS['cache_array']['refsystem']);
- //* DEBUG: */ echo "</pre>";
- //* DEBUG: */ die();
+ //* DEBUG: */ OUTPUT_HTML("<pre>");
+ //* DEBUG: */ OUTPUT_HTML(print_r($GLOBALS['cache_array']['refsystem'], true));
+ //* DEBUG: */ OUTPUT_HTML("</pre>");
+ //* DEBUG: */ shutdown();
if ($cnt > 0) {
// Count cache hits
incrementConfigEntry('cache_hits');
// Remove old refs
- //* DEBUG: */ echo '+'.$cnt.'/'.$old."+<br />";
+ //* DEBUG: */ OUTPUT_HTML('+'.$cnt.'/'.$old."+<br />");
$cnt -= $old;
} // END - if
} else {
}
// Return count
- //* DEBUG: */ echo "*".$uid.'/'.$old.'/'.$cnt."*<br />";
+ //* DEBUG: */ OUTPUT_HTML("*".$uid.'/'.$old.'/'.$cnt."*<br />");
return $cnt;
}