- if ((SQL_NUMROWS($result) == 0) && (empty($ext_ver))) {
- // Generate subject line
- $ext_subj = sprintf("[%s:]", $ext);
-
- // Not installed and do we have created a task for the admin?
- //* DEBUG: */ echo $ext.":".$ext_ver."=";
- $result = SQL_QUERY_ESC("SELECT `id` FROM `"._MYSQL_PREFIX."_task_system` WHERE `subject` LIKE '%s%%' LIMIT 1",
- array($ext_subj), __FILE__, __LINE__);
- //* DEBUG: */ echo SQL_NUMROWS($result)."<br />\n";
- if ((SQL_NUMROWS($result) == 0) && (GET_EXT_VERSION($ext) == "")) {
- // Template file
- $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
- PATH,
- GET_LANGUAGE(),
- $ext
- );
-
- // Load text for task
- if ((file_exists($tpl)) && (is_readable($tpl))) {
- // Load extension's own text template (HTML!)
- $MSG = LOAD_TEMPLATE("ext_".$ext, true);
- } else {
- // Load default message
- $MSG = LOAD_EMAIL_TEMPLATE("admin_new_ext","", 0);
- }
-
- // Task not created so it's a brand-new extension which we need to register and create a task for!
- $result_insert = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (assigned_admin, userid, status, task_type, subject, text, task_created)
-VALUES ('%s', '0', 'NEW', 'EXTENSION', '%s', '%s', UNIX_TIMESTAMP())",
- array(
- GET_ADMIN_ID(get_session('admin_login')),
- $ext_subj,
- addslashes($MSG),
- ), __FILE__, __LINE__, true, false);
- }
-
- // Free memory
- SQL_FREERESULT($result);
-