2 function oexchange_init(App $a) {
4 if (($a->argc > 1) && ($a->argv[1] === 'xrd')) {
5 $tpl = get_markup_template('oexchange_xrd.tpl');
7 $o = replace_macros($tpl, array('$base' => App::get_baseurl()));
13 function oexchange_content(App $a) {
20 if (($a->argc > 1) && $a->argv[1] === 'done') {
21 info( t('Post successful.') . EOL);
25 $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url']))
26 ? urlencode(notags(trim($_REQUEST['url']))) : '');
27 $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title']))
28 ? '&title=' . urlencode(notags(trim($_REQUEST['title']))) : '');
29 $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description']))
30 ? '&description=' . urlencode(notags(trim($_REQUEST['description']))) : '');
31 $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags']))
32 ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : '');
34 $s = fetch_url(App::get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags);
40 require_once('include/html2bbcode.php');
44 $post['profile_uid'] = local_user();
45 $post['return'] = '/oexchange/done' ;
46 $post['body'] = html2bbcode($s);
47 $post['type'] = 'wall';
50 require_once('mod/item.php');