X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoke.php;h=848ed817d69d4b5ff0a846a8fe7b5b1f274ae4e2;hb=b8a76794e06f270b591bdc851c03ce3a6f4764ba;hp=edcb27d021f86a721631acf50a4d71971520fb9b;hpb=f1bc2afbfef6dc822929f8436c29927b703c5c48;p=friendica.git diff --git a/mod/poke.php b/mod/poke.php index edcb27d021..848ed817d6 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -1,31 +1,53 @@ ' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . $a->get_baseurl() . '/contact/' . $target['id'] . ''; + $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . System::baseUrl() . '/contact/' . $target['id'] . ''; $arr['object'] .= '' . xmlify('' . "\n"); $arr['object'] .= xmlify('' . "\n"); @@ -111,27 +134,27 @@ function poke_init(&$a) { $item_id = item_store($arr); if($item_id) { - q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1", - dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id), - intval($uid), - intval($item_id) - ); - proc_run('php',"include/notifier.php","tag","$item_id"); + //q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d", + // dbesc(System::baseUrl() . '/display/' . $poster['nickname'] . '/' . $item_id), + // intval($uid), + // intval($item_id) + //); + Worker::add(PRIORITY_HIGH, "notifier", "tag", $item_id); } call_hooks('post_local_end', $arr); - proc_run('php',"include/notifier.php","like","$post_id"); + Worker::add(PRIORITY_HIGH, "notifier", "like", $post_id); return; } -function poke_content(&$a) { +function poke_content(App $a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -140,44 +163,29 @@ function poke_content(&$a) { $id = ''; if(intval($_GET['c'])) { - $r = q("select id,name from contact where id = %d and uid = %d limit 1", + $r = q("SELECT `id`,`name` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($_GET['c']), intval(local_user()) ); - if(count($r)) { + if (DBM::is_result($r)) { $name = $r[0]['name']; $id = $r[0]['id']; } } - $base = $a->get_baseurl(); - - $a->page['htmlhead'] .= ''; - $a->page['htmlhead'] .= <<< EOT - - -EOT; $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0'); - $verbs = get_poke_verbs(); $shortlist = array(); @@ -203,4 +211,4 @@ EOT; return $o; -} \ No newline at end of file +}