+
+function update_1166() {
+ $r = q("CREATE TABLE IF NOT EXISTS `unique_contacts` (
+ `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ `url` CHAR(255) NOT NULL,
+ `nick` CHAR(255) NOT NULL,
+ `name` CHAR(255) NOT NULL,
+ `avatar` CHAR(255) NOT NULL,
+ INDEX (`url`)
+ ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ");
+ if (!$r)
+ return UPDATE_FAILED;
+
+ return UPDATE_SUCCESS;
+}
+
+function update_1167() {
+ $r = q("ALTER TABLE `contact` ADD `notify_new_posts` TINYINT(1) NOT NULL DEFAULT '0'");
+ if (!$r)
+ return UPDATE_FAILED;
+
+ return UPDATE_SUCCESS;
+}
+
+function update_1168() {
+ $r = q("ALTER TABLE `contact` ADD `fetch_further_information` TINYINT(1) NOT NULL DEFAULT '0'");
+ if (!$r)
+ return UPDATE_FAILED;
+
+ return UPDATE_SUCCESS;
+}
+
+function update_1169() {
+ $r = q("CREATE TABLE IF NOT EXISTS `thread` (
+ `iid` int(10) unsigned NOT NULL DEFAULT '0',
+ `uid` int(10) unsigned NOT NULL DEFAULT '0',
+ `contact-id` int(11) unsigned NOT NULL DEFAULT '0',
+ `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `wall` tinyint(1) NOT NULL DEFAULT '0',
+ `private` tinyint(1) NOT NULL DEFAULT '0',
+ `pubmail` tinyint(1) NOT NULL DEFAULT '0',
+ `moderated` tinyint(1) NOT NULL DEFAULT '0',
+ `visible` tinyint(1) NOT NULL DEFAULT '0',
+ `spam` tinyint(1) NOT NULL DEFAULT '0',
+ `starred` tinyint(1) NOT NULL DEFAULT '0',
+ `bookmark` tinyint(1) NOT NULL DEFAULT '0',
+ `unseen` tinyint(1) NOT NULL DEFAULT '1',
+ `deleted` tinyint(1) NOT NULL DEFAULT '0',
+ `origin` tinyint(1) NOT NULL DEFAULT '0',
+ `forum_mode` tinyint(1) NOT NULL DEFAULT '0',
+ `mention` tinyint(1) NOT NULL DEFAULT '0',
+ `network` char(32) NOT NULL,
+ PRIMARY KEY (`iid`),
+ KEY `created` (`created`),
+ KEY `commented` (`commented`),
+ KEY `uid_network_commented` (`uid`,`network`,`commented`),
+ KEY `uid_network_created` (`uid`,`network`,`created`),
+ KEY `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
+ KEY `uid_contactid_created` (`uid`,`contact-id`,`created`),
+ KEY `wall_private_received` (`wall`,`private`,`received`),
+ KEY `uid_created` (`uid`,`created`),
+ KEY `uid_commented` (`uid`,`commented`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
+ if (!$r)
+ return UPDATE_FAILED;
+
+ proc_run('php',"include/threadupdate.php");
+
+ return UPDATE_SUCCESS;
+}
+
+/*
+==========
+ATTENTION!
+==========
+
+All following update functions are ONLY for jobs that need to run AFTER the database changes are applied.
+
+Database changes are ONLY applied in the file include/dbstructure.php.
+*/
+
+function update_1177() {
+ require_once("mod/profiles.php");
+
+ $profiles = q("SELECT `uid`, `about`, `locality`, `pub_keywords`, `gender` FROM `profile` WHERE `is-default`");
+
+ foreach ($profiles AS $profile) {
+ if ($profile["about"].$profile["locality"].$profile["pub_keywords"].$profile["gender"] == "")
+ continue;
+
+ $profile["pub_keywords"] = profile_clean_keywords($profile["pub_keywords"]);
+
+ $r = q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d",
+ dbesc($profile["about"]),
+ dbesc($profile["locality"]),
+ dbesc($profile["pub_keywords"]),
+ dbesc($profile["gender"]),
+ intval($profile["uid"])
+ );
+ }
+}
+
+function update_1178() {
+ if (get_config('system','no_community_page'))
+ set_config('system','community_page_style', CP_NO_COMMUNITY_PAGE);
+
+ // Update the central item storage with uid=0
+ proc_run('php',"include/threadupdate.php");
+
+ return UPDATE_SUCCESS;
+}