X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoke.php;h=2e15ed853ff395be7363279c8d9499871d3348a4;hb=061bcd7d2fcfb8da18e63ed4fde436b38463539d;hp=5cd88d7e2a8ee5d448a44d74d978eaa777601ce9;hpb=04c31d194f07e3b7a39ab7c8d5690da840c11fb7;p=friendica.git diff --git a/mod/poke.php b/mod/poke.php index 5cd88d7e2a..2e15ed853f 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -1,31 +1,49 @@ -contact; - $uri = item_new_uri($a->get_hostname(),$owner_uid); + $uri = item_new_uri($a->get_hostname(),$uid); $arr = array(); + $arr['guid'] = get_guid(32); $arr['uid'] = $uid; $arr['uri'] = $uri; $arr['parent-uri'] = (($parent_uri) ? $parent_uri : $uri); @@ -103,7 +122,7 @@ function poke_init(&$a) { $arr['origin'] = 1; $arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]'; - $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . $a->get_baseurl() . '/contact/' . $target['id'] . ''; + $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . App::get_baseurl() . '/contact/' . $target['id'] . ''; $arr['object'] .= '' . xmlify('' . "\n"); $arr['object'] .= xmlify('' . "\n"); @@ -111,27 +130,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(App::get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id), + // intval($uid), + // intval($item_id) + //); + proc_run(PRIORITY_HIGH, "include/notifier.php", "tag", $item_id); } 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; } -function poke_content(&$a) { +function poke_content(App &$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -140,44 +159,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(); + $base = App::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 +207,4 @@ EOT; return $o; -} \ No newline at end of file +}