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