X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Flike.php;h=8223cf3626080ec9803ac0fb8f8819ffb13012da;hb=e24c3a5b826d2357e40a173d9e7b66048dab5b37;hp=118ec81ca1c35e47ca966c997c254a2a379234d1;hpb=7886de5c393591eaf4e05f2a496a4f40060cb262;p=friendica.git diff --git a/include/like.php b/include/like.php index 118ec81ca1..8223cf3626 100644 --- a/include/like.php +++ b/include/like.php @@ -57,7 +57,7 @@ function do_like($item_id, $verb) { dbesc($item_id) ); - if(! $item_id || (! count($r))) { + if(! $item_id || (! dbm::is_result($r))) { logger('like: no item ' . $item_id); return false; } @@ -78,8 +78,9 @@ function do_like($item_id, $verb) { intval($item['contact-id']), intval($item['uid']) ); - if(! count($r)) + if (! dbm::is_result($r)) { return false; + } if(! $r[0]['self']) $remote_owner = $r[0]; } @@ -90,7 +91,7 @@ function do_like($item_id, $verb) { 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) { @@ -112,7 +113,7 @@ function do_like($item_id, $verb) { intval($_SESSION['visitor_id']), intval($owner_uid) ); - if(count($r)) + if (dbm::is_result($r)) $contact = $r[0]; } if(! $contact) { @@ -135,7 +136,7 @@ function do_like($item_id, $verb) { dbesc($item_id), dbesc($item_id), dbesc($item['uri']) ); - if(count($r)) { + if (dbm::is_result($r)) { $like_item = $r[0]; // Already voted, undo it @@ -164,7 +165,7 @@ function do_like($item_id, $verb) { if($item['object-type'] === ACTIVITY_OBJ_EVENT) $post_type = t('event'); $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); - $link = xmlify('' . "\n") ; + $link = xmlify('' . "\n") ; $body = $item['body']; $obj = <<< EOT @@ -214,7 +215,7 @@ EOT; $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]'; + $plink = '[url=' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; $arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink ); $arr['verb'] = $activity;