]> git.mxchange.org Git - friendica.git/blobdiff - mod/subthread.php
Some more
[friendica.git] / mod / subthread.php
index b85f461dcf85c291ba939a434648eb68b7bd52b7..d4b861baabd7144ee9eba7bd92e8dad4f200bd76 100644 (file)
@@ -1,13 +1,15 @@
 <?php
 
+use Friendica\App;
+use Friendica\Core\System;
+
 require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
 function subthread_content(App $a) {
 
-       if (! local_user() && ! remote_user()) {
+       if(! local_user() && ! remote_user()) {
                return;
        }
 
@@ -20,7 +22,7 @@ function subthread_content(App $a) {
                dbesc($item_id)
        );
 
-       if (! $item_id || (! dbm::is_result($r))) {
+       if(! $item_id || (! dbm::is_result($r))) {
                logger('subthread: no item ' . $item_id);
                return;
        }
@@ -29,13 +31,13 @@ function subthread_content(App $a) {
 
        $owner_uid = $item['uid'];
 
-       if (! can_write_wall($a,$owner_uid)) {
+       if(! can_write_wall($a,$owner_uid)) {
                return;
        }
 
        $remote_owner = null;
 
-       if (! $item['wall']) {
+       if(! $item['wall']) {
                // The top level post may have been written by somebody on another system
                $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($item['contact-id']),
@@ -87,7 +89,7 @@ function subthread_content(App $a) {
 
        $post_type = (($item['resource-id']) ? t('photo') : t('status'));
        $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
-       $link = xmlify('<link rel="alternate" type="text/html" href="' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
+       $link = xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
        $body = $item['body'];
 
        $obj = <<< EOT
@@ -129,7 +131,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;