diff --git a/boot.php b/boot.php index 497a97b0ec..2242ba476d 100644 --- a/boot.php +++ b/boot.php @@ -36,7 +36,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_VERSION', '3.5-dev' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1191 ); +define ( 'DB_UPDATE_VERSION', 1193 ); /** * @brief Constant with a HTML line break. @@ -467,6 +467,7 @@ class App { public $is_tablet; public $is_friendica_app; public $performance = array(); + public $callstack = array(); public $nav_sel; @@ -554,6 +555,12 @@ class App { $this->performance["marktime"] = 0; $this->performance["markstart"] = microtime(true); + $this->callstack["database"] = array(); + $this->callstack["network"] = array(); + $this->callstack["file"] = array(); + $this->callstack["rendering"] = array(); + $this->callstack["parser"] = array(); + $this->config = array(); $this->page = array(); $this->pager= array(); @@ -903,6 +910,10 @@ class App { } function get_cached_avatar_image($avatar_image){ + return $avatar_image; + + // The following code is deactivated. It doesn't seem to make any sense and it slows down the system. + /* if($this->cached_profile_image[$avatar_image]) return $this->cached_profile_image[$avatar_image]; @@ -922,6 +933,7 @@ class App { } } return $this->cached_profile_image[$avatar_image]; + */ } @@ -1016,6 +1028,20 @@ class App { $this->performance[$value] += (float)$duration; $this->performance["marktime"] += (float)$duration; + + // Trace the different functions with their timestamps + $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5); + + array_shift($trace); + + $function = array(); + foreach ($trace AS $func) + $function[] = $func["function"]; + + $function = implode(", ", $function); + + $this->callstack[$value][$function] += (float)$duration; + } function mark_timestamp($mark) { diff --git a/database.sql b/database.sql index e3768c1efb..70b315ea24 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ --- Friendica 3.4.2 (Lily of the valley) --- DB_UPDATE_VERSION 1190 +-- Friendica 3.5-dev (Asparagus) +-- DB_UPDATE_VERSION 1193 -- ------------------------------------------ @@ -8,20 +8,21 @@ -- TABLE addon -- CREATE TABLE IF NOT EXISTS `addon` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL DEFAULT '', `version` varchar(255) NOT NULL DEFAULT '', `installed` tinyint(1) NOT NULL DEFAULT 0, `hidden` tinyint(1) NOT NULL DEFAULT 0, `timestamp` bigint(20) NOT NULL DEFAULT 0, - `plugin_admin` tinyint(1) NOT NULL DEFAULT 0 + `plugin_admin` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE attach -- CREATE TABLE IF NOT EXISTS `attach` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `hash` varchar(64) NOT NULL DEFAULT '', `filename` varchar(255) NOT NULL DEFAULT '', @@ -33,28 +34,31 @@ CREATE TABLE IF NOT EXISTS `attach` ( `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, - `deny_gid` mediumtext NOT NULL + `deny_gid` mediumtext NOT NULL, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE auth_codes -- CREATE TABLE IF NOT EXISTS `auth_codes` ( - `id` varchar(40) NOT NULL PRIMARY KEY, + `id` varchar(40) NOT NULL, `client_id` varchar(20) NOT NULL DEFAULT '', `redirect_uri` varchar(200) NOT NULL DEFAULT '', `expires` int(11) NOT NULL DEFAULT 0, - `scope` varchar(250) NOT NULL DEFAULT '' + `scope` varchar(250) NOT NULL DEFAULT '', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE cache -- CREATE TABLE IF NOT EXISTS `cache` ( - `k` varchar(255) NOT NULL PRIMARY KEY, + `k` varchar(255) NOT NULL, `v` text NOT NULL, `expire_mode` int(11) NOT NULL DEFAULT 0, `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`k`), INDEX `updated` (`updated`) ) DEFAULT CHARSET=utf8; @@ -62,34 +66,37 @@ CREATE TABLE IF NOT EXISTS `cache` ( -- TABLE challenge -- CREATE TABLE IF NOT EXISTS `challenge` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `challenge` varchar(255) NOT NULL DEFAULT '', `dfrn-id` varchar(255) NOT NULL DEFAULT '', `expire` int(11) NOT NULL DEFAULT 0, `type` varchar(255) NOT NULL DEFAULT '', - `last_update` varchar(255) NOT NULL DEFAULT '' + `last_update` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE clients -- CREATE TABLE IF NOT EXISTS `clients` ( - `client_id` varchar(20) NOT NULL PRIMARY KEY, + `client_id` varchar(20) NOT NULL, `pw` varchar(20) NOT NULL DEFAULT '', `redirect_uri` varchar(200) NOT NULL DEFAULT '', `name` text, `icon` text, - `uid` int(11) NOT NULL DEFAULT 0 + `uid` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`client_id`) ) DEFAULT CHARSET=utf8; -- -- TABLE config -- CREATE TABLE IF NOT EXISTS `config` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `cat` varchar(255) NOT NULL DEFAULT '', `k` varchar(255) NOT NULL DEFAULT '', `v` text NOT NULL, + PRIMARY KEY(`id`), INDEX `cat_k` (`cat`(30),`k`(30)) ) DEFAULT CHARSET=utf8; @@ -97,7 +104,7 @@ CREATE TABLE IF NOT EXISTS `config` ( -- TABLE contact -- CREATE TABLE IF NOT EXISTS `contact` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `self` tinyint(1) NOT NULL DEFAULT 0, @@ -162,6 +169,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `notify_new_posts` tinyint(1) NOT NULL DEFAULT 0, `fetch_further_information` tinyint(1) NOT NULL DEFAULT 0, `ffi_keyword_blacklist` mediumtext NOT NULL, + PRIMARY KEY(`id`), INDEX `uid` (`uid`) ) DEFAULT CHARSET=utf8; @@ -169,7 +177,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( -- TABLE conv -- CREATE TABLE IF NOT EXISTS `conv` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `guid` varchar(64) NOT NULL DEFAULT '', `recips` mediumtext NOT NULL, `uid` int(11) NOT NULL DEFAULT 0, @@ -177,6 +185,7 @@ CREATE TABLE IF NOT EXISTS `conv` ( `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `subject` mediumtext NOT NULL, + PRIMARY KEY(`id`), INDEX `uid` (`uid`) ) DEFAULT CHARSET=utf8; @@ -184,27 +193,29 @@ CREATE TABLE IF NOT EXISTS `conv` ( -- TABLE deliverq -- CREATE TABLE IF NOT EXISTS `deliverq` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `cmd` varchar(32) NOT NULL DEFAULT '', `item` int(11) NOT NULL DEFAULT 0, - `contact` int(11) NOT NULL DEFAULT 0 + `contact` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE dsprphotoq -- CREATE TABLE IF NOT EXISTS `dsprphotoq` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `msg` mediumtext NOT NULL, - `attempt` tinyint(4) NOT NULL DEFAULT 0 + `attempt` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE event -- CREATE TABLE IF NOT EXISTS `event` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `cid` int(11) NOT NULL DEFAULT 0, `uri` varchar(255) NOT NULL DEFAULT '', @@ -223,6 +234,7 @@ CREATE TABLE IF NOT EXISTS `event` ( `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, `deny_gid` mediumtext NOT NULL, + PRIMARY KEY(`id`), INDEX `uid` (`uid`) ) DEFAULT CHARSET=utf8; @@ -230,7 +242,7 @@ CREATE TABLE IF NOT EXISTS `event` ( -- TABLE fcontact -- CREATE TABLE IF NOT EXISTS `fcontact` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `url` varchar(255) NOT NULL DEFAULT '', `name` varchar(255) NOT NULL DEFAULT '', `photo` varchar(255) NOT NULL DEFAULT '', @@ -246,6 +258,7 @@ CREATE TABLE IF NOT EXISTS `fcontact` ( `alias` varchar(255) NOT NULL DEFAULT '', `pubkey` text NOT NULL, `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`), INDEX `addr` (`addr`) ) DEFAULT CHARSET=utf8; @@ -253,20 +266,22 @@ CREATE TABLE IF NOT EXISTS `fcontact` ( -- TABLE ffinder -- CREATE TABLE IF NOT EXISTS `ffinder` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `cid` int(10) unsigned NOT NULL DEFAULT 0, - `fid` int(10) unsigned NOT NULL DEFAULT 0 + `fid` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE fserver -- CREATE TABLE IF NOT EXISTS `fserver` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `server` varchar(255) NOT NULL DEFAULT '', `posturl` varchar(255) NOT NULL DEFAULT '', `key` text NOT NULL, + PRIMARY KEY(`id`), INDEX `server` (`server`) ) DEFAULT CHARSET=utf8; @@ -274,7 +289,7 @@ CREATE TABLE IF NOT EXISTS `fserver` ( -- TABLE fsuggest -- CREATE TABLE IF NOT EXISTS `fsuggest` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `cid` int(11) NOT NULL DEFAULT 0, `name` varchar(255) NOT NULL DEFAULT '', @@ -282,16 +297,18 @@ CREATE TABLE IF NOT EXISTS `fsuggest` ( `request` varchar(255) NOT NULL DEFAULT '', `photo` varchar(255) NOT NULL DEFAULT '', `note` text NOT NULL, - `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE gcign -- CREATE TABLE IF NOT EXISTS `gcign` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `gcid` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `uid` (`uid`), INDEX `gcid` (`gcid`) ) DEFAULT CHARSET=utf8; @@ -300,7 +317,7 @@ CREATE TABLE IF NOT EXISTS `gcign` ( -- TABLE gcontact -- CREATE TABLE IF NOT EXISTS `gcontact` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL DEFAULT '', `nick` varchar(255) NOT NULL DEFAULT '', `url` varchar(255) NOT NULL DEFAULT '', @@ -315,11 +332,17 @@ CREATE TABLE IF NOT EXISTS `gcontact` ( `about` text NOT NULL, `keywords` text NOT NULL, `gender` varchar(32) NOT NULL DEFAULT '', + `birthday` varchar(32) NOT NULL DEFAULT '0000-00-00', `community` tinyint(1) NOT NULL DEFAULT 0, + `hide` tinyint(1) NOT NULL DEFAULT 0, + `nsfw` tinyint(1) NOT NULL DEFAULT 0, `network` varchar(255) NOT NULL DEFAULT '', `addr` varchar(255) NOT NULL DEFAULT '', + `notify` text NOT NULL, + `alias` varchar(255) NOT NULL DEFAULT '', `generation` tinyint(3) NOT NULL DEFAULT 0, `server_url` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `nurl` (`nurl`), INDEX `updated` (`updated`) ) DEFAULT CHARSET=utf8; @@ -328,12 +351,13 @@ CREATE TABLE IF NOT EXISTS `gcontact` ( -- TABLE glink -- CREATE TABLE IF NOT EXISTS `glink` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `cid` int(11) NOT NULL DEFAULT 0, `uid` int(11) NOT NULL DEFAULT 0, `gcid` int(11) NOT NULL DEFAULT 0, `zcid` int(11) NOT NULL DEFAULT 0, `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`), INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`), INDEX `gcid` (`gcid`), INDEX `zcid` (`zcid`) @@ -343,11 +367,12 @@ CREATE TABLE IF NOT EXISTS `glink` ( -- TABLE group -- CREATE TABLE IF NOT EXISTS `group` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `visible` tinyint(1) NOT NULL DEFAULT 0, `deleted` tinyint(1) NOT NULL DEFAULT 0, `name` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `uid` (`uid`) ) DEFAULT CHARSET=utf8; @@ -355,10 +380,11 @@ CREATE TABLE IF NOT EXISTS `group` ( -- TABLE group_member -- CREATE TABLE IF NOT EXISTS `group_member` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `gid` int(10) unsigned NOT NULL DEFAULT 0, `contact-id` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `uid_gid_contactid` (`uid`,`gid`,`contact-id`) ) DEFAULT CHARSET=utf8; @@ -366,7 +392,7 @@ CREATE TABLE IF NOT EXISTS `group_member` ( -- TABLE gserver -- CREATE TABLE IF NOT EXISTS `gserver` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `url` varchar(255) NOT NULL DEFAULT '', `nurl` varchar(255) NOT NULL DEFAULT '', `version` varchar(255) NOT NULL DEFAULT '', @@ -381,6 +407,7 @@ CREATE TABLE IF NOT EXISTS `gserver` ( `last_poco_query` datetime DEFAULT '0000-00-00 00:00:00', `last_contact` datetime DEFAULT '0000-00-00 00:00:00', `last_failure` datetime DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`), INDEX `nurl` (`nurl`) ) DEFAULT CHARSET=utf8; @@ -388,11 +415,12 @@ CREATE TABLE IF NOT EXISTS `gserver` ( -- TABLE guid -- CREATE TABLE IF NOT EXISTS `guid` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `guid` varchar(255) NOT NULL DEFAULT '', `plink` varchar(255) NOT NULL DEFAULT '', `uri` varchar(255) NOT NULL DEFAULT '', `network` varchar(32) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `guid` (`guid`), INDEX `plink` (`plink`), INDEX `uri` (`uri`) @@ -402,11 +430,12 @@ CREATE TABLE IF NOT EXISTS `guid` ( -- TABLE hook -- CREATE TABLE IF NOT EXISTS `hook` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `hook` varchar(255) NOT NULL DEFAULT '', `file` varchar(255) NOT NULL DEFAULT '', `function` varchar(255) NOT NULL DEFAULT '', `priority` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `hook_file_function` (`hook`(30),`file`(60),`function`(30)) ) DEFAULT CHARSET=utf8; @@ -414,7 +443,7 @@ CREATE TABLE IF NOT EXISTS `hook` ( -- TABLE intro -- CREATE TABLE IF NOT EXISTS `intro` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `fid` int(11) NOT NULL DEFAULT 0, `contact-id` int(11) NOT NULL DEFAULT 0, @@ -424,18 +453,20 @@ CREATE TABLE IF NOT EXISTS `intro` ( `hash` varchar(255) NOT NULL DEFAULT '', `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `blocked` tinyint(1) NOT NULL DEFAULT 1, - `ignore` tinyint(1) NOT NULL DEFAULT 0 + `ignore` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE item -- CREATE TABLE IF NOT EXISTS `item` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `guid` varchar(255) NOT NULL DEFAULT '', `uri` varchar(255) NOT NULL DEFAULT '', `uid` int(10) unsigned NOT NULL DEFAULT 0, `contact-id` int(11) NOT NULL DEFAULT 0, + `gcontact-id` int(11) unsigned NOT NULL DEFAULT 0, `type` varchar(255) NOT NULL DEFAULT '', `wall` tinyint(1) NOT NULL DEFAULT 0, `gravity` tinyint(1) NOT NULL DEFAULT 0, @@ -493,6 +524,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `rendered-hash` varchar(32) NOT NULL DEFAULT '', `rendered-html` mediumtext NOT NULL, `global` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `guid` (`guid`), INDEX `uri` (`uri`), INDEX `parent` (`parent`), @@ -509,6 +541,7 @@ CREATE TABLE IF NOT EXISTS `item` ( INDEX `uid_thrparent` (`uid`,`thr-parent`), INDEX `uid_parenturi` (`uid`,`parent-uri`), INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), + INDEX `gcontactid_uid_created` (`gcontact-id`,`uid`,`created`), INDEX `wall_body` (`wall`,`body`(6)), INDEX `uid_visible_moderated_created` (`uid`,`visible`,`moderated`,`created`), INDEX `uid_uri` (`uid`,`uri`), @@ -531,11 +564,12 @@ CREATE TABLE IF NOT EXISTS `item` ( -- TABLE item_id -- CREATE TABLE IF NOT EXISTS `item_id` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `iid` int(11) NOT NULL DEFAULT 0, `uid` int(11) NOT NULL DEFAULT 0, `sid` varchar(255) NOT NULL DEFAULT '', `service` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `uid` (`uid`), INDEX `sid` (`sid`), INDEX `service` (`service`), @@ -546,17 +580,18 @@ CREATE TABLE IF NOT EXISTS `item_id` ( -- TABLE locks -- CREATE TABLE IF NOT EXISTS `locks` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `name` varchar(128) NOT NULL DEFAULT '', `locked` tinyint(1) NOT NULL DEFAULT 0, - `created` datetime DEFAULT '0000-00-00 00:00:00' + `created` datetime DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE mail -- CREATE TABLE IF NOT EXISTS `mail` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `guid` varchar(64) NOT NULL DEFAULT '', `from-name` varchar(255) NOT NULL DEFAULT '', @@ -573,6 +608,7 @@ CREATE TABLE IF NOT EXISTS `mail` ( `uri` varchar(255) NOT NULL DEFAULT '', `parent-uri` varchar(255) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`), INDEX `uid` (`uid`), INDEX `guid` (`guid`), INDEX `convid` (`convid`), @@ -585,7 +621,7 @@ CREATE TABLE IF NOT EXISTS `mail` ( -- TABLE mailacct -- CREATE TABLE IF NOT EXISTS `mailacct` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `server` varchar(255) NOT NULL DEFAULT '', `port` int(11) NOT NULL DEFAULT 0, @@ -597,16 +633,18 @@ CREATE TABLE IF NOT EXISTS `mailacct` ( `action` int(11) NOT NULL DEFAULT 0, `movetofolder` varchar(255) NOT NULL DEFAULT '', `pubmail` tinyint(1) NOT NULL DEFAULT 0, - `last_check` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' + `last_check` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE manage -- CREATE TABLE IF NOT EXISTS `manage` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `mid` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `uid_mid` (`uid`,`mid`) ) DEFAULT CHARSET=utf8; @@ -614,7 +652,7 @@ CREATE TABLE IF NOT EXISTS `manage` ( -- TABLE notify -- CREATE TABLE IF NOT EXISTS `notify` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `hash` varchar(64) NOT NULL DEFAULT '', `type` int(11) NOT NULL DEFAULT 0, `name` varchar(255) NOT NULL DEFAULT '', @@ -629,6 +667,7 @@ CREATE TABLE IF NOT EXISTS `notify` ( `seen` tinyint(1) NOT NULL DEFAULT 0, `verb` varchar(255) NOT NULL DEFAULT '', `otype` varchar(16) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `uid` (`uid`) ) DEFAULT CHARSET=utf8; @@ -636,24 +675,50 @@ CREATE TABLE IF NOT EXISTS `notify` ( -- TABLE notify-threads -- CREATE TABLE IF NOT EXISTS `notify-threads` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `notify-id` int(11) NOT NULL DEFAULT 0, `master-parent-item` int(10) unsigned NOT NULL DEFAULT 0, `parent-item` int(10) unsigned NOT NULL DEFAULT 0, `receiver-uid` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `master-parent-item` (`master-parent-item`), INDEX `receiver-uid` (`receiver-uid`) ) DEFAULT CHARSET=utf8; +-- +-- TABLE oembed +-- +CREATE TABLE IF NOT EXISTS `oembed` ( + `url` varchar(255) NOT NULL, + `content` text NOT NULL, + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`url`), + INDEX `created` (`created`) +) DEFAULT CHARSET=utf8; + +-- +-- TABLE parsed_url +-- +CREATE TABLE IF NOT EXISTS `parsed_url` ( + `url` varchar(255) NOT NULL, + `guessing` tinyint(1) NOT NULL DEFAULT 0, + `oembed` tinyint(1) NOT NULL DEFAULT 0, + `content` text NOT NULL, + `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`url`,`guessing`,`oembed`), + INDEX `created` (`created`) +) DEFAULT CHARSET=utf8; + -- -- TABLE pconfig -- CREATE TABLE IF NOT EXISTS `pconfig` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `cat` varchar(255) NOT NULL DEFAULT '', `k` varchar(255) NOT NULL DEFAULT '', `v` mediumtext NOT NULL, + PRIMARY KEY(`id`), INDEX `uid_cat_k` (`uid`,`cat`(30),`k`(30)) ) DEFAULT CHARSET=utf8; @@ -661,7 +726,7 @@ CREATE TABLE IF NOT EXISTS `pconfig` ( -- TABLE photo -- CREATE TABLE IF NOT EXISTS `photo` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `contact-id` int(10) unsigned NOT NULL DEFAULT 0, `guid` varchar(64) NOT NULL DEFAULT '', @@ -683,6 +748,7 @@ CREATE TABLE IF NOT EXISTS `photo` ( `allow_gid` mediumtext NOT NULL, `deny_cid` mediumtext NOT NULL, `deny_gid` mediumtext NOT NULL, + PRIMARY KEY(`id`), INDEX `uid` (`uid`), INDEX `resource-id` (`resource-id`), INDEX `guid` (`guid`) @@ -692,7 +758,7 @@ CREATE TABLE IF NOT EXISTS `photo` ( -- TABLE poll -- CREATE TABLE IF NOT EXISTS `poll` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `q0` mediumtext NOT NULL, `q1` mediumtext NOT NULL, @@ -704,6 +770,7 @@ CREATE TABLE IF NOT EXISTS `poll` ( `q7` mediumtext NOT NULL, `q8` mediumtext NOT NULL, `q9` mediumtext NOT NULL, + PRIMARY KEY(`id`), INDEX `uid` (`uid`) ) DEFAULT CHARSET=utf8; @@ -711,9 +778,10 @@ CREATE TABLE IF NOT EXISTS `poll` ( -- TABLE poll_result -- CREATE TABLE IF NOT EXISTS `poll_result` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `poll_id` int(11) NOT NULL DEFAULT 0, `choice` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `poll_id` (`poll_id`), INDEX `choice` (`choice`) ) DEFAULT CHARSET=utf8; @@ -722,7 +790,7 @@ CREATE TABLE IF NOT EXISTS `poll_result` ( -- TABLE profile -- CREATE TABLE IF NOT EXISTS `profile` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `profile-name` varchar(255) NOT NULL DEFAULT '', `is-default` tinyint(1) NOT NULL DEFAULT 0, @@ -763,6 +831,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `thumb` varchar(255) NOT NULL DEFAULT '', `publish` tinyint(1) NOT NULL DEFAULT 0, `net-publish` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `hometown` (`hometown`) ) DEFAULT CHARSET=utf8; @@ -770,39 +839,42 @@ CREATE TABLE IF NOT EXISTS `profile` ( -- TABLE profile_check -- CREATE TABLE IF NOT EXISTS `profile_check` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `uid` int(10) unsigned NOT NULL DEFAULT 0, `cid` int(10) unsigned NOT NULL DEFAULT 0, `dfrn_id` varchar(255) NOT NULL DEFAULT '', `sec` varchar(255) NOT NULL DEFAULT '', - `expire` int(11) NOT NULL DEFAULT 0 + `expire` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE push_subscriber -- CREATE TABLE IF NOT EXISTS `push_subscriber` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `callback_url` varchar(255) NOT NULL DEFAULT '', `topic` varchar(255) NOT NULL DEFAULT '', `nickname` varchar(255) NOT NULL DEFAULT '', `push` int(11) NOT NULL DEFAULT 0, `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `secret` varchar(255) NOT NULL DEFAULT '' + `secret` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE queue -- CREATE TABLE IF NOT EXISTS `queue` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `cid` int(11) NOT NULL DEFAULT 0, `network` varchar(32) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `content` mediumtext NOT NULL, `batch` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `cid` (`cid`), INDEX `created` (`created`), INDEX `last` (`last`), @@ -814,21 +886,23 @@ CREATE TABLE IF NOT EXISTS `queue` ( -- TABLE register -- CREATE TABLE IF NOT EXISTS `register` ( - `id` int(11) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(11) unsigned NOT NULL auto_increment, `hash` varchar(255) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `uid` int(11) unsigned NOT NULL DEFAULT 0, `password` varchar(255) NOT NULL DEFAULT '', - `language` varchar(16) NOT NULL DEFAULT '' + `language` varchar(16) NOT NULL DEFAULT '', + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE search -- CREATE TABLE IF NOT EXISTS `search` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `term` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `uid` (`uid`), INDEX `term` (`term`) ) DEFAULT CHARSET=utf8; @@ -837,10 +911,11 @@ CREATE TABLE IF NOT EXISTS `search` ( -- TABLE session -- CREATE TABLE IF NOT EXISTS `session` ( - `id` bigint(20) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` bigint(20) unsigned NOT NULL auto_increment, `sid` varchar(255) NOT NULL DEFAULT '', `data` text NOT NULL, `expire` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY(`id`), INDEX `sid` (`sid`), INDEX `expire` (`expire`) ) DEFAULT CHARSET=utf8; @@ -849,12 +924,13 @@ CREATE TABLE IF NOT EXISTS `session` ( -- TABLE sign -- CREATE TABLE IF NOT EXISTS `sign` ( - `id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `id` int(10) unsigned NOT NULL auto_increment, `iid` int(10) unsigned NOT NULL DEFAULT 0, `retract_iid` int(10) unsigned NOT NULL DEFAULT 0, `signed_text` mediumtext NOT NULL, `signature` text NOT NULL, `signer` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY(`id`), INDEX `iid` (`iid`), INDEX `retract_iid` (`retract_iid`) ) DEFAULT CHARSET=utf8; @@ -863,12 +939,13 @@ CREATE TABLE IF NOT EXISTS `sign` ( -- TABLE spam -- CREATE TABLE IF NOT EXISTS `spam` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `uid` int(11) NOT NULL DEFAULT 0, `spam` int(11) NOT NULL DEFAULT 0, `ham` int(11) NOT NULL DEFAULT 0, `term` varchar(255) NOT NULL DEFAULT '', `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`), INDEX `uid` (`uid`), INDEX `spam` (`spam`), INDEX `ham` (`ham`), @@ -879,7 +956,7 @@ CREATE TABLE IF NOT EXISTS `spam` ( -- TABLE term -- CREATE TABLE IF NOT EXISTS `term` ( - `tid` int(10) unsigned NOT NULL auto_increment PRIMARY KEY, + `tid` int(10) unsigned NOT NULL auto_increment, `oid` int(10) unsigned NOT NULL DEFAULT 0, `otype` tinyint(3) unsigned NOT NULL DEFAULT 0, `type` tinyint(3) unsigned NOT NULL DEFAULT 0, @@ -891,6 +968,7 @@ CREATE TABLE IF NOT EXISTS `term` ( `global` tinyint(1) NOT NULL DEFAULT 0, `aid` int(10) unsigned NOT NULL DEFAULT 0, `uid` int(10) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY(`tid`), INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`), INDEX `uid_term_tid` (`uid`,`term`,`tid`), INDEX `type_term` (`type`,`term`), @@ -903,9 +981,10 @@ CREATE TABLE IF NOT EXISTS `term` ( -- TABLE thread -- CREATE TABLE IF NOT EXISTS `thread` ( - `iid` int(10) unsigned NOT NULL DEFAULT 0 PRIMARY KEY, + `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, + `gcontact-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', @@ -926,12 +1005,15 @@ CREATE TABLE IF NOT EXISTS `thread` ( `forum_mode` tinyint(1) NOT NULL DEFAULT 0, `mention` tinyint(1) NOT NULL DEFAULT 0, `network` varchar(32) NOT NULL DEFAULT '', + PRIMARY KEY(`iid`), INDEX `created` (`created`), INDEX `commented` (`commented`), INDEX `uid_network_commented` (`uid`,`network`,`commented`), INDEX `uid_network_created` (`uid`,`network`,`created`), INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`), INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`), + INDEX `uid_gcontactid_commented` (`uid`,`gcontact-id`,`commented`), + INDEX `uid_gcontactid_created` (`uid`,`gcontact-id`,`created`), INDEX `wall_private_received` (`wall`,`private`,`received`), INDEX `uid_created` (`uid`,`created`), INDEX `uid_commented` (`uid`,`commented`) @@ -941,33 +1023,20 @@ CREATE TABLE IF NOT EXISTS `thread` ( -- TABLE tokens -- CREATE TABLE IF NOT EXISTS `tokens` ( - `id` varchar(40) NOT NULL PRIMARY KEY, + `id` varchar(40) NOT NULL, `secret` text NOT NULL, `client_id` varchar(20) NOT NULL DEFAULT '', `expires` int(11) NOT NULL DEFAULT 0, `scope` varchar(200) NOT NULL DEFAULT '', - `uid` int(11) NOT NULL DEFAULT 0 -) DEFAULT CHARSET=utf8; - --- --- TABLE unique_contacts --- -CREATE TABLE IF NOT EXISTS `unique_contacts` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, - `url` varchar(255) NOT NULL DEFAULT '', - `nick` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) NOT NULL DEFAULT '', - `avatar` varchar(255) NOT NULL DEFAULT '', - `location` varchar(255) NOT NULL DEFAULT '', - `about` text NOT NULL, - INDEX `url` (`url`) + `uid` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY(`id`) ) DEFAULT CHARSET=utf8; -- -- TABLE user -- CREATE TABLE IF NOT EXISTS `user` ( - `uid` int(11) NOT NULL auto_increment PRIMARY KEY, + `uid` int(11) NOT NULL auto_increment, `guid` varchar(64) NOT NULL DEFAULT '', `username` varchar(255) NOT NULL DEFAULT '', `password` varchar(255) NOT NULL DEFAULT '', @@ -1009,6 +1078,7 @@ CREATE TABLE IF NOT EXISTS `user` ( `deny_cid` mediumtext NOT NULL, `deny_gid` mediumtext NOT NULL, `openidserver` text NOT NULL, + PRIMARY KEY(`uid`), INDEX `nickname` (`nickname`) ) DEFAULT CHARSET=utf8; @@ -1016,8 +1086,9 @@ CREATE TABLE IF NOT EXISTS `user` ( -- TABLE userd -- CREATE TABLE IF NOT EXISTS `userd` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `username` varchar(255) NOT NULL, + PRIMARY KEY(`id`), INDEX `username` (`username`) ) DEFAULT CHARSET=utf8; @@ -1025,12 +1096,13 @@ CREATE TABLE IF NOT EXISTS `userd` ( -- TABLE workerqueue -- CREATE TABLE IF NOT EXISTS `workerqueue` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `id` int(11) NOT NULL auto_increment, `parameter` text NOT NULL, `priority` tinyint(3) unsigned NOT NULL DEFAULT 0, `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `pid` int(11) NOT NULL DEFAULT 0, `executed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY(`id`), INDEX `created` (`created`) ) DEFAULT CHARSET=utf8; diff --git a/doc/Settings.md b/doc/Settings.md index ae7d916078..86254cb29e 100644 --- a/doc/Settings.md +++ b/doc/Settings.md @@ -24,6 +24,9 @@ You are not required to provide the year. System settings --- +**Settings should be done in the admin panel** (/admin). +Those settings found in the database, will always override the settings added to the ``.htconfig.php`` file. + ###Language Please see util/README for information on creating language translations. @@ -219,6 +222,8 @@ LOGGER_DEBUG will show a good deal of information about system activity but will You may also select LOGGER_ALL but due to the volume of information we recommend only enabling this when you are tracking down a specific problem. Other log levels are possible but are not being used at the present time. +Please be aware that turning on the logging can fill up the disk space on your server relatively quick. +You should take preventions with e.g. [logrotate](https://en.wikipedia.org/wiki/Log_rotation) or similar tools. ###PHP error logging @@ -237,4 +242,6 @@ The vast majority of issues reported at these levels are completely harmless. Please report to the developers any errors you encounter in the logs using the recommended settings above. They generally indicate issues which need to be resolved. -If you encounter a blank (white) page when using the application, view the PHP logs - as this almost always indicates an error has occurred. +If you encounter a blank (white) page when using the application, view the PHP logs - as this almost always indicates an error has occurred. + +*Note*: PHP logging cannot be activated from the admin panel but has to be configured from the ``.htconfig.php`` file. diff --git a/doc/database.md b/doc/database.md index 1893f77d0c..a0b28f4e84 100644 --- a/doc/database.md +++ b/doc/database.md @@ -38,6 +38,8 @@ Database Tables | [manage](help/database/db_manage) | table of accounts that can "su" each other | | [notify](help/database/db_notify) | notifications | | [notify-threads](help/database/db_notify-threads) | | +| [oembed](help/database/db_oembed) | cache for OEmbed queries | +| [parsed_url](help/database/db_parsed_url) | cache for "parse_url" queries | | [pconfig](help/database/db_pconfig) | personal (per user) configuration storage | | [photo](help/database/db_photo) | photo storage | | [poll](help/database/db_poll) | data for polls | @@ -54,7 +56,6 @@ Database Tables | [term](help/database/db_term) | item taxonomy (categories, tags, etc.) table | | [thread](help/database/db_thread) | | | [tokens](help/database/db_tokens) | OAuth usage | -| [unique_contacts](help/database/db_unique_contacts) | | | [user](help/database/db_user) | local user table | | [userd](help/database/db_userd) | | | [workerqueue](help/database/db_workerqueue) | | diff --git a/doc/database/db_gcontact.md b/doc/database/db_gcontact.md index 8e9de43c96..c47e726228 100644 --- a/doc/database/db_gcontact.md +++ b/doc/database/db_gcontact.md @@ -18,9 +18,14 @@ Table gcontact | about | | text | NO | | NULL | | | keywords | puplic keywords (interests) | text | NO | | NULL | | | gender | | varchar(32) | NO | | | | +| birthday | | varchar(32) | NO | | 0000-00-00 | | | community | 1 if contact is forum account | tinyint(1) | NO | | 0 | | +| hide | 1 = should be hidden from search | tinyint(1) | NO | | 0 | | +| nsfw | 1 = contact posts nsfw content | tinyint(1) | NO | | 0 | | | network | social network protocol | varchar(255) | NO | | | | | addr | | varchar(255) | NO | | | | +| notify | | text | NO | | | | +| alias | | varchar(255) | NO | | | | | generation | | tinyint(3) | NO | | 0 | | | server_url | baseurl of the contacts server | varchar(255) | NO | | | | diff --git a/doc/database/db_item.md b/doc/database/db_item.md index 3ed986a781..00fa213c89 100644 --- a/doc/database/db_item.md +++ b/doc/database/db_item.md @@ -8,6 +8,7 @@ Table item | uri | | varchar(255) | NO | MUL | | | | uid | user.id which owns this copy of the item | int(10) unsigned | NO | MUL | 0 | | | contact-id | contact.id | int(11) | NO | MUL | 0 | | +| gcontact-id | ID of the global contact | int(11) | NO | MUL | 0 | | | type | | varchar(255) | NO | | | | | wall | This item was posted to the wall of uid | tinyint(1) | NO | MUL | 0 | | | gravity | | tinyint(1) | NO | | 0 | | diff --git a/doc/database/db_oembed.md b/doc/database/db_oembed.md new file mode 100644 index 0000000000..5e994eca39 --- /dev/null +++ b/doc/database/db_oembed.md @@ -0,0 +1,10 @@ +Table oembed +============ + +| Field | Description | Type | Null | Key | Default | Extra | +| ------------ | ---------------------------------- | ------------ | ---- | --- | ------------------- | ----- | +| url | page url | varchar(255) | NO | PRI | NULL | | +| content | OEmbed data of the page | text | NO | | NULL | | +| created | datetime of creation | datetime | NO | MUL | 0000-00-00 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_parsed_url.md b/doc/database/db_parsed_url.md new file mode 100644 index 0000000000..ada42c2ea6 --- /dev/null +++ b/doc/database/db_parsed_url.md @@ -0,0 +1,12 @@ +Table parsed_url +================ + +| Field | Description | Type | Null | Key | Default | Extra | +| ------------ | ---------------------------------- | ------------ | ---- | --- | ------------------- | ----- | +| url | page url | varchar(255) | NO | PRI | NULL | | +| guessing | is the "guessing" mode active? | tinyint(1) | NO | PRI | 0 | | +| oembed | is the data the result of oembed? | tinyint(1) | NO | PRI | 0 | | +| content | page data | text | NO | | NULL | | +| created | datetime of creation | datetime | NO | MUL | 0000-00-00 00:00:00 | | + +Return to [database documentation](help/database) diff --git a/doc/database/db_thread.md b/doc/database/db_thread.md index 78af5cb37a..4c912bec10 100644 --- a/doc/database/db_thread.md +++ b/doc/database/db_thread.md @@ -1,30 +1,31 @@ Table thread ============ -| Field | Description | Type | Null | Key | Default | Extra | -|------------|------------------|------------------|------|-----|---------------------|-------| -| iid | sequential ID | int(10) unsigned | NO | PRI | 0 | | -| uid | | int(10) unsigned | NO | MUL | 0 | | -| contact-id | | int(11) unsigned | NO | | 0 | | -| created | | datetime | NO | MUL | 0000-00-00 00:00:00 | | -| edited | | datetime | NO | | 0000-00-00 00:00:00 | | -| commented | | datetime | NO | MUL | 0000-00-00 00:00:00 | | -| received | | datetime | NO | | 0000-00-00 00:00:00 | | -| changed | | datetime | NO | | 0000-00-00 00:00:00 | | -| wall | | tinyint(1) | NO | MUL | 0 | | -| private | | tinyint(1) | NO | | 0 | | -| pubmail | | tinyint(1) | NO | | 0 | | -| moderated | | tinyint(1) | NO | | 0 | | -| visible | | tinyint(1) | NO | | 0 | | -| spam | | tinyint(1) | NO | | 0 | | -| starred | | tinyint(1) | NO | | 0 | | -| ignored | | tinyint(1) | NO | | 0 | | -| bookmark | | tinyint(1) | NO | | 0 | | -| unseen | | tinyint(1) | NO | | 1 | | -| deleted | | tinyint(1) | NO | | 0 | | -| origin | | tinyint(1) | NO | | 0 | | -| forum_mode | | tinyint(1) | NO | | 0 | | -| mention | | tinyint(1) | NO | | 0 | | -| network | | varchar(32) | NO | | | | +| Field | Description | Type | Null | Key | Default | Extra | +|-------------|------------------|------------------|------|-----|---------------------|-------| +| iid | sequential ID | int(10) unsigned | NO | PRI | 0 | | +| uid | | int(10) unsigned | NO | MUL | 0 | | +| contact-id | | int(11) unsigned | NO | | 0 | | +| gcontact-id | Global Contact | int(11) unsigned | NO | | 0 | | +| created | | datetime | NO | MUL | 0000-00-00 00:00:00 | | +| edited | | datetime | NO | | 0000-00-00 00:00:00 | | +| commented | | datetime | NO | MUL | 0000-00-00 00:00:00 | | +| received | | datetime | NO | | 0000-00-00 00:00:00 | | +| changed | | datetime | NO | | 0000-00-00 00:00:00 | | +| wall | | tinyint(1) | NO | MUL | 0 | | +| private | | tinyint(1) | NO | | 0 | | +| pubmail | | tinyint(1) | NO | | 0 | | +| moderated | | tinyint(1) | NO | | 0 | | +| visible | | tinyint(1) | NO | | 0 | | +| spam | | tinyint(1) | NO | | 0 | | +| starred | | tinyint(1) | NO | | 0 | | +| ignored | | tinyint(1) | NO | | 0 | | +| bookmark | | tinyint(1) | NO | | 0 | | +| unseen | | tinyint(1) | NO | | 1 | | +| deleted | | tinyint(1) | NO | | 0 | | +| origin | | tinyint(1) | NO | | 0 | | +| forum_mode | | tinyint(1) | NO | | 0 | | +| mention | | tinyint(1) | NO | | 0 | | +| network | | varchar(32) | NO | | | | Return to [database documentation](help/database) diff --git a/doc/database/db_unique_contacts.md b/doc/database/db_unique_contacts.md deleted file mode 100644 index 491da6aacd..0000000000 --- a/doc/database/db_unique_contacts.md +++ /dev/null @@ -1,14 +0,0 @@ -Table unique_contacts -===================== - -| Field | Description | Type | Null | Key | Default | Extra | -|----------|------------------|--------------|------|-----|---------|----------------| -| id | sequential ID | int(11) | NO | PRI | NULL | auto_increment | -| url | | varchar(255) | NO | MUL | | | -| nick | | varchar(255) | NO | | | | -| name | | varchar(255) | NO | | | | -| avatar | | varchar(255) | NO | | | | -| location | | varchar(255) | NO | | | | -| about | | text | NO | | NULL | | - -Return to [database documentation](help/database) diff --git a/friendica_test_data.sql b/friendica_test_data.sql index c39a057651..45080e44d0 100644 --- a/friendica_test_data.sql +++ b/friendica_test_data.sql @@ -1657,35 +1657,6 @@ LOCK TABLES `tokens` WRITE; /*!40000 ALTER TABLE `tokens` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `unique_contacts` --- - -DROP TABLE IF EXISTS `unique_contacts`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `unique_contacts` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `url` varchar(255) NOT NULL DEFAULT '', - `nick` varchar(255) NOT NULL DEFAULT '', - `name` varchar(255) NOT NULL DEFAULT '', - `avatar` varchar(255) NOT NULL DEFAULT '', - `location` varchar(255) NOT NULL DEFAULT '', - `about` text NOT NULL, - PRIMARY KEY (`id`), - KEY `url` (`url`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `unique_contacts` --- - -LOCK TABLES `unique_contacts` WRITE; -/*!40000 ALTER TABLE `unique_contacts` DISABLE KEYS */; -/*!40000 ALTER TABLE `unique_contacts` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `user` -- diff --git a/htconfig.php b/htconfig.php index 508de9a323..fe6c0d82ee 100644 --- a/htconfig.php +++ b/htconfig.php @@ -57,7 +57,7 @@ $a->config['system']['huburl'] = '[internal]'; // allowed themes (change this from admin panel after installation) -$a->config['system']['allowed_themes'] = 'dispy,quattro,vier,darkzero,duepuntozero,greenzero,purplezero,slackr,diabook'; +$a->config['system']['allowed_themes'] = 'quattro,vier,duepuntozero'; // default system theme diff --git a/include/Contact.php b/include/Contact.php index a3cbbfed15..93d6237cbf 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -205,59 +205,46 @@ function get_contact_details_by_url($url, $uid = -1) { if ((($profile["addr"] == "") OR ($profile["name"] == "")) AND in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) proc_run('php',"include/update_gcontact.php", $profile["gid"]); - - } else { - $r = q("SELECT `url`, `name`, `nick`, `avatar` AS `photo`, `location`, `about` FROM `unique_contacts` WHERE `url` = '%s'", - dbesc(normalise_link($url))); - - if (count($r)) { - $profile = $r[0]; - $profile["keywords"] = ""; - $profile["gender"] = ""; - $profile["community"] = false; - $profile["network"] = ""; - $profile["addr"] = ""; - } } // Fetching further contact data from the contact table $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d AND `network` = '%s'", dbesc(normalise_link($url)), intval($uid), dbesc($profile["network"])); - if (!count($r)) + if (!count($r) AND !isset($profile)) $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d", dbesc(normalise_link($url)), intval($uid)); - if (!count($r)) + if (!count($r) AND !isset($profile)) $r = q("SELECT `id`, `uid`, `url`, `network`, `name`, `nick`, `addr`, `location`, `about`, `keywords`, `gender`, `photo`, `addr`, `forum`, `prv`, `bd` FROM `contact` WHERE `nurl` = '%s' AND `uid` = 0", dbesc(normalise_link($url))); if ($r) { - if (isset($r[0]["url"]) AND $r[0]["url"]) + if (!isset($profile["url"]) AND $r[0]["url"]) $profile["url"] = $r[0]["url"]; - if (isset($r[0]["name"]) AND $r[0]["name"]) + if (!isset($profile["name"]) AND $r[0]["name"]) $profile["name"] = $r[0]["name"]; - if (isset($r[0]["nick"]) AND $r[0]["nick"] AND ($profile["nick"] == "")) + if (!isset($profile["nick"]) AND $r[0]["nick"]) $profile["nick"] = $r[0]["nick"]; - if (isset($r[0]["addr"]) AND $r[0]["addr"] AND ($profile["addr"] == "")) + if (!isset($profile["addr"]) AND $r[0]["addr"]) $profile["addr"] = $r[0]["addr"]; - if (isset($r[0]["photo"]) AND $r[0]["photo"]) + if (!isset($profile["photo"]) AND $r[0]["photo"]) $profile["photo"] = $r[0]["photo"]; - if (isset($r[0]["location"]) AND $r[0]["location"]) + if (!isset($profile["location"]) AND $r[0]["location"]) $profile["location"] = $r[0]["location"]; - if (isset($r[0]["about"]) AND $r[0]["about"]) + if (!isset($profile["about"]) AND $r[0]["about"]) $profile["about"] = $r[0]["about"]; - if (isset($r[0]["keywords"]) AND $r[0]["keywords"]) + if (!isset($profile["keywords"]) AND $r[0]["keywords"]) $profile["keywords"] = $r[0]["keywords"]; - if (isset($r[0]["gender"]) AND $r[0]["gender"]) + if (!isset($profile["gender"]) AND $r[0]["gender"]) $profile["gender"] = $r[0]["gender"]; if (isset($r[0]["forum"]) OR isset($r[0]["prv"])) $profile["community"] = ($r[0]["forum"] OR $r[0]["prv"]); - if (isset($r[0]["network"]) AND $r[0]["network"]) + if (!isset($profile["network"]) AND $r[0]["network"]) $profile["network"] = $r[0]["network"]; - if (isset($r[0]["addr"]) AND $r[0]["addr"]) + if (!isset($profile["addr"]) AND $r[0]["addr"]) $profile["addr"] = $r[0]["addr"]; - if (isset($r[0]["bd"]) AND $r[0]["bd"]) + if (!isset($profile["bd"]) AND $r[0]["bd"]) $profile["bd"] = $r[0]["bd"]; if ($r[0]["uid"] == 0) $profile["cid"] = 0; @@ -415,6 +402,7 @@ function get_contact($url, $uid = 0) { $contactid = 0; // is it an address in the format user@server.tld? + /// @todo use gcontact and/or the addr field for a lookup if (!strstr($url, "http") OR strstr($url, "@")) { $data = probe_url($url); $url = $data["url"]; @@ -513,3 +501,165 @@ function get_contact($url, $uid = 0) { return $contactid; } + +/** + * @brief Returns posts from a given gcontact + * + * @param App $a argv application class + * @param int $gcontact_id Global contact + * + * @return string posts in HTML + */ +function posts_from_gcontact($a, $gcontact_id) { + + require_once('include/conversation.php'); + + // There are no posts with "uid = 0" with connector networks + // This speeds up the query a lot + $r = q("SELECT `network` FROM `gcontact` WHERE `id` = %d", dbesc($gcontact_id)); + if (in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""))) + $sql = "(`item`.`uid` = 0 OR (`item`.`uid` = %d AND `item`.`private`))"; + else + $sql = "`item`.`uid` = %d"; + + if(get_config('system', 'old_pager')) { + $r = q("SELECT COUNT(*) AS `total` FROM `item` + WHERE `gcontact-id` = %d and $sql", + intval($gcontact_id), + intval(local_user())); + + $a->set_pager_total($r[0]['total']); + } + + $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, + `author-name` AS `name`, `owner-avatar` AS `photo`, + `owner-link` AS `url`, `owner-avatar` AS `thumb` + FROM `item` FORCE INDEX (`gcontactid_uid_created`) + WHERE `gcontact-id` = %d AND $sql AND + NOT `deleted` AND NOT `moderated` AND `visible` + ORDER BY `item`.`created` DESC LIMIT %d, %d", + intval($gcontact_id), + intval(local_user()), + intval($a->pager['start']), + intval($a->pager['itemspage']) + ); + + $o = conversation($a,$r,'community',false); + + if(!get_config('system', 'old_pager')) { + $o .= alt_pager($a,count($r)); + } else { + $o .= paginate($a); + } + + return $o; +} + +/** + * @brief set the gcontact-id in all item entries + * + * This job has to be started multiple times until all entries are set. + * It isn't started in the update function since it would consume too much time and can be done in the background. + */ +function item_set_gcontact() { + define ('POST_UPDATE_VERSION', 1192); + + // Was the script completed? + if (get_config("system", "post_update_version") >= POST_UPDATE_VERSION) + return; + + // Check if the first step is done (Setting "gcontact-id" in the item table) + $r = q("SELECT `author-link`, `author-name`, `author-avatar`, `uid`, `network` FROM `item` WHERE `gcontact-id` = 0 LIMIT 1000"); + if (!$r) { + // Are there unfinished entries in the thread table? + $r = q("SELECT COUNT(*) AS `total` FROM `thread` + INNER JOIN `item` ON `item`.`id` =`thread`.`iid` + WHERE `thread`.`gcontact-id` = 0 AND + (`thread`.`uid` IN (SELECT `uid` from `user`) OR `thread`.`uid` = 0)"); + + if ($r AND ($r[0]["total"] == 0)) { + set_config("system", "post_update_version", POST_UPDATE_VERSION); + return false; + } + + // Update the thread table from the item table + q("UPDATE `thread` INNER JOIN `item` ON `item`.`id`=`thread`.`iid` + SET `thread`.`gcontact-id` = `item`.`gcontact-id` + WHERE `thread`.`gcontact-id` = 0 AND + (`thread`.`uid` IN (SELECT `uid` from `user`) OR `thread`.`uid` = 0)"); + + return false; + } + + $item_arr = array(); + foreach ($r AS $item) { + $index = $item["author-link"]."-".$item["uid"]; + $item_arr[$index] = array("author-link" => $item["author-link"], + "uid" => $item["uid"], + "network" => $item["network"]); + } + + // Set the "gcontact-id" in the item table and add a new gcontact entry if needed + foreach($item_arr AS $item) { + $gcontact_id = get_gcontact_id(array("url" => $item['author-link'], "network" => $item['network'], + "photo" => $item['author-avatar'], "name" => $item['author-name'])); + q("UPDATE `item` SET `gcontact-id` = %d WHERE `uid` = %d AND `author-link` = '%s' AND `gcontact-id` = 0", + intval($gcontact_id), intval($item["uid"]), dbesc($item["author-link"])); + } + return true; +} + +/** + * @brief Returns posts from a given contact + * + * @param App $a argv application class + * @param int $contact_id contact + * + * @return string posts in HTML + */ +function posts_from_contact($a, $contact_id) { + + require_once('include/conversation.php'); + + $r = q("SELECT `url` FROM `contact` WHERE `id` = %d", intval($contact_id)); + if (!$r) + return false; + + $contact = $r[0]; + + if(get_config('system', 'old_pager')) { + $r = q("SELECT COUNT(*) AS `total` FROM `item` + WHERE `item`.`uid` = %d AND `author-link` IN ('%s', '%s')", + intval(local_user()), + dbesc(str_replace("https://", "http://", $contact["url"])), + dbesc(str_replace("http://", "https://", $contact["url"]))); + + $a->set_pager_total($r[0]['total']); + } + + $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, + `author-name` AS `name`, `owner-avatar` AS `photo`, + `owner-link` AS `url`, `owner-avatar` AS `thumb` + FROM `item` FORCE INDEX (`uid_contactid_created`) + WHERE `item`.`uid` = %d AND `contact-id` = %d + AND `author-link` IN ('%s', '%s') + AND NOT `deleted` AND NOT `moderated` AND `visible` + ORDER BY `item`.`created` DESC LIMIT %d, %d", + intval(local_user()), + intval($contact_id), + dbesc(str_replace("https://", "http://", $contact["url"])), + dbesc(str_replace("http://", "https://", $contact["url"])), + intval($a->pager['start']), + intval($a->pager['itemspage']) + ); + + $o .= conversation($a,$r,'community',false); + + if(!get_config('system', 'old_pager')) + $o .= alt_pager($a,count($r)); + else + $o .= paginate($a); + + return $o; +} +?> diff --git a/include/Photo.php b/include/Photo.php index 30424747da..5fdd682e74 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -792,15 +792,19 @@ function get_photo_info($url) { $filesize = strlen($img_str); - $tempfile = tempnam(get_temppath(), "cache"); + if (function_exists("getimagesizefromstring")) + $data = getimagesizefromstring($img_str); + else { + $tempfile = tempnam(get_temppath(), "cache"); - $a = get_app(); - $stamp1 = microtime(true); - file_put_contents($tempfile, $img_str); - $a->save_timestamp($stamp1, "file"); + $a = get_app(); + $stamp1 = microtime(true); + file_put_contents($tempfile, $img_str); + $a->save_timestamp($stamp1, "file"); - $data = getimagesize($tempfile); - unlink($tempfile); + $data = getimagesize($tempfile); + unlink($tempfile); + } if ($data) $data["size"] = $filesize; diff --git a/include/Scrape.php b/include/Scrape.php index cb192c77c2..9cc7086157 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -559,10 +559,11 @@ function probe_url($url, $mode = PROBE_NORMAL, $level = 1) { $pubkey = $hcard_key; } } - if($diaspora && $diaspora_base && $diaspora_guid) { - if($mode == PROBE_DIASPORA || ! $notify) { - $notify = $diaspora_base . 'receive/users/' . $diaspora_guid; + $diaspora_notify = $diaspora_base.'receive/users/'.$diaspora_guid; + + if($mode == PROBE_DIASPORA || ! $notify || ($notify == $diaspora_notify)) { + $notify = $diaspora_notify; $batch = $diaspora_base . 'receive/public' ; } if(strpos($url,'@')) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 4ef3d05ea3..69181b7359 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -20,7 +20,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) { $o .= " + - {{include file="field_checkbox.tpl" field=$debugging}} - {{include file="field_input.tpl" field=$logfile}} - {{include file="field_select.tpl" field=$loglevel}} + {{include file="field_checkbox.tpl" field=$debugging}} + {{include file="field_input.tpl" field=$logfile}} + {{include file="field_select.tpl" field=$loglevel}} -
+
+ +

{{$phpheader}}

+
+

{{$phphint}}

+
{{$phplogcode}}
+
-

{{$logname}}

-
{{$data}}
- - diff --git a/view/templates/admin_plugins.tpl b/view/templates/admin_plugins.tpl index 6caa04a3a4..75565dd2ed 100644 --- a/view/templates/admin_plugins.tpl +++ b/view/templates/admin_plugins.tpl @@ -1,6 +1,11 @@

{{$title}} - {{$page}}

+ {{if $pcount eq 0}} +
+ {{$noplugshint}} +
+ {{else}} {{$reload}} + {{/if}}
diff --git a/view/templates/admin_remoteupdate.tpl b/view/templates/admin_remoteupdate.tpl deleted file mode 100644 index c3e85f2e80..0000000000 --- a/view/templates/admin_remoteupdate.tpl +++ /dev/null @@ -1,99 +0,0 @@ - - - - -
-
Your version:
{{$localversion}}
-{{if $needupdate}} -
New version:
{{$remoteversion}}
- -
- - - {{if $canwrite}} -
- {{else}} -

Your friendica installation is not writable by web server.

- {{if $canftp}} -

You can try to update via FTP

- {{include file="field_input.tpl" field=$ftphost}} - {{include file="field_input.tpl" field=$ftppath}} - {{include file="field_input.tpl" field=$ftpuser}} - {{include file="field_password.tpl" field=$ftppwd}} -
- {{/if}} - {{/if}} -
-{{else}} -

No updates

-{{/if}} -
diff --git a/view/templates/admin_settings_features.tpl b/view/templates/admin_settings_features.tpl new file mode 100644 index 0000000000..abcc527d42 --- /dev/null +++ b/view/templates/admin_settings_features.tpl @@ -0,0 +1,21 @@ +

{{$title}}

+ +
+ + +{{foreach $features as $g => $f}} +

{{$f.0}}

+ +
+ {{foreach $f.1 as $fcat}} + {{include file="field_yesno.tpl" field=$fcat.0}} + {{include file="field_yesno.tpl" field=$fcat.1}} + {{/foreach}} + +
+ +
+
+{{/foreach}} + +
diff --git a/view/templates/admin_settings_head.tpl b/view/templates/admin_settings_head.tpl new file mode 100644 index 0000000000..25c0f804e4 --- /dev/null +++ b/view/templates/admin_settings_head.tpl @@ -0,0 +1,9 @@ + diff --git a/view/templates/admin_viewlogs.tpl b/view/templates/admin_viewlogs.tpl new file mode 100644 index 0000000000..c80264c52a --- /dev/null +++ b/view/templates/admin_viewlogs.tpl @@ -0,0 +1,6 @@ +
+

{{$title}} - {{$page}}

+ +

{{$logname}}

+
{{$data}}
+
diff --git a/view/templates/events.tpl b/view/templates/events.tpl index 525a5e0677..f723cb44c4 100644 --- a/view/templates/events.tpl +++ b/view/templates/events.tpl @@ -1,6 +1,6 @@ {{$tabs}} -

{{$title}}

+{{include file="section_title.tpl"}} diff --git a/view/templates/events_reminder.tpl b/view/templates/events_reminder.tpl index 9aceb3f1cb..2fcb1908d7 100644 --- a/view/templates/events_reminder.tpl +++ b/view/templates/events_reminder.tpl @@ -4,7 +4,7 @@ {{/if}} diff --git a/view/templates/profile_advanced.tpl b/view/templates/profile_advanced.tpl index 084fdf3b77..32de6bfa9f 100644 --- a/view/templates/profile_advanced.tpl +++ b/view/templates/profile_advanced.tpl @@ -1,5 +1,5 @@ -

{{$title}}

+{{include file="section_title.tpl"}}
{{$profile.fullname.0}}
diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 84b3ff2361..defeec7023 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -1055,6 +1055,7 @@ aside .vcard .title { aside .vcard dl { height: auto; overflow: auto; + word-break: break-word; } aside .vcard .account-type { margin-bottom: 13px; @@ -1412,6 +1413,7 @@ section.minimal { /* font-size: 14px; */ max-width: 660px; word-wrap: break-word; + word-break: break-word; /* line-height: 1.36; */ padding-bottom: 6px; } diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php index 72731a9beb..3d3c776745 100644 --- a/view/theme/vier/style.php +++ b/view/theme/vier/style.php @@ -1,12 +1,7 @@ $modified) + $modified = $stylemodified; + +$modified = gmdate('r', $modified); + +$etag = md5($stylecss); + +// Only send the CSS file if it was changed +header('Cache-Control: public'); +header('ETag: "'.$etag.'"'); +header('Last-Modified: '.$modified); + +if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) { + + $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])); + $cached_etag = str_replace(array('"', "-gzip"), array('', ''), + stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); + + if (($cached_modified == $modified) AND ($cached_etag == $etag)) { + header('HTTP/1.1 304 Not Modified'); + exit(); + } +} echo $stylecss; diff --git a/view/theme/vier/templates/profile_advanced.tpl b/view/theme/vier/templates/profile_advanced.tpl index 809aa4c13a..8451188f0d 100644 --- a/view/theme/vier/templates/profile_advanced.tpl +++ b/view/theme/vier/templates/profile_advanced.tpl @@ -4,7 +4,7 @@ {{/if}} -

{{$title}}

+{{include file="section_title.tpl"}}
{{$profile.fullname.0}}
@@ -171,6 +171,9 @@
{{/if}} - - - +{{if $profile.forumlist}} +
+
{{$profile.forumlist.0}}
+
{{$profile.forumlist.1}}
+
+{{/if}}