' : $channel['channel_allow_cid']);
			$allow_gid     = (($item_private) ? '' : $channel['channel_allow_gid']);
			$deny_cid      = (($item_private) ? '' : $channel['channel_deny_cid']);
			$deny_gid      = (($item_private) ? '' : $channel['channel_deny_gid']);
		}
	
	
		$arr = array();
	
		$arr['item_wall']     = 1;
		$arr['owner_xchan']   = (($parent_item) ? $parent_item['owner_xchan'] : $channel['channel_hash']);
		$arr['parent_mid']    = (($parent_mid) ? $parent_mid : '');
		$arr['title']         = '';
		$arr['allow_cid']     = $allow_cid;
		$arr['allow_gid']     = $allow_gid;
		$arr['deny_cid']      = $deny_cid;
		$arr['deny_gid']      = $deny_gid;
		$arr['verb']          = $activity;
		$arr['item_private']  = $item_private;
		$arr['obj_type']      = ACTIVITY_OBJ_PERSON;
		$arr['body']          = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t($verbs[$verb][0]) . ' ' . '[zrl=' . $target['xchan_url'] . ']' . $target['xchan_name'] . '[/zrl]';
	
		$obj = array(
			'type' => ACTIVITY_OBJ_PERSON,
			'title' => $target['xchan_name'],
			'id' => $target['xchan_hash'],
			'link' => array(
				array('rel' => 'alternate', 'type' => 'text/html', 'href' => $target['xchan_url']),
				array('rel' => 'photo', 'type' => $target['xchan_photo_mimetype'], 'href' => $target['xchan_photo_l'])
			),
		);
	
		$arr['obj'] = json_encode($obj);
	
		$arr['item_origin']   = 1;
		$arr['item_wall']     = 1;
		$arr['item_unseen']   = 1;
		if(! $parent_item)
			$item['item_thread_top'] = 1;
	
	
		post_activity_item($arr);
	
		return;
	}
	
	
	
	function get() {
	
		if(! local_channel()) {
			notice( t('Permission denied.') . EOL);
			return;
		}
		if(! Apps::system_app_installed(local_channel(), 'Poke')) {
			//Do not display any associated widgets at this point
			App::$pdl = '';
			$o = '' . t('Poke App') . ' (' . t('Not Installed') . '):
';
			$o .= t('Poke somebody in your addressbook');
			return $o;
		}
		nav_set_selected('Poke');
	
		$name = '';
		$id = '';
	
		if(intval($_REQUEST['c'])) {
			$r = q("select abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash 
				where abook_id = %d and abook_channel = %d limit 1",
				intval($_REQUEST['c']),
				intval(local_channel())
			);
			if($r) {
				$name = $r[0]['xchan_name'];
				$id = $r[0]['abook_id'];
			}
		}
	
		$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : '0');
	
		$verbs = get_poke_verbs();
	
		$shortlist = array();
		foreach($verbs as $k => $v)
			if($v[1] !== 'NOTRANSLATION')
				$shortlist[] = array($k,$v[1]);
	
	
		$poke_basic = get_config('system','poke_basic');
		if($poke_basic) {
			$title = t('Poke');
			$desc = t('Poke somebody');
		}
		else {
			$title = t('Poke/Prod');
			$desc = t('Poke, prod or do other things to somebody');
		}
	
		$o = replace_macros(get_markup_template('poke_content.tpl'),array(
			'$title' => $title,
			'$poke_basic' => $poke_basic,
			'$desc' => $desc,
			'$clabel' => t('Recipient'),
			'$choice' => t('Choose what you wish to do to recipient'),
			'$verbs' => $shortlist,
			'$parent' => $parent,
			'$prv_desc' => t('Make this post private'),
			'$private' => array('private', t('Make this post private'), false, ''),
			'$submit' => t('Submit'),
			'$name' => $name,
			'$id' => $id
		));
	
		return $o;
	
	}
}