@@ -147,7+147,7 @@ function RALLYE_ADD_PRICES($rallye,$mode="email")
}
// Load prices
- $result_prices = SQL_QUERY("SELECT price_level, points, info FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id='".$rallye."' ORDER BY price_level", __FILE__, __LINE__);
+ $result_prices = SQL_QUERY("SELECT price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id='".$rallye."' ORDER BY price_level", __FILE__, __LINE__);
if (SQL_NUMROWS($result_prices) > 0)
{
// Load prices
@@ -184,17+184,15 @@ function RALLYE_ADD_PRICES($rallye,$mode="email")
//
function RALLYE_ADD_TOPUSERS($rallye,$default=0)
{
- global $_CONFIG;
-
// First check how many prices are set
- $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_prices WHERE rallye_id=%s ORDER BY price_level",
+ $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level",
array(bigintval($rallye)), __FILE__, __LINE__);
$prices = SQL_NUMROWS($result);
SQL_FREERESULT($result);
// And load only limited users
- $result = SQL_QUERY_ESC("SELECT DISTINCT u.userid, u.refs, u.curr_points FROM "._MYSQL_PREFIX."_rallye_users AS u
-LEFT JOIN "._MYSQL_PREFIX."_refsystem AS r
+ $result = SQL_QUERY_ESC("SELECT DISTINCT u.userid, u.refs, u.curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` AS u
+LEFT JOIN `{!_MYSQL_PREFIX!}_refsystem` AS r
ON u.userid=r.userid
WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC",
array(bigintval($rallye)), __FILE__, __LINE__);
@@ -206,17+204,17 @@ WHERE u.rallye_id=%s AND r.counter > 0 ORDER BY u.refs DESC",
@@ -281,7+279,7 @@ function RALLYE_AUTOADD_USER($uid)
} // 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", __FILE__, __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", __FILE__, __LINE__);
@@ -476,7+474,7 @@ function RALLYE_LOAD_USER_DATA($uids_array)
$uid_string = implode(",", $uids_array['uid']);
// Load users
- $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",
+ $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",