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;
// 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')) {
} // 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)
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;
// 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
// 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
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-} elseif (!isExtensionActive('beg')) {
+} elseif ((!isExtensionActive('beg')) || (isExtensionInstalledAndOlder('beg', '0.2.8'))) {
return;
}
$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!
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!
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",
// Some security stuff...
if (!defined('__SECURITY')) {
die();
-} elseif (!isExtensionActive('bonus')) {
+} elseif ((!isExtensionActive('bonus')) || (isExtensionInstalledAndOlder('bonus', '0.9.2'))) {
return;
}
$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!
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!)
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",
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);