]> git.mxchange.org Git - friendica.git/commitdiff
New fields "author-id" and "owner-id" in the item table
authorMichael Vogel <icarus@dabo.de>
Wed, 15 Jun 2016 19:20:55 +0000 (21:20 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 15 Jun 2016 19:20:55 +0000 (21:20 +0200)
boot.php
database.sql
include/dbstructure.php
include/items.php
update.php

index 318a87346771e7f609bcb9ad2cdfbbbdbfdb1904..62baf116da28c57026b18cb01a670c9c17ede83d 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM',     'Friendica');
 define ( 'FRIENDICA_CODENAME',     'Asparagus');
 define ( 'FRIENDICA_VERSION',      '3.5-dev' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
-define ( 'DB_UPDATE_VERSION',      1196      );
+define ( 'DB_UPDATE_VERSION',      1197      );
 
 /**
  * @brief Constant with a HTML line break.
index 8269a8bba086e80c68479eb3a439cdf4f43e6a53..275982d8446346b1b27ee9485862585f37cb4452 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 3.5-dev (Asparagus)
--- DB_UPDATE_VERSION 1196
+-- DB_UPDATE_VERSION 1197
 -- ------------------------------------------
 
 
@@ -458,9 +458,11 @@ CREATE TABLE IF NOT EXISTS `item` (
        `commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
        `received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
        `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+       `owner-id` int(11) NOT NULL DEFAULT 0,
        `owner-name` varchar(255) NOT NULL DEFAULT '',
        `owner-link` varchar(255) NOT NULL DEFAULT '',
        `owner-avatar` varchar(255) NOT NULL DEFAULT '',
+       `author-id` int(11) NOT NULL DEFAULT 0,
        `author-name` varchar(255) NOT NULL DEFAULT '',
        `author-link` varchar(255) NOT NULL DEFAULT '',
        `author-avatar` varchar(255) NOT NULL DEFAULT '',
index f89a3ff9268b60737edc5bcb4086e34478ed17ff..8ae3ae6c8c8a5f47634e2ca0bbbf37af21ba7adc 100644 (file)
@@ -792,9 +792,11 @@ function db_definition() {
                                        "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-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
                                        "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-id" => array("type" => "int(11)", "not null" => "1", "default" => "0"),
                                        "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" => ""),
index 203b7d0eee6755d0699d8261e3d2da2dedae7d46..f5e568306e4765c8a5a467a5ee5d8c7859f68d2b 100644 (file)
@@ -584,6 +584,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
                                                                 "photo" => $arr['author-avatar'], "name" => $arr['author-name']));
        }
 
+       if ($arr["author-id"] == 0)
+               $arr["author-id"] = get_contact($arr["author-link"], 0);
+
+       if ($arr["owner-id"] == 0)
+               $arr["owner-id"] = get_contact($arr["owner-link"], 0);
+
        if ($arr['guid'] != "") {
                // Checking if there is already an item with the same guid
                logger('checking for an item for user '.$arr['uid'].' on network '.$arr['network'].' with the guid '.$arr['guid'], LOGGER_DEBUG);
index 1189ac4a91b2c5e385e280f7a3908e95ee4e806d..f2d790aa4cb2eb8d15b4d306a6a5d6e5ec91f2e6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define('UPDATE_VERSION' , 1196);
+define('UPDATE_VERSION' , 1197);
 
 /**
  *