Naming convention further applied: _ral_ is replaced by _rallye_ to make it clear...
authorRoland Häder <roland@mxchange.org>
Sun, 27 Jun 2010 17:32:00 +0000 (17:32 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 27 Jun 2010 17:32:00 +0000 (17:32 +0000)
inc/extensions/ext-beg.php
inc/extensions/ext-bonus.php
inc/extensions/ext-user.php
inc/libs/register_functions.php
inc/mails/beg_mails.php
inc/mails/bonus_mails.php
inc/modules/admin/what-config_beg.php

index a8da2f7d48dd354d821a84cfa0b732d098bf7779..a83d675b19209ec7a2226e20968abb3141bc5051 100644 (file)
@@ -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')) {
index a5cf74ba55c0c90786c9174f66fd559421919fbb..14e0f2e5ba4c7c4a311f23cba0a941d17d00ea0a 100644 (file)
@@ -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;
index d2cb8d16bb40ec5f03d7b7748881e34a3ad696d8..3fa25d9875f561189c9735bc42687006c7d8fca6 100644 (file)
@@ -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&ouml;schen des Users mit ausgesendet.");
                                break;
-               }
+               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
index 211f98465363efbdcf4bdda0951ddec9e90df8d6..006be6f123dd9f9dd086cda7d42c548034493d03 100644 (file)
@@ -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
index d81f507a1eaa93f5d92a4fde34abe9f6879e35b4..5806fe5f59fde9ba249d7924038f95c08d663447 100644 (file)
@@ -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",
index 80c2558a52b32de4a5066f2f4e011bb42bdcfeb3..99f47d66a7125e04b1fda182fb1c005d9320a617 100644 (file)
@@ -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",
index 7d9852c40a6decbdc0f82ca2a60d144f8ddcb775..516fd067b88d4000475739764df314b7809bb479 100644 (file)
@@ -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);