' : $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['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'] = 'Create'; $arr['item_private'] = $item_private; $arr['obj_type'] = 'Note'; $arr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t($verbs[$verb][0]) . ' ' . '[zrl=' . $target['xchan_url'] . ']' . $target['xchan_name'] . '[/zrl]'; $arr['item_origin'] = 1; $arr['item_unseen'] = 1; if(! $parent_item) $arr['item_thread_top'] = 1; $arr['obj'] = Activity::encode_item($arr); 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 = ''; $papp = Apps::get_papp('Poke'); return Apps::app_render($papp, 'module'); } nav_set_selected('Poke'); $name = ''; $id = ''; if(isset($_REQUEST['c']) && 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'); $desc = t('Poke or ping 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 action'), '$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; } }