4 function oexchange_init(App &$a) {
6 if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
7 $tpl = get_markup_template('oexchange_xrd.tpl');
9 $o = replace_macros($tpl, array('$base' => App::get_baseurl()));
17 function oexchange_content(App &$a) {
24 if (($a->argc > 1) && $a->argv[1] === 'done') {
25 info( t('Post successful.') . EOL);
29 $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url']))
30 ? urlencode(notags(trim($_REQUEST['url']))) : '');
31 $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title']))
32 ? '&title=' . urlencode(notags(trim($_REQUEST['title']))) : '');
33 $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description']))
34 ? '&description=' . urlencode(notags(trim($_REQUEST['description']))) : '');
35 $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags']))
36 ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : '');
38 $s = fetch_url(App::get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags);
43 require_once('include/html2bbcode.php');
47 $post['profile_uid'] = local_user();
48 $post['return'] = '/oexchange/done' ;
49 $post['body'] = html2bbcode($s);
50 $post['type'] = 'wall';
53 require_once('mod/item.php');