X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fthreads.php;h=169a63c7ca144284677a85abf786a6fcc1540fb1;hb=fd5cf0f14728702b21007d133d4b990ecc350581;hp=bb978bc77428f05a962e9d3c355daa149043b20d;hpb=638e6491cc305b0455ae890351183e03e0bce52b;p=friendica.git diff --git a/include/threads.php b/include/threads.php index bb978bc774..169a63c7ca 100644 --- a/include/threads.php +++ b/include/threads.php @@ -1,6 +1,7 @@ $itemuri, 'uid' => 0)); - logger("delete_thread: Deleted shadow for item ".$itemuri." - ".print_r($result, true), LOGGER_DEBUG); + logger("delete_thread: Deleted shadow for item ".$itemuri, LOGGER_DEBUG); } } } @@ -262,7 +270,7 @@ function delete_thread($itemid, $itemuri = "") { function update_threads() { logger("update_threads: start"); - $messages = dba::p("SELECT `id` FROM `item` WHERE `id` = `parent`"); + $messages = dba::select('item', array('id'), array("`id` = `parent`")); logger("update_threads: fetched messages: ".dba::num_rows($messages)); @@ -277,7 +285,7 @@ function update_threads_mention() { $users = q("SELECT `uid`, `nickname` FROM `user` ORDER BY `uid`"); foreach ($users AS $user) { - $self = normalise_link(App::get_baseurl() . '/profile/' . $user['nickname']); + $self = normalise_link(System::baseUrl() . '/profile/' . $user['nickname']); $selfhttps = str_replace("http://", "https://", $self); $parents = q("SELECT DISTINCT(`parent`) FROM `item` WHERE `uid` = %d AND ((`owner-link` IN ('%s', '%s')) OR (`author-link` IN ('%s', '%s')))", @@ -292,9 +300,9 @@ function update_threads_mention() { function update_shadow_copy() { logger("start"); - $messages = dba::p("SELECT `iid` FROM `thread` WHERE `uid` != 0 AND `network` IN ('', ?, ?, ?) - AND `visible` AND NOT `deleted` AND NOT `moderated` AND NOT `private` ORDER BY `created`", - NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS); + $condition = "`uid` != 0 AND `network` IN ('', ?, ?, ?) AND `visible` AND NOT `deleted` AND NOT `moderated` AND NOT `private`"; + $messages = dba::select('thread', array('iid'), array($condition, NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS), + array('order' => 'created')); logger("fetched messages: ".dba::num_rows($messages)); while ($message = dba::fetch($messages))