]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #1224 from beardy-unixer/development
authortobiasd <tobias.diekershoff@gmx.net>
Tue, 11 Nov 2014 07:30:55 +0000 (08:30 +0100)
committertobiasd <tobias.diekershoff@gmx.net>
Tue, 11 Nov 2014 07:30:55 +0000 (08:30 +0100)
Move a hub that's no longer a Friendica hub from the doco.  This is

17 files changed:
boot.php
include/bbcode.php
include/dbstructure.php
include/items.php
js/main.js
mod/admin.php
mod/dfrn_notify.php
mod/dfrn_poll.php
mod/network.php
update.php
view/templates/admin_site.tpl
view/templates/contact_head.tpl
view/templates/event_head.tpl
view/templates/jot-header.tpl
view/templates/msg-header.tpl
view/templates/profed_head.tpl
view/templates/wallmsg-header.tpl

index eb0eb3e6626c8025f0d54c91349c2666e9cfaa39..44d72bb3cb297872f5f75234c20a8624664beb0f 100644 (file)
--- 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',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
 
@@ -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;
                }
 
index 8efeabb8bfa5c19dd2562af96dfd8003349082af..5395548f51b90279c6497bc2fcdec0c50893a87b 100644 (file)
@@ -66,7 +66,7 @@ function bb_attachment($Text, $plaintext = false, $tryoembed = true) {
                        }
 
                        if ($plaintext)
-                               $text = sprintf('<a href="%s" target="_blank">%s</a>', $url, $title);
+                               $text = sprintf('<a href="%s" target="_blank">%s</a><br>', $url, $title);
                        else {
                                $text = sprintf('<span class="type-%s">', $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,13 +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);
 
-       // 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);
-
        // 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);
@@ -848,21 +813,22 @@ 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);
                } 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('<br />','<br />'), $Text);
 
        if($preserve_nl)
                $Text = str_replace(array("\n","\r"), array('',''),$Text);
 
-
-
        // Set up the parameters for a URL search string
        $URLSearchString = "^\[\]";
        // Set up the parameters for a MAIL search string
index c05bd3796afaccde39e35bbb20e6639f25c91533..66e67c0a9aaf977ca68f0086360fa955d26ca60e 100644 (file)
@@ -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"),
index 37532eaf9adc8c00c05db48ea1e52160a75057cd..5b275593576f82de68aa9902f1764347af05000e 100644 (file)
@@ -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();
index 43d37a99bfcd19b78340bb4019bacad56c63e552..23f63f8224616274d08e5c61c45e0d4dae5eb39d 100644 (file)
@@ -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,
index 224a1f8c6c3b2278902e862e181164b1d4d45ac7..8bddd8ce88ae6c492a2b87bcef95c28e74169f8e 100644 (file)
@@ -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),
index 7f160de44390e0b4be395083bb9fea802d226afd..2aa654534621dbb186a5dd6b61db1068397ae212 100644 (file)
@@ -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 );
index b9fcd8c4a4c7be4978944d1882cf57a0dfa3124c..b5f60a0397e39020cd77253b925e2386136e0277 100644 (file)
@@ -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) {
index bff30f7fc36c2ce331a23385a39399102e35064b..1cb72aebab4e92ad447c89093c9b7124d26e8b60 100644 (file)
@@ -16,12 +16,13 @@ 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) {
                $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'.
@@ -73,11 +74,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
@@ -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']);
 
index 51b532d88d2de234c82809fbf5d76c235bd5443e..10195c1baa39414e56eea937f6861fd8a0c7a895 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define( 'UPDATE_VERSION' , 1174 );
+define( 'UPDATE_VERSION' , 1175 );
 
 /**
  *
index 7237a2f27a22b17142ac60703a2e5dc12f41957c..166b35e7d43d1dddaa5d9da8c11414c88687d94e 100644 (file)
@@ -45,6 +45,7 @@
     <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
 
        {{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}}
index 498cbfbcc4b2fe7c384381a13592e9346cca9969..ceda781eabf80883468f1bd61404cec4e1409990 100644 (file)
@@ -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,
index 8d40be3be9a4da326c9e1201e528cb1aea861a9f..8085a774b3fbdef72a4b0460e0ee47f11173ef12 100644 (file)
@@ -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",
index f8cf96f7c3b2652582a8150831afd7da6c4c39d7..3a67e8bcc40a0a5336b690fff4d4c90d1e72d582 100644 (file)
@@ -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",
index 47b92ddf14a3c0d2738ab3874dced43976d022f3..86598bbf6ce7d6e612fd8a08935a4e4b93c6c2f9 100644 (file)
@@ -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",
index 67e7a85aca50364bfeba2bbd9a1c30bff3758f68..2dbdbcdeb7a3f0b95de8442df78a51bf7808b565 100644 (file)
@@ -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",
index c4d81f8cc069f62e514315f7e6ff9c35d3c725af..f03f496fe2948d060e2eb9db03b03f4b1a365480 100644 (file)
@@ -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",