3 if(! function_exists('oexchange_init')) {
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()));
17 if(! function_exists('oexchange_content')) {
18 function oexchange_content(&$a) {
25 if(($a->argc > 1) && $a->argv[1] === 'done') {
26 info( t('Post successful.') . EOL);
30 $url = (((x($_REQUEST,'url')) && strlen($_REQUEST['url']))
31 ? urlencode(notags(trim($_REQUEST['url']))) : '');
32 $title = (((x($_REQUEST,'title')) && strlen($_REQUEST['title']))
33 ? '&title=' . urlencode(notags(trim($_REQUEST['title']))) : '');
34 $description = (((x($_REQUEST,'description')) && strlen($_REQUEST['description']))
35 ? '&description=' . urlencode(notags(trim($_REQUEST['description']))) : '');
36 $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags']))
37 ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : '');
39 $s = fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags);
44 require_once('include/html2bbcode.php');
48 $post['profile_uid'] = local_user();
49 $post['return'] = '/oexchange/done' ;
50 $post['body'] = html2bbcode($s);
51 $post['type'] = 'wall';
54 require_once('mod/item.php');