aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-31 19:26:00 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-31 19:26:00 -0700
commitf3b95f591a7ec49b6fc148913861bae2bb6aa6c7 (patch)
tree22f9f085950ac16766ed3af1f1d052d233c0660e /include/items.php
parent8fe3daab21f9aba00f7def3553247b0cbcf5f94a (diff)
parent5cc5e0fafdbc1795781b52124a63695ce3e2d49f (diff)
downloadvolse-hubzilla-f3b95f591a7ec49b6fc148913861bae2bb6aa6c7.tar.gz
volse-hubzilla-f3b95f591a7ec49b6fc148913861bae2bb6aa6c7.tar.bz2
volse-hubzilla-f3b95f591a7ec49b6fc148913861bae2bb6aa6c7.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php43
1 files changed, 40 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index cc777788c..818e7f526 100755
--- a/include/items.php
+++ b/include/items.php
@@ -545,6 +545,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');
@@ -4349,6 +4350,8 @@ function zot_feed($uid,$observer_hash,$arr) {
$mindate = null;
$message_id = null;
+ require_once('include/security.php');
+
if(array_key_exists('mindate',$arr)) {
$mindate = datetime_convert('UTC','UTC',$arr['mindate']);
}
@@ -4371,10 +4374,8 @@ function zot_feed($uid,$observer_hash,$arr) {
return $result;
}
- if(! is_sys_channel($uid)) {
- require_once('include/security.php');
+ if(! is_sys_channel($uid))
$sql_extra = item_permissions_sql($uid,$observer_hash);
- }
$limit = " LIMIT 100 ";
@@ -4839,3 +4840,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;
+}