From: Roland Häder Date: Wed, 23 Jan 2013 16:55:34 +0000 (+0000) Subject: Rewrote new extension detection: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fed2288507c2538be58677ebb72c38bfa7b3dd9e;p=mailer.git Rewrote new extension detection: - Updated new extension detection (and task registration) so that it won't use so much database space anymore as this only adds a place-holder (see below) - Renamed OPEN/CLOSE_TEMPLATE TO OPEN/CLOSE_LANGUAGE - Added OPEN/CLOSE_TEMPLATE for {% and %} - TODOs.txt updated --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 5359e40fdb..5ffb98425a 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -192,7 +192,7 @@ ./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter * ./inc/modules/member/what-logout.php:52: // @TODO Move this in a filter, e.g. member_logout ./inc/modules/member/what-mydata.php:82: // @TODO Move this to a function (for better EL code) -./inc/modules/member/what-order.php:362: // @TODO Rewrite this to a filter +./inc/modules/member/what-order.php:365: // @TODO Rewrite this to a filter ./inc/modules/member/what-order.php:72: // @TODO Try to move out url_tlock to a filter for extra SQL statements ./inc/modules/member/what-payout.php:208: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:61:// @TODO Should we rewrite this to a filter? @@ -226,7 +226,7 @@ ./inc/template-functions.php:209: * @TODO On some pages this is buggy ./inc/template-functions.php:298: // @TODO Remove these sanity checks if all is fine ./inc/template-functions.php:747: // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates -./inc/wrapper-functions.php:3215: // @TODO Find a way to not use direct module comparison +./inc/wrapper-functions.php:3227: // @TODO Find a way to not use direct module comparison ./inc/wrapper-functions.php:566:// @TODO Do some more sanity check here ./inc/xml-functions.php:240: // @TODO Handle characters ./mailid.php:123: // @TODO Rewrite this to a filter/function diff --git a/DOCS/de/TEMPLATES.txt b/DOCS/de/TEMPLATES.txt index 39eca18e3c..b5eb5dff99 100644 --- a/DOCS/de/TEMPLATES.txt +++ b/DOCS/de/TEMPLATES.txt @@ -74,8 +74,10 @@ Diese werden durch folgende "Austauscher" ersetzt: Dollarzeichen = {DOLLAR_TAG} Klammer-Auf = {OPEN_TAG} Klammer-Zu = {CLOSE_TAG} -Template-Auf = {OPEN_TEMPLATE} (damit ist {-- gemeint!) -Template-Zu = {CLOSE_TEMPLATE} (damit ist --} gemeint!) +Sprache-Auf = {OPEN_LANGUAGE} (damit ist {-- gemeint) +Sprache-Zu = {CLOSE_LANGUAGE} (damit ist --} gemeint) +Template-Auf = {OPEN_TEMPLATE} (damit ist {% gemeint) +Template-Zu = {CLOSE_TEMPLATE} (damit ist %} gemeint) Neu sind (v0.0.8 mit neusten Patches): Abostrof (') = {QUOT} diff --git a/DOCS/en/TEMPLATES.txt b/DOCS/en/TEMPLATES.txt index abdcafb745..4d76fa8fb3 100644 --- a/DOCS/en/TEMPLATES.txt +++ b/DOCS/en/TEMPLATES.txt @@ -82,8 +82,10 @@ Diese werden durch folgende "Templates" ersetzt: Dollarzeichen = {DOLLAR_TAG} Klammer-Auf = {OPEN_TAG} Klammer-Zu = {CLOSE_TAG} -Template-Auf = {OPEN_TEMPLATE} (damit ist {-- gemeint!) -Template-Zu = {CLOSE_TEMPLATE} (damit ist --} gemeint!) +Sprache-Auf = {OPEN_LANGUAGE} (damit ist {-- gemeint) +Sprache-Zu = {CLOSE_LANGUAGE} (damit ist --} gemeint) +Template-Auf = {OPEN_TEMPLATE} (damit ist {% gemeint) +Template-Zu = {CLOSE_TEMPLATE} (damit ist %} gemeint) Neu sind (v0.0.8 mit neusten Patches): Abostrof (') = {QUOT} diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 6fbbe22afa..10a4dfc36c 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -1084,7 +1084,7 @@ function createNewExtensionTask ($ext_name) { // Load text for task if found if (isFileReadable($FQFN)) { // Load extension's description template (but do not compile the code) - $message = loadTemplate('ext_' . $ext_name, TRUE, array(), FALSE); + $message = '{OPEN_TEMPLATE}template,LoadTemplate=ext_' . $ext_name . '{CLOSE_TEMPLATE}'; } else { // Write this in debug.log as well logDebugMessage(__FUNCTION__, __LINE__, $message); diff --git a/inc/extensions/ext- b/inc/extensions/ext- index b087e334d7..e76d0a144b 100644 --- a/inc/extensions/ext- +++ b/inc/extensions/ext- @@ -54,7 +54,7 @@ switch (getExtensionMode()) { // SQL commands to run // Register module - //addModuleSql('foo', '{OPEN_TEMPLATE}MODULE_FOO_TITLE{CLOSE_TEMPLATE}','Y','Y','N','N'); + //addModuleSql('foo', '{OPEN_LANGUAGE}MODULE_FOO_TITLE{CLOSE_LANGUAGE}','Y','Y','N','N'); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-alert.php b/inc/extensions/ext-alert.php index 86cadcf64f..30d8d4ccf8 100644 --- a/inc/extensions/ext-alert.php +++ b/inc/extensions/ext-alert.php @@ -54,7 +54,7 @@ switch (getExtensionMode()) { // SQL commands to run // Register module - //addModuleSql('foo', '{OPEN_TEMPLATE}MODULE_FOO_TITLE{CLOSE_TEMPLATE}','Y','Y','N','N'); + //addModuleSql('foo', '{OPEN_LANGUAGE}MODULE_FOO_TITLE{CLOSE_LANGUAGE}','Y','Y','N','N'); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 90af8aa143..6675d04874 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -41,10 +41,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.3.5'); +setThisExtensionVersion('0.3.6'); // Version history array (add more with , '0.0.1' and so on) -setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5')); +setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6')); switch (getExtensionMode()) { case 'setup': // Do stuff when installation is running @@ -331,7 +331,7 @@ INDEX (`userid`)", case '0.3.2': // SQL queries for v0.3.2 // Add module entry - addModuleSql('beg', '{OPEN_TEMPLATE}MODULE_BEG_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); + addModuleSql('beg', '{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); // Set module title addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Betteln bei {OPEN_CONFIG}MAIN_TITLE{CLOSE_CONFIG}' WHERE `module`='beg' AND `title`='' LIMIT 1"); @@ -373,6 +373,14 @@ INDEX (`userid`)", // Update notes setExtensionUpdateNotes("Filter für das Ausschließen des konfigurierbaren Mitgliedaccounts hinzugefügt."); break; + + case '0.3.6': // SQL queries for v0.3.6 + // SQL to update module + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}' WHERE `module`='beg' LIMIT 1"); + + // Update notes + setExtensionUpdateNotes("Modul-Titel nach neuem Format angepasst."); + break; } // END - switch break; diff --git a/inc/extensions/ext-cprping.php b/inc/extensions/ext-cprping.php index d042cadbdd..31fd3e3f04 100644 --- a/inc/extensions/ext-cprping.php +++ b/inc/extensions/ext-cprping.php @@ -54,7 +54,7 @@ switch (getExtensionMode()) { // SQL commands to run // Register module - //addModuleSql('foo', '{OPEN_TEMPLATE}MODULE_CPRPING_TITLE{CLOSE_TEMPLATE}','Y','Y','N','N'); + //addModuleSql('foo', '{OPEN_LANGUAGE}MODULE_CPRPING_TITLE{CLOSE_LANGUAGE}','Y','Y','N','N'); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-cron.php b/inc/extensions/ext-cron.php index db89ad649f..14a9588883 100644 --- a/inc/extensions/ext-cron.php +++ b/inc/extensions/ext-cron.php @@ -54,7 +54,7 @@ switch (getExtensionMode()) { // SQL commands to run // Register module - //addModuleSql('foo', '{OPEN_TEMPLATE}MODULE_FOO_TITLE{CLOSE_TEMPLATE}','Y','Y','N','N'); + //addModuleSql('foo', '{OPEN_LANGUAGE}MODULE_FOO_TITLE{CLOSE_LANGUAGE}','Y','Y','N','N'); break; case 'remove': // Do stuff when removing extension diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 679e9805d4..299ad3d540 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -210,7 +210,7 @@ UNIQUE INDEX `status_action` (`actions_status`, `actions_action`)", addAdminMenuSql('surfbar', 'list_surfbar_actions', 'Mitglieder-Aktionen', 'Listet alle Mitglieder-Aktionen auf.', 7); // Register module - addModuleSql('surfbar', '{OPEN_TEMPLATE}MODULE_SURFBAR_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); + addModuleSql('surfbar', '{OPEN_LANGUAGE}MODULE_SURFBAR_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); // Insert data for points accounts registerExtensionPointsData('monthly_surfbar', 'points', 'LOCKED', 'DIRECT'); diff --git a/inc/extensions/network/mode-setup.php b/inc/extensions/network/mode-setup.php index 3698a9d819..530b8e7c19 100644 --- a/inc/extensions/network/mode-setup.php +++ b/inc/extensions/network/mode-setup.php @@ -12234,8 +12234,8 @@ addConfigAddSql('network_logging_debug', "ENUM ('Y','N') NOT NULL DEFAULT 'N'"); addConfigAddSql('network_logging_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 3)); // Register modules -addModuleSql('network-delurl', '{OPEN_TEMPLATE}MODULE_NETWORK_DELURL_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); -addModuleSql('network-vcheck', '{OPEN_TEMPLATE}MODULE_NETWORK_VCHECK_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); +addModuleSql('network-delurl', '{OPEN_LANGUAGE}MODULE_NETWORK_DELURL_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); +addModuleSql('network-vcheck', '{OPEN_LANGUAGE}MODULE_NETWORK_VCHECK_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); // [EOF] ?> diff --git a/inc/extensions/sponsor/mode-setup.php b/inc/extensions/sponsor/mode-setup.php index 50fe1cee3c..11cb03a65c 100644 --- a/inc/extensions/sponsor/mode-setup.php +++ b/inc/extensions/sponsor/mode-setup.php @@ -362,9 +362,9 @@ INDEX (`sponsor_id`)", // // Register module // - addModuleSql('sponsor', '{OPEN_TEMPLATE}MODULE_SPONSOR_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); - addModuleSql('sponsor_confirm', '{OPEN_TEMPLATE}MODULE_SPONSOR_CONFIRM_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); - addModuleSql('sponsor_ref', '{OPEN_TEMPLATE}MODULE_SPONSOR_REF_TITLE{CLOSE_TEMPLATE}', 'Y', 'Y', 'N', 'N'); + addModuleSql('sponsor', '{OPEN_LANGUAGE}MODULE_SPONSOR_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); + addModuleSql('sponsor_confirm', '{OPEN_LANGUAGE}MODULE_SPONSOR_CONFIRM_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); + addModuleSql('sponsor_ref', '{OPEN_LANGUAGE}MODULE_SPONSOR_REF_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N'); // [EOF] ?> diff --git a/inc/extensions/sql_patches/mode-update.php b/inc/extensions/sql_patches/mode-update.php index 88d866f998..749590d6b4 100644 --- a/inc/extensions/sql_patches/mode-update.php +++ b/inc/extensions/sql_patches/mode-update.php @@ -55,7 +55,7 @@ if (!defined('__SECURITY')) { break; case '0.0.3': // SQL queries for v0.0.3 - addConfigAddSql('points_word', "VARCHAR(255) NOT NULL DEFAULT '{OPEN_TEMPLATE}DEFAULT_POINTS{CLOSE_TEMPLATE}'"); + addConfigAddSql('points_word', "VARCHAR(255) NOT NULL DEFAULT '{OPEN_LANGUAGE}DEFAULT_POINTS{CLOSE_LANGUAGE}'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Das Wort "Punkte" kann nun per Datenbank geändert werden. Damit können anstelle des Wortes Punkte auch Klammlose, Wernis, Primera und auch € geschrieben werden."); diff --git a/inc/libs/security_functions.php b/inc/libs/security_functions.php index 10002eea71..bcb381a7f4 100644 --- a/inc/libs/security_functions.php +++ b/inc/libs/security_functions.php @@ -181,7 +181,7 @@ if (!isset($_POST)) { // Generate arrays which holds the relevante chars to replace $GLOBALS['security_chars'] = array( // The chars we are looking for... - 'from' => array('/', '.', chr(39), '$', '(', ')', '{--', '--}', '{?', '?}', '%', ';', '[', ']', ':', '--', chr(92), chr(39), '<', '>'), + 'from' => array('/', '.', chr(39), '$', '(', ')', '{--', '--}', '{%', '%}', '{?', '?}', '%', ';', '[', ']', ':', '--', chr(92), chr(39), '<', '>'), // ... and we will replace to. 'to' => array( '{SLASH}', @@ -190,6 +190,8 @@ $GLOBALS['security_chars'] = array( '{DOLLAR}', '{OPEN_ANCHOR}', '{CLOSE_ANCHOR}', + '{OPEN_LANGUAGE}', + '{CLOSE_LANGUAGE}', '{OPEN_TEMPLATE}', '{CLOSE_TEMPLATE}', '{OPEN_CONFIG}', diff --git a/templates/de/html/ext/ext_blacklist.tpl b/templates/de/html/ext/ext_blacklist.tpl index b9a43270be..8eb7b4cd70 100644 --- a/templates/de/html/ext/ext_blacklist.tpl +++ b/templates/de/html/ext/ext_blacklist.tpl @@ -1,4 +1,4 @@
- Sperren Sie Email-Adressen oder URLs mit dieser Erweiterung. Diese - Erweiterung sollte in keinem {?mt_word?} fehlen. + Sperren Sie mit dieser Erweiterung Email-Adressen, IP-Adressen, URLs oder + was auch immer. Diese Erweiterung sollte in keinem {?mt_word?} fehlen.