-$ADMIN = " AND d.is_active='Y'";
-if (IS_ADMIN()) $ADMIN = "";
-$result = SQL_QUERY("SELECT DISTINCT d.id, d.admin_id, a.login, d.title, d.descr, d.template, d.start_time, d.end_time, d.min_users, d.min_prices
- FROM `{!MYSQL_PREFIX!}_rallye_data` AS d, `{!MYSQL_PREFIX!}_admins` AS a
- WHERE d.admin_id=a.id".$ADMIN." AND d.notified='Y'
- ORDER BY d.end_time LIMIT 1", __FILE__, __LINE__);