X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fthreads.php;h=48391174ecd683eaaf9d577f6e1d777d64d1d8c0;hb=8039ad0e2318c28a22f87c31dbbdb3165f1ef058;hp=3cfa02564036b4d38577da017a31ee48f1b243a7;hpb=98bba66dcb335a86385967bc08ce30f5be0f4b75;p=friendica.git diff --git a/include/threads.php b/include/threads.php index 3cfa025640..48391174ec 100644 --- a/include/threads.php +++ b/include/threads.php @@ -1,7 +1,9 @@ $data) - if (!in_array($field, array("guid", "title", "body"))) { + if (!in_array($field, array("guid", "title", "body", "rendered-html", "rendered-hash"))) { if ($sql != "") $sql .= ", "; @@ -143,9 +211,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); @@ -171,8 +241,8 @@ function delete_thread($itemid, $itemuri = "") { dbesc($itemuri), intval($item["uid"]) ); - if (!count($r)) { - $r = q("DELETE FROM `item` WHERE `uri` = '%s' AND `uid` = 0)", + if (!dbm::is_result($r)) { + $r = q("DELETE FROM `item` WHERE `uri` = '%s' AND `uid` = 0", dbesc($itemuri) ); logger("delete_thread: Deleted shadow for item ".$itemuri." - ".print_r($result, true), LOGGER_DEBUG); @@ -189,8 +259,10 @@ function update_threads() { logger("update_threads: fetched messages: ".count($messages)); - while ($message = $db->qfetch()) + while ($message = $db->qfetch()) { add_thread($message["id"]); + add_shadow_thread($message["id"]); + } $db->qclose(); } @@ -223,7 +295,7 @@ function update_shadow_copy() { logger("fetched messages: ".count($messages)); while ($message = $db->qfetch()) - add_thread($message["iid"], true); + add_shadow_thread($message["iid"]); $db->qclose(); }