aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-28 15:01:19 -0800
committerzotlabs <mike@macgirvin.com>2017-01-28 15:01:19 -0800
commit5aa0017e91cac135ef8b84c138becb09decb1d58 (patch)
treec44b5632ab4493bfc8731b7614e8ee66bf260bca /include/items.php
parentf90d5f3dc8b26d5a1fd3e44013385bda9a7361b2 (diff)
downloadvolse-hubzilla-5aa0017e91cac135ef8b84c138becb09decb1d58.tar.gz
volse-hubzilla-5aa0017e91cac135ef8b84c138becb09decb1d58.tar.bz2
volse-hubzilla-5aa0017e91cac135ef8b84c138becb09decb1d58.zip
provide lowlevel xchan storage function to ensure that all non-null rows are initialised
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php34
1 files changed, 20 insertions, 14 deletions
diff --git a/include/items.php b/include/items.php
index 0d9fb02a4..559992b7f 100755
--- a/include/items.php
+++ b/include/items.php
@@ -833,13 +833,15 @@ function import_author_rss($x) {
}
$name = trim($x['name']);
- $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_url, xchan_name, xchan_network )
- values ( '%s', '%s', '%s', '%s', '%s' )",
- dbesc($x['guid']),
- dbesc($x['guid']),
- dbesc($x['url']),
- dbesc(($name) ? $name : t('(Unknown)')),
- dbesc('rss')
+ $r = xchan_store_lowlevel(
+ [
+ 'xchan_hash' => $x['guid'],
+ 'xchan_guid' => $x['guid'],
+ 'xchan_url' => $x['url'],
+ 'xchan_name' => (($name) ? $name : t('(Unknown)')),
+ 'xchan_name_date' => datetime_convert(),
+ 'xchan_network' => 'rss'
+ ]
);
if($r && $x['photo']) {
@@ -878,14 +880,17 @@ function import_author_unknown($x) {
$name = trim($x['name']);
- $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_url, xchan_name, xchan_network )
- values ( '%s', '%s', '%s', '%s', '%s' )",
- dbesc($x['url']),
- dbesc($x['url']),
- dbesc($x['url']),
- dbesc(($name) ? $name : t('(Unknown)')),
- dbesc('unknown')
+ $r = xchan_store_lowlevel(
+ [
+ 'xchan_hash' => $x['url'],
+ 'xchan_guid' => $x['url'],
+ 'xchan_url' => $x['url'],
+ 'xchan_name' => (($name) ? $name : t('(Unknown)')),
+ 'xchan_name_date' => datetime_convert(),
+ 'xchan_network' => 'unknown'
+ ]
);
+
if($r && $x['photo']) {
$photos = import_xchan_photo($x['photo']['src'],$x['url']);
@@ -1516,6 +1521,7 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
$arr['deny_cid'] = ((x($arr,'deny_cid')) ? trim($arr['deny_cid']) : '');
$arr['deny_gid'] = ((x($arr,'deny_gid')) ? trim($arr['deny_gid']) : '');
$arr['postopts'] = ((x($arr,'postopts')) ? trim($arr['postopts']) : '');
+ $arr['route'] = ((x($arr,'route')) ? trim($arr['route']) : '');
$arr['item_private'] = ((x($arr,'item_private')) ? intval($arr['item_private']) : 0 );
$arr['item_wall'] = ((x($arr,'item_wall')) ? intval($arr['item_wall']) : 0 );
$arr['item_type'] = ((x($arr,'item_type')) ? intval($arr['item_type']) : 0 );