]> git.mxchange.org Git - friendica.git/blobdiff - include/threads.php
Automatically refresh after two minutes when system is overloaded
[friendica.git] / include / threads.php
index 21fdb0df34000f4e0a60c49fd8ed74f7c1637371..0b2b26e8d242886b870fa3595563d031c23e4f32 100644 (file)
@@ -1,7 +1,9 @@
 <?php
 function add_thread($itemid, $onlyshadow = false) {
-       $items = q("SELECT `uid`, `created`, `edited`, `commented`, `received`, `changed`, `wall`, `private`, `pubmail`, `moderated`, `visible`, `spam`, `starred`, `bookmark`, `contact-id`, `gcontact-id`,
-                       `deleted`, `origin`, `forum_mode`, `mention`, `network`  FROM `item` WHERE `id` = %d AND (`parent` = %d OR `parent` = 0) LIMIT 1", intval($itemid), intval($itemid));
+       $items = q("SELECT `uid`, `created`, `edited`, `commented`, `received`, `changed`, `wall`, `private`, `pubmail`,
+                       `moderated`, `visible`, `spam`, `starred`, `bookmark`, `contact-id`, `gcontact-id`,
+                       `deleted`, `origin`, `forum_mode`, `mention`, `network`, `author-id`, `owner-id`
+               FROM `item` WHERE `id` = %d AND (`parent` = %d OR `parent` = 0) LIMIT 1", intval($itemid), intval($itemid));
 
        if (!$items)
                return;
@@ -65,19 +67,13 @@ function add_thread($itemid, $onlyshadow = false) {
                        require_once("include/Contact.php");
 
                        unset($item[0]['id']);
-                       unset($item[0]['shadow']);
                        $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);
 
                        logger("add_thread: Stored public shadow for post ".$itemid." under id ".$public_shadow, LOGGER_DEBUG);
-               } else
-                       $public_shadow = $r[0]["id"];
-
-               if ($public_shadow > 0)
-                       q("UPDATE `item` SET `shadow` = %d WHERE `id` = %d", intval($public_shadow), intval($itemid));
-
+               }
        }
 }