X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodule-functions.php;h=ba6ba895cfa513c7b96615e04f9b0262907d662f;hp=fd44d136dcd5b434a32e50cd2850709622ee97b3;hb=155492a5b96cec674846973a8524238b0365a848;hpb=1d22c70e65e858422ee0d17a7612f4b5c0757a42 diff --git a/inc/module-functions.php b/inc/module-functions.php index fd44d136dc..ba6ba895cf 100644 --- a/inc/module-functions.php +++ b/inc/module-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -59,17 +59,17 @@ function getModuleTitle ($module) { incrementStatsEntry('cache_hits'); } elseif (!isExtensionActive('cache')) { // Load from database - $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1", + $result = sqlQueryEscaped("SELECT `title` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1", array($module), __FUNCTION__, __LINE__); // Is the entry there? - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Get the title from database - $data = SQL_FETCHARRAY($result); + $data = sqlFetchArray($result); } // END - if // Free the result - SQL_FREERESULT($result); + sqlFreeResult($result); } } // END - if @@ -85,7 +85,7 @@ function getModuleTitle ($module) { } else { // No name found $data['title'] = '{%message,UNKNOWN_MODULE_DETECTED_TITLE=' . $module . '%}'; - if ((is_resource($result)) && (SQL_HASZERONUMS($result))) { + if ((is_resource($result)) && (ifSqlHasZeroNums($result))) { // Add module to database and ignore return value checkModulePermissions($module); } // END - if @@ -116,7 +116,7 @@ function getModuleStatus ($module) { // Is the module_status entry there? if (!isModuleStatusSet($module)) { // Abort - reportBug('Module status not set. module=' . $module); + reportBug(__FUNCTION__, __LINE__, 'Module status not set. module=' . $module); } // END - if // Return it @@ -145,11 +145,11 @@ function isModuleRegistered ($module) { } elseif (!isExtensionActive('cache')) { // Check for module in database //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using database.'); - $result = SQL_QUERY_ESC("SELECT `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1", + $result = sqlQueryEscaped("SELECT `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1", array($module), __FUNCTION__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Read data - $data = SQL_FETCHARRAY($result); + $data = sqlFetchArray($result); // Set all entries foreach ($data as $key => $value) { @@ -164,7 +164,7 @@ function isModuleRegistered ($module) { } // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); } // Return status @@ -288,23 +288,23 @@ function checkModulePermissions ($module = '') { // Data is missing so we add it if (isExtensionInstalledAndNewer('sql_patches', '0.3.6')) { /* - * Since 0.3.6 we have a has_menu column, this took me a half + * Since 0.3.6 there is a has_menu column, this took me a half * hour to find a loop here... *sigh* */ - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg` + sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg` (`module`, `locked`, `hidden`, `mem_only`, `admin_only`, `has_menu`) VALUES ('%s','Y','N','N','N','N')", array($module_chk), __FUNCTION__, __LINE__); } else { // Wrong/missing sql_patches! - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg` + sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_mod_reg` (`module`, `locked`, `hidden`, `mem_only`, `admin_only`) VALUES ('%s','Y','N','N','N')", array($module_chk), __FUNCTION__, __LINE__); } // Everthing is fine? - if (SQL_HASZEROAFFECTED()) { + if (ifSqlHasZeroAffectedRows()) { // Something bad happend! setModuleStatus($module_chk, 'major'); return 'major'; @@ -368,13 +368,13 @@ function ifModuleHasMenu ($module, $forceDb = FALSE) { } } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((!isExtensionActive('cache')) || ($forceDb === TRUE))) { // Check database for entry - $result = SQL_QUERY_ESC("SELECT `has_menu` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1", + $result = sqlQueryEscaped("SELECT `has_menu` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1", array($module), __FUNCTION__, __LINE__); // Entry found? - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Load "has_menu" column - $data = SQL_FETCHARRAY($result); + $data = sqlFetchArray($result); // Fake cache... ;-) $GLOBALS['cache_array']['extension']['ext_menu'][$module] = $data['has_menu']; @@ -384,7 +384,7 @@ function ifModuleHasMenu ($module, $forceDb = FALSE) { } // END - if // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); } elseif (!isExtensionInstalled('sql_patches')) { // No ext-sql_patches installed, so maybe in admin/guest/member/sponsor area or no admin registered? $ret = in_array($module, array('admin', 'index', 'login', 'sponsor')); // Then there is a menu! @@ -421,7 +421,7 @@ function loadModule () { $isModuleValid = FALSE; // Construct module name - $GLOBALS['module_inc'] = sprintf("inc/modules/%s.php", getModule()); + $GLOBALS['module_inc'] = sprintf("inc/modules/%s.php", getModule()); // Check module permission (again) $moduleState = checkModulePermissions(); @@ -501,7 +501,7 @@ function doIncludeModule () { if ((isExtensionActive('maintenance')) && (isMaintenanceEnabled()) && (!isAdmin()) && (getModule() != 'admin')) { // Maintain mode is active and you are no admin addFatalMessage(__FUNCTION__, __LINE__, '{--MAILER_DOWN_FOR_MAINTENANCE--}'); - } elseif ((SQL_IS_LINK_UP()) && (!ifFatalErrorsDetected())) { + } elseif ((isSqlLinkUp()) && (!ifFatalErrorsDetected())) { // Do the small "load module" call $isModuleValid = loadModule(); } elseif (!ifFatalErrorsDetected()) {