X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsubthread.php;h=c858f2d1fa3a3c847ea132b823605d33b31496ce;hb=76fdf5c910e8cd887f6f7b83559f4c81c88f507d;hp=b85f461dcf85c291ba939a434648eb68b7bd52b7;hpb=9c2c4839968169a191084d6d2b0d629d82430e67;p=friendica.git diff --git a/mod/subthread.php b/mod/subthread.php index b85f461dcf..c858f2d1fa 100644 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -1,13 +1,20 @@ get_hostname(),$owner_uid); - $post_type = (($item['resource-id']) ? t('photo') : t('status')); + $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status')); $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); - $link = xmlify('' . "\n") ; + $link = xmlify('' . "\n") ; $body = $item['body']; $obj = <<< EOT @@ -101,13 +110,13 @@ function subthread_content(App $a) { $body EOT; - $bodyverb = t('%1$s is following %2$s\'s %3$s'); + $bodyverb = L10n::t('%1$s is following %2$s\'s %3$s'); if (! isset($bodyverb)) { return; } - $arr = array(); + $arr = []; $arr['guid'] = get_guid(32); $arr['uri'] = $uri; @@ -129,7 +138,7 @@ EOT; $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; - $plink = '[url=' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; + $plink = '[url=' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; $arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink ); $arr['verb'] = $activity; @@ -141,20 +150,16 @@ EOT; $arr['deny_gid'] = $item['deny_gid']; $arr['visible'] = 1; $arr['unseen'] = 1; - $arr['last-child'] = 0; - $post_id = item_store($arr); + $post_id = Item::insert($arr); - if (! $item['visible']) { - $r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d", - intval($item['id']), - intval($owner_uid) - ); + if (!$item['visible']) { + Item::update(['visible' => true], ['id' => $item['id']]); } $arr['id'] = $post_id; - call_hooks('post_local_end', $arr); + Addon::callHooks('post_local_end', $arr); killme();