- $result_notified = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_rallye_data SET notified='Y' WHERE id=%s LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
-
- // Do a snapshot off all user refs
- $result_user = SQL_QUERY("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
-
- // Transfer all neccessary data to the global $DATA array
- $DATA['uid_cnt'] = SQL_NUMROWS($result_user);
- $DATA['start'] = MAKE_DATETIME($start, "2");
- $DATA['end'] = MAKE_DATETIME($end , "2");
- $DATA['now_t'] = MAKE_DATETIME(time(), "2");
- $DATA['title'] = $title;
- $DATA['id'] = $id; // ID for the rallye details link
-
- if ($min_users == 0)
- {
- // Rallye ends without user limitation
- $DATA['min_users'] = RALLYE_END_NO_USER_LIMITATION;
- }
- else
- {
- // Rallye ends when X members are totally in your exchange
- $DATA['min_users'] = RALLYE_END_USERS_1." ".$min_users." ".RALLYE_END_USERS_2;
- }
- if ($min_prices == 0)
- {
- // Rallye ends without user limitation
- $DATA['min_prices'] = RALLYE_END_NO_PRICE_LIMITATION;
- }
- else
- {
- // Rallye ends when X members are totally in your exchange
- $DATA['min_prices'] = RALLYE_END_PRICES_1." ".$min_prices." ".RALLYE_END_PRICES_2;
- }
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_rallye_data` SET `notified`='Y' WHERE `id`=%s LIMIT 1",
+ array(bigintval($id)), __FUNCTION__, __LINE__);
+
+ // Transfer all neccessary data to the $content array
+ $content['userid_cnt'] = countSumTotalData('CONFIRMED','user_data','userid','status',true);
+ $content['start'] = generateDateTime($start, 2);
+ $content['end'] = generateDateTime($end , 2);
+ $content['now_t'] = generateDateTime(time(), 2);
+ $content['title'] = $title;
+ $content['id'] = $id; // id for the rallye details link
+
+ // Determine min_users and min_prices
+ $content['min_users'] = determineReferalRallyeMinimumUsers($min_users);
+ $content['min_prices'] = determineReferalRallyeMinimumPrices($min_prices);