4 function oexchange_init(&$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' => $a->get_baseurl()));
19 function oexchange_content(&$a) {
26 if(($a->argc > 1) && $a->argv[1] === 'done') {
27 info( t('Post successful.') . EOL);
31 $url = (((x($_GET,'url')) && strlen($_GET['url']))
32 ? urlencode(notags(trim($_GET['url']))) : '');
33 $title = (((x($_GET,'title')) && strlen($_GET['title']))
34 ? '&title=' . urlencode(notags(trim($_GET['title']))) : '');
35 $description = (((x($_GET,'description')) && strlen($_GET['description']))
36 ? '&description=' . urlencode(notags(trim($_GET['description']))) : '');
37 $tags = (((x($_GET,'tags')) && strlen($_GET['tags']))
38 ? '&tags=' . urlencode(notags(trim($_GET['tags']))) : '');
40 $s = fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags);
45 require_once('include/html2bbcode.php');
49 $post['profile_uid'] = local_user();
50 $post['return'] = '/oexchange/done' ;
51 $post['body'] = html2bbcode($s);
52 $post['type'] = 'wall';
55 require_once('mod/item.php');