// Download functions file
loadIncludeOnce($funcsInclude);
} // END - if
- } elseif ((!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) && (isDebugModeEnabled()) && (getOutputMode() == '0') && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme') && (getExtensionMode() == 'test')) {
+ } elseif ((!isset($GLOBALS['cache_array']['extension']['ext_func'][$ext_name])) && (isDebugModeEnabled()) && (getOutputMode() == 0) && ($ext_name != 'sql_patches') && (substr($ext_name, 0, 10) != 'admintheme') && (getExtensionMode() == 'test')) {
// No functions file is not so good...
logDebugMessage(__FUNCTION__, __LINE__, sprintf("NOTICE: Extension %s has no own functions file or we cannot read from it. mode=%s",
$ext_name,
// Count cache hits
incrementStatsEntry('cache_hits');
- } elseif ((!isCacheInstanceValid()) || (isset($GLOBALS['cache_array']['extension'])) || (getOutputMode() != '0')) {
+ } elseif ((!isCacheInstanceValid()) || (isset($GLOBALS['cache_array']['extension'])) || (getOutputMode() != 0)) {
// Load from database
$result = SQL_QUERY_ESC("SELECT `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1",
array($ext_name), __FUNCTION__, __LINE__);
$out = ''; $content = array();
// Is do we have verbose output enabled?
- if ((getConfig('verbose_sql') == 'Y') || (!isExtensionActive('sql_patches'))) {
+ if ((!isExtensionActive('sql_patches')) || (getConfig('verbose_sql') == 'Y')) {
// Update notes found?
if (getExtensionUpdateNotes($ver) != '') {
// Update notes found
// Do we have some entries?
//* DEBUG */ print __FUNCTION__.': ENTRY!<br />';
if (isset($GLOBALS['cache_array']['extension']['ext_name'])) {
- //* DEBUG */ print __FUNCTION__.': CACHE - START!<br />';
// Load all found extensions if found
- foreach ($GLOBALS['cache_array']['extension']['ext_name'] as $key=>$ext_name) {
+ //* DEBUG */ print __FUNCTION__.': CACHE - START!<br />';
+ foreach ($GLOBALS['cache_array']['extension']['ext_name'] as $key => $ext_name) {
// Load it
//* DEBUG */ print __FUNCTION__.': '.$ext_name.' - START<br />';
loadExtension($ext_name, 'init');
function addAdminMenuSql ($action, $what, $title, $descr, $sort) {
// Now check if this menu is there
if (!isMenuActionValid('admin', $action, $what)) {
- // Not found, so construct it
- $sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr',`sort`) VALUES('%s','%s','%s','%s',%s)",
- $action,
- $what,
- $title,
- $descr,
- bigintval($sort)
- );
+ // Is what null?
+ if (is_null($what)) {
+ // Add main menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('%s',NULL,'%s','%s',%s)",
+ $action,
+ $title,
+ $descr,
+ bigintval($sort)
+ );
+ } else {
+ // Add sub menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES('%s','%s','%s','%s',%s)",
+ $action,
+ $what,
+ $title,
+ $descr,
+ bigintval($sort)
+ );
+ }
// Add it to the queue
addExtensionSql($sql);
- } else {
+ } elseif (isDebugModeEnabled()) {
// Double menus should be located and fixed!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double admin menu action=%s, what=%s detected.", $action, $what));
}
function addGuestMenuSql ($action, $what, $title, $visible, $locked, $sort) {
// Now check if this menu is there
if (!isMenuActionValid('guest', $action, $what)) {
- // Not found, so construct it
- $sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s','%s','%s','%s','%s',%s)",
- $action,
- $what,
- $title,
- $visible,
- $locked,
- bigintval($sort)
- );
+ // Is what null?
+ if (is_null($what)) {
+ // Add main menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s',NULL,'%s','%s','%s',%s)",
+ $action,
+ $title,
+ $visible,
+ $locked,
+ bigintval($sort)
+ );
+ } else {
+ // Add sub menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s','%s','%s','%s','%s',%s)",
+ $action,
+ $what,
+ $title,
+ $visible,
+ $locked,
+ bigintval($sort)
+ );
+ }
// Add it to the queue
addExtensionSql($sql);
- } else {
+ } elseif (isDebugModeEnabled()) {
// Double menus should be located and fixed!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double guest menu action=%s, what=%s detected.", $action, $what));
}
function addMemberMenuSql ($action, $what, $title, $visible, $locked, $sort) {
// Now check if this menu is there
if (!isMenuActionValid('member', $action, $what)) {
- // Not found, so construct it
- $sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s','%s','%s','%s','%s',%s)",
- $action,
- $what,
- $title,
- $visible,
- $locked,
- bigintval($sort)
- );
+ // Is what null?
+ if (is_null($what)) {
+ // Add main menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s',NULL,'%s','%s','%s',%s)",
+ $action,
+ $title,
+ $visible,
+ $locked,
+ bigintval($sort)
+ );
+ } else {
+ // Add sub menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES('%s','%s','%s','%s','%s',%s)",
+ $action,
+ $what,
+ $title,
+ $visible,
+ $locked,
+ bigintval($sort)
+ );
+ }
// Add it to the queue
addExtensionSql($sql);
- } else {
+ } elseif (isDebugModeEnabled()) {
// Double menus should be located and fixed!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double member menu action=%s, what=%s detected.", $action, $what));
}
function addSponsorMenuSql ($action, $what, $title, $active, $sort) {
// Now check if this menu is there, if no ext-sponsor is installed all is not yet added
if ((!isExtensionInstalled('sponsor')) || (!isMenuActionValid('sponsor', $action, $what))) {
- // Not found, so construct it
- $sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES('%s','%s','%s','%s',%s)",
- $action,
- $what,
- $title,
- $active,
- bigintval($sort)
- );
+ // Is what null?
+ if (is_null($what)) {
+ // Add main menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES('%s',NULL,'%s','%s',%s)",
+ $action,
+ $title,
+ $active,
+ bigintval($sort)
+ );
+ } else {
+ // Add sub menu
+ $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_menu` (`action`,`what`,`title`,`active`,`sort`) VALUES('%s','%s','%s','%s',%s)",
+ $action,
+ $what,
+ $title,
+ $active,
+ bigintval($sort)
+ );
+ }
// Add it to the queue
addExtensionSql($sql);
- } else {
+ } elseif (isDebugModeEnabled()) {
// Double menus should be located and fixed!
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Double sponsor menu action=%s, what=%s detected.", $action, $what));
}