}
// Version number
-EXT_SET_VERSION("0.3.1");
+EXT_SET_VERSION("0.3.2");
// Version history array (add more with , "0.1" and so on)
-EXT_SET_VER_HISTORY(array("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"));
+EXT_SET_VER_HISTORY(array("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"));
switch ($EXT_LOAD_MODE)
{
// Update notes (these will be set as task text!)
EXT_SET_UPDATE_NOTES("Diverse Fixes an den Templates (Notice-Hinweise vom PHP-Interpreter entfernt).");
break;
+
+ case "0.3.2": // SQL queries for v0.3.2
+ // This update depends on user update
+ EXT_ADD_UPDATE_DEPENDS("sql_patches");
+
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Hängt nun von <u>ext-user</u> ab.");
+ break;
}
break;
switch ($EXT_LOAD_MODE)
{
case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_cats`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_cats` (
+ `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+INDEX (`userid`),
+INDEX (`cat_id`)
+) TYPE={!type!}");
+
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_data`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_data` (
+ `userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `surname` VARCHAR(255) NOT NULL DEFAULT '',
+ `family` VARCHAR(255) NOT NULL DEFAULT '',
+ `street_nr` VARCHAR(255) NOT NULL DEFAULT '',
+ `country` VARCHAR(4) NOT NULL DEFAULT '',
+ `zip` VARCHAR(6) NOT NULL DEFAULT '',
+ `city` VARCHAR(255) NOT NULL DEFAULT '',
+ `email` VARCHAR(255) NOT NULL DEFAULT '',
+ `birth_day` CHAR(2) NOT NULL DEFAULT '01',
+ `birth_month` CHAR(2) NOT NULL DEFAULT '01',
+ `birth_year` VARCHAR(4) NOT NULL DEFAULT '1970',
+ `password` VARCHAR(32) NOT NULL DEFAULT '',
+ `max_mails` INT(7) NOT NULL DEFAULT 0,
+ `receive_mails` INT(7) NOT NULL DEFAULT 0,
+ `refid` BIGINT(22) NOT NULL DEFAULT 0,
+ `status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
+ `user_hash` VARCHAR(32) NOT NULL DEFAULT '',
+ `REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+ `last_online` VARCHAR(10) NOT NULL DEFAULT 0,
+ `last_module` VARCHAR(255) NOT NULL DEFAULT '',
+ `ref_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `total_logins` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `gender` ENUM('M','F') NOT NULL DEFAULT 'M',
+ `used_points` FLOAT(22,3) NOT NULL DEFAULT '0.000',
+ `emails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `joined` VARCHAR(10) NOT NULL DEFAULT 0,
+ `last_update` VARCHAR(10) NOT NULL DEFAULT 0,
+ `last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0,
+ `notified` ENUM('Y','N') NOT NULL DEFAULT 'N',
+ `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`userid`),
+INDEX (`refid`)
+) TYPE={!type!}");
+
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_points`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_points` (
+ `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
+ `userid` BIGINT(22) NOT NULL DEFAULT 0,
+ `ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+ `points` FLOAT(22,3) NOT NULL DEFAULT '0.000',
+ `locked_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`id`),
+INDEX (`userid`)
+) TYPE={!type!}");
+
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_links`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_links` (
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `link_type` ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL',
+PRIMARY KEY (`id`),
+INDEX (`userid`),
+INDEX (`stats_id`)
+) TYPE={!type!}");
+
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_stats`");
+ ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}user_stats` (
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `subject` VARCHAR(200) NOT NULL DEFAULT '',
+ `url` TINYBLOB NOT NULL,
+ `max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
+ `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+ `timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
+ `timestamp_send` VARCHAR(10) NOT NULL DEFAULT '',
+ BIGINT(20) UNSIGNED NOT NULL,
+PRIMARY KEY (`id`),
+INDEX (`userid`),
+INDEX (`cat_id`),
+INDEX (`payment_id`),
+INDEX (`pool_id`)
+) TYPE={!type!}");
+
+ // Admin menu
ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user',NULL,'Mitglieder-Management','Mitglieder freischalten, sperren, Accounts editieren, Neuanmeldungen verwalten, {!POINTS!} gutschreiben und abziehen und und und...',3)");
ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','del_user','Mitglied löschen','Löschen Sie hier Mitglied, die gegen die AGBs mehrmals verstossen haben. Bitte seien Sie nett zu Ihren Mitgliedern und löschen Sie nicht gleich.',1)");
ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','chk_regs','Anmeldungen prüfen','Prüfen Sie hier neue Anmeldungen zu Ihrem System. Hier können Sie im Falle einer Fehler-Mail den Mitglied gleich wieder löschen!',2)");
// SQL commands to run
ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_user_del`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_cats`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_data`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_points`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_links`");
+ ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}user_stats`");
break;
case "activate": // Do stuff when admin activates this extension
// Add a fatal error message to the queue array
function addFatalMessage ($F, $L, $message, $extra="") {
+ debug_report_bug($message);
if (is_array($extra)) {
// Multiple extras for a message with masks
$message = call_user_func_array('sprintf', $extra);
}
// Activate exchange
function activateExchange () {
+ // Is the extension 'user' there?
+ if (!EXT_IS_ACTIVE("user")) {
+ // Silently abort here
+ return false;
+ } // END - if
+
// Check total amount of users
$totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true, " AND max_mails > 0");
PRIMARY KEY (`id`)
) TYPE={!type!};
-DROP TABLE IF EXISTS `{!prefix!}user_cats`;
-CREATE TABLE `{!prefix!}user_cats` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
- `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `cat_id` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
- PRIMARY KEY (`id`)
-) TYPE={!type!};
-
-DROP TABLE IF EXISTS `{!prefix!}user_data`;
-CREATE TABLE `{!prefix!}user_data` (
- `userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
- `surname` VARCHAR(255) NOT NULL DEFAULT '',
- `family` VARCHAR(255) NOT NULL DEFAULT '',
- `street_nr` VARCHAR(255) NOT NULL DEFAULT '',
- `country` VARCHAR(4) NOT NULL DEFAULT '',
- `zip` VARCHAR(6) NOT NULL DEFAULT '',
- `city` VARCHAR(255) NOT NULL DEFAULT '',
- `email` VARCHAR(255) NOT NULL DEFAULT '',
- `birth_day` CHAR(2) NOT NULL DEFAULT '01',
- `birth_month` CHAR(2) NOT NULL DEFAULT '01',
- `birth_year` VARCHAR(4) NOT NULL DEFAULT '1970',
- `password` VARCHAR(32) NOT NULL DEFAULT '',
- `max_mails` INT(7) NOT NULL DEFAULT 0,
- `receive_mails` INT(7) NOT NULL DEFAULT 0,
- `refid` BIGINT(22) NOT NULL DEFAULT 0,
- `status` ENUM('UNCONFIRMED','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
- `user_hash` VARCHAR(32) NOT NULL DEFAULT '',
- `REMOTE_ADDR` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
- `last_online` VARCHAR(10) NOT NULL DEFAULT 0,
- `last_module` VARCHAR(20) NOT NULL DEFAULT '',
- `ref_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `total_logins` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `gender` ENUM('M','F') NOT NULL DEFAULT 'M',
- `used_points` FLOAT(22,3) NOT NULL DEFAULT '0.000',
- `emails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- PRIMARY KEY (`userid`)
-) TYPE={!type!};
-
-DROP TABLE IF EXISTS `{!prefix!}user_points`;
-CREATE TABLE `{!prefix!}user_points` (
- `id` BIGINT(22) NOT NULL AUTO_INCREMENT,
- `userid` BIGINT(22) NOT NULL DEFAULT 0,
- `ref_depth` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
- `points` FLOAT(22,3) NOT NULL DEFAULT '0.000',
- PRIMARY KEY (`id`)
-) TYPE={!type!};
-
ALTER TABLE `{!prefix!}config` ADD `max_send` TINYINT(3) UNSIGNED NOT NULL DEFAULT '100';
ALTER TABLE `{!prefix!}config` ADD `url_blacklist` ENUM('Y','N') NOT NULL DEFAULT 'Y';
ALTER TABLE `{!prefix!}config` ADD `auto_purge` TINYINT(3) UNSIGNED NOT NULL DEFAULT '14';
ALTER TABLE `{!prefix!}pool` CHANGE `url` `url` TINYBLOB NOT NULL;
ALTER TABLE `{!prefix!}pool` MODIFY `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP';
-DROP TABLE IF EXISTS `{!prefix!}user_links`;
-CREATE TABLE `{!prefix!}user_links` (
- `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
- `stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `link_type` ENUM('NORMAL') NOT NULL DEFAULT 'NORMAL',
- PRIMARY KEY (`id`)
-) TYPE={!type!};
-
-DROP TABLE IF EXISTS `{!prefix!}user_stats`;
-CREATE TABLE `{!prefix!}user_stats` (
- `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
- `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `subject` VARCHAR(200) NOT NULL DEFAULT '',
- `url` TINYBLOB NOT NULL,
- `max_rec` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `timestamp_ordered` VARCHAR(10) NOT NULL DEFAULT '',
- `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
- `timestamp_sstart` VARCHAR(10) NOT NULL DEFAULT '',
- `timestamp_send` VARCHAR(10) NOT NULL DEFAULT '',
- PRIMARY KEY (`id`)
-) TYPE={!type!};
-
-ALTER TABLE `{!prefix!}user_data` ADD `joined` VARCHAR(10) NOT NULL DEFAULT 0;
ALTER TABLE `{!prefix!}config` ADD `last_update` VARCHAR(10) NOT NULL DEFAULT 0;
INSERT INTO `{!prefix!}mod_reg` VALUES (NULL,'chk_login','N','N','N','','N',0);
ALTER TABLE `{!prefix!}pool` MODIFY `data_type` ENUM('TEMP','SEND','NEW','ADMIN','ACTIVE') NOT NULL DEFAULT 'TEMP';
ALTER TABLE `{!prefix!}config` ADD `unconfirmed` BIGINT(20) UNSIGNED NOT NULL DEFAULT '100';
ALTER TABLE `{!prefix!}config` ADD `profile_lock` BIGINT(20) UNSIGNED NOT NULL DEFAULT '86400';
-ALTER TABLE `{!prefix!}user_data` ADD `last_update` VARCHAR(10) NOT NULL DEFAULT 0;
ALTER TABLE `{!prefix!}refbanner` ADD `clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `{!prefix!}config` ADD `online_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1800';
ALTER TABLE `{!prefix!}config` ADD `send_prof_update` ENUM('Y','N') NOT NULL DEFAULT 'Y';
ALTER TABLE `{!prefix!}config` ADD `resend_profile_update` BIGINT(20) UNSIGNED NOT NULL DEFAULT '172800';
-ALTER TABLE `{!prefix!}user_data` ADD `last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0;
-ALTER TABLE `{!prefix!}user_data` ADD `notified` ENUM('Y','N') NOT NULL DEFAULT 'N';
-
ALTER TABLE `{!prefix!}config` ADD `patch_level` VARCHAR(100) NOT NULL DEFAULT '78';
ALTER TABLE `{!prefix!}config` ADD `patch_ctime` VARCHAR(10) NOT NULL DEFAULT 0;
ALTER TABLE `{!prefix!}refsystem` ADD INDEX (`userid`);
ALTER TABLE `{!prefix!}task_system` ADD INDEX (`assigned_admin`);
ALTER TABLE `{!prefix!}task_system` ADD INDEX (`userid`);
-ALTER TABLE `{!prefix!}user_cats` ADD INDEX (`userid`);
-ALTER TABLE `{!prefix!}user_cats` ADD INDEX (`cat_id`);
-ALTER TABLE `{!prefix!}user_data` ADD INDEX (`refid`);
-ALTER TABLE `{!prefix!}user_links` ADD INDEX (`userid`);
-ALTER TABLE `{!prefix!}user_links` ADD INDEX (`stats_id`);
-ALTER TABLE `{!prefix!}user_points` ADD INDEX (`userid`);
-ALTER TABLE `{!prefix!}user_stats` ADD INDEX (`userid`);
-ALTER TABLE `{!prefix!}user_stats` ADD INDEX (`cat_id`);
-ALTER TABLE `{!prefix!}user_stats` ADD INDEX (`payment_id`);
-ALTER TABLE `{!prefix!}user_stats` ADD INDEX (`pool_id`);
-ALTER TABLE `{!prefix!}user_stats` ADD `clicks` BIGINT(20) UNSIGNED NOT NULL;
ALTER TABLE `{!prefix!}config` ADD `code_length` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5;
ALTER TABLE `{!prefix!}config` ADD `guest_stats` ENUM('MEMBERS','MODULES','INACTIVE') NOT NULL DEFAULT 'MEMBERS';
ALTER TABLE `{!prefix!}config` ADD `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5;
-ALTER TABLE `{!prefix!}user_data` ADD `ref_payout` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0;
-ALTER TABLE `{!prefix!}user_points` ADD `locked_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0;
DROP TABLE IF EXISTS `{!prefix!}extensions`;
CREATE TABLE `{!prefix!}extensions` (
ALTER TABLE `{!prefix!}pool` ADD `zip` VARCHAR(6) NOT NULL DEFAULT '';
ALTER TABLE `{!prefix!}task_system` CHANGE `task_type` `task_type` VARCHAR(255) NOT NULL DEFAULT 'FIRST_USER';
-ALTER TABLE `{!prefix!}user_data` MODIFY `zip` VARCHAR(6) NOT NULL DEFAULT '';
-ALTER TABLE `{!prefix!}user_data` MODIFY `last_module` VARCHAR(255) NOT NULL DEFAULT '';
ALTER TABLE `{!prefix!}config` ADD `allow_direct_pay` ENUM('Y','N') NOT NULL DEFAULT 'N';
-ALTER TABLE `{!prefix!}user_data` MODIFY `last_profile_sent` VARCHAR(10) NOT NULL DEFAULT 0;
-ALTER TABLE `{!prefix!}user_data` MODIFY `last_update` VARCHAR(10) NOT NULL DEFAULT 0;
-ALTER TABLE `{!prefix!}user_data` MODIFY `joined` VARCHAR(10) NOT NULL DEFAULT 0;
-ALTER TABLE `{!prefix!}user_data` MODIFY `last_online` VARCHAR(10) NOT NULL DEFAULT 0;