X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fthreads.php;h=0320eaa018e98b28a04179f79aae2b020bbd68da;hb=999ef7f6793f790aefdf8a40e1b0c5cb30b9be7e;hp=44a7e6538447fc55baa41cdd53f5b92f857b5c7c;hpb=885dc1df81c9ab752f9f5d66894786944184a9c9;p=friendica.git diff --git a/include/threads.php b/include/threads.php index 44a7e65384..0320eaa018 100644 --- a/include/threads.php +++ b/include/threads.php @@ -66,6 +66,7 @@ function add_thread($itemid, $onlyshadow = false) { unset($item[0]['id']); $item[0]['uid'] = 0; + $item[0]['origin'] = 0; $item[0]['contact-id'] = get_contact($item[0]['author-link'], 0); $public_shadow = item_store($item[0], false, false, true); @@ -111,8 +112,8 @@ function update_thread_uri($itemuri, $uid) { } function update_thread($itemid, $setmention = false) { - $items = q("SELECT `uid`, `guid`, `title`, `body`, `created`, `edited`, `commented`, `received`, `changed`, `wall`, `private`, `pubmail`, `moderated`, `visible`, `spam`, `starred`, `bookmark`, `contact-id`, 'gcontact-id`, - `deleted`, `origin`, `forum_mode`, `network` FROM `item` WHERE `id` = %d AND (`parent` = %d OR `parent` = 0) LIMIT 1", intval($itemid), intval($itemid)); + $items = q("SELECT `uid`, `guid`, `title`, `body`, `created`, `edited`, `commented`, `received`, `changed`, `wall`, `private`, `pubmail`, `moderated`, `visible`, `spam`, `starred`, `bookmark`, `contact-id`, `gcontact-id`, + `deleted`, `origin`, `forum_mode`, `network`, `rendered-html`, `rendered-hash` FROM `item` WHERE `id` = %d AND (`parent` = %d OR `parent` = 0) LIMIT 1", intval($itemid), intval($itemid)); if (!$items) return; @@ -125,7 +126,7 @@ function update_thread($itemid, $setmention = false) { $sql = ""; foreach ($item AS $field => $data) - if (!in_array($field, array("guid", "title", "body"))) { + if (!in_array($field, array("guid", "title", "body", "rendered-html", "rendered-hash"))) { if ($sql != "") $sql .= ", "; @@ -142,9 +143,11 @@ function update_thread($itemid, $setmention = false) { if (!$items) return; - $result = q("UPDATE `item` SET `title` = '%s', `body` = '%s' WHERE `id` = %d", + $result = q("UPDATE `item` SET `title` = '%s', `body` = '%s', `rendered-html` = '%s', `rendered-hash` = '%s' WHERE `id` = %d", dbesc($item["title"]), dbesc($item["body"]), + dbesc($item["rendered-html"]), + dbesc($item["rendered-hash"]), intval($items[0]["id"]) ); logger("Updating public shadow for post ".$items[0]["id"]." - guid ".$item["guid"]." Result: ".print_r($result, true), LOGGER_DEBUG);