From 00974432ffe0ed217b993e1ea5aaaac7dc31e82b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 27 Jun 2010 17:32:00 +0000 Subject: [PATCH] Naming convention further applied: _ral_ is replaced by _rallye_ to make it clear what is meant --- inc/extensions/ext-beg.php | 12 +++++++++++- inc/extensions/ext-bonus.php | 13 +++++++++++-- inc/extensions/ext-user.php | 2 +- inc/libs/register_functions.php | 8 ++++---- inc/mails/beg_mails.php | 16 ++++++++-------- inc/mails/bonus_mails.php | 17 ++++++++--------- inc/modules/admin/what-config_beg.php | 6 +++--- 7 files changed, 46 insertions(+), 28 deletions(-) diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index a8da2f7d48..a83d675b19 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -263,6 +263,16 @@ PRIMARY KEY (id) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `beg_ral_en_notify` `beg_ral_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `beg_ral_di_notify` `beg_ral_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention"); + break; + + case '0.2.8': // SQL queries for v0.2.8 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `beg_ral_enable_notify` `beg_rallye_enable_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `beg_ral_disable_notify` `beg_rallye_disable_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `beg_ral_enable_notify` `beg_rallye_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `beg_ral_disable_notify` `beg_rallye_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + // Update notes (these will be set as task text!) setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention"); break; @@ -279,7 +289,7 @@ PRIMARY KEY (id) // Remove old entries $OLD = getConfig('beg_timeout'); if (getConfig('beg_userid_timeout') > $OLD) $OLD = getConfig('beg_userid_timeout'); - $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE `timeout` < (UNIX_TIMESTAMP() -".($OLD + 60*60).")", __FILE__, __LINE__); + $result_ext = SQL_QUERY("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE `timeout` < (UNIX_TIMESTAMP() - ".($OLD + 60*60).")", __FILE__, __LINE__); // Check for beg rallye is active and send mails out if ((getConfig('beg_rallye') == 'Y') && (getConfig('beg_new_member_notify') == 'Y')) { diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index a5cf74ba55..14e0f2e5ba 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -43,10 +43,10 @@ if (!defined('__SECURITY')) { } // END - if // Version of this extension -setThisExtensionVersion('0.9.1'); +setThisExtensionVersion('0.9.2'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.1.6', '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', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1')); +setExtensionVersionHistory(array('0.0', '0.1.6', '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', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9', '0.9.0', '0.9.1', '0.9.2')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) @@ -556,6 +556,15 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `bonus_di_notify` `bonus_disable_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `bonus_new_mem_notify` `bonus_new_member_notify` ENUM('Y','N') NOT NULL DEFAULT 'N'"); + // Update notes + setExtensionUpdateNotes("Umbenannt nach neuer Konvention (bitte Einstellungen kontrollieren)."); + break; + + case '0.9.2': // SQL queries for v0.9.2 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ral_en_notify` `bonus_ralley_enable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ral_di_notify` `bonus_ralley_disable_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `bonus_ral_notify` `bonus_rallley_notify` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + // Update notes setExtensionUpdateNotes("Umbenannt nach neuer Konvention (bitte Einstellungen kontrollieren)."); break; diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index d2cb8d16bb..3fa25d9875 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -368,7 +368,7 @@ PRIMARY KEY (`id`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet."); break; - } + } // END - switch break; case 'modify': // When the extension got modified diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 211f984653..006be6f123 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -308,19 +308,19 @@ function doRegistration () { // Check if I shall disable sending mail to newly registered members out about active/begging rallye // // First comes first: begging rallye - if (isExtensionInstalledAndNewer('beg', '0.1.7')) { + if (isExtensionInstalledAndNewer('beg', '0.2.8')) { // Okay, shall I disable now? if (getConfig('beg_new_member_notify') != 'Y') { - $GLOBALS['register_sql_columns'] .= ', `beg_ral_notify`, `beg_ral_enable_notify`'; + $GLOBALS['register_sql_columns'] .= ', `beg_rallye_notify`, `beg_rallye_enable_notify`'; $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()'; } // END - if } // END - if // Second: active rallye - if (isExtensionInstalledAndNewer('bonus', '0.7.7')) { + if (isExtensionInstalledAndNewer('bonus', '0.9.2')) { // Okay, shall I disable now? if (getConfig('bonus_new_member_notify') != 'Y') { - $GLOBALS['register_sql_columns'] .= ', `bonus_ral_notify`, `bonus_ral_enable_notify`'; + $GLOBALS['register_sql_columns'] .= ', `bonus_rallye_notify`, `bonus_rallye_enable_notify`'; $GLOBALS['register_sql_data'] .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()'; } // END - if } // END - if diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index d81f507a1e..5806fe5f59 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -40,7 +40,7 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif (!isExtensionActive('beg')) { +} elseif ((!isExtensionActive('beg')) || (isExtensionInstalledAndOlder('beg', '0.2.8'))) { return; } @@ -52,12 +52,12 @@ $mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', ti $sql = ''; $mode = ''; // Shall I sent activation or deactivation mail? -$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`beg_ral_notify` "; +$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`beg_rallye_notify` "; switch (getConfig('beg_rallye')) { case 'Y': // Begging rallye is activated - if (getConfig('beg_ral_enable_notify') == 'Y') { + if (getConfig('beg_rallye_enable_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= '= 0 OR (`beg_ral_notify` > 0 AND `beg_ral_enable_notify` < `beg_ral_disable_notify`)'; + $sql .= '= 0 OR (`beg_rallye_notify` > 0 AND `beg_rallye_enable_notify` < `beg_rallye_disable_notify`)'; $mode = 'enable'; } else { // Do not notify! @@ -66,9 +66,9 @@ switch (getConfig('beg_rallye')) { break; case 'N': // Begging rallye is deactivated - if (getConfig('beg_ral_disable_notify') == 'Y') { + if (getConfig('beg_rallye_disable_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= ' > 0 AND `beg_ral_disable_notify` < `beg_ral_enable_notify`'; + $sql .= ' > 0 AND `beg_rallye_disable_notify` < `beg_rallye_enable_notify`'; $mode = 'disable'; } else { // Do not notify! @@ -111,8 +111,8 @@ if (!empty($sql)) { SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET - `beg_ral_notify`=UNIX_TIMESTAMP(), - `beg_ral_%s_notify`=UNIX_TIMESTAMP() + `beg_rallye_notify`=UNIX_TIMESTAMP(), + `beg_rallye_%s_notify`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 80c2558a52..99f47d66a7 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -40,7 +40,7 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} elseif (!isExtensionActive('bonus')) { +} elseif ((!isExtensionActive('bonus')) || (isExtensionInstalledAndOlder('bonus', '0.9.2'))) { return; } @@ -52,13 +52,12 @@ $mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', ti $sql = ''; $mode = ''; // Shall I sent activation or deactivation mail? -$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`bonus_ral_notify` "; -switch (getConfig('bonus_active')) -{ +$sql = "SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE (`bonus_rallye_notify` "; +switch (getConfig('bonus_active')) { case 'Y': // Active rallye is activated if (getConfig('bonus_enable_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= '= 0 OR (`bonus_ral_notify` > 0 AND `bonus_ral_enable_notify` < `bonus_ral_disable_notify`)'; + $sql .= '= 0 OR (`bonus_rallye_notify` > 0 AND `bonus_rallye_enable_notify` < `bonus_rallye_disable_notify`)'; $mode = 'enable'; } else { // Do not notify! @@ -69,14 +68,14 @@ switch (getConfig('bonus_active')) case 'N': // Active rallye is deactivated if (getConfig('bonus_disable_notify') == 'Y') { // Okay, let's check for member accounts - $sql .= ' > 0 AND `bonus_ral_disable_notify` < `bonus_ral_enable_notify`'; + $sql .= ' > 0 AND `bonus_rallye_disable_notify` < `bonus_rallye_enable_notify`'; $mode = 'disable'; } else { // Do not notify! $sql = ''; } break; -} +} // END - switch if (!empty($sql)) { // The SQL command needs to be finisched here (only confirmed accounts!) @@ -101,8 +100,8 @@ if (!empty($sql)) { SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET - `bonus_ral_notify`=UNIX_TIMESTAMP(), - `bonus_ral_%s_notify`=UNIX_TIMESTAMP() + `bonus_rallye_notify`=UNIX_TIMESTAMP(), + `bonus_rallye_%s_notify`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", diff --git a/inc/modules/admin/what-config_beg.php b/inc/modules/admin/what-config_beg.php index 7d9852c40a..516fd067b8 100644 --- a/inc/modules/admin/what-config_beg.php +++ b/inc/modules/admin/what-config_beg.php @@ -55,9 +55,9 @@ if (isFormSent()) { adminSaveSettingsFromPostData(); // Remember new settings - setConfigEntry('beg_rallye' , postRequestParameter('beg_rallye')); - setConfigEntry('beg_ral_enable_notify' , postRequestParameter('beg_ral_enable_notify')); - setConfigEntry('beg_ral_disable_notify', postRequestParameter('beg_ral_disable_notify')); + setConfigEntry('beg_rallye' , postRequestParameter('beg_rallye')); + setConfigEntry('beg_rallye_enable_notify' , postRequestParameter('beg_rallye_enable_notify')); + setConfigEntry('beg_rallye_disable_notify', postRequestParameter('beg_rallye_disable_notify')); } else { // Prepare constants for the template $content['points'] = translateComma(getConfig('beg_points') , false); -- 2.39.5