]> 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 6cbaa1d2a744be3b466d6fcfba7adcda1b9e50a8..4d044f45f8297e58bdbb0e0804f97d90e5d413dc 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
-if(! function_exists('subthread_content')) {
+
 function subthread_content(&$a) {
 
        if(! local_user() && ! remote_user()) {
@@ -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,19 +41,19 @@ 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];
        }
 
-       // 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(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) {
@@ -107,6 +107,7 @@ EOT;
 
        $arr = array();
 
+       $arr['guid'] = get_guid(32);
        $arr['uri'] = $uri;
        $arr['uid'] = $owner_uid;
        $arr['contact-id'] = $contact['id'];
@@ -154,5 +155,7 @@ EOT;
        call_hooks('post_local_end', $arr);
 
        killme();
+
 }
-}
+
+