- ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE `id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
- ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
- ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
-
- // Add task
- // @TODO Rewrite this to a function
- ADD_SQL(SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created)
-VALUES ('NEW','RALLYE_PURGED','{--RALLYE_ADMIN_PURGED--}: %s','{--RALLYE_ADMIN_PURGED_TEXT--}',UNIX_TIMESTAMP())",
- array($content['title']), __FUNCTION__, __LINE__, false));
+ addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
+ addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s LIMIT 1",
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
+ addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s LIMIT 1",
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
+
+ // Add task (we ignore the task id here
+ createNewTask('{--ADMIN_RALLYE_PURGED_TASK--}: ' . $content['title'], '{--ADMIN_RALLYE_PURGED_TEXT--}', 'RALLYE_PURGED');