X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpoke.php;h=2f989dd7d3b07bd415847fe376034911b3be3ea9;hb=0b5f7da270bcaa679cb684dbbbbe40781f0b49c6;hp=5cd88d7e2a8ee5d448a44d74d978eaa777601ce9;hpb=31eff376939b2d739e1cb31cb1407cf064b7eaac;p=friendica.git diff --git a/mod/poke.php b/mod/poke.php index 5cd88d7e2a..2f989dd7d3 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -1,31 +1,53 @@ 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 +126,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'] . '' . 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 +}