dbesc($item_id)
);
- if(! $item_id || (! count($r))) {
+ if(! $item_id || (! dbm::is_result($r))) {
logger('like: no item ' . $item_id);
return false;
}
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];
}
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) {
intval($_SESSION['visitor_id']),
intval($owner_uid)
);
- if(count($r))
+ if (dbm::is_result($r))
$contact = $r[0];
}
if(! $contact) {
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
);
$like_item_id = $like_item['id'];
- proc_run('php',"include/notifier.php","like","$like_item_id");
+ proc_run(PRIORITY_HIGH, "include/notifier.php", "like", $like_item_id);
return true;
}
$uri = item_new_uri($a->get_hostname(),$owner_uid);
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
- if($item['obj_type'] === ACTIVITY_OBJ_EVENT)
+ if($item['object-type'] === ACTIVITY_OBJ_EVENT)
$post_type = t('event');
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
- $link = xmlify('<link rel="alternate" type="text/html" href="' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
+ $link = xmlify('<link rel="alternate" type="text/html" href="' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
$body = $item['body'];
$obj = <<< 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;
call_hooks('post_local_end', $arr);
- proc_run('php',"include/notifier.php","like","$post_id");
+ proc_run(PRIORITY_HIGH, "include/notifier.php", "like", $post_id);
return true;
}