]> git.mxchange.org Git - friendica.git/blobdiff - mod/subthread.php
Remove unused parameter in can_write_wall()
[friendica.git] / mod / subthread.php
index a00196825bbe4dfb09bfb0be837f9093f8d9c45a..9200c335e1b7b457eefe2441629691fc617d15b8 100644 (file)
@@ -1,11 +1,14 @@
 <?php
 
+use Friendica\App;
+use Friendica\Core\System;
+use Friendica\Database\DBM;
+
 require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-
-function subthread_content(App &$a) {
+function subthread_content(App $a) {
 
        if(! local_user() && ! remote_user()) {
                return;
@@ -20,7 +23,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,7 +32,7 @@ function subthread_content(App &$a) {
 
        $owner_uid = $item['uid'];
 
-       if(! can_write_wall($a,$owner_uid)) {
+       if(! can_write_wall($owner_uid)) {
                return;
        }
 
@@ -41,7 +44,7 @@ function subthread_content(App &$a) {
                        intval($item['contact-id']),
                        intval($item['uid'])
                );
-               if (! dbm::is_result($r)) {
+               if (! DBM::is_result($r)) {
                        return;
                }
                if (! $r[0]['self']) {
@@ -49,13 +52,13 @@ function subthread_content(App &$a) {
                }
        }
 
-       // this represents the post owner on this system. 
+       // this represents the post owner on this system.
 
        $r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
                WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
                intval($owner_uid)
        );
-       if (dbm::is_result($r))
+       if (DBM::is_result($r))
                $owner = $r[0];
 
        if (! $owner) {
@@ -71,13 +74,12 @@ function subthread_content(App &$a) {
 
        if ((local_user()) && (local_user() == $owner_uid)) {
                $contact = $owner;
-       }
-       else {
+       } else {
                $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($_SESSION['visitor_id']),
                        intval($owner_uid)
                );
-               if (dbm::is_result($r))
+               if (DBM::is_result($r))
                        $contact = $r[0];
        }
        if (! $contact) {
@@ -88,7 +90,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
@@ -130,7 +132,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;