aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-09-13 22:57:31 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-09-13 22:57:31 -0700
commitc5031139ebb46ce4994d3bd62059ae4eaba71359 (patch)
treeaadb065cbaf0fbf788b6f4fdd7a5e1a332ba7373 /include
parent38fde6672eb3d46b8b154ba2f22df99f91f64852 (diff)
downloadvolse-hubzilla-c5031139ebb46ce4994d3bd62059ae4eaba71359.tar.gz
volse-hubzilla-c5031139ebb46ce4994d3bd62059ae4eaba71359.tar.bz2
volse-hubzilla-c5031139ebb46ce4994d3bd62059ae4eaba71359.zip
abstractify items, check photos for birthday paradox
Diffstat (limited to 'include')
-rw-r--r--include/items.php8
-rw-r--r--include/poller.php4
2 files changed, 6 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php
index dbe6493d4..f85a0e64b 100644
--- a/include/items.php
+++ b/include/items.php
@@ -308,7 +308,7 @@ function get_atom_elements($item) {
return $res;
}
-function post_remote($a,$arr) {
+function item_store($arr) {
//print_r($arr);
@@ -330,14 +330,14 @@ function post_remote($a,$arr) {
$arr['owner-name'] = notags(trim($arr['owner-name']));
$arr['owner-link'] = notags(trim($arr['owner-link']));
$arr['owner-avatar'] = notags(trim($arr['owner-avatar']));
- $arr['created'] = datetime_convert('UTC','UTC',$arr['created'],'Y-m-d H:i:s');
- $arr['edited'] = datetime_convert('UTC','UTC',$arr['edited'],'Y-m-d H:i:s');
+ $arr['created'] = ((x($arr,'created') !== false) ? datetime_convert('UTC','UTC',$arr['created']) : datetime_convert());
+ $arr['edited'] = ((x($arr,'edited') !== false) ? datetime_convert('UTC','UTC',$arr['edited']) : datetime_convert());
$arr['changed'] = datetime_convert();
$arr['title'] = notags(trim($arr['title']));
$arr['location'] = notags(trim($arr['location']));
$arr['body'] = escape_tags(trim($arr['body']));
$arr['last-child'] = intval($arr['last-child']);
- $arr['visible'] = 1;
+ $arr['visible'] = ((x($arr,'visible') !== false) ? intval($arr['visible']) : 1);
$arr['deleted'] = 0;
$arr['parent-uri'] = notags(trim($arr['parent-uri']));
$arr['verb'] = notags(trim($arr['verb']));
diff --git a/include/poller.php b/include/poller.php
index c4d697e24..6024b1844 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -348,7 +348,7 @@
$datarray['parent-uri'] = $parent_uri;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
- $r = post_remote($a,$datarray);
+ $r = item_store($datarray);
continue;
}
@@ -377,7 +377,7 @@
$datarray['parent-uri'] = $item_id;
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
- $r = post_remote($a,$datarray);
+ $r = item_store($datarray);
continue;
}