]> git.mxchange.org Git - friendica.git/blobdiff - mod/subthread.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / mod / subthread.php
index 1486a33b429bc2de89eee738a246ec08121ee6f8..4d044f45f8297e58bdbb0e0804f97d90e5d413dc 100644 (file)
@@ -20,7 +20,7 @@ function subthread_content(&$a) {
                dbesc($item_id)
        );
 
-       if(! $item_id || (! count($r))) {
+       if(! $item_id || (! dbm::is_result($r))) {
                logger('subthread: no item ' . $item_id);
                return;
        }
@@ -41,7 +41,7 @@ function subthread_content(&$a) {
                        intval($item['contact-id']),
                        intval($item['uid'])
                );
-               if(! count($r))
+               if(! dbm::is_result($r))
                        return;
                if(! $r[0]['self'])
                        $remote_owner = $r[0];
@@ -53,7 +53,7 @@ function subthread_content(&$a) {
                WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
                intval($owner_uid)
        );
-       if(count($r))
+       if(dbm::is_result($r))
                $owner = $r[0];
 
        if(! $owner) {
@@ -75,7 +75,7 @@ function subthread_content(&$a) {
                        intval($_SESSION['visitor_id']),
                        intval($owner_uid)
                );
-               if(count($r))
+               if(dbm::is_result($r))
                        $contact = $r[0];
        }
        if(! $contact) {
@@ -103,10 +103,11 @@ EOT;
        $bodyverb = t('%1$s is following %2$s\'s %3$s');
 
        if(! isset($bodyverb))
-                       return; 
+                       return;
 
        $arr = array();
 
+       $arr['guid'] = get_guid(32);
        $arr['uri'] = $uri;
        $arr['uid'] = $owner_uid;
        $arr['contact-id'] = $contact['id'];
@@ -123,7 +124,7 @@ EOT;
        $arr['author-name'] = $contact['name'];
        $arr['author-link'] = $contact['url'];
        $arr['author-avatar'] = $contact['thumb'];
-       
+
        $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
        $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
        $plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]';