From 00c16b387acb3675db1bbccb5dc8dfb598ca91a5 Mon Sep 17 00:00:00 2001 From: Carsten Pfeiffer Date: Sat, 1 Nov 2014 22:18:42 +0100 Subject: [PATCH 01/25] Make TinyMCE editors resizable --- js/main.js | 1 + view/templates/contact_head.tpl | 1 + view/templates/event_head.tpl | 1 + view/templates/jot-header.tpl | 1 + view/templates/msg-header.tpl | 1 + view/templates/profed_head.tpl | 1 + view/templates/wallmsg-header.tpl | 1 + 7 files changed, 7 insertions(+) diff --git a/js/main.js b/js/main.js index 43d37a99b..23f63f822 100644 --- a/js/main.js +++ b/js/main.js @@ -703,6 +703,7 @@ function setupFieldRichtext(){ theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_blockformats : "blockquote,code", + theme_advanced_resizing : true, paste_text_sticky : true, entity_encoding : "raw", add_unload_trigger : false, diff --git a/view/templates/contact_head.tpl b/view/templates/contact_head.tpl index 498cbfbcc..ceda781ea 100644 --- a/view/templates/contact_head.tpl +++ b/view/templates/contact_head.tpl @@ -14,6 +14,7 @@ tinyMCE.init({ theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_styles : "blockquote,code", + theme_advanced_resizing : true, gecko_spellcheck : true, entity_encoding : "raw", add_unload_trigger : false, diff --git a/view/templates/event_head.tpl b/view/templates/event_head.tpl index 8d40be3be..8085a774b 100644 --- a/view/templates/event_head.tpl +++ b/view/templates/event_head.tpl @@ -90,6 +90,7 @@ theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_blockformats : "blockquote,code", + theme_advanced_resizing : true, gecko_spellcheck : true, paste_text_sticky : true, entity_encoding : "raw", diff --git a/view/templates/jot-header.tpl b/view/templates/jot-header.tpl index f8cf96f7c..3a67e8bcc 100644 --- a/view/templates/jot-header.tpl +++ b/view/templates/jot-header.tpl @@ -34,6 +34,7 @@ function initEditor(cb){ theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_blockformats : "blockquote,code", + theme_advanced_resizing : true, gecko_spellcheck : true, paste_text_sticky : true, entity_encoding : "raw", diff --git a/view/templates/msg-header.tpl b/view/templates/msg-header.tpl index 47b92ddf1..86598bbf6 100644 --- a/view/templates/msg-header.tpl +++ b/view/templates/msg-header.tpl @@ -17,6 +17,7 @@ if(plaintext != 'none') { theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_blockformats : "blockquote,code", + theme_advanced_resizing : true, gecko_spellcheck : true, paste_text_sticky : true, entity_encoding : "raw", diff --git a/view/templates/profed_head.tpl b/view/templates/profed_head.tpl index 67e7a85ac..2dbdbcdeb 100644 --- a/view/templates/profed_head.tpl +++ b/view/templates/profed_head.tpl @@ -16,6 +16,7 @@ tinyMCE.init({ theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_blockformats : "blockquote,code", + theme_advanced_resizing : true, gecko_spellcheck : true, paste_text_sticky : true, entity_encoding : "raw", diff --git a/view/templates/wallmsg-header.tpl b/view/templates/wallmsg-header.tpl index c4d81f8cc..f03f496fe 100644 --- a/view/templates/wallmsg-header.tpl +++ b/view/templates/wallmsg-header.tpl @@ -17,6 +17,7 @@ if(plaintext != 'none') { theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_blockformats : "blockquote,code", + theme_advanced_resizing : true, gecko_spellcheck : true, paste_text_sticky : true, entity_encoding : "raw", From 14ea4b972ecddbf66f9661a62983e007a452b700 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 2 Nov 2014 17:35:49 +0100 Subject: [PATCH 02/25] BBCode: Newlines under attachments are now removed --- include/bbcode.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 8efeabb8b..ee607cf6a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -825,9 +825,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal // Rearrange shares to attachments $Text = preg_replace_callback("((.*?)\[class=(.*?)\](.*?)\[\/class\])ism", "bb_rearrange_share",$Text); - // Handle attached links or videos - $Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed); - // Rearrange shared links // if (get_config("system", "rearrange_shared_links") AND (!$simplehtml OR $tryoembed)) // $Text = preg_replace_callback("(\[class=(.*?)\](.*?)\[\/class\])ism","bb_rearrange_link",$Text); @@ -848,8 +845,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal // removing multiplicated newlines if (get_config("system", "remove_multiplicated_lines")) { - $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share "); - $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share "); + $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n"); + $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]"); do { $oldtext = $Text; $Text = str_replace($search, $replace, $Text); @@ -861,7 +858,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal if($preserve_nl) $Text = str_replace(array("\n","\r"), array('',''),$Text); - + // Handle attached links or videos + $Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed); // Set up the parameters for a URL search string $URLSearchString = "^\[\]"; From 3eed5bbd3e6891738332649f73602329d7973bb0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 2 Nov 2014 18:39:23 +0100 Subject: [PATCH 03/25] Further improvement for newlines after attachments --- include/bbcode.php | 44 ++++++-------------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index ee607cf6a..5395548f5 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -66,7 +66,7 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { } if ($plaintext) - $text = sprintf('%s', $url, $title); + $text = sprintf('%s
', $url, $title); else { $text = sprintf('', $type); @@ -92,35 +92,6 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { return($Text); } -/* function bb_rearrange_link($shared) { - if ($shared[1] != "type-link") - return($shared[0]); - - $newshare = trim($shared[2]); - $newshare = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $newshare); - - if (!strpos($shared[0], "[bookmark")) - $newshare = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/ism", '[bookmark=$1]$2[/bookmark]', $newshare, 1); - - preg_match("/\[img\](.*?)\[\/img\]/ism", $newshare, $matches); - - if ($matches) { - $newshare = str_replace($matches[0], '', $newshare); - $newshare = "[img]".$matches[1]."[/img]\n".$newshare; - } - - $search = array("\n\n", "\n ", " \n"); - $replace = array("\n", "\n", "\n"); - do { - $oldtext = $newshare; - $newshare = str_replace($search, $replace, $newshare); - } while ($oldtext != $newshare); - - $newshare = "[class=type-link]".$newshare."[/class]"; - - return($newshare); -} */ - function bb_rearrange_share($shared) { if (!in_array(strtolower($shared[2]), array("type-link", "type-audio", "type-video"))) return($shared[0]); @@ -211,7 +182,8 @@ function bb_cleanup_share($shared, $plaintext, $nolink) { if (isset($bookmark[1][0])) $link = $bookmark[1][0]; - if (($title != "") AND (strpos($shared[1],$title) !== false)) + if (($title != "") AND ((strpos($shared[1],$title) !== false) OR + (similar_text($shared[1],$title) / strlen($title)) > 0.9)) $title = ""; // if (strpos($shared[1],$link) !== false) @@ -825,10 +797,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal // Rearrange shares to attachments $Text = preg_replace_callback("((.*?)\[class=(.*?)\](.*?)\[\/class\])ism", "bb_rearrange_share",$Text); - // Rearrange shared links -// if (get_config("system", "rearrange_shared_links") AND (!$simplehtml OR $tryoembed)) -// $Text = preg_replace_callback("(\[class=(.*?)\](.*?)\[\/class\])ism","bb_rearrange_link",$Text); - // when the content is meant exporting to other systems then remove the avatar picture since this doesn't really look good on these systems if (!$tryoembed) $Text = preg_replace("/\[share(.*?)avatar\s?=\s?'.*?'\s?(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism","\n[share$1$2]$3[/share]",$Text); @@ -853,14 +821,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal } while ($oldtext != $Text); } + // Handle attached links or videos + $Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed); + $Text = str_replace(array("\r","\n"), array('
','
'), $Text); if($preserve_nl) $Text = str_replace(array("\n","\r"), array('',''),$Text); - // Handle attached links or videos - $Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed); - // Set up the parameters for a URL search string $URLSearchString = "^\[\]"; // Set up the parameters for a MAIL search string From 70ba1667e10cc9b8350d32c0c788e780eb2f50cc Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 8 Nov 2014 00:07:21 +0100 Subject: [PATCH 04/25] It is now possible to define the hostname from the admin page. This should definetely end the problem that the hostname couldn't be detected unter certain conditions. --- boot.php | 28 +++++++++++++++++++--------- mod/admin.php | 6 ++++++ view/templates/admin_site.tpl | 1 + 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/boot.php b/boot.php index eb0eb3e66..7a6f4bd4e 100644 --- a/boot.php +++ b/boot.php @@ -522,28 +522,28 @@ if(! class_exists('App')) { if (substr($this->query_string, 0, 1) == "/") $this->query_string = substr($this->query_string, 1); } - + if (x($_GET,'pagename')) $this->cmd = trim($_GET['pagename'],'/\\'); elseif (x($_GET,'q')) $this->cmd = trim($_GET['q'],'/\\'); - - + + // fix query_string $this->query_string = str_replace($this->cmd."&",$this->cmd."?", $this->query_string); - - + + // unix style "homedir" - + if(substr($this->cmd,0,1) === '~') $this->cmd = 'profile/' . substr($this->cmd,1); - + // Diaspora style profile url if(substr($this->cmd,0,2) === 'u/') $this->cmd = 'profile/' . substr($this->cmd,2); - + /** * * Break the URL path into C style argc/argv style arguments for our @@ -639,6 +639,9 @@ if(! class_exists('App')) { } } + if (get_config('config','hostname') != "") + $this->hostname = get_config('config','hostname'); + $this->baseurl = $scheme . "://" . $this->hostname . ((isset($this->path) && strlen($this->path)) ? '/' . $this->path : '' ); return $this->baseurl; } @@ -660,12 +663,19 @@ if(! class_exists('App')) { if (file_exists(".htpreconfig.php")) @include(".htpreconfig.php"); - $this->hostname = $hostname; + if (get_config('config','hostname') != "") + $this->hostname = get_config('config','hostname'); + + if (!isset($this->hostname) OR ($this->hostname == "")) + $this->hostname = $hostname; } } function get_hostname() { + if (get_config('config','hostname') != "") + $this->hostname = get_config('config','hostname'); + return $this->hostname; } diff --git a/mod/admin.php b/mod/admin.php index 224a1f8c6..8bddd8ce8 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -308,6 +308,7 @@ function admin_page_site_post(&$a){ // end relocate $sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : ''); + $hostname = ((x($_POST,'hostname')) ? notags(trim($_POST['hostname'])) : ''); $banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false); $info = ((x($_POST,'info')) ? trim($_POST['info']) : false); $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : ''); @@ -413,6 +414,7 @@ function admin_page_site_post(&$a){ set_config('system','poll_interval',$poll_interval); set_config('system','maxloadavg',$maxloadavg); set_config('config','sitename',$sitename); + set_config('config','hostname',$hostname); set_config('system','suppress_language',$suppress_language); if ($banner==""){ // don't know why, but del_config doesn't work... @@ -585,6 +587,9 @@ function admin_page_site(&$a) { SSL_POLICY_SELFSIGN => t("Self-signed certificate, use SSL for local links only (discouraged)") ); + if ($a->config['hostname'] == "") + $a->config['hostname'] = $a->get_hostname(); + $t = get_markup_template("admin_site.tpl"); return replace_macros($t, array( '$title' => t('Administration'), @@ -599,6 +604,7 @@ function admin_page_site(&$a) { '$baseurl' => $a->get_baseurl(true), // name, label, value, help string, extra data... '$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), 'UTF-8'), + '$hostname' => array('hostname', t("Host name"), $a->config['hostname'], ""), '$banner' => array('banner', t("Banner/Logo"), $banner, ""), '$info' => array('info',t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at dir.friendica.com/siteinfo.')), '$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices), diff --git a/view/templates/admin_site.tpl b/view/templates/admin_site.tpl index 7237a2f27..166b35e7d 100644 --- a/view/templates/admin_site.tpl +++ b/view/templates/admin_site.tpl @@ -45,6 +45,7 @@ {{include file="field_input.tpl" field=$sitename}} + {{include file="field_input.tpl" field=$hostname}} {{include file="field_textarea.tpl" field=$banner}} {{include file="field_textarea.tpl" field=$info}} {{include file="field_select.tpl" field=$language}} From 030784ad3598902b44a5e42f25e6d3bac4bd1bcb Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 8 Nov 2014 20:52:15 +0100 Subject: [PATCH 05/25] Fix for issue "Field 'type' doesn't have a default value" in the challenge table. --- mod/dfrn_notify.php | 8 ++++++-- mod/dfrn_poll.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 7f160de44..2aa654534 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -175,6 +175,8 @@ function dfrn_notify_content(&$a) { $dfrn_id = notags(trim($_GET['dfrn_id'])); $dfrn_version = (float) $_GET['dfrn_version']; + $type = ""; + $last_update = ""; logger('dfrn_notify: new notification dfrn_id=' . $dfrn_id); @@ -190,11 +192,13 @@ function dfrn_notify_content(&$a) { $r = q("DELETE FROM `challenge` WHERE `expire` < " . intval(time())); - $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` ) + $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` ) VALUES( '%s', '%s', %d ) ", dbesc($hash), dbesc($dfrn_id), - intval(time() + 90 ) + intval(time() + 90 ), + dbesc($type), + dbesc($last_update) ); logger('dfrn_notify: challenge=' . $hash, LOGGER_DEBUG ); diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index b9fcd8c4a..b5f60a039 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -389,7 +389,7 @@ function dfrn_poll_content(&$a) { $sec = ((x($_GET,'sec')) ? $_GET['sec'] : ''); $dfrn_version = ((x($_GET,'dfrn_version')) ? (float) $_GET['dfrn_version'] : 2.0); $perm = ((x($_GET,'perm')) ? $_GET['perm'] : 'r'); - $quiet = ((x($_GET,'quiet')) ? true : false); + $quiet = ((x($_GET,'quiet')) ? true : false); $direction = (-1); if(strpos($dfrn_id,':') == 1) { From 9172ea224696a9c2b3b540558ae5a3d85c9f25fa Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 9 Nov 2014 01:13:07 +0100 Subject: [PATCH 06/25] Some more values that need to be set to avoid SQL warnings. --- include/items.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/items.php b/include/items.php index 37532eaf9..5b2755935 100644 --- a/include/items.php +++ b/include/items.php @@ -1161,6 +1161,11 @@ function item_store($arr,$force_parent = false, $notify = false) { $arr['origin'] = ((x($arr,'origin')) ? intval($arr['origin']) : 0 ); $arr['guid'] = ((x($arr,'guid')) ? notags(trim($arr['guid'])) : get_guid(30)); $arr['network'] = ((x($arr,'network')) ? trim($arr['network']) : ''); + $arr['postopts'] = ((x($arr,'postopts')) ? trim($arr['postopts']) : ''); + $arr['resource-id'] = ((x($arr,'resource-id')) ? trim($arr['resource-id']) : ''); + $arr['event-id'] = ((x($arr,'event-id')) ? intval($arr['event-id']) : 0 ); + $arr['inform'] = ((x($arr,'inform')) ? trim($arr['inform']) : ''); + $arr['file'] = ((x($arr,'file')) ? trim($arr['file']) : ''); if ($arr['plink'] == "") { $a = get_app(); From 5379e07c4eb24d8bc03fa31303dc8b626d8c401d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 9 Nov 2014 13:29:27 +0100 Subject: [PATCH 07/25] Setting default values for all database fields. --- boot.php | 2 +- include/dbstructure.php | 521 ++++++++++++++++++++-------------------- update.php | 2 +- 3 files changed, 262 insertions(+), 263 deletions(-) diff --git a/boot.php b/boot.php index eb0eb3e66..60863ff7d 100644 --- a/boot.php +++ b/boot.php @@ -18,7 +18,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_CODENAME', 'Ginger'); define ( 'FRIENDICA_VERSION', '3.3.1' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1174 ); +define ( 'DB_UPDATE_VERSION', 1175 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/include/dbstructure.php b/include/dbstructure.php index c05bd3796..66e67c0a9 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -92,7 +92,7 @@ function table_structure($table) { if ($field["Null"] == "NO") $fielddata[$field["Field"]]["not null"] = true; - if ($field["Default"] != "") + if (isset($field["Default"])) $fielddata[$field["Field"]]["default"] = $field["Default"]; if ($field["Extra"] != "") @@ -102,7 +102,6 @@ function table_structure($table) { $fielddata[$field["Field"]]["primary"] = true; } } - return(array("fields"=>$fielddata, "indexes"=>$indexdata)); } @@ -182,8 +181,8 @@ function update_structure($verbose, $action) { $sql3 .= ", ".$sql2; } else { // Compare the field definition - $current_field_definition = implode($database[$name]["fields"][$fieldname]); - $new_field_definition = implode($parameters); + $current_field_definition = implode(",",$database[$name]["fields"][$fieldname]); + $new_field_definition = implode(",",$parameters); if ($current_field_definition != $new_field_definition) { $sql2=db_modify_table_field($fieldname, $parameters); if ($sql3 == "") @@ -232,7 +231,7 @@ function db_field_command($parameters, $create = true) { if ($parameters["not null"]) $fieldstruct .= " NOT NULL"; - if ($parameters["default"] != "") + if (isset($parameters["default"])) $fieldstruct .= " DEFAULT '".$parameters["default"]."'"; if ($parameters["extra"] != "") @@ -310,8 +309,8 @@ function db_definition() { $database["addon"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "version" => array("type" => "varchar(255)", "not null" => "1"), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "version" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "installed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "timestamp" => array("type" => "bigint(20)", "not null" => "1", "default" => "0"), @@ -324,11 +323,11 @@ function db_definition() { $database["attach"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "hash" => array("type" => "varchar(64)", "not null" => "1"), - "filename" => array("type" => "varchar(255)", "not null" => "1"), - "filetype" => array("type" => "varchar(64)", "not null" => "1"), - "filesize" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), + "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), + "filesize" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "data" => array("type" => "longblob", "not null" => "1"), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), @@ -344,10 +343,10 @@ function db_definition() { $database["auth_codes"] = array( "fields" => array( "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"), - "client_id" => array("type" => "varchar(20)", "not null" => "1"), - "redirect_uri" => array("type" => "varchar(200)", "not null" => "1"), - "expires" => array("type" => "int(11)", "not null" => "1"), - "scope" => array("type" => "varchar(250)", "not null" => "1"), + "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""), + "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""), + "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "scope" => array("type" => "varchar(250)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -357,7 +356,7 @@ function db_definition() { "fields" => array( "k" => array("type" => "varchar(255)", "not null" => "1", "primary" => "1"), "v" => array("type" => "text", "not null" => "1"), - "updated" => array("type" => "datetime", "not null" => "1"), + "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), "indexes" => array( "PRIMARY" => array("k"), @@ -367,11 +366,11 @@ function db_definition() { $database["challenge"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "challenge" => array("type" => "varchar(255)", "not null" => "1"), - "dfrn-id" => array("type" => "varchar(255)", "not null" => "1"), - "expire" => array("type" => "int(11)", "not null" => "1"), - "type" => array("type" => "varchar(255)", "not null" => "1"), - "last_update" => array("type" => "varchar(255)", "not null" => "1"), + "challenge" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "last_update" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -380,8 +379,8 @@ function db_definition() { $database["clients"] = array( "fields" => array( "client_id" => array("type" => "varchar(20)", "not null" => "1", "primary" => "1"), - "pw" => array("type" => "varchar(20)", "not null" => "1"), - "redirect_uri" => array("type" => "varchar(200)", "not null" => "1"), + "pw" => array("type" => "varchar(20)", "not null" => "1", "default" => ""), + "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => ""), "name" => array("type" => "text"), "icon" => array("type" => "text"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), @@ -393,8 +392,8 @@ function db_definition() { $database["config"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "cat" => array("type" => "varchar(255)", "not null" => "1"), - "k" => array("type" => "varchar(255)", "not null" => "1"), + "cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "v" => array("type" => "text", "not null" => "1"), ), "indexes" => array( @@ -405,29 +404,29 @@ function db_definition() { $database["contact"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "remote_self" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "rel" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "network" => array("type" => "varchar(255)", "not null" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "nick" => array("type" => "varchar(255)", "not null" => "1"), - "attag" => array("type" => "varchar(255)", "not null" => "1"), + "network" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "attag" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "photo" => array("type" => "text", "not null" => "1"), "thumb" => array("type" => "text", "not null" => "1"), "micro" => array("type" => "text", "not null" => "1"), "site-pubkey" => array("type" => "text", "not null" => "1"), - "issued-id" => array("type" => "varchar(255)", "not null" => "1"), - "dfrn-id" => array("type" => "varchar(255)", "not null" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), - "nurl" => array("type" => "varchar(255)", "not null" => "1"), - "addr" => array("type" => "varchar(255)", "not null" => "1"), - "alias" => array("type" => "varchar(255)", "not null" => "1"), + "issued-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "pubkey" => array("type" => "text", "not null" => "1"), "prvkey" => array("type" => "text", "not null" => "1"), - "batch" => array("type" => "varchar(255)", "not null" => "1"), + "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "request" => array("type" => "text", "not null" => "1"), "notify" => array("type" => "text", "not null" => "1"), "poll" => array("type" => "text", "not null" => "1"), @@ -437,14 +436,14 @@ function db_definition() { "ret-aes" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "usehub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "subhub" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "hub-verify" => array("type" => "varchar(255)", "not null" => "1"), + "hub-verify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "last-update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "success_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "name-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "uri-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "avatar-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "term-date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), - "priority" => array("type" => "tinyint(3)", "not null" => "1"), + "priority" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"), "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"), "readonly" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "writable" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), @@ -458,8 +457,8 @@ function db_definition() { "closeness" => array("type" => "tinyint(2)", "not null" => "1", "default" => "99"), "info" => array("type" => "mediumtext", "not null" => "1"), "profile-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "bdyear" => array("type" => "varchar(4)", "not null" => "1"), - "bd" => array("type" => "date", "not null" => "1"), + "bdyear" => array("type" => "varchar(4)", "not null" => "1", "default" => ""), + "bd" => array("type" => "date", "not null" => "1", "default" => "0000-00-00"), "notify_new_posts" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "fetch_further_information" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "ffi_keyword_blacklist" => array("type" => "mediumtext", "not null" => "1"), @@ -472,10 +471,10 @@ function db_definition() { $database["conv"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "guid" => array("type" => "varchar(64)", "not null" => "1"), + "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), "recips" => array("type" => "mediumtext", "not null" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "creator" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "creator" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "subject" => array("type" => "mediumtext", "not null" => "1"), @@ -488,9 +487,9 @@ function db_definition() { $database["deliverq"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "cmd" => array("type" => "varchar(32)", "not null" => "1"), - "item" => array("type" => "int(11)", "not null" => "1"), - "contact" => array("type" => "int(11)", "not null" => "1"), + "cmd" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), + "item" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "contact" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -499,9 +498,9 @@ function db_definition() { $database["dsprphotoq"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "msg" => array("type" => "mediumtext", "not null" => "1"), - "attempt" => array("type" => "tinyint(4)", "not null" => "1"), + "attempt" => array("type" => "tinyint(4)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -510,17 +509,17 @@ function db_definition() { $database["event"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "cid" => array("type" => "int(11)", "not null" => "1"), - "uri" => array("type" => "varchar(255)", "not null" => "1"), - "created" => array("type" => "datetime", "not null" => "1"), - "edited" => array("type" => "datetime", "not null" => "1"), - "start" => array("type" => "datetime", "not null" => "1"), - "finish" => array("type" => "datetime", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "start" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "finish" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "summary" => array("type" => "text", "not null" => "1"), "desc" => array("type" => "text", "not null" => "1"), "location" => array("type" => "text", "not null" => "1"), - "type" => array("type" => "varchar(255)", "not null" => "1"), + "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "nofinish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "adjust" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"), "ignore" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "0"), @@ -537,19 +536,19 @@ function db_definition() { $database["fcontact"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "photo" => array("type" => "varchar(255)", "not null" => "1"), - "request" => array("type" => "varchar(255)", "not null" => "1"), - "nick" => array("type" => "varchar(255)", "not null" => "1"), - "addr" => array("type" => "varchar(255)", "not null" => "1"), - "batch" => array("type" => "varchar(255)", "not null" => "1"), - "notify" => array("type" => "varchar(255)", "not null" => "1"), - "poll" => array("type" => "varchar(255)", "not null" => "1"), - "confirm" => array("type" => "varchar(255)", "not null" => "1"), - "priority" => array("type" => "tinyint(1)", "not null" => "1"), - "network" => array("type" => "varchar(32)", "not null" => "1"), - "alias" => array("type" => "varchar(255)", "not null" => "1"), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "notify" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "poll" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "confirm" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "priority" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), + "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), + "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "pubkey" => array("type" => "text", "not null" => "1"), "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), @@ -561,9 +560,9 @@ function db_definition() { $database["ffinder"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), - "cid" => array("type" => "int(10) unsigned", "not null" => "1"), - "fid" => array("type" => "int(10) unsigned", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), + "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), + "fid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -572,8 +571,8 @@ function db_definition() { $database["fserver"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "server" => array("type" => "varchar(255)", "not null" => "1"), - "posturl" => array("type" => "varchar(255)", "not null" => "1"), + "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "posturl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "key" => array("type" => "text", "not null" => "1"), ), "indexes" => array( @@ -584,14 +583,14 @@ function db_definition() { $database["fsuggest"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "cid" => array("type" => "int(11)", "not null" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), - "request" => array("type" => "varchar(255)", "not null" => "1"), - "photo" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "request" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "note" => array("type" => "text", "not null" => "1"), - "created" => array("type" => "datetime", "not null" => "1"), + "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -600,8 +599,8 @@ function db_definition() { $database["gcign"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "gcid" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -612,11 +611,11 @@ function db_definition() { $database["gcontact"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), - "nurl" => array("type" => "varchar(255)", "not null" => "1"), - "photo" => array("type" => "varchar(255)", "not null" => "1"), - "connect" => array("type" => "varchar(255)", "not null" => "1"), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "connect" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -626,11 +625,11 @@ function db_definition() { $database["glink"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "cid" => array("type" => "int(11)", "not null" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "gcid" => array("type" => "int(11)", "not null" => "1"), - "zcid" => array("type" => "int(11)", "not null" => "1"), - "updated" => array("type" => "datetime", "not null" => "1"), + "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "gcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "zcid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "updated" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -642,10 +641,10 @@ function db_definition() { $database["group"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "visible" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "deleted" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "name" => array("type" => "varchar(255)", "not null" => "1"), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -655,9 +654,9 @@ function db_definition() { $database["group_member"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), - "gid" => array("type" => "int(10) unsigned", "not null" => "1"), - "contact-id" => array("type" => "int(10) unsigned", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), + "gid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), + "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -667,7 +666,7 @@ function db_definition() { $database["guid"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "guid" => array("type" => "varchar(255)", "not null" => "1"), + "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -677,9 +676,9 @@ function db_definition() { $database["hook"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "hook" => array("type" => "varchar(255)", "not null" => "1"), - "file" => array("type" => "varchar(255)", "not null" => "1"), - "function" => array("type" => "varchar(255)", "not null" => "1"), + "hook" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "file" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "function" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "priority" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), ), "indexes" => array( @@ -690,14 +689,14 @@ function db_definition() { $database["intro"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "fid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "contact-id" => array("type" => "int(11)", "not null" => "1"), - "knowyou" => array("type" => "tinyint(1)", "not null" => "1"), + "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "knowyou" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "duplex" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "note" => array("type" => "text", "not null" => "1"), - "hash" => array("type" => "varchar(255)", "not null" => "1"), - "datetime" => array("type" => "datetime", "not null" => "1"), + "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "datetime" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "blocked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"), "ignore" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), ), @@ -708,46 +707,46 @@ function db_definition() { $database["item"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "guid" => array("type" => "varchar(255)", "not null" => "1"), - "uri" => array("type" => "varchar(255)", "not null" => "1"), + "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), - "contact-id" => array("type" => "int(11)", "not null" => "1"), - "type" => array("type" => "varchar(255)", "not null" => "1"), + "contact-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "wall" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "gravity" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "parent" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), - "parent-uri" => array("type" => "varchar(255)", "not null" => "1"), - "extid" => array("type" => "varchar(255)", "not null" => "1"), - "thr-parent" => array("type" => "varchar(255)", "not null" => "1"), + "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "extid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "thr-parent" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "commented" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "received" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "changed" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), - "owner-name" => array("type" => "varchar(255)", "not null" => "1"), - "owner-link" => array("type" => "varchar(255)", "not null" => "1"), - "owner-avatar" => array("type" => "varchar(255)", "not null" => "1"), - "author-name" => array("type" => "varchar(255)", "not null" => "1"), - "author-link" => array("type" => "varchar(255)", "not null" => "1"), - "author-avatar" => array("type" => "varchar(255)", "not null" => "1"), - "title" => array("type" => "varchar(255)", "not null" => "1"), + "owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "body" => array("type" => "mediumtext", "not null" => "1"), - "app" => array("type" => "varchar(255)", "not null" => "1"), - "verb" => array("type" => "varchar(255)", "not null" => "1"), - "object-type" => array("type" => "varchar(255)", "not null" => "1"), + "app" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "object-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "object" => array("type" => "text", "not null" => "1"), - "target-type" => array("type" => "varchar(255)", "not null" => "1"), + "target-type" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "target" => array("type" => "text", "not null" => "1"), "postopts" => array("type" => "text", "not null" => "1"), - "plink" => array("type" => "varchar(255)", "not null" => "1"), - "resource-id" => array("type" => "varchar(255)", "not null" => "1"), - "event-id" => array("type" => "int(11)", "not null" => "1"), + "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "event-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "tag" => array("type" => "mediumtext", "not null" => "1"), "attach" => array("type" => "mediumtext", "not null" => "1"), "inform" => array("type" => "mediumtext", "not null" => "1"), "file" => array("type" => "mediumtext", "not null" => "1"), - "location" => array("type" => "varchar(255)", "not null" => "1"), - "coord" => array("type" => "varchar(255)", "not null" => "1"), + "location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "coord" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "allow_cid" => array("type" => "mediumtext", "not null" => "1"), "allow_gid" => array("type" => "mediumtext", "not null" => "1"), "deny_cid" => array("type" => "mediumtext", "not null" => "1"), @@ -765,7 +764,7 @@ function db_definition() { "forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "last-child" => array("type" => "tinyint(1) unsigned", "not null" => "1", "default" => "1"), "mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "network" => array("type" => "varchar(32)", "not null" => "1"), + "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -806,10 +805,10 @@ function db_definition() { $database["item_id"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "iid" => array("type" => "int(11)", "not null" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "sid" => array("type" => "varchar(255)", "not null" => "1"), - "service" => array("type" => "varchar(255)", "not null" => "1"), + "iid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "service" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -822,7 +821,7 @@ function db_definition() { $database["locks"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "name" => array("type" => "varchar(128)", "not null" => "1"), + "name" => array("type" => "varchar(128)", "not null" => "1", "default" => ""), "locked" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), ), "indexes" => array( @@ -832,21 +831,21 @@ function db_definition() { $database["mail"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), - "guid" => array("type" => "varchar(64)", "not null" => "1"), - "from-name" => array("type" => "varchar(255)", "not null" => "1"), - "from-photo" => array("type" => "varchar(255)", "not null" => "1"), - "from-url" => array("type" => "varchar(255)", "not null" => "1"), - "contact-id" => array("type" => "varchar(255)", "not null" => "1"), - "convid" => array("type" => "int(11) unsigned", "not null" => "1"), - "title" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), + "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), + "from-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "from-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "from-url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "contact-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "convid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), + "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "body" => array("type" => "mediumtext", "not null" => "1"), - "seen" => array("type" => "tinyint(1)", "not null" => "1"), + "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "reply" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "replied" => array("type" => "tinyint(1)", "not null" => "1"), + "replied" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "unknown" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "uri" => array("type" => "varchar(255)", "not null" => "1"), - "parent-uri" => array("type" => "varchar(255)", "not null" => "1"), + "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), "indexes" => array( @@ -862,16 +861,16 @@ function db_definition() { $database["mailacct"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "server" => array("type" => "varchar(255)", "not null" => "1"), - "port" => array("type" => "int(11)", "not null" => "1"), - "ssltype" => array("type" => "varchar(16)", "not null" => "1"), - "mailbox" => array("type" => "varchar(255)", "not null" => "1"), - "user" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "server" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "port" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""), + "mailbox" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "user" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "pass" => array("type" => "text", "not null" => "1"), - "reply_to" => array("type" => "varchar(255)", "not null" => "1"), - "action" => array("type" => "int(11)", "not null" => "1"), - "movetofolder" => array("type" => "varchar(255)", "not null" => "1"), + "reply_to" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "action" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "movetofolder" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "pubmail" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "last_check" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), @@ -882,8 +881,8 @@ function db_definition() { $database["manage"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "mid" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "mid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -893,19 +892,19 @@ function db_definition() { $database["notify"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "hash" => array("type" => "varchar(64)", "not null" => "1"), - "type" => array("type" => "int(11)", "not null" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), - "photo" => array("type" => "varchar(255)", "not null" => "1"), - "date" => array("type" => "datetime", "not null" => "1"), + "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), + "type" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "msg" => array("type" => "mediumtext", "not null" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "link" => array("type" => "varchar(255)", "not null" => "1"), - "parent" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "link" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "parent" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "seen" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "verb" => array("type" => "varchar(255)", "not null" => "1"), - "otype" => array("type" => "varchar(16)", "not null" => "1"), + "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "otype" => array("type" => "varchar(16)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -915,10 +914,10 @@ function db_definition() { $database["notify-threads"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "notify-id" => array("type" => "int(11)", "not null" => "1"), + "notify-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "master-parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "parent-item" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), - "receiver-uid" => array("type" => "int(11)", "not null" => "1"), + "receiver-uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -930,8 +929,8 @@ function db_definition() { "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "cat" => array("type" => "varchar(255)", "not null" => "1"), - "k" => array("type" => "varchar(255)", "not null" => "1"), + "cat" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "k" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "v" => array("type" => "mediumtext", "not null" => "1"), ), "indexes" => array( @@ -942,22 +941,22 @@ function db_definition() { $database["photo"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "contact-id" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), - "guid" => array("type" => "varchar(64)", "not null" => "1"), - "resource-id" => array("type" => "varchar(255)", "not null" => "1"), - "created" => array("type" => "datetime", "not null" => "1"), - "edited" => array("type" => "datetime", "not null" => "1"), - "title" => array("type" => "varchar(255)", "not null" => "1"), + "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), + "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "edited" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "title" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "desc" => array("type" => "text", "not null" => "1"), - "album" => array("type" => "varchar(255)", "not null" => "1"), - "filename" => array("type" => "varchar(255)", "not null" => "1"), + "album" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "type" => array("type" => "varchar(128)", "not null" => "1", "default" => "image/jpeg"), - "height" => array("type" => "smallint(6)", "not null" => "1"), - "width" => array("type" => "smallint(6)", "not null" => "1"), + "height" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"), + "width" => array("type" => "smallint(6)", "not null" => "1", "default" => "0"), "datasize" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "data" => array("type" => "mediumblob", "not null" => "1"), - "scale" => array("type" => "tinyint(3)", "not null" => "1"), + "scale" => array("type" => "tinyint(3)", "not null" => "1", "default" => "0"), "profile" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "allow_cid" => array("type" => "mediumtext", "not null" => "1"), "allow_gid" => array("type" => "mediumtext", "not null" => "1"), @@ -974,7 +973,7 @@ function db_definition() { $database["poll"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "q0" => array("type" => "mediumtext", "not null" => "1"), "q1" => array("type" => "mediumtext", "not null" => "1"), "q2" => array("type" => "mediumtext", "not null" => "1"), @@ -994,8 +993,8 @@ function db_definition() { $database["poll_result"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "poll_id" => array("type" => "int(11)", "not null" => "1"), - "choice" => array("type" => "int(11)", "not null" => "1"), + "poll_id" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "choice" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1006,32 +1005,32 @@ function db_definition() { $database["profile"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "profile-name" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "is-default" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "hide-friends" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "pdesc" => array("type" => "varchar(255)", "not null" => "1"), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "pdesc" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00"), - "address" => array("type" => "varchar(255)", "not null" => "1"), - "locality" => array("type" => "varchar(255)", "not null" => "1"), - "region" => array("type" => "varchar(255)", "not null" => "1"), - "postal-code" => array("type" => "varchar(32)", "not null" => "1"), - "country-name" => array("type" => "varchar(255)", "not null" => "1"), - "hometown" => array("type" => "varchar(255)", "not null" => "1"), - "gender" => array("type" => "varchar(32)", "not null" => "1"), - "marital" => array("type" => "varchar(255)", "not null" => "1"), + "address" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "locality" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "region" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "postal-code" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), + "country-name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "hometown" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), + "marital" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "with" => array("type" => "text", "not null" => "1"), "howlong" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), - "sexual" => array("type" => "varchar(255)", "not null" => "1"), - "politic" => array("type" => "varchar(255)", "not null" => "1"), - "religion" => array("type" => "varchar(255)", "not null" => "1"), + "sexual" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "politic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "religion" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "pub_keywords" => array("type" => "text", "not null" => "1"), "prv_keywords" => array("type" => "text", "not null" => "1"), "likes" => array("type" => "text", "not null" => "1"), "dislikes" => array("type" => "text", "not null" => "1"), "about" => array("type" => "text", "not null" => "1"), - "summary" => array("type" => "varchar(255)", "not null" => "1"), + "summary" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "music" => array("type" => "text", "not null" => "1"), "book" => array("type" => "text", "not null" => "1"), "tv" => array("type" => "text", "not null" => "1"), @@ -1041,9 +1040,9 @@ function db_definition() { "work" => array("type" => "text", "not null" => "1"), "education" => array("type" => "text", "not null" => "1"), "contact" => array("type" => "text", "not null" => "1"), - "homepage" => array("type" => "varchar(255)", "not null" => "1"), - "photo" => array("type" => "varchar(255)", "not null" => "1"), - "thumb" => array("type" => "varchar(255)", "not null" => "1"), + "homepage" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "thumb" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "net-publish" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), ), @@ -1055,11 +1054,11 @@ function db_definition() { $database["profile_check"] = array( "fields" => array( "id" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(10) unsigned", "not null" => "1"), + "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "cid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), - "dfrn_id" => array("type" => "varchar(255)", "not null" => "1"), - "sec" => array("type" => "varchar(255)", "not null" => "1"), - "expire" => array("type" => "int(11)", "not null" => "1"), + "dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "sec" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "expire" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1068,13 +1067,13 @@ function db_definition() { $database["push_subscriber"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "callback_url" => array("type" => "varchar(255)", "not null" => "1"), - "topic" => array("type" => "varchar(255)", "not null" => "1"), - "nickname" => array("type" => "varchar(255)", "not null" => "1"), - "push" => array("type" => "int(11)", "not null" => "1"), - "last_update" => array("type" => "datetime", "not null" => "1"), - "secret" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "topic" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "push" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "last_update" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "secret" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1083,10 +1082,10 @@ function db_definition() { $database["queue"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "cid" => array("type" => "int(11)", "not null" => "1"), - "network" => array("type" => "varchar(32)", "not null" => "1"), - "created" => array("type" => "datetime", "not null" => "1"), - "last" => array("type" => "datetime", "not null" => "1"), + "cid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), + "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "last" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "content" => array("type" => "mediumtext", "not null" => "1"), "batch" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), ), @@ -1102,11 +1101,11 @@ function db_definition() { $database["register"] = array( "fields" => array( "id" => array("type" => "int(11) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "hash" => array("type" => "varchar(255)", "not null" => "1"), - "created" => array("type" => "datetime", "not null" => "1"), - "uid" => array("type" => "int(11) unsigned", "not null" => "1"), - "password" => array("type" => "varchar(255)", "not null" => "1"), - "language" => array("type" => "varchar(16)", "not null" => "1"), + "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "created" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), + "uid" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), + "password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "language" => array("type" => "varchar(16)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1115,8 +1114,8 @@ function db_definition() { $database["search"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), - "term" => array("type" => "varchar(255)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1127,9 +1126,9 @@ function db_definition() { $database["session"] = array( "fields" => array( "id" => array("type" => "bigint(20) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "sid" => array("type" => "varchar(255)", "not null" => "1"), + "sid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "data" => array("type" => "text", "not null" => "1"), - "expire" => array("type" => "int(10) unsigned", "not null" => "1"), + "expire" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1144,7 +1143,7 @@ function db_definition() { "retract_iid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "signed_text" => array("type" => "mediumtext", "not null" => "1"), "signature" => array("type" => "text", "not null" => "1"), - "signer" => array("type" => "varchar(255)", "not null" => "1"), + "signer" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1155,10 +1154,10 @@ function db_definition() { $database["spam"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "spam" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "ham" => array("type" => "int(11)", "not null" => "1", "default" => "0"), - "term" => array("type" => "varchar(255)", "not null" => "1"), + "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), ), "indexes" => array( @@ -1172,11 +1171,11 @@ function db_definition() { $database["term"] = array( "fields" => array( "tid" => array("type" => "int(10) unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "oid" => array("type" => "int(10) unsigned", "not null" => "1"), - "otype" => array("type" => "tinyint(3) unsigned", "not null" => "1"), - "type" => array("type" => "tinyint(3) unsigned", "not null" => "1"), - "term" => array("type" => "varchar(255)", "not null" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), + "oid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), + "otype" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"), + "type" => array("type" => "tinyint(3) unsigned", "not null" => "1", "default" => "0"), + "term" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "aid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), "uid" => array("type" => "int(10) unsigned", "not null" => "1", "default" => "0"), ), @@ -1213,7 +1212,7 @@ function db_definition() { "origin" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "forum_mode" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "mention" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "network" => array("type" => "varchar(32)", "not null" => "1"), + "network" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("iid"), @@ -1232,10 +1231,10 @@ function db_definition() { "fields" => array( "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1"), "secret" => array("type" => "text", "not null" => "1"), - "client_id" => array("type" => "varchar(20)", "not null" => "1"), - "expires" => array("type" => "int(11)", "not null" => "1"), - "scope" => array("type" => "varchar(200)", "not null" => "1"), - "uid" => array("type" => "int(11)", "not null" => "1"), + "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => ""), + "expires" => array("type" => "int(11)", "not null" => "1", "default" => "0"), + "scope" => array("type" => "varchar(200)", "not null" => "1", "default" => ""), + "uid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1244,10 +1243,10 @@ function db_definition() { $database["unique_contacts"] = array( "fields" => array( "id" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "url" => array("type" => "varchar(255)", "not null" => "1"), - "nick" => array("type" => "varchar(255)", "not null" => "1"), - "name" => array("type" => "varchar(255)", "not null" => "1"), - "avatar" => array("type" => "varchar(255)", "not null" => "1"), + "url" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "name" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), ), "indexes" => array( "PRIMARY" => array("id"), @@ -1257,19 +1256,19 @@ function db_definition() { $database["user"] = array( "fields" => array( "uid" => array("type" => "int(11)", "not null" => "1", "extra" => "auto_increment", "primary" => "1"), - "guid" => array("type" => "varchar(64)", "not null" => "1"), - "username" => array("type" => "varchar(255)", "not null" => "1"), - "password" => array("type" => "varchar(255)", "not null" => "1"), - "nickname" => array("type" => "varchar(255)", "not null" => "1"), - "email" => array("type" => "varchar(255)", "not null" => "1"), - "openid" => array("type" => "varchar(255)", "not null" => "1"), - "timezone" => array("type" => "varchar(128)", "not null" => "1"), + "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => ""), + "username" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "password" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "email" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "openid" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), + "timezone" => array("type" => "varchar(128)", "not null" => "1", "default" => ""), "language" => array("type" => "varchar(32)", "not null" => "1", "default" => "en"), "register_date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "login_date" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), - "default-location" => array("type" => "varchar(255)", "not null" => "1"), + "default-location" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "allow_location" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "theme" => array("type" => "varchar(255)", "not null" => "1"), + "theme" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "pubkey" => array("type" => "text", "not null" => "1"), "prvkey" => array("type" => "text", "not null" => "1"), "spubkey" => array("type" => "text", "not null" => "1"), @@ -1284,14 +1283,14 @@ function db_definition() { "notify-flags" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "65535"), "page-flags" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "prvnets" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "pwdreset" => array("type" => "varchar(255)", "not null" => "1"), + "pwdreset" => array("type" => "varchar(255)", "not null" => "1", "default" => ""), "maxreq" => array("type" => "int(11)", "not null" => "1", "default" => "10"), "expire" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), "account_removed" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "account_expired" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "account_expires_on" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), "expire_notification_sent" => array("type" => "datetime", "not null" => "1", "default" => "0000-00-00 00:00:00"), - "service_class" => array("type" => "varchar(32)", "not null" => "1"), + "service_class" => array("type" => "varchar(32)", "not null" => "1", "default" => ""), "def_gid" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "allow_cid" => array("type" => "mediumtext", "not null" => "1"), "allow_gid" => array("type" => "mediumtext", "not null" => "1"), diff --git a/update.php b/update.php index 51b532d88..10195c1ba 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ Date: Mon, 10 Nov 2014 15:07:35 +0100 Subject: [PATCH 08/25] small indentation fix --- mod/network.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mod/network.php b/mod/network.php index bff30f7fc..71f9f2578 100644 --- a/mod/network.php +++ b/mod/network.php @@ -16,11 +16,11 @@ function network_init(&$a) { } } - // convert query string to array. remove friendica args - $query_array = array(); - $query_string = str_replace($a->cmd."?", "", $a->query_string); - parse_str($query_string, $query_array); - array_shift($query_array); + // convert query string to array. remove friendica args + $query_array = array(); + $query_string = str_replace($a->cmd."?", "", $a->query_string); + parse_str($query_string, $query_array); + array_shift($query_array); // fetch last used network view and redirect if needed if(! $is_a_date_query) { @@ -73,11 +73,11 @@ function network_init(&$a) { $net_baseurl .= $tab_baseurls[$k]; - // parse out tab queries - $dest_qa = array(); - $dest_qs = $tab_args[$k]; - parse_str( $dest_qs, $dest_qa); - $net_args = array_merge($net_args, $dest_qa); + // parse out tab queries + $dest_qa = array(); + $dest_qs = $tab_args[$k]; + parse_str( $dest_qs, $dest_qa); + $net_args = array_merge($net_args, $dest_qa); } else if($sel_tabs[4] === 'active') { // The '/new' tab is selected From 2fee5966f1544d493420a735687bcee48d6baec2 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Mon, 10 Nov 2014 15:37:52 +0100 Subject: [PATCH 09/25] fix #1222 --- mod/network.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mod/network.php b/mod/network.php index 71f9f2578..1cb72aeba 100644 --- a/mod/network.php +++ b/mod/network.php @@ -22,6 +22,7 @@ function network_init(&$a) { parse_str($query_string, $query_array); array_shift($query_array); + // fetch last used network view and redirect if needed if(! $is_a_date_query) { $sel_tabs = network_query_get_sel_tab($a); @@ -44,7 +45,7 @@ function network_init(&$a) { else if($sel_groups !== false) { $net_baseurl .= '/' . $sel_groups; } - + if($remember_tab) { // redirect if current selected tab is '/network' and // last selected tab is _not_ '/network?f=&order=comment'. @@ -87,16 +88,20 @@ function network_init(&$a) { if($remember_net) { $net_args['nets'] = $last_sel_nets; } - + else if($sel_nets!==false) { + $net_args['nets'] = $sel_nets; + } + if($remember_tab || $remember_net || $remember_group) { $net_args = array_merge($query_array, $net_args); $net_queries = build_querystring($net_args); - + $redir_url = ($net_queries ? $net_baseurl."?".$net_queries : $net_baseurl); + goaway($a->get_baseurl() . $redir_url); } } - + if(x($_GET['nets']) && $_GET['nets'] === 'all') unset($_GET['nets']); From ba2567fdf34acea56dbb4d39d2bcd0aa79ea6df9 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 11 Nov 2014 00:43:04 +0000 Subject: [PATCH 10/25] Move a hub that's no longer a Friendica hub from the doco. This is also listed in the German entries. I left it there for somebody German to fix because it can't be easily removed. --- doc/Making-Friends.md | 4 +--- doc/andfinally.md | 4 ---- doc/de/Quick-Start-andfinally.md | 4 ---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/doc/Making-Friends.md b/doc/Making-Friends.md index 70b87abbc..e0b1a254e 100644 --- a/doc/Making-Friends.md +++ b/doc/Making-Friends.md @@ -5,9 +5,7 @@ Making Friends Friendship in Friendica can take on a great many different meanings. But let's keep it simple, you want to be friends with somebody. How do you do it? -The easiest thing to do is to join the New Here group. This group is especially for people new to the Friendica network. Simply connect to the group, post to the wall, and make new friends. You don't even have to like us - comment on a few of our posts, and other people will start to add you too. - -The next thing you can do is look at the Directory. The directory is split up into two parts. If you click the directory button, you will be presented with a list of all members (who chose to be listed) on your server. You'll also see a link to the Global Directory. If you click through to the global directory, you will be presented with a list of everybody who chose to be listed across all instances of Friendica. You will also see a "Show Community Forums" link, which will direct you to Groups, Forums and Fanpages. You connect to people, groups and forums in the same way, except groups and forums will automatically accept your introduction request, whereas a human will approve you manually. +The first thing you can do is look at the Directory. The directory is split up into two parts. If you click the directory button, you will be presented with a list of all members (who chose to be listed) on your server. You'll also see a link to the Global Directory. If you click through to the global directory, you will be presented with a list of everybody who chose to be listed across all instances of Friendica. You will also see a "Show Community Forums" link, which will direct you to Groups, Forums and Fanpages. You connect to people, groups and forums in the same way, except groups and forums will automatically accept your introduction request, whereas a human will approve you manually. To connect with other Friendica users: diff --git a/doc/andfinally.md b/doc/andfinally.md index c4e8cb948..f7aeb1bd4 100644 --- a/doc/andfinally.md +++ b/doc/andfinally.md @@ -7,12 +7,8 @@ Here are some more things to help get you started: **Groups** -- New Here - a group for people new to Friendica - - Friendica Support - problems? This is the place to ask. -- Public Stream - a place to talk about anything to anyone. - - Let's Talk a group for finding people and groups who share similar interests. - Local Friendica a page for local Friendica groups diff --git a/doc/de/Quick-Start-andfinally.md b/doc/de/Quick-Start-andfinally.md index 06a1878ba..b6e492ae6 100644 --- a/doc/de/Quick-Start-andfinally.md +++ b/doc/de/Quick-Start-andfinally.md @@ -8,12 +8,8 @@ Hier sind noch einige weitere Dinge, die dir den Start vereinfachen können. **Gruppen** -- Neu hier? - eine Gruppe für Leute, die neu bei Friendica sind - - Friendica Support - Probleme? Dann ist das der Platz, um zu fragen! -- Öffentlicher Stream - ein Platz, um über alles mit jedem zu reden. - - Let's Talk eine Gruppe, um Leute und Gruppen mit gleichen Interessen zu finden - Local Friendica eine Seite für lokale Friendica-Gruppen From efab6031d5d47e406602b873dcbd18a6206c9c56 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Thu, 13 Nov 2014 08:28:49 +0100 Subject: [PATCH 11/25] applying the removal of that host from the German /help as well --- doc/de/Making-Friends.md | 4 +--- doc/de/andfinally.md | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/doc/de/Making-Friends.md b/doc/de/Making-Friends.md index e6725228f..74f1f62b3 100644 --- a/doc/de/Making-Friends.md +++ b/doc/de/Making-Friends.md @@ -5,9 +5,7 @@ Freunde finden Freundschaft kann in Friendica viele verschiedene Bedeutungen annehmen. Aber lasst es uns einfach halten, du willst einfach mit jemandem befreundet sein. Wie machst du das? -Der einfachste Weg, um das zu machen, ist es, der Gruppe Neu hier beizutreten. Diese Gruppe ist speziell für Leute, die neu im Friendica-Netzwerk sind. Verbinde dich einfach mit der Gruppe, schreibe auf die "Wall" und lerne neue Leute kennen. Du musst uns nicht einmal direkt "liken" - kommentiere einige Beiträge und andere Leute werden anfangen, dich hinzuzufügen. - -Als Nächstes kannst du dir das Verzeichnis anschauen. Das Verzeichnis ist in zwei Teile aufgeteilt. Wenn du auf den "Verzeichnis"-Button klickst, wirst du zunächst alle Mitglieder deines Servers sehen, die sich dazu entschlossen haben, angezeigt zu werden. Außerdem siehst du dort einen Link zum globalen Verzeichnis. Wenn du dich durch das globale Verzeichnis klickst, siehst du alle Nutzer weltweit auf allen Servern, die sich entschlossen haben, im Verzeichnis zu erscheinen. Du wirst außerdem den Link "Show Community Forums" sehen, welcher dich zu Gruppen, Foren und Fan-Seiten führt. Du verbindest dich mit Personen, Gruppen und Foren auf die gleiche Art, wobei Gruppen und Foren deine Anfrage automatisch annehmen, wohingegen ein Mensch dich erst manuell bestätigen muss. +Schau dir das Verzeichnis an. Das Verzeichnis ist in zwei Teile aufgeteilt. Wenn du auf den "Verzeichnis"-Button klickst, wirst du zunächst alle Mitglieder deines Servers sehen, die sich dazu entschlossen haben, angezeigt zu werden. Außerdem siehst du dort einen Link zum globalen Verzeichnis. Wenn du dich durch das globale Verzeichnis klickst, siehst du alle Nutzer weltweit auf allen Servern, die sich entschlossen haben, im Verzeichnis zu erscheinen. Du wirst außerdem den Link "Show Community Forums" sehen, welcher dich zu Gruppen, Foren und Fan-Seiten führt. Du verbindest dich mit Personen, Gruppen und Foren auf die gleiche Art, wobei Gruppen und Foren deine Anfrage automatisch annehmen, wohingegen ein Mensch dich erst manuell bestätigen muss. *Mit anderen Friendica-Nutzern verbinden* diff --git a/doc/de/andfinally.md b/doc/de/andfinally.md index 06a1878ba..b6e492ae6 100644 --- a/doc/de/andfinally.md +++ b/doc/de/andfinally.md @@ -8,12 +8,8 @@ Hier sind noch einige weitere Dinge, die dir den Start vereinfachen können. **Gruppen** -- Neu hier? - eine Gruppe für Leute, die neu bei Friendica sind - - Friendica Support - Probleme? Dann ist das der Platz, um zu fragen! -- Öffentlicher Stream - ein Platz, um über alles mit jedem zu reden. - - Let's Talk eine Gruppe, um Leute und Gruppen mit gleichen Interessen zu finden - Local Friendica eine Seite für lokale Friendica-Gruppen From 9a414cc4a0e02db0c31b6b6fbe92137c12d4959c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 15 Nov 2014 19:21:54 +0100 Subject: [PATCH 12/25] Bugfix: There was a SQL error when trying to deliver friendica posts because of a parameter mismatch --- mod/dfrn_notify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 2aa654534..43414dc87 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -193,7 +193,7 @@ function dfrn_notify_content(&$a) { $r = q("DELETE FROM `challenge` WHERE `expire` < " . intval(time())); $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` ) - VALUES( '%s', '%s', %d ) ", + VALUES( '%s', '%s', %d, '%s', '%s' ) ", dbesc($hash), dbesc($dfrn_id), intval(time() + 90 ), From 2b65d776852bc8302602557b6a0752c5bd4191bd Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Sun, 16 Nov 2014 13:47:35 +0100 Subject: [PATCH 13/25] Updage CHANGELOG --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 165695f8f..d910917e9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +Version 3.3.2 + + Set default value for all not-null fields (fixes SQL warinigs) (annando) + Fix item filters in network page (issue #1222) (fabrixxm) + Remove reference to an ex Friendica hub from documentation (beardyunixer, tobiasd) + Version 3.3.1 JSONP support for API (fabrixxm) From f8f7cc9292e2f01637f0fec991229e8ffe16b83b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 18 Nov 2014 23:55:45 +0100 Subject: [PATCH 14/25] API: Possibilty of throttling when posting limit is reached --- include/api.php | 61 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 374a71847..ffa5d0e9d 100644 --- a/include/api.php +++ b/include/api.php @@ -169,7 +169,7 @@ $json = json_encode($rr); if ($_GET['callback']) $json = $_GET['callback']."(".$json.")"; - return $json; + return $json; break; case "rss": header ("Content-Type: application/rss+xml"); @@ -681,6 +681,7 @@ logger('api_statuses_update: no user'); return false; } + $user_info = api_get_user($a); // convert $_POST array items to the form we use for web posts. @@ -725,6 +726,64 @@ if($parent) $_REQUEST['type'] = 'net-comment'; else { + // Check for throttling (maximum posts per day, week and month) + $throttle_day = get_config('system','throttle_limit_day'); + if ($throttle_day > 0) { + $datefrom = date("Y-m-d H:i:s", time() - 24*60*60); + + $r = q("SELECT COUNT(*) AS `posts_day` FROM `item` WHERE `uid`=%d AND `wall` + AND `created` > '%s' AND `id` = `parent`", + intval(api_user()), dbesc($datefrom)); + + if ($r) + $posts_day = $r[0]["posts_day"]; + else + $posts_day = 0; + + if ($posts_day > $throttle_day) { + logger('Daily posting limit reached for user '.api_user(), LOGGER_DEBUG); + die(api_error($a, $type, sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day))); + } + } + + $throttle_week = get_config('system','throttle_limit_week'); + if ($throttle_week > 0) { + $datefrom = date("Y-m-d H:i:s", time() - 24*60*60*7); + + $r = q("SELECT COUNT(*) AS `posts_week` FROM `item` WHERE `uid`=%d AND `wall` + AND `created` > '%s' AND `id` = `parent`", + intval(api_user()), dbesc($datefrom)); + + if ($r) + $posts_week = $r[0]["posts_week"]; + else + $posts_week = 0; + + if ($posts_week > $throttle_week) { + logger('Weekly posting limit reached for user '.api_user(), LOGGER_DEBUG); + die(api_error($a, $type, sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week))); + } + } + + $throttle_month = get_config('system','throttle_limit_month'); + if ($throttle_month > 0) { + $datefrom = date("Y-m-d H:i:s", time() - 24*60*60*30); + + $r = q("SELECT COUNT(*) AS `posts_month` FROM `item` WHERE `uid`=%d AND `wall` + AND `created` > '%s' AND `id` = `parent`", + intval(api_user()), dbesc($datefrom)); + + if ($r) + $posts_month = $r[0]["posts_month"]; + else + $posts_month = 0; + + if ($posts_month > $throttle_month) { + logger('Monthly posting limit reached for user '.api_user(), LOGGER_DEBUG); + die(api_error($a, $type, sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month))); + } + } + $_REQUEST['type'] = 'wall'; if(x($_FILES,'media')) { // upload the image if we have one From 7b26aa2b84d5679168cfa0b61d3329a173377cce Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:45:13 +0100 Subject: [PATCH 15/25] When exporting shared posts to diaspora now removed hashtags will be added again. --- include/bb2diaspora.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 39742291f..d836f325e 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -56,6 +56,8 @@ function diaspora2bb($s) { function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { + $OriginalText = $Text; + // Since Diaspora is creating a summary for links, this function removes them before posting if ($fordiaspora) $Text = bb_remove_share_information($Text); @@ -73,9 +75,20 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) { $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text); // Convert it to HTML - don't try oembed - if ($fordiaspora) + if ($fordiaspora) { $Text = bbcode($Text, $preserve_nl, false, 3); - else { + + // Add all tags that maybe were removed + if (preg_match_all("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",$OriginalText, $tags)) { + $tagline = ""; + foreach($tags[2] as $tag) + if (!strpos($Text, "#".$tag)) + $tagline .= "#".$tag." "; + + $Text = $Text."
".$tagline; + } + + } else { $Text = bbcode($Text, $preserve_nl, false, 4); // Libertree doesn't convert a harizontal rule if there isn't a linefeed $Text = str_replace("
", "

", $Text); From e475cf131d96ac1b9fc82ae598acad811cd9e4aa Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:49:35 +0100 Subject: [PATCH 16/25] When a post contains a picture then a picture in the added information is displayed only as a small preview picture. --- include/bbcode.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 5395548f5..724b8e2fd 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -3,10 +3,10 @@ require_once("include/oembed.php"); require_once('include/event.php'); function bb_attachment($Text, $plaintext = false, $tryoembed = true) { - $Text = preg_replace_callback("/\[attachment(.*?)\](.*?)\[\/attachment\]/ism", + $Text = preg_replace_callback("/(.*?)\[attachment(.*?)\](.*?)\[\/attachment\]/ism", function ($match) use ($plaintext){ - $attributes = $match[1]; + $attributes = $match[2]; $type = ""; preg_match("/type='(.*?)'/ism", $attributes, $matches); @@ -65,6 +65,11 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { $preview = $matches[1]; } + if (((strpos($match[1], "[img=") !== false) OR (strpos($match[1], "[img]") !== false)) AND ($image != "")) { + $preview = $image; + $image = ""; + } + if ($plaintext) $text = sprintf('%s
', $url, $title); else { @@ -83,10 +88,10 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) { $text .= $oembed; - $text .= sprintf('
%s
', trim($match[2])); + $text .= sprintf('
%s
', trim($match[3])); } - return($text); + return($match[1].$text); },$Text); return($Text); From d2d3804e091011f80e1cc1da9b5ed20769e4b177 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:51:41 +0100 Subject: [PATCH 17/25] If a link contains BBCode stuff, make a short link out of this to avoid parsing problems --- include/items.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/items.php b/include/items.php index 5b2755935..0398f5458 100644 --- a/include/items.php +++ b/include/items.php @@ -903,6 +903,12 @@ function add_page_info_data($data) { if ($no_photos AND ($data["type"] == "photo")) return(""); + // If the link contains BBCode stuff, make a short link out of this to avoid parsing problems + if (strpos($data["url"], '[') OR strpos($data["url"], ']')) { + require_once("include/network.php"); + $data["url"] = short_link($data["url"]); + } + if (($data["type"] != "photo") AND is_string($data["title"])) $text .= "[bookmark=".$data["url"]."]".trim($data["title"])."[/bookmark]"; From 0c60eb18f76bd9368f8e4a8276ffd343765c6d47 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:52:51 +0100 Subject: [PATCH 18/25] Some more typical tracking parameter is removed --- include/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/network.php b/include/network.php index eb29a02b6..6a37f4a54 100644 --- a/include/network.php +++ b/include/network.php @@ -1130,7 +1130,7 @@ function original_url($url, $depth=1, $fetchbody = false) { if (in_array($param, array("utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign", "wt_mc", "pk_campaign", "pk_kwd", "mc_cid", "mc_eid", "fb_action_ids", "fb_action_types", "fb_ref", - "awesm", + "awesm", "wtrid", "woo_campaign", "woo_source", "woo_medium", "woo_content", "woo_term"))) { $pair = $param."=".urlencode($value); From 9124d922e9e5bf2b9dbc7ea187237f2a6776bc28 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:54:01 +0100 Subject: [PATCH 19/25] In "parse_url" now links with [ or ] are replaced with shortened versions to avoid parsing problems. --- mod/parse_url.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mod/parse_url.php b/mod/parse_url.php index 564b22c04..06e59b869 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -187,6 +187,9 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true, $co case "description": $siteinfo["text"] = $attr["content"]; break; + case "thumbnail": + $siteinfo["image"] = $attr["content"]; + break; case "twitter:image": $siteinfo["image"] = $attr["content"]; break; @@ -421,6 +424,12 @@ function parse_url_content(&$a) { $url= $siteinfo["url"]; + // If the link contains BBCode stuff, make a short link out of this to avoid parsing problems + if (strpos($url, '[') OR strpos($url, ']')) { + require_once("include/network.php"); + $url = short_link($url); + } + $sitedata = ""; if($siteinfo["title"] == "") { From 8b5412068e55964aae930480b0feecbbb176708c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 1 Dec 2014 22:56:41 +0100 Subject: [PATCH 20/25] When selecting forums there was an added "span" html element. --- js/acl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/acl.js b/js/acl.js index 9c55842fd..487ffafc7 100644 --- a/js/acl.js +++ b/js/acl.js @@ -62,7 +62,7 @@ ACL.prototype.add_mention = function(id) { that.element.val( searchText + that.element.val() ); } else { if ( tinyMCE.activeEditor.getContent({format : 'raw'}).search(searchText) >= 0 ) return; - tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'span', {}, searchText); + tinyMCE.activeEditor.dom.add(tinyMCE.activeEditor.getBody(), 'dummy', {}, searchText); } } From f493252ac8c9cef6626585e1e8de5f7d739bdd83 Mon Sep 17 00:00:00 2001 From: Silke Meyer Date: Sat, 6 Dec 2014 20:05:30 +0100 Subject: [PATCH 21/25] Use a sans-serif font-family in breathe --- view/theme/vier/breathe.css | 1 + 1 file changed, 1 insertion(+) diff --git a/view/theme/vier/breathe.css b/view/theme/vier/breathe.css index 3343cac12..049c1bf4b 100644 --- a/view/theme/vier/breathe.css +++ b/view/theme/vier/breathe.css @@ -3,6 +3,7 @@ body { background-color: #eeeeee !important; + font-family: "Lucida Sans Unicode","Lucida Sans", sans-serif; } header #banner #logo-text { From c398974918347e3491302d63177c787675f53e74 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 8 Dec 2014 11:02:03 +0100 Subject: [PATCH 22/25] Logging to analyse the stale gprobe processes --- include/gprobe.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/gprobe.php b/include/gprobe.php index 0cf32e95f..36650eb9a 100644 --- a/include/gprobe.php +++ b/include/gprobe.php @@ -10,7 +10,7 @@ function gprobe_run(&$argv, &$argc){ if(is_null($a)) { $a = new App; } - + if(is_null($db)) { @include(".htconfig.php"); require_once("include/dba.php"); @@ -37,6 +37,8 @@ function gprobe_run(&$argv, &$argc){ dbesc(normalise_link($url)) ); + logger("gprobe start for ".normalise_link($url), LOGGER_DEBUG); + if(! count($r)) { $arr = probe_url($url); @@ -55,7 +57,8 @@ function gprobe_run(&$argv, &$argc){ } if(count($r)) poco_load(0,0,$r[0]['id'], str_replace('/profile/','/poco/',$r[0]['url'])); - + + logger("gprobe end for ".normalise_link($url), LOGGER_DEBUG); return; } From 620ee6be0bdb4e706abfa2172d3dfb3e2d035e25 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 8 Dec 2014 14:26:44 +0100 Subject: [PATCH 23/25] Cleanup the HTML before parsing it. --- include/Scrape.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/Scrape.php b/include/Scrape.php index 99784af33..ad9e030a3 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -263,6 +263,11 @@ function scrape_feed($url) { } try { + // Cleanup invalid HTML + $doc = new DOMDocument(); + @$doc->loadHTML($s); + $s = $doc->saveHTML(); + $dom = HTML5_Parser::parse($s); } catch (DOMException $e) { logger('scrape_feed: parse error: ' . $e); From 04106ff6f52b03d0d5b009f07a7b6ab11107f0c0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 8 Dec 2014 22:37:49 +0100 Subject: [PATCH 24/25] Moving the clean up code to a central place. --- include/Scrape.php | 5 ----- library/HTML5/Parser.php | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/Scrape.php b/include/Scrape.php index ad9e030a3..99784af33 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -263,11 +263,6 @@ function scrape_feed($url) { } try { - // Cleanup invalid HTML - $doc = new DOMDocument(); - @$doc->loadHTML($s); - $s = $doc->saveHTML(); - $dom = HTML5_Parser::parse($s); } catch (DOMException $e) { logger('scrape_feed: parse error: ' . $e); diff --git a/library/HTML5/Parser.php b/library/HTML5/Parser.php index 5f9ca560e..c7faf875a 100644 --- a/library/HTML5/Parser.php +++ b/library/HTML5/Parser.php @@ -17,6 +17,12 @@ class HTML5_Parser * @return Parsed HTML as DOMDocument */ static public function parse($text, $builder = null) { + + // Cleanup invalid HTML + $doc = new DOMDocument(); + @$doc->loadHTML($text); + $text = $doc->saveHTML(); + $tokenizer = new HTML5_Tokenizer($text, $builder); $tokenizer->parse(); return $tokenizer->save(); From 039e09dd5e6ff495a07ed0c72750222a742de15e Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Wed, 10 Dec 2014 13:41:36 +0100 Subject: [PATCH 25/25] Update CHANGELOG --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d910917e9..bece6b374 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,12 @@ Version 3.3.2 Set default value for all not-null fields (fixes SQL warinigs) (annando) Fix item filters in network page (issue #1222) (fabrixxm) Remove reference to an ex Friendica hub from documentation (beardyunixer, tobiasd) + API throttling (annando) + Use a san-serif font in breathe style of vier theme (silke) + Prevent BBCode parsing problems with URLs (annando) + Add back tags to posts to Diaspora (annando) + Better display of pictures in posts (annando) + Fix out of control gprobe process (annando) Version 3.3.1