aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-29 22:43:51 -0700
committerfriendica <info@friendica.com>2012-07-29 22:43:51 -0700
commit194c52aee590a209cc38ee8fb322ff7dc4a9143d (patch)
tree1fedc5103d47bd030d8519a0e09deeb25af7575b /include/items.php
parent4824e5b8b8d57ba9af8a5a26f78a5dc90eb714d1 (diff)
downloadvolse-hubzilla-194c52aee590a209cc38ee8fb322ff7dc4a9143d.tar.gz
volse-hubzilla-194c52aee590a209cc38ee8fb322ff7dc4a9143d.tar.bz2
volse-hubzilla-194c52aee590a209cc38ee8fb322ff7dc4a9143d.zip
get_item_elements (json version)
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index b7115587b..2381dd2ea 100755
--- a/include/items.php
+++ b/include/items.php
@@ -400,6 +400,58 @@ function title_is_body($title, $body) {
}
+function get_item_elements($j) {
+
+ $arr = array();
+
+ if(strlen($j->signed))
+ $arr['body'] = htmlentities($j->signed,ENT_COMPAT,'UTF-8');
+ else
+ $arr['body'] = (($j->body) ? htmlentities($j->body,ENT_COMPAT,'UTF-8') : '');
+
+ $arr['created'] = datetime_convert('UTC','UTC',$j->created);
+ $arr['edited'] = datetime_convert('UTC','UTC',$j->edited);
+
+ if($arr['created'] > datetime_convert())
+ $arr['created'] = datetime_convert();
+ if($arr['edited'] > datetime_convert())
+ $arr['edited'] = datetime_convert();
+
+ $arr['title'] = (($j->title) ? htmlentities($j->title, ENT_COMPAT,'UTF-8') : '');
+ $arr['app'] = (($j->app) ? htmlentities($j->app, ENT_COMPAT,'UTF-8') : '');
+ $arr['uri'] = (($j->uri) ? htmlentities($j->uri, ENT_COMPAT,'UTF-8') : '');
+ $arr['puri'] = (($j->puri) ? htmlentities($j->puri, ENT_COMPAT,'UTF-8') : '');
+ $arr['plink'] = (($j->plink) ? htmlentities($j->plink, ENT_COMPAT,'UTF-8') : '');
+ $arr['location'] = (($j->location) ? htmlentities($j->location, ENT_COMPAT,'UTF-8') : '');
+ $arr['coord'] = (($j->coord) ? htmlentities($j->coord, ENT_COMPAT,'UTF-8') : '');
+ $arr['verb'] = (($j->verb) ? htmlentities($j->verb, ENT_COMPAT,'UTF-8') : '');
+ $arr['objtype'] = (($j->objtype) ? htmlentities($j->objtype, ENT_COMPAT,'UTF-8') : '');
+ $arr['tgttype'] = (($j->tgttype) ? htmlentities($j->tgttype, ENT_COMPAT,'UTF-8') : '');
+
+ $arr['obj'] = $j->obj;
+ $arr['tgt'] = $j->tgt;
+
+ $arr['attach'] = $j->attach;
+ $arr['tags'] = $j->tags;
+
+ $arr['privacy'] = $j->privacy;
+
+ $arr['flags'] = intval($j->flags);
+ $arr['types'] = intval($j->types);
+
+ $arr['author'] = $j->author;
+
+ $arr['new'] = 1;
+
+ return $arr;
+
+}
+
+
+
+
+
+
function get_atom_elements($feed,$item) {