From 08b3c51b70b6498fd92a2760979d64470ad1b586 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 22 Feb 2009 23:39:06 +0000 Subject: [PATCH] More queries and language constants rewritten --- beg.php | 5 +- birthday_confirm.php | 21 +++--- css.php | 6 +- doubler.php | 6 +- inc/doubler_send.php | 2 +- inc/extensions.php | 12 ++-- inc/extensions/ext-active.php | 8 +-- inc/extensions/ext-admins.php | 8 +-- inc/extensions/ext-admintheme1.php | 6 +- inc/extensions/ext-admintheme_default.php | 6 +- inc/extensions/ext-bank.php | 8 +-- inc/extensions/ext-beg.php | 18 ++--- inc/extensions/ext-birthday.php | 2 +- inc/extensions/ext-bonus.php | 20 +++--- inc/extensions/ext-booking.php | 4 +- inc/extensions/ext-cache.php | 2 +- inc/extensions/ext-country.php | 2 +- inc/extensions/ext-doubler.php | 16 ++--- inc/extensions/ext-holiday.php | 10 +-- inc/extensions/ext-html_mail.php | 6 +- inc/extensions/ext-logs.php | 2 +- inc/extensions/ext-maintenance.php | 2 +- inc/extensions/ext-mediadata.php | 4 +- inc/extensions/ext-mods.php | 2 +- inc/extensions/ext-newsletter.php | 10 +-- inc/extensions/ext-nickname.php | 8 +-- inc/extensions/ext-online.php | 8 +-- inc/extensions/ext-optimize.php | 2 +- inc/extensions/ext-order.php | 12 ++-- inc/extensions/ext-other.php | 2 +- inc/extensions/ext-payout.php | 10 +-- inc/extensions/ext-primera.php | 8 +-- inc/extensions/ext-rallye.php | 16 ++--- inc/extensions/ext-refback.php | 6 +- inc/extensions/ext-register.php | 4 +- inc/extensions/ext-removeip.php | 2 +- inc/extensions/ext-repair.php | 2 +- inc/extensions/ext-rewrite.php | 2 +- inc/extensions/ext-sponsor.php | 14 ++-- inc/extensions/ext-sql_patches.php | 14 ++-- inc/extensions/ext-task.php | 2 +- inc/extensions/ext-theme.php | 8 +-- inc/extensions/ext-top10.php | 8 +-- inc/extensions/ext-transfer.php | 10 +-- inc/extensions/ext-usage.php | 2 +- inc/extensions/ext-wernis.php | 14 ++-- inc/fatal_errors.php | 4 +- inc/filters.php | 16 ++--- inc/functions.php | 12 +++- inc/install-inc.php | 2 + inc/language/de.php | 8 +-- inc/language/en.php | 8 +-- inc/libs/sponsor_functions.php | 2 +- inc/libs/surfbar_functions.php | 2 +- inc/modules/admin/admin-inc.php | 4 +- inc/modules/admin/what-add_rallye.php | 2 +- inc/modules/admin/what-admin_add.php | 2 +- inc/modules/admin/what-adminedit.php | 14 ++-- inc/modules/admin/what-config_home.php | 2 +- inc/modules/admin/what-config_mods.php | 2 +- inc/modules/admin/what-guest_add.php | 2 +- inc/modules/admin/what-guestedit.php | 14 ++-- inc/modules/admin/what-mem_add.php | 2 +- inc/modules/admin/what-memedit.php | 14 ++-- inc/modules/admin/what-repair_amenu.php | 4 +- inc/modules/admin/what-repair_gmenu.php | 4 +- inc/modules/admin/what-repair_mmenu.php | 4 +- inc/modules/guest/action-admin.php | 4 +- inc/modules/guest/action-main.php | 8 +-- inc/modules/guest/action-members.php | 4 +- inc/modules/guest/action-sponsor.php | 4 +- inc/modules/login.php | 2 +- inc/mysql-manager.php | 83 +++++++++-------------- install.php | 2 +- js.php | 5 +- mailid.php | 12 +--- mailid_top.php | 25 +++---- modules.php | 10 +-- ref.php | 2 +- show_bonus.php | 11 ++- sponsor_confirm.php | 2 +- sponsor_ref.php | 4 +- surfbar.php | 11 +-- view.php | 4 +- 84 files changed, 313 insertions(+), 346 deletions(-) diff --git a/beg.php b/beg.php index 5f68fbc761..ae27b8168f 100644 --- a/beg.php +++ b/beg.php @@ -49,10 +49,7 @@ $msg = null; require("inc/config.php"); // Is the "beg" extension active? -if (!EXT_IS_ACTIVE("beg")) { - // Redirect to index - LOAD_URL("modules.php?module=index&msg=".constant('CODE_EXTENSION_PROBLEM')."&ext=beg"); -} // END - if +REDIRCT_ON_UNINSTALLED_EXTENSION("beg"); // Is the script installed? if (isBooleanConstantAndTrue('mxchange_installed')) { diff --git a/birthday_confirm.php b/birthday_confirm.php index 25e737196b..cfbbb60f2d 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -45,10 +45,7 @@ $GLOBALS['module'] = "birthday_confirm"; $CSS = -1; require("inc/config.php"); // Is the "birthday" extension active? -if (!EXT_IS_ACTIVE("birthday")) { - // Redirect to index - LOAD_URL("modules.php?module=index&msg=".constant('CODE_EXTENSION_PROBLEM')."&ext=birthday"); -} // END - if +REDIRECT_ON_UNINSTALLED_EXTENSION("birthday"); // Is the script installed? if (isBooleanConstantAndTrue('mxchange_installed')) { @@ -82,21 +79,21 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", unset($GLOBALS['ref_level']); ADD_POINTS_REFSYSTEM("birthday_confirm", $uid, $data['points'], false, "0", $locked, strtolower(getConfig('birthday_mode'))); - // Remove entry from table - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_birthday` WHERE userid=%s AND chk_value='%s' LIMIT 1", - array($uid, $chk), __FILE__, __LINE__); - // Update mediadata if version is 0.0.4 or newer if (GET_EXT_VERSION("mediadata") >= "0.0.4") { // Update database MEDIA_UPDATE_ENTRY(array("total_points"), "add", $data['points']); } + // Remove entry from table + SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_birthday` WHERE userid=%s AND chk_value='%s' LIMIT 1", + array($uid, $chk), __FILE__, __LINE__); + // Transfer data to constants for the template define('__GENDER', TRANSLATE_GENDER($data['gender'])); - define('__SNAME', $data['surname']); - define('__FNAME', $data['family']); - define('__GIFT' , $data['points']); + define('__SNAME' , $data['surname']); + define('__FNAME' , $data['family']); + define('__GIFT' , TRANSLATE_COMMA($data['points'])); // Load message from template define('__MSG', LOAD_TEMPLATE("birthday_msg", true)); @@ -106,7 +103,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1", } } else { // Cannot load data! - define('__MSG', BIRTHDAY_CANNOT_LOAD_DATA); + define('__MSG', getMessage('BIRTHDAY_CANNOT_LOAD_DATA')); } // Free memory diff --git a/css.php b/css.php index 9e73bd618a..9efdc9588b 100644 --- a/css.php +++ b/css.php @@ -58,13 +58,13 @@ header("Content-type: text/css"); require("inc/config.php"); // Load header -LOAD_INC_ONCE("inc/header.php"); +LOAD_INC("inc/header.php"); // Load CSS code -LOAD_INC_ONCE("inc/stylesheet.php"); +LOAD_INC("inc/stylesheet.php"); // Load footer -LOAD_INC_ONCE("inc/footer.php"); +LOAD_INC("inc/footer.php"); // ?> diff --git a/doubler.php b/doubler.php index 869e3da1e5..fb92ccfbd4 100644 --- a/doubler.php +++ b/doubler.php @@ -49,10 +49,7 @@ $CSS = 0; require("inc/config.php"); // Is the "doubler" extension active? -if (!EXT_IS_ACTIVE("doubler")) { - // Redirect to index - LOAD_URL("modules.php?module=index&msg={!CODE_EXTENSION_PROBLEM!}&ext=doubler"); -} // END - if +REDIRECT_ON_UNINSTALLED_EXTENSION("doubler"); // Is the script installed? if (isBooleanConstantAndTrue('mxchange_installed')) { @@ -161,7 +158,6 @@ if (isBooleanConstantAndTrue('mxchange_installed')) { // Update usage counter UPDATE_CONFIG("doubler_counter", 1, "+"); - incrementCondigEntry('doubler_counter'); // Set constant define('__DOUBLER_MSG', LOAD_TEMPLATE("doubler_reflink", true, $_POST['userid'])); diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 75e73ca3d7..58bf1ab3e2 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -150,7 +150,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) // Load mail template and send mail away... $msg = LOAD_EMAIL_TEMPLATE("member_doubler", $content, $uid); - SEND_EMAIL($uid, DOUBLER_MEMBER_SUBJECT, $msg); + SEND_EMAIL($uid, getMessage('DOUBLER_MEMBER_SUBJECT'), $msg); } // END - if } // END - while } // END - if diff --git a/inc/extensions.php b/inc/extensions.php index b54e756123..b3604ccdb4 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -631,7 +631,11 @@ function DEACTIVATE_EXTENSION($ext_name) { CREATE_EXTENSION_DEACTIVATION_TASK($ext_name); // Notify the admin - SEND_ADMIN_NOTIFICATION(ADMIN_SUBJECT_EXTENSION_DEACTIVATED, "admin_ext_deactivated", array('ext_name' => $ext_name)); + SEND_ADMIN_NOTIFICATION( + getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'), + "admin_ext_deactivated", + array('ext_name' => $ext_name) + ); } // END - if } @@ -699,7 +703,7 @@ VALUES (%s,0,'NEW','EXTENSION','%s','%s',UNIX_TIMESTAMP())", // Creates a task for automatically deactivated (deprecated) extension function CREATE_EXTENSION_DEACTIVATION_TASK ($ext) { // Create subject line - $subject = sprintf("[%s:] %s", $ext, TASK_SUBJ_EXTENSION_DEACTIVATED); + $subject = sprintf("[%s:] %s", $ext, getMessage('TASK_SUBJ_EXTENSION_DEACTIVATED')); // Not installed and do we have created a task for the admin? if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) != "")) { @@ -828,13 +832,13 @@ function ADD_EXTENSION_NOTES ($ver, &$UPDATE_NOTES) { // Initial release $content = array( 'ver' => $ver, - 'notes' => INITIAL_RELEASE + 'notes' => getMessage('INITIAL_RELEASE') ); } else { // No update notes found! $content = array( 'ver' => $ver, - 'notes' => NO_UPDATE_NOTES + 'notes' => getMessage('NO_UPDATE_NOTES') ); } diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 9cf42e0818..2c00f4a3ed 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -58,8 +58,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='active' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_active' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='active' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_active' LIMIT 1"; // Unregister filter UNREGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run); @@ -67,12 +67,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='N' WHERE what='active' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='N' WHERE `what`='active' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='active' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='active' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index 6d02c75fae..5ae10591cb 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='admins' LIMIT 6"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='admins' LIMIT 6"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_acls`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_mails`"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP default_acl"; @@ -199,7 +199,7 @@ PRIMARY KEY (id) break; case "0.5.6": // SQL queries for v0.5.6 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`='admins_contct' WHERE `what`='admins_contact' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen admins und (kommender) contact."; @@ -211,7 +211,7 @@ PRIMARY KEY (id) break; case "0.5.8": // SQL queries for v0.5.8 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`='admins_contct' WHERE `what`='admins_contact' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Ein Punkt in der Versionsnummernliste verhinderte das 0.5.6-Update."; @@ -253,7 +253,7 @@ PRIMARY KEY (id) break; case "0.6.6": // SQL queries for v0.5.6 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='admins_contct' WHERE what='admins_contact' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`='admins_contct' WHERE `what`='admins_contact' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Namenskonflikt zwischen den Erweiterungen admins und (kommender) contact."; diff --git a/inc/extensions/ext-admintheme1.php b/inc/extensions/ext-admintheme1.php index 3b42449509..5c0e33ddad 100644 --- a/inc/extensions/ext-admintheme1.php +++ b/inc/extensions/ext-admintheme1.php @@ -51,9 +51,9 @@ switch ($EXT_LOAD_MODE) case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Remove all other themes $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='usr_online' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='email_stats' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='misc' WHERE what='maintenance' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='usr_online' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='email_stats' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='misc' WHERE `what`='maintenance' LIMIT 1"; break; case "remove": // Do stuff when removing extension diff --git a/inc/extensions/ext-admintheme_default.php b/inc/extensions/ext-admintheme_default.php index bb9e45ccad..a8e44246d7 100644 --- a/inc/extensions/ext-admintheme_default.php +++ b/inc/extensions/ext-admintheme_default.php @@ -51,9 +51,9 @@ switch ($EXT_LOAD_MODE) case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) // Remove all other menu themes $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name LIKE 'admintheme%'"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='misc' WHERE what='usr_online' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='stats' WHERE what='email' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='setup' WHERE what='maintenance' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='misc' WHERE `what`='usr_online' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='stats' WHERE `what`='email' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='setup' WHERE `what`='maintenance' LIMIT 1"; break; case "remove": // Do stuff when removing extension diff --git a/inc/extensions/ext-bank.php b/inc/extensions/ext-bank.php index b571558af6..b993625337 100644 --- a/inc/extensions/ext-bank.php +++ b/inc/extensions/ext-bank.php @@ -158,18 +158,18 @@ case "remove": // Do stuff when removing extension $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_transfers`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_packages`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bank_tanlist`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='bank' LIMIT 14"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='bank' LIMIT 8"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='bank' LIMIT 14"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='bank' LIMIT 8"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE action='bank' LIMIT 8"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='bank' LIMIT 8"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE action='bank' LIMIT 8"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `action`='bank' LIMIT 8"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 8d392d6473..2c899da2ea 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -73,22 +73,22 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_beg' OR what='list_beg' LIMIT 2"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='beg' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='beg' OR what='beg2' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='beg' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='beg' OR `what`='beg2' LIMIT 2"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_beg_ips`"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='beg' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='beg' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='beg' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='beg' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what IN('beg','beg2') LIMIT 2"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='beg' LIMIT 1"; break; @@ -179,7 +179,7 @@ case "update": // Update an extension break; case "0.1.5": // SQL queries for v0.1.5 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Bettellink/-rallye', descr='IP-Sperre, {!POINTS!}-Vergütung und auch die Bettel-Rallye können Sie hier einstellen.' WHERE what='config_beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Bettellink/-rallye', descr='IP-Sperre, {!POINTS!}-Vergütung und auch die Bettel-Rallye können Sie hier einstellen.' WHERE `what`='config_beg' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehlendes Template im Admin-Bereich hinzugefügt. Im Admin-Bereich Hinweis hinzugefügt, wenn Bettel-Rallye inaktiv ist. Bitte Script inc/monthly_beg.php löschen!"; @@ -237,8 +237,8 @@ case "update": // Update an extension break; case "0.2.4": // SQL queries for v0.2.4 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='1' WHERE what='beg' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='rals', sort='3', title='Bettel-Rallye' WHERE what='beg2' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='1' WHERE `what`='beg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='rals', `sort`='3', `title`='Bettel-Rallye' WHERE `what`='beg2' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 4a0e9d2612..71aeeb7174 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -57,7 +57,7 @@ case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP birthday_sent"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_birthday`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_birthday' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_birthday' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 8fad3e4797..637aef5494 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -81,8 +81,8 @@ PRIMARY KEY (id) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications') LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='bonus' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='bonus' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='bonus' LIMIT 1"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` MODIFY link_type ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL'"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_links` DROP bonus_id"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_bonus`"; @@ -93,15 +93,15 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='bonus' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE action='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `action`='bonus' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='show_bonus' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='bonus' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE action='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `action`='bonus' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='show_bonus' LIMIT 1"; break; @@ -121,7 +121,7 @@ case "update": // Update an extension break; case "0.2.1": // SQL queries for v0.2.1 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_bonus' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_bonus' LIMIT 1"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_bonus','Bonus-{!POINTS!}',8,'Richten Sie Bonus-{!POINTS!} ein, die beim x'ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {!POINTS!} zusätzlich bekommen, als der 10. Klick.')"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 10.000"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 100.000"; @@ -158,7 +158,7 @@ KEY userid (userid) break; case "0.2.3": // SQL queries for v0.2.3 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='bonus' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='bonus' LIMIT 1"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`, `what`, `title`, `sort`, `visible`, `locked`, `counter`) VALUES ('main','bonus','Aktiv-Rallye',7,'Y','Y', 0)"; // Update notes (these will be set as task text!) @@ -401,7 +401,7 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.6.4": // SQL queries for v0.6.4 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Aktiv-Rallye' WHERE what='config_bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Aktiv-Rallye' WHERE `what`='config_bonus' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Der Menüpunkt "Bonus-{!POINTS!}" unter Einstellungen wird nach "Aktiv-Rallye umbenannt. Und die Aktiv-Rallye konnte aufgrund eines Template-Fehlers nicht gespeichert werden."; @@ -508,7 +508,7 @@ WHERE last_online < ".$mark." ORDER BY userid"; break; case "0.8.3": // SQL queries for v0.8.3 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='rals', sort='2', title='Aktiv-Rallye' WHERE what='bonus' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='rals', `sort`='2', `title`='Aktiv-Rallye' WHERE `what`='bonus' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 54a3eb205c..2acd4e73a8 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -81,12 +81,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='booking' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='booking' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='booking' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='booking' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 1ae1bc7d38..897c3e370c 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -59,7 +59,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_cache' OR what='cache_stats' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_cache' OR `what`='cache_stats' LIMIT 2"; // Unregister all filters UNREGISTER_FILTER('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index cb40121173..7a3ebb6588 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -72,7 +72,7 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='country' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country' LIMIT 2"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index e8c82f7615..2f17680dc3 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -118,22 +118,22 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_doubler`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='doubler' LIMIT 3"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='doubler' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='doubler' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='doubler' LIMIT 3"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='doubler' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='doubler' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='doubler' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='doubler' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='N' WHERE module='doubler' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='doubler' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='doubler' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='doubler' LIMIT 1"; break; @@ -216,7 +216,7 @@ case "update": // Update an extension break; case "0.1.4": // SQL queries for v0.1.4 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='4' WHERE what='doubler' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='4' WHERE `what`='doubler' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index bdcaca1767..4ae49173e8 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -80,20 +80,20 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_holidays`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='holiday' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='holiday' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='holiday' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='holiday' LIMIT 4"; $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='0' LIMIT 1"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_max_receive` (value, comment) VALUES ('0','Urlaub')"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='holiday' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='holiday' LIMIT 1"; break; case "update": // Update an extension @@ -202,7 +202,7 @@ case "update": // Update an extension break; case "0.1.9": // SQL queries for v0.1.9 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='account', sort='2', title='In Urlaub' WHERE what='holiday' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='account', `sort`='2', `title`='In Urlaub' WHERE `what`='holiday' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index e2e80cdf57..7db775f15f 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -61,17 +61,17 @@ case "remove": // Do stuff when removing extension $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP html"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_bonus` DROP html_msg"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_pool` DROP html_msg"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='html_mail' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='html_mail' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='html_mail' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='html_mail' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='html_mail' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='html_mail' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-logs.php b/inc/extensions/ext-logs.php index 51702da9e9..ded3a2ef56 100644 --- a/inc/extensions/ext-logs.php +++ b/inc/extensions/ext-logs.php @@ -56,7 +56,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='logs' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='logs' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php index e8990bd303..faa8304e43 100644 --- a/inc/extensions/ext-maintenance.php +++ b/inc/extensions/ext-maintenance.php @@ -56,7 +56,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='maintenance' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='maintenance' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index 23eb6ec06a..f02f71c1c0 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -56,8 +56,8 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_mediadata`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_mediadata' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='mediadata' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_mediadata' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='mediadata' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-mods.php b/inc/extensions/ext-mods.php index 69023ee1de..17d838c35d 100644 --- a/inc/extensions/ext-mods.php +++ b/inc/extensions/ext-mods.php @@ -57,7 +57,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='mods' LIMIT 3"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='mods' LIMIT 3"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index daaf75603e..e71f0362be 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -55,18 +55,18 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='newsletter' AND what != 'send_newsletter' LIMIT 3"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='newsletter' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='newsletter' AND what != 'send_newsletter' LIMIT 3"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='newsletter' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `locked`='N', `visible`='Y' WHERE what='newsletter' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `locked`='N', `visible`='Y' WHERE `what`='newsletter' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `locked`='Y', `visible`='N' WHERE what='newsletter' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `locked`='Y', `visible`='N' WHERE `what`='newsletter' LIMIT 1"; break; case "update": // Update an extension @@ -76,7 +76,7 @@ case "update": // Update an extension $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter', NULL, 'Newsletter','Einstellungen am Newsletter, Newsletter versenden, Abbestellungen auflisten usw.', 3)"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','list_newsletter','Abbestellungen','Alle Abbestellungen auflisten und bearbeiten.', 2)"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('newsletter','config_newsletter','Einstellungen','Gebühr zum Abbestellen des Newsletters usw. sind hier einstellbar.', 3)"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='newsletter', what='send_newsletter', title='Versenden', sort='1' WHERE what='newsletter' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='newsletter', `what`='send_newsletter', `title`='Versenden', `sort`='1' WHERE `what`='newsletter' LIMIT 1"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','newsletter','Newsletter-Empfang','N','Y', 10)"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD nl_charge FLOAT(10,2) UNSIGNED NOT NULL DEFAULT '5.00'"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD nl_receive ENUM('Y','N') NOT NULL DEFAULT 'Y'"; diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index 01a6f8f031..15cd71c8f8 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -60,19 +60,19 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='nickname' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='nickname' LIMIT 1"; $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN ('config_nickname','list_nickname') LIMIT 2"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_nickname_history`"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='nickname' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='nickname' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='nickname' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='nickname' LIMIT 1"; break; case "update": // Update an extension @@ -161,7 +161,7 @@ case "update": // Update an extension break; case "0.1.6": // SQL queries for v0.1.6 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='2' WHERE what='nickname' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='2' WHERE `what`='nickname' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index 1c2104683b..4c5dbbb25f 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -73,8 +73,8 @@ KEY(refid) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_online`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='usr_online' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='online' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usr_online' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='online' LIMIT 1"; // Unregister filter UNREGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', true, $dry_run); @@ -82,12 +82,12 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE action='online' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `action`='online' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE action='online' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `action`='online' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index b65fe34d1c..2019fc6792 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -61,7 +61,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_optimize_gain`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='optimize' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='optimize' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 1201a78662..6112f61c6d 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -55,18 +55,18 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_order' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='order' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='order' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='order' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='order' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `visible`='N', `locked`='Y' WHERE module='order' LIMIT 1"; break; @@ -82,7 +82,7 @@ case "update": // Update an extension break; case "0.1.1": // SQL queries for v0.1.1 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_order' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"; @@ -273,7 +273,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us case "0.4.6": // SQL queries for v0.4.6 $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order',NULL,'Mailbuchungen',3,'Y','N')"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order','order2','Framekiller-Mails',2,'Y','N')"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='order', sort='1', title='Klick-Mails' WHERE what='order' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='order', `sort`='1', `title`='Klick-Mails' WHERE `what`='order' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; @@ -285,7 +285,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us break; case "0.4.8": // SQL queries for v0.4.8 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Mailbuchung' WHERE what='config_order' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Mailbuchung' WHERE `what`='config_order' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben."; diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index dc2a09b865..398204c3e4 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -55,7 +55,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_other' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_other' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index fc3e066964..f58dd62354 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -81,18 +81,18 @@ case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_payouts`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_payout_types`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='payouts'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='payout' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='payouts'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='payout' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='payout' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='payout' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='payout' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='payout' LIMIT 1"; break; case "update": // Update an extension @@ -100,7 +100,7 @@ case "update": // Update an extension { case "0.1.2": // SQL queries for v0.1.2 $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('payouts', NULL, 'Auszahlungsmanagement','Management der Auszahlungsarten.','8')"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET action='payouts', title='Einstellungen' WHERE action='setup' AND what='config_payouts' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `action`='payouts', `title`='Einstellungen' WHERE `action`='setup' AND `what`='config_payouts' LIMIT 1"; break; case "0.1.3": // SQL queries for v0.1.3 diff --git a/inc/extensions/ext-primera.php b/inc/extensions/ext-primera.php index 430e2e4a44..30070d6788 100644 --- a/inc/extensions/ext-primera.php +++ b/inc/extensions/ext-primera.php @@ -86,18 +86,18 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_primera`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='primera'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='primera' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='primera'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='primera' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='primera' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='primera' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='primera' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='primera' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index f563aa4936..a4d6c26d05 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -107,9 +107,9 @@ case "remove": // Do stuff when removing extension $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_rallye_users`"; // Remove menus - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='rallye' LIMIT 4"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='rallyes' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='rallye' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='rallyes' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='rallyes' LIMIT 1"; // Unregister filter UNREGISTER_FILTER('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, $dry_run); @@ -117,14 +117,14 @@ case "remove": // Do stuff when removing extension case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='rallyes' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='rallyes' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='rallyes' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='rallyes' LIMIT 1"; break; case "update": // Update an extension @@ -290,7 +290,7 @@ Zudem sollten Sie mindestens folgende Templates (in templates/".GET_LANG break; case "0.3.2": // SQL queries for v0.3.2 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='rals', sort='1', title='Referal-Rallye' WHERE what='rallyes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='rals', `sort`='1', `title`='Referal-Rallye' WHERE `what`='rallyes' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 8edb325efd..53846bbd78 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -69,19 +69,19 @@ KEY (`refid`) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_refs`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='refback' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='refback' LIMIT 1"; $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what IN('config_refback','list_refback') LIMIT 2"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_refsystem` SET level=level-1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='refback' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='refback' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='refback' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='refback' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-register.php b/inc/extensions/ext-register.php index 622557095a..8f537ccff4 100644 --- a/inc/extensions/ext-register.php +++ b/inc/extensions/ext-register.php @@ -58,7 +58,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_register' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_register' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension @@ -263,7 +263,7 @@ PRIMARY KEY(id) case "0.4.2": // SQL queries for v0.4.2 $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD register_default ENUM('Y','N') NOT NULL DEFAULT 'N'"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET what='config_register2' WHERE what='config_reg' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`='config_register2' WHERE `what`='config_reg' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das Ändern des Templates templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl ist nicht mehr nötig."; diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php index bb6004716e..cd6f4c4a4b 100644 --- a/inc/extensions/ext-removeip.php +++ b/inc/extensions/ext-removeip.php @@ -64,7 +64,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_removeip' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_removeip' LIMIT 1"; // Remove filters UNREGISTER_FILTER('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, $dry_run); diff --git a/inc/extensions/ext-repair.php b/inc/extensions/ext-repair.php index d3afb2ba9a..d3b1a5d0f8 100644 --- a/inc/extensions/ext-repair.php +++ b/inc/extensions/ext-repair.php @@ -56,7 +56,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='repair' LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='repair' LIMIT 5"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-rewrite.php b/inc/extensions/ext-rewrite.php index 0ef248cc22..89f17b04ec 100644 --- a/inc/extensions/ext-rewrite.php +++ b/inc/extensions/ext-rewrite.php @@ -61,7 +61,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_rewrite' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_rewrite' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index e4c155e872..e113c39dc8 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -384,23 +384,23 @@ case "remove": // Do stuff when removing extension $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_campaign_assigns`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_admin_data`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_sponsor_display_data`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='sponsor' LIMIT 5"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='sponsor' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='sponsor' OR what IN('repr_sponsor','sponsor_medit','sponsor_madd') LIMIT 20"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='sponsor' LIMIT 5"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='sponsor' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE action='sponsor' LIMIT 4"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='sponsor' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `action`='sponsor' LIMIT 4"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='sponsor' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_menu` SET active='Y' WHERE active='N'"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_registry` SET is_active='Y' WHERE is_active='N'"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE action='sponsor' LIMIT 4"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='sponsor' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `action`='sponsor' LIMIT 4"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='sponsor' LIMIT 1"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_menu` SET active='N' WHERE active='Y'"; $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_sponsor_registry` SET is_active='N' WHERE is_active='Y'"; break; diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index a64088ad08..3cc2446bf5 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -84,7 +84,7 @@ LIMIT 10"; (action='extras' AND (`what`='' OR `what` IS NULL)) OR (action='rals' AND (`what`='' OR `what` IS NULL)) OR (action='account' AND (`what`='' OR `what` IS NULL))"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='main' WHERE + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='main' WHERE action='stats' OR action='extras' OR action='rals' OR @@ -210,7 +210,7 @@ case "update": // Update an extension break; case "0.1.1": // SQL queries for v0.1.1 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_delay TINYINT(3) UNSIGNED NOT NULL DEFAULT '-1'"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD index_cookie BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*365).""; @@ -363,8 +363,8 @@ case "update": // Update an extension break; case "0.3.0": // SQL queries for v0.3.0 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='{!POINTS!}/Referal-Ebenen' WHERE `what`='config_points' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET title='Mailvergütungen...' WHERE `what`='payments' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='{!POINTS!}/Referal-Ebenen' WHERE `what`='config_points' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Mailvergütungen...' WHERE `what`='payments' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Zwei Menüpunkte umbenannt."; @@ -474,8 +474,8 @@ PRIMARY KEY (id) $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('extras',NULL,'Extras',5,'Y','N')"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('rals',NULL,'Rallyes',6,'Y','N')"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('account',NULL,'Ihr Account',7,'Y','N')"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='stats', sort='1', title='Klick-Mails' WHERE `what`='stats' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='3' WHERE `what`='reflinks' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='stats', `sort`='1', `title`='Klick-Mails' WHERE `what`='stats' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='3' WHERE `what`='reflinks' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut."; @@ -672,7 +672,7 @@ INDEX (`stats_type`) break; case "0.5.7": // SQL queries for v0.5.7 - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='list_norefs' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='list_norefs' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Auflistung der Mitglieder ohne Werber nach what=list_user&mode=norefs verschoben."; diff --git a/inc/extensions/ext-task.php b/inc/extensions/ext-task.php index 86309cb85b..b2965e57bc 100644 --- a/inc/extensions/ext-task.php +++ b/inc/extensions/ext-task.php @@ -60,7 +60,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='task' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='task' LIMIT 2"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php index 15610a5b73..14e8a9e721 100644 --- a/inc/extensions/ext-theme.php +++ b/inc/extensions/ext-theme.php @@ -60,10 +60,10 @@ case "remove": // Do stuff when removing extension $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4"; // Delete guest menu entries - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='themes' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes' LIMIT 1"; // Delete member menu entries - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='themes' OR `what`='themes' LIMIT 2"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes' LIMIT 2"; break; case "activate": // Do stuff when admin activates this extension @@ -140,8 +140,8 @@ INDEX (`theme_active`) // Memember menu $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')"; $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='8' WHERE action='themes' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='account', sort='1', title='Designs' WHERE `what`='themes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='8' WHERE `action`='themes' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='account', `sort`='1', `title`='Designs' WHERE `what`='themes' LIMIT 1"; // User data $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'"; diff --git a/inc/extensions/ext-top10.php b/inc/extensions/ext-top10.php index 9acd5d9105..d989103ca9 100644 --- a/inc/extensions/ext-top10.php +++ b/inc/extensions/ext-top10.php @@ -60,18 +60,18 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='top10' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='config_top10' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='top10' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_top10' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='top10' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='top10' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='top10' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='top10' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 6b89ad4da8..284ae4130d 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -105,19 +105,19 @@ case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_in`"; $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_transfers_out`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='transfer' LIMIT 4"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='transfer' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='transfer' LIMIT 4"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='transfer' LIMIT 1"; $SQLs[] = "ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP opt_in"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='transfer' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='transfer' LIMIT 1"; break; case "update": // Update an extension @@ -248,7 +248,7 @@ case "update": // Update an extension break; case "0.2.5": // SQL queries for v0.2.5 - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET action='extras', sort='5' WHERE what='transfer' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='extras', `sort`='5' WHERE `what`='transfer' LIMIT 1"; // Update notes (these will be set as task text!) $UPDATE_NOTES = "Mitgliedsmenü komplett geändert."; diff --git a/inc/extensions/ext-usage.php b/inc/extensions/ext-usage.php index 301c92abe8..8af57804b3 100644 --- a/inc/extensions/ext-usage.php +++ b/inc/extensions/ext-usage.php @@ -56,7 +56,7 @@ case "register": // Do stuff when installation is running (modules.php?module=ad case "remove": // Do stuff when removing extension // SQL commands to run - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE what='usage' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='usage' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension diff --git a/inc/extensions/ext-wernis.php b/inc/extensions/ext-wernis.php index 5d3ac30fbc..1b95422242 100644 --- a/inc/extensions/ext-wernis.php +++ b/inc/extensions/ext-wernis.php @@ -89,21 +89,21 @@ PRIMARY KEY(id) case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_wernis`"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='wernis'"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE what='wernis' LIMIT 1"; - $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE what='wernis_portal' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='wernis'"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='wernis' LIMIT 1"; + $SQLs[] = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `what`='wernis_portal' LIMIT 1"; break; case "activate": // Do stuff when admin activates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE what='wernis_portal' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE what='wernis' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='Y', `locked`='N' WHERE `what`='wernis_portal' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='wernis' LIMIT 1"; break; case "deactivate": // Do stuff when admin deactivates this extension // SQL commands to run - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE what='wernis_portal' LIMIT 1"; - $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE what='wernis' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `visible`='N', `locked`='Y' WHERE `what`='wernis_portal' LIMIT 1"; + $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='wernis' LIMIT 1"; break; case "update": // Update an extension diff --git a/inc/fatal_errors.php b/inc/fatal_errors.php index a3a476ca54..52323fe8c8 100644 --- a/inc/fatal_errors.php +++ b/inc/fatal_errors.php @@ -78,11 +78,11 @@ if (getTotalFatalErrors() > 0) { } // Message to regular users (non-admin) - $CORR = FATAL_REPORT_ERRORS; + $CORR = getMessage('FATAL_REPORT_ERRORS'); // PHP warnings fixed if ($check == "done") { - if (IS_ADMIN()) $CORR = FATAL_CORRECT_ERRORS; + if (IS_ADMIN()) $CORR = getMessage('FATAL_CORRECT_ERRORS'); } // END - if // Load footer template diff --git a/inc/filters.php b/inc/filters.php index 8715aed08f..f479861e71 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -44,7 +44,7 @@ function INIT_FILTER_SYSTEM () { // Is the filter already initialized? if ((isset($filters)) && (is_array($filters))) { // Then abort here - addFatalMessage(FILTER_FAILED_ALREADY_INIT); + addFatalMessage(getMessage('FILTER_FAILED_ALREADY_INIT')); return false; } // END - if @@ -144,7 +144,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo if ((isset($filters[$filterName][$filterFunction])) && (!$force)) { // Then abort here if (!$silentAbort) { - addFatalMessage(sprintf(FILTER_FAILED_ALREADY_ADDED, $filterFunction, $filterName)); + addFatalMessage(sprintf(getMessage('FILTER_FAILED_ALREADY_ADDED'), $filterFunction, $filterName)); } // END - if // Abort here @@ -154,7 +154,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo // Is the function there? if (!function_exists($filterFunction)) { // Then abort here - addFatalMessage(sprintf(FILTER_FAILED_NOT_FOUND, $filterFunction, $filterName)); + addFatalMessage(sprintf(getMessage('FILTER_FAILED_NOT_FOUND'), $filterFunction, $filterName)); return false; } // END - if @@ -178,7 +178,7 @@ function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $dry_r // Is that filter there? if ((!isset($filters[$filterName][$filterFunction])) && (!$force)) { // Not found, so abort here - addFatalMessage(sprintf(FILTER_FAILED_NOT_REMOVED, $filterFunction, $filterName)); + addFatalMessage(sprintf(getMessage('FILTER_FAILED_NOT_REMOVED'), $filterFunction, $filterName)); return false; } // END - if @@ -199,7 +199,7 @@ function RUN_FILTER ($filterName, $data = null, $silentAbort = true) { // Then abort here (quick'N'dirty hack) if ((!$silentAbort) && (defined('FILTER_FAILED_NO_FILTER_FOUND'))) { // Add fatal message - addFatalMessage(sprintf(FILTER_FAILED_NO_FILTER_FOUND, $filterName)); + addFatalMessage(sprintf(getMessage('FILTER_FAILED_NO_FILTER_FOUND'), $filterName)); } // END - if // Abort here @@ -251,7 +251,7 @@ function FILTER_FLUSH_FILTERS () { // Is a database link here and not in installation mode? if ((!is_resource($link)) && (!isBooleanConstantAndTrue('mxchange_installing'))) { // Abort here - addFatalMessage(sprintf(FILTER_FLUSH_FAILED_NO_DATABASE, $filterFunction, $filterName)); + addFatalMessage(sprintf(getMessage('FILTER_FLUSH_FAILED_NO_DATABASE'), $filterFunction, $filterName)); return false; } // END - if @@ -347,7 +347,7 @@ function FILTER_REDIRECT_TO_LOGOUT_SQL_PATCHES () { // Is the element set? if (isset($GLOBALS['ext_load_mode'])) { // Redirect here - LOAD_URL("modules.php?module=admin&logout=1&".$GLOBALS['ext_load_mode']."=sql_patches"); + LOAD_URL("modules.php?module=admin&logout=1&".$GLOBALS['ext_load_mode']."=sql_patches"); } // END - if // This should not happen! @@ -512,7 +512,7 @@ function FILTER_CHECK_ADMIN_ACL () { // Filter for initializing randomizer function FILTER_INIT_RANDOMIZER () { // Simply init the randomizer with seed and _ADD value - mt_srand(make_seed() + constant('_ADD')); + mt_srand(generateSeed() + constant('_ADD')); } // diff --git a/inc/functions.php b/inc/functions.php index 9a7bd4b484..2b393d7377 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3184,7 +3184,7 @@ function debug_report_bug ($message = "") { } // Generates a ***weak*** seed (taken from de.php.net/mt_srand) -function make_seed () { +function generateSeed () { list($usec, $sec) = explode(" ", microtime()); return ((float)$sec + (float)$usec); } @@ -3228,6 +3228,16 @@ function convertCodeToMessage ($code) { return $msg; } +// Checks wether the given extension is currently not installed +// and redirects if so. +function REDIRCT_ON_UNINSTALLED_EXTENSION ($ext_name) { + // Is the extension uninstalled/inactive? + if (!EXT_IS_ACTIVE($ext_name)) { + // Redirect to index + LOAD_URL("modules.php?module=index&msg=".constant('CODE_EXTENSION_PROBLEM')."&ext=".$ext_name); + } // END - if +} + ////////////////////////////////////////////////// // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS // ////////////////////////////////////////////////// diff --git a/inc/install-inc.php b/inc/install-inc.php index f2cc829fee..c2aa8b041e 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -441,7 +441,9 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT break; } } else { + // Already installed! addFatalMessage(getMessage('ALREADY_INSTALLED')); } + // ?> diff --git a/inc/language/de.php b/inc/language/de.php index 86d8cee23b..82c16b744f 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -92,10 +92,10 @@ define('FATAL_INC_WRITABLE', "Das Verzeichnis inc ist beschreibbar! Bitte setzen define('LANG_WRITE_FOOTER', "Scriptname, -version und -author anzeigen?"); define('LANG_FRAMESET_ACTIVE', "Soll das Frameset aktiviert werden? (Wenn nein wird ein Table-Set aktiviert)"); define('MYSQL_ERRORS', "Es sind MySQL-Fehler aufgetreten! Bitte korregieren Sie diese!"); -define('LANG_MOD_UNKNOWN_1', "Der Return-Code "); -define('LANG_MOD_UNKNOWN_2', " ist unbekannt!"); -define('LANG_MOD_LOCKED_1', "Das Modul "); -define('LANG_MOD_LOCKED_2', " wurde gesperrt!"); +define('LANG_MOD_REG_UNKNOWN_1', "Der Return-Code "); +define('LANG_MOD_REG_UNKNOWN_2', " ist unbekannt!"); +define('LANG_MOD_REG_LOCKED_1', "Das Modul "); +define('LANG_MOD_REG_LOCKED_2', " wurde gesperrt!"); define('ADMIN_UNKNOWN_ACTION_1', "Unbekannte Admin-Aktion "); define('ADMIN_UNKNOWN_ACTION_2', " erkannt! Bitte das Modul richtig aufrufen!"); define('ADMIN_ACTION_404_1', "Admin-Modul für Aktion "); diff --git a/inc/language/en.php b/inc/language/en.php index 6833a5764d..b59e0cf75a 100644 --- a/inc/language/en.php +++ b/inc/language/en.php @@ -97,10 +97,10 @@ define('FATAL_INC_WRITABLE', "Directory inc is writeable! Please set the access define('LANG_WRITE_FOOTER', "Display name, version and author of this script?"); define('LANG_FRAMESET_ACTIVE', "Enable frameset? If not a table-set will be used instead."); define('MYSQL_ERRORS', "MySQL errors detected. Please correct first to continue."); -define('LANG_MOD_UNKNOWN_1', "Unknown return-code "); -define('LANG_MOD_UNKNOWN_2', " detected!"); -define('LANG_MOD_LOCKED_1', "Selected module "); -define('LANG_MOD_LOCKED_2', " is locked!"); +define('LANG_MOD_REG_UNKNOWN_1', "Unknown return-code "); +define('LANG_MOD_REG_UNKNOWN_2', " detected!"); +define('LANG_MOD_REG_LOCKED_1', "Selected module "); +define('LANG_MOD_REG_LOCKED_2', " is locked!"); define('ADMIN_UNKNOWN_ACTION_1', "Unknown administrator-action "); define('ADMIN_UNKNOWN_ACTION_2', " detected. Please call this module correctly!"); define('ADMIN_ACTION_404_1', "Administrator module for action "); diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 26fd2fa935..868ff43862 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -297,7 +297,7 @@ ORDER BY `sort`", __FILE__, __LINE__); { // Load sub menus $result_sub = SQL_QUERY_ESC("SELECT what, title FROM `{!_MYSQL_PREFIX!}_sponsor_menu` -WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ".$WHERE." +WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$WHERE." ORDER BY `sort`", array($action), __FILE__, __LINE__); if (SQL_NUMROWS($result_sub) > 0) { diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 3b52f3cc1a..bddf3e2b2d 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -264,7 +264,7 @@ function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) { global $SURFBAR_CACHE; // Search for the requested action/status combination in database - $result = SQL_QUERY_ESC("SELECT new_status FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE action='%s' AND `status`='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT new_status FROM `{!_MYSQL_PREFIX!}_surfbar_actions` WHERE `action`='%s' AND `status`='%s' LIMIT 1", array($action, $status), __FILE__, __LINE__); // Is the entry there? diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 9230839a83..50174c2379 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -344,7 +344,7 @@ function ADMIN_DO_ACTION($wht) { // Check if action/what pair is valid $result_action = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` -WHERE action='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR `what` IS NULL) AND '%s'='overview')) +WHERE `action`='%s' AND ((what='%s' AND what != 'overview') OR ((what='' OR `what` IS NULL) AND '%s'='overview')) LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__); if (SQL_NUMROWS($result_action) == 1) { @@ -457,7 +457,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) { } $OUT .= " \n"; - $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC", + $result_what = SQL_QUERY_ESC("SELECT what, title, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`, id DESC", array($menu), __FILE__, __LINE__); if ((SQL_NUMROWS($result_what) > 0) && ($act == $menu)) { diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index 3f32393e10..12798e8899 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -68,7 +68,7 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')", ), __FILE__, __LINE__); // Load ID - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND title='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND `title`='%s' LIMIT 1", array($START, $END, $_POST['title']), __FILE__, __LINE__); list($id) = SQL_FETCHROW($result); SQL_FREERESULT($result); diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 23849f3a72..acc0bb2f82 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -89,7 +89,7 @@ if (!isset($_POST['ok'])) // Load sub menus :) foreach ($menus as $key_main => $value_main) { - $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", + $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($value_main), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index 87543809d5..b20760df3e 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -200,21 +200,21 @@ WHERE ".$AND." AND id=%s LIMIT 1", // Get IDs if (!empty($_GET['w'])) { // Sub menus selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); } else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (what='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -222,9 +222,9 @@ WHERE ".$AND." AND id=%s LIMIT 1", if ((!empty($tid)) && (!empty($fid))) { // Sort menu - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__); - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__); CACHE_PURGE_ADMIN_MENU(0, "", "", $AND); } @@ -233,7 +233,7 @@ WHERE ".$AND." AND id=%s LIMIT 1", // By default list menus if (!empty($SUB)) { // Sub menus of a main menu - $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", + $result = SQL_QUERY_ESC("SELECT id, action, what, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", array($SUB), __FILE__, __LINE__); } else { // Main menus diff --git a/inc/modules/admin/what-config_home.php b/inc/modules/admin/what-config_home.php index 3a9c3ae627..9c3ae2cc5b 100644 --- a/inc/modules/admin/what-config_home.php +++ b/inc/modules/admin/what-config_home.php @@ -73,7 +73,7 @@ case "target": // Set which what-file will be placed in home-page (only modules. // Load all what menu points $result = SQL_QUERY("SELECT id, what, title FROM `{!_MYSQL_PREFIX!}_guest_menu` -WHERE action='main' AND `what` != '' AND `what` IS NOT NULL AND `locked`='N' +WHERE `action`='main' AND `what` != '' AND `what` IS NOT NULL AND `locked`='N' ORDER BY `sort` ASC", __FILE__, __LINE__); $SW = 2; $OUT = ""; $atitle = ""; diff --git a/inc/modules/admin/what-config_mods.php b/inc/modules/admin/what-config_mods.php index 68f4307228..6ae6c9b6a2 100644 --- a/inc/modules/admin/what-config_mods.php +++ b/inc/modules/admin/what-config_mods.php @@ -90,7 +90,7 @@ if (isset($_POST['edit'])) { $id = bigintval($id); // Update module - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET title='%s', `locked`='%s', hidden='%s', admin_only='%s', mem_only='%s' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `title`='%s', `locked`='%s', hidden='%s', admin_only='%s', mem_only='%s' WHERE id=%s LIMIT 1", array($_POST['title'][$id], $_POST['locked'][$id], $_POST['hidden'][$id], $_POST['admin'][$id], $_POST['member'][$id], $id), __FILE__, __LINE__); } diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index 8e063e7757..3bd9a5c284 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -89,7 +89,7 @@ if (!isset($_POST['ok'])) { foreach ($menus as $key_main => $value_main) { $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_guest_menu` -WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", +WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($value_main), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index c2d46fab5b..3f67c4ca9c 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -157,7 +157,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) $sel = bigintval($sel); // Update entry - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array($menu, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel], $sel),__FILE__, __LINE__); } LOAD_TEMPLATE("admin_settings_saved", false, getMessage('SETTINGS_SAVED')); @@ -247,21 +247,21 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) // Get IDs if (!empty($_GET['w'])) { // Sub menus selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1", array($_GET['act'], bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); } else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (what='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); @@ -269,9 +269,9 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) if ((!empty($tid)) && (!empty($fid))) { // Sort menu - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__); - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__); } // END - if } // END - if diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index c075449cb7..e783f528c3 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -86,7 +86,7 @@ if (!isset($_POST['ok'])) { // Load sub menus :) foreach ($menus as $key_main => $value_main) { - $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND `what` != '' ORDER BY `sort`", + $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `what` != '' ORDER BY `sort`", array($value_main), __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Initialize arrays diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index d89f0f4566..fb80b42047 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -182,7 +182,7 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) { switch ($_POST['ok']) { case "edit": // Edit menu - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array($menu, $_POST['sel_act'][$sel], $_POST['sel_what'][$sel], $sel), __FILE__, __LINE__); break; @@ -209,29 +209,29 @@ if ((isset($_POST['edit'])) && ($chk > 0) && (!IS_DEMO())) { // Get IDs if (!empty($_GET['w'])) { // Sub menus selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1", array(bigintval($_GET['act']), bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); SQL_FREERESULT($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1", array(bigintval($_GET['act']), bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); SQL_FREERESULT($result); } else { // Main menu selected - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1", array(bigintval($_GET['tid'])), __FILE__, __LINE__); list($tid) = SQL_FETCHROW($result); - $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND sort='%s' LIMIT 1", + $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (what='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1", array(bigintval($_GET['fid'])), __FILE__, __LINE__); list($fid) = SQL_FETCHROW($result); } if ((!empty($tid)) && (!empty($fid))) { // Sort menu - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['tid']), bigintval($fid)), __FILE__, __LINE__); - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='%s' WHERE ".$AND." AND id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1", array(bigintval($_GET['fid']), bigintval($tid)), __FILE__, __LINE__); } // END - -fi } diff --git a/inc/modules/admin/what-repair_amenu.php b/inc/modules/admin/what-repair_amenu.php index e17ad5ad9e..803f11bd17 100644 --- a/inc/modules/admin/what-repair_amenu.php +++ b/inc/modules/admin/what-repair_amenu.php @@ -58,11 +58,11 @@ while (list($id, $act) = SQL_FETCHROW($result_fix)) { } // Set logout weight to 999 -SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort='999' WHERE action='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); +SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `sort`='999' WHERE `action`='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) { - $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", + $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($act), __FILE__, __LINE__); $cnt = 1; while (list($id) = SQL_FETCHROW($result_fix)) { diff --git a/inc/modules/admin/what-repair_gmenu.php b/inc/modules/admin/what-repair_gmenu.php index 0215024dfa..5a42fcb2db 100644 --- a/inc/modules/admin/what-repair_gmenu.php +++ b/inc/modules/admin/what-repair_gmenu.php @@ -57,11 +57,11 @@ while (list($id, $act) = SQL_FETCHROW($result_fix)) $cnt++; } // Set logout weight to 999 -$result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='999' WHERE action='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); +$result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='999' WHERE `action`='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) { - $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", + $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($act), __FILE__, __LINE__); $cnt = 1; while (list($id) = SQL_FETCHROW($result_fix)) { diff --git a/inc/modules/admin/what-repair_mmenu.php b/inc/modules/admin/what-repair_mmenu.php index 0e8b32f404..83c4d9bbbf 100644 --- a/inc/modules/admin/what-repair_mmenu.php +++ b/inc/modules/admin/what-repair_mmenu.php @@ -57,11 +57,11 @@ while (list($id, $act) = SQL_FETCHROW($result_fix)) { $cnt++; } // Set logout weight to 999 -SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='999' WHERE action='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); +SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='999' WHERE `action`='logout' AND (what='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__); // Now sort every each menu foreach ($ACTIONS as $act) { - $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", + $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", array($act), __FILE__, __LINE__); $cnt = 1; while (list($id) = SQL_FETCHROW($result_fix)) { diff --git a/inc/modules/guest/action-admin.php b/inc/modules/guest/action-admin.php index eb04fed853..7da2d06355 100644 --- a/inc/modules/guest/action-admin.php +++ b/inc/modules/guest/action-admin.php @@ -45,10 +45,8 @@ $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module LOAD_INC($INC); -} elseif ($IS_VALID) { - addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - addFatalMessage(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); + addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/action-main.php b/inc/modules/guest/action-main.php index 4a1528f741..89989bd8b4 100644 --- a/inc/modules/guest/action-main.php +++ b/inc/modules/guest/action-main.php @@ -45,15 +45,11 @@ ADD_DESCR("guest", __FILE__); // Load the include file $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); -$IS_VALID = WHAT_IS_VALID($GLOBALS['action'], $GLOBALS['what'], "guest"); - -if ((FILE_READABLE($INC)) && ($IS_VALID)) { +if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module LOAD_INC($INC); -} elseif ($IS_VALID) { - addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - addFatalMessage(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); + addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/action-members.php b/inc/modules/guest/action-members.php index 39edeefbff..6468059570 100644 --- a/inc/modules/guest/action-members.php +++ b/inc/modules/guest/action-members.php @@ -48,10 +48,8 @@ $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module LOAD_INC($INC); -} elseif ($IS_VALID) { - addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - addFatalMessage(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); + addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/guest/action-sponsor.php b/inc/modules/guest/action-sponsor.php index d2a0a9c9eb..a6f754c22f 100644 --- a/inc/modules/guest/action-sponsor.php +++ b/inc/modules/guest/action-sponsor.php @@ -50,10 +50,8 @@ $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what'])); if (FILE_READABLE($INC)) { // Ok, we finally load the guest action module LOAD_INC($INC); -} elseif ($IS_VALID) { - addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } else { - addFatalMessage(sprintf(getMessage('GUEST_LOCKED_ACTION'), SQL_ESCAPE($GLOBALS['what']))); + addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what']))); } // diff --git a/inc/modules/login.php b/inc/modules/login.php index 50d7d98f42..229c0747c6 100644 --- a/inc/modules/login.php +++ b/inc/modules/login.php @@ -79,7 +79,7 @@ OUTPUT_HTML(" "); $INC_ACTION = sprintf("inc/modules/member/action-%s.php", $act); -if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']))) { +if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", $GLOBALS['action'], $GLOBALS['what']))) { // Requested module is available so we load it LOAD_INC($INC_ACTION); } else { diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index a233f5b7eb..98c45fe686 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -252,7 +252,7 @@ function ADD_DESCR ($ACC_LVL, $file, $return = false, $output = true) { break; } $dummy = substr($search, 0, -4); - $AND .= " AND action='".GET_ACTION($ACC_LVL, $dummy)."'"; + $AND .= " AND `action`='".GET_ACTION($ACC_LVL, $dummy)."'"; } elseif (($ACC_LVL == "sponsor") || ($ACC_LVL == "engine")) { // Sponsor / engine menu $type = "what"; @@ -335,7 +335,10 @@ function ADD_MENU ($MODE, $act, $wht) { $main_action = ""; $sub_what = ""; - if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) return getMessage('CODE_MENU_NOT_VALID'); + // is the menu action valid? + if (!VALIDATE_MENU_ACTION($MODE, $act, $wht, true)) { + return getMessage('CODE_MENU_NOT_VALID'); + } // END - if // Non-admin shall not see all menus if (!IS_ADMIN()) { @@ -363,7 +366,7 @@ function ADD_MENU ($MODE, $act, $wht) { // Load menu header template LOAD_TEMPLATE($MODE."_menu_title", false, $content); - $result_sub = SQL_QUERY_ESC("SELECT title, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE action='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`", + $result_sub = SQL_QUERY_ESC("SELECT title, what FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$AND." ORDER BY `sort`", array($MODE, $main_action), __FILE__, __LINE__); $ctl = SQL_NUMROWS($result_sub); if ($ctl > 0) { @@ -518,7 +521,7 @@ function ADD_MAX_RECEIVE_LIST ($MODE, $default = "", $return = false) { while (list($value, $comment) = SQL_FETCHROW($result)) { $OUT .= "