diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 8 | ||||
-rwxr-xr-x | include/items.php | 37 |
2 files changed, 45 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index f4d9bb525..e2403b8eb 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -958,6 +958,14 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true) { return $Text; } +/** + * This function exists as a short-term solution to folks linking to private images from their /cloud in + * their profiles, which brings up a login dialogue in the directory when that entry is viewed. + * The long term solution is to separate the web file browser from DAV so that you'll never see a + * login prompt (though the resource may return a permission denied). + */ + + function strip_bbimage($s) { $Text = preg_replace("/\[[zi]mg(.*?)\](.*?)\[\/[zi]mg\]/ism", '', $Text); diff --git a/include/items.php b/include/items.php index aa052b307..a04cd1c76 100755 --- a/include/items.php +++ b/include/items.php @@ -553,6 +553,7 @@ function get_feed_for($channel, $observer_hash, $params) { 'order' => 'post', 'top' => $params['top'] ), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module); + $feed_template = get_markup_template('atom_feed.tpl'); @@ -4881,3 +4882,39 @@ function comment_local_origin($item) { return false; } + + +function i2asld($i) { + + if(! $i) + return array(); + + $ret = array(); + + if($i['verb']) { + $ret['@context'] = dirname($i['verb']); + $ret['@type'] = ucfirst(basename($i['verb'])); + } + $ret['@id'] = $i['plink']; + $ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME); + if($i['title']) + $ret['title'] = $i['title']; + $ret['content'] = bbcode($i['body']); + + $ret['actor'] = asencode_person($i['author']); + $ret['owner'] = asencode_person($i['owner']); + + + return $ret; + +} + + +function asencode_person($p) { + $ret = array(); + $ret['@type'] = 'Person'; + $ret['@id'] = 'acct:' . $p['xchan_addr']; + $ret['displayName'] = $p['xchan_name']; + + return $ret; +}
\ No newline at end of file |