More improved SQL queries
[mailer.git] / inc / extensions.php
index 91646a16cc79a8a65afc9976cacc9e67042c16b5..07fd2858b0eba2875b4bc0b4b7df4efbdd0d3dfe 100644 (file)
@@ -55,7 +55,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for extension file
-       $extInclude = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+       $extInclude = sprintf("inc/extensions/ext-%s.php", $ext_name);
 
        // Is the extension file NOT there?
        if (!FILE_READABLE($extInclude)) {
@@ -67,25 +67,25 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for language file
-       $langInclude = sprintf("%sinc/language/%s_%s.php", PATH, $ext_name, GET_LANGUAGE());
+       $langInclude = sprintf("inc/language/%s_%s.php", $ext_name, GET_LANGUAGE());
 
        // Is this include there?
        if ((FILE_READABLE($langInclude)) && (!isset($EXT_LOADED['lang'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Language loaded.");
                $EXT_LOADED['lang'][$ext_name] = true;
-               require($langInclude);
+               LOAD_INC_ONCE($langInclude);
        } // END - if
 
        // Construct FQFN for functions file
-       $funcsInclude = sprintf("%sinc/libs/%s_functions.php", PATH, $ext_name);
+       $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
        // Is this include there?
        if ((FILE_READABLE($funcsInclude)) && (!isset($EXT_LOADED['funcs'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Functions loaded.");
                $EXT_LOADED['funcs'][$ext_name] = true;
-               require($funcsInclude);
+               LOAD_INC_ONCE($funcsInclude);
        } // END - if
 
        // Extensions are not deprecated by default
@@ -102,7 +102,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
 
        // Include the extension file
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Extension loaded.");
-       require($extInclude);
+       LOAD_INC($extInclude);
 
        // Is this extension deprecated?
        if ($EXT_DEPRECATED == "Y") {
@@ -243,7 +243,7 @@ function EXTENSION_REGISTER ($ext_name, $task_id, $dry_run = false, $logout = tr
                }
        } elseif (($task_id > 0) && (!empty($ext_name))) {
                // Remove task from system when id and extension's name is valid
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND status='NEW' LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND `status`='NEW' LIMIT 1",
                        array(bigintval($task_id)), __FILE__, __LINE__);
        }
 
@@ -667,7 +667,7 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
        if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) == "")) {
                // Template file
                $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
-                       PATH,
+                       constant('PATH'),
                        GET_LANGUAGE(),
                        $ext
                );