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));
}
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter-Tabelle bereinigt um doppelte Einträge und Unique-Key auf <em>filter_name</em> und <em>filter_function</em> zusammen gesetzt.");
- // Include special filte
- loadIncludeOnce('inc/fix_filters.php');
+ // Add special fix include to fix filters
+ addIncludeToPool('extension', 'inc/fix_filters.php');
break;
case '0.6.4': // SQL queries for v0.6.4
// Maybe need setup of secret key!
loadIncludeOnce('inc/gen_sql_patches.php');
- // @TODO Rewrite this to a filter!
+ // @TODO Rewrite this to a filter
if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isCacheInstanceValid())) {
- // Remove extensions and mod_reg cache file
- loadIncludeOnce('inc/libs/cache_functions.php');
-
// Destroy some cache files
if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
if ($GLOBALS['cache_instance']->loadCacheFile('modules')) $GLOBALS['cache_instance']->removeCacheFile();
updateConfiguration('file_hash', '');
// Cannot read secret file!
- app_die(__FILE__, __LINE__, "Cannot read secret file! Please try to reload");
+ app_die(__FILE__, __LINE__, 'Cannot read secret file! Please try to reload.');
}
} // END - if
INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','email_archiv','E-Mail Archiv','Sehen Sie sich hier bereits gesendete Mails an.','6');
INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','del_email','E-Mail löschen','Löschen Sie hierrüber E-Mails (sowohl Bonus- als auch Normal-Mails) aus Ihrem Mailtausch-System. <strong>Nur bei Normal-Mails:</strong> {?POINTS?} aus den unbestätigten Mails werden dem Werber wieder vergütet.','7');
-INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','updates','Updates prüfen','Prüft, ob eine neue Version oder ein Patch auf dem Server exisitiert. Sie müssen dann die Patches/Updates selber herunterladen und einspielen. Dabei werden keine Daten von Ihrer Installation an uns gesendet!','8');
INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','extensions','Erweiterungen','Erweiterungen installieren, updaten, sperren, löschen usw.','8');
INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','stats','Statistiken','7','Y','N');
INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','email_archiv','E-Mail Archiv','Sehen Sie sich hier bereits gesendete Mails an.','6');
INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('email','del_email','E-Mail löschen','Löschen Sie hierrüber E-Mails (sowohl Bonus- als auch Normal-Mails) aus Ihrem Mailtausch-System. <strong>Nur bei Normal-Mails:</strong> {?POINTS?} aus den unbestätigten Mails werden dem Werber wieder vergütet.','7');
-INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','updates','Updates prüfen','Prüft, ob eine neue Version oder ein Patch auf dem Server exisitiert. Sie müssen dann die Patches/Updates selber herunterladen und einspielen. Dabei werden keine Daten von Ihrer Installation an uns gesendet!','8');
INSERT INTO `{?_MYSQL_PREFIX?}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('misc','extensions','Erweiterungen','Erweiterungen installieren, updaten, sperren, löschen usw.','8');
INSERT INTO `{?_MYSQL_PREFIX?}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','stats','Statistiken','7','Y','N');