aboutsummaryrefslogtreecommitdiffstats
path: root/mod/oexchange.php
diff options
context:
space:
mode:
authorChris Case <kahotep@bunda.dreamhost.com>2011-05-21 21:40:16 -0700
committerChris Case <kahotep@bunda.dreamhost.com>2011-05-21 21:40:16 -0700
commit4cff911939b263993eb41682ca558c975e2db01f (patch)
tree78f58e08d04413827744689d0f5df7660bee6caa /mod/oexchange.php
parent2cf696d0b5d647e1741d2f94ee379aa19b25ae1b (diff)
parentf3f063c0dd7fd8b706987b856d79c7b58924acbb (diff)
downloadvolse-hubzilla-4cff911939b263993eb41682ca558c975e2db01f.tar.gz
volse-hubzilla-4cff911939b263993eb41682ca558c975e2db01f.tar.bz2
volse-hubzilla-4cff911939b263993eb41682ca558c975e2db01f.zip
merged multipart email changes
Diffstat (limited to 'mod/oexchange.php')
-rw-r--r--mod/oexchange.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/mod/oexchange.php b/mod/oexchange.php
new file mode 100644
index 000000000..d5af4813b
--- /dev/null
+++ b/mod/oexchange.php
@@ -0,0 +1,53 @@
+<?php
+
+
+function oexchange_init(&$a) {
+
+ if(($a->argc > 1) && ($a->argv[1] === 'xrd')) {
+ $tpl = get_markup_template('oexchange_xrd.tpl');
+
+ $o = replace_macros($tpl, array('$base' => $a->get_baseurl()));
+ echo $o;
+ killme();
+ }
+
+
+
+
+}
+
+function oexchange_content(&$a) {
+
+ if(! local_user()) {
+ $o = login(false);
+ return $o;
+ }
+
+ if(($a->argc > 1) && $a->argv[1] === 'done') {
+ notice( t('Post successful.') . EOL);
+ return;
+ }
+
+ $url = (((x($_GET,'url')) && strlen($_GET['url'])) ? notags(trim($_GET['url'])) : '');
+
+ $s = fetch_url($a->get_baseurl() . '/parse_url&url=' . $url);
+
+ if(! strlen($s))
+ return;
+
+ require_once('include/html2bbcode.php');
+
+ $post = array();
+
+ $post['profile_uid'] = local_user();
+ $post['return'] = '/oexchange/done' ;
+ $post['body'] = html2bbcode($s);
+ $post['type'] = 'wall';
+
+ $_POST = $post;
+ require_once('mod/item.php');
+ item_post($a);
+
+}
+
+