diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-02 17:38:34 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-02 17:38:34 -0700 |
commit | 9f5dfe797bb8c68b7ba4935abe87f355bd56f04f (patch) | |
tree | a1cd59eb387b298bb261d28955a4d858cc037586 /mod/p.php | |
parent | 49532aa6dd63d2f3fd95a0e20c0dd0529b320ed5 (diff) | |
download | volse-hubzilla-9f5dfe797bb8c68b7ba4935abe87f355bd56f04f.tar.gz volse-hubzilla-9f5dfe797bb8c68b7ba4935abe87f355bd56f04f.tar.bz2 volse-hubzilla-9f5dfe797bb8c68b7ba4935abe87f355bd56f04f.zip |
begin moving diaspora to plugin
Diffstat (limited to 'mod/p.php')
-rw-r--r-- | mod/p.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/mod/p.php b/mod/p.php deleted file mode 100644 index 4e411a17b..000000000 --- a/mod/p.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php /** @file */ - -require_once('include/bb2diaspora.php'); - -// used in Diaspora communications to provide a server copy of a sent post in XML format. - -function p_init(&$a) { - - if(argc() < 2) - http_status_exit(401); - - $mid = str_replace('.xml','',argv(1)); - - $r = q("select * from item where mid = '%s' and item_wall = 1 and item_private = 0 limit 1", - dbesc($mid) - ); - - - if((! $r) || (! perm_is_allowed($r[0]['uid'],'','view_stream'))) - http_status_exit(404); - - - $c = q("select * from channel where channel_id = %d limit 1", - intval($r[0]['uid']) - ); - - if(! $c) - http_status_exit(404); - - $myaddr = $c[0]['channel_address'] . '@' . $a->get_hostname(); - - $item = $r[0]; - - $title = $item['title']; - $body = bb2diaspora_itembody($item); - $created = datetime_convert('UTC','UTC',$item['created'],'Y-m-d H:i:s \U\T\C'); - - $tpl = get_markup_template('diaspora_post.tpl'); - $msg = replace_macros($tpl, array( - '$body' => xmlify($body), - '$guid' => $item['mid'], - '$handle' => xmlify($myaddr), - '$public' => 'true', - '$created' => $created, - '$provider' => (($item['app']) ? $item['app'] : t('$projectname')) - )); - - header('Content-type: text/xml'); - echo $msg; - killme(); -}
\ No newline at end of file |