// Get refs by userid
$cnt = RALLYE_GET_REFCOUNT($uid);
- if (empty($cnt)) $cnt = "0"; // Added prevent some unknown troubles... :-?
+ if (empty($cnt)) $cnt = 0; // Added prevent some unknown troubles... :-?
// Check if line is already included...
$result_ref = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
- if (empty($refpoints)) $refpoints = "0";
+ if (empty($refpoints)) $refpoints = 0;
// And subtract start refs
$cnt -= $refs;
$DATA['now_t'] = MAKE_DATETIME(time(), "2");
$DATA['title'] = $title;
$DATA['id'] = $id; // ID for the rallye details link
- $DATA['ref'] = "0";
+ $DATA['ref'] = 0;
// Load prices
$prices = RALLYE_ADD_PRICES($id);
// Just count...
$TOTAL = 0;
- foreach($prices['uid'] as $key=>$uid)
+ foreach($prices['uid'] as $key => $uid)
{
// Check status
// active = 1: account is still confirmed
array(bigintval($id)), __FILE__, __LINE__);
// Run array through (by uid is the most important 2nd-level-array)
- foreach($prices['uid'] as $key=>$uid)
+ foreach($prices['uid'] as $key => $uid)
{
// Allow valid and active users with at least one ref to get points
if (($uid > 0) && ($prices['ref'][$key] > 0) && ($prices['active'][$key] == 1) && ($prices['cpoints'][$key] > 0))
$uid_string = implode(",", $uids_array['uid']);
// Load users
- $result = SQL_QUERY_ESC("SELECT userid, sex, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid IN(%s) AND status='CONFIRMED' ORDER BY userid LIMIT %s",
+ $result = SQL_QUERY_ESC("SELECT userid, gender, surname, family, email FROM "._MYSQL_PREFIX."_user_data WHERE userid IN(%s) AND status='CONFIRMED' ORDER BY userid LIMIT %s",
array($uid_string, count($uids_array)), __FILE__, __LINE__);
$ret = "";
- while (list($u, $sex, $surname, $family, $email) = SQL_FETCHROW($result))
+ while (list($u, $gender, $surname, $family, $email) = SQL_FETCHROW($result))
{
- $ret .= TRANSLATE_SEX($sex)." ".$surname." ".$family." (".$email.") - ".$uids_array['poi'][$u]."\n";
+ $ret .= TRANSLATE_GENDER($gender)." ".$surname." ".$family." (".$email.") - ".$uids_array['poi'][$u]."\n";
}
// Return result
list($refpoints) = SQL_FETCHROW($result_ref);
SQL_FREERESULT($result_ref);
- if (empty($refpoints)) $refpoints = "0";
+ if (empty($refpoints)) $refpoints = 0;
// Store calculated new refs to array
$users['uid'][] = $uid;
$prices = RALLYE_LOAD_PRICES_ARRAY($rallye);
// Merge users into prices
- foreach ($prices['level'] as $k=>$lvl)
+ foreach ($prices['level'] as $k => $lvl)
{
$prices['uid'][$k] = $users['uid'][$k];
if (empty($prices['uid'][$k])) $prices['uid'][$k] = "---";
{
// Get refs from cache
$cnt = 0;
- foreach ($cacheArray['ref_system']['userid'] as $id=>$u_id)
+ foreach ($cacheArray['ref_system']['userid'] as $id => $u_id)
{
if (($u_id == $uid) && ($cacheArray['ref_system']['level'][$id] == 0))
{
SQL_FREERESULT($result_ref);
if (empty($cnt))
{
- $cnt = "0";
+ $cnt = 0;
}
else
{