aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Impel.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-06-15 19:15:47 -0400
committerAndrew Manning <tamanning@zoho.com>2016-06-15 19:15:47 -0400
commitf2dda646ecf1d11bf88c085d1174d3c147f799b1 (patch)
treec86f59fcca3a84413d77c325be433c4c5ea862e2 /Zotlabs/Module/Impel.php
parent98484f0def82493ff9d45405dadefd141a1b32ba (diff)
parent47fc0c79588d55a207dc39ae8062ec55382e2564 (diff)
downloadvolse-hubzilla-f2dda646ecf1d11bf88c085d1174d3c147f799b1.tar.gz
volse-hubzilla-f2dda646ecf1d11bf88c085d1174d3c147f799b1.tar.bz2
volse-hubzilla-f2dda646ecf1d11bf88c085d1174d3c147f799b1.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'Zotlabs/Module/Impel.php')
-rw-r--r--Zotlabs/Module/Impel.php26
1 files changed, 9 insertions, 17 deletions
diff --git a/Zotlabs/Module/Impel.php b/Zotlabs/Module/Impel.php
index e326f7818..735c311d0 100644
--- a/Zotlabs/Module/Impel.php
+++ b/Zotlabs/Module/Impel.php
@@ -137,9 +137,7 @@ class Impel extends \Zotlabs\Web\Controller {
require_once('library/urlify/URLify.php');
$pagetitle = strtolower(\URLify::transliterate($j['pagetitle']));
}
-
-
-
+
// Verify ability to use html or php!!!
$execflag = false;
@@ -154,21 +152,14 @@ class Impel extends \Zotlabs\Web\Controller {
}
}
- $remote_id = 0;
-
- $z = q("select * from item_id where sid = '%s' and service = '%s' and uid = %d limit 1",
- dbesc($pagetitle),
- dbesc($namespace),
- intval(local_channel())
- );
-
$i = q("select id, edited, item_deleted from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['mid']),
intval(local_channel())
);
+
+ \Zotlabs\Lib\IConfig::Set($arr,'system',$namespace,(($pagetitle) ? $pagetitle : substr($arr['mid'],0,16)),true);
- if($z && $i) {
- $remote_id = $z[0]['id'];
+ if($i) {
$arr['id'] = $i[0]['id'];
// don't update if it has the same timestamp as the original
if($arr['edited'] > $i[0]['edited'])
@@ -182,12 +173,12 @@ class Impel extends \Zotlabs\Web\Controller {
intval(local_channel())
);
}
- $x = item_store($arr,$execflag);
+ else
+ $x = item_store($arr,$execflag);
}
- if($x['success']) {
+ if($x && $x['success']) {
$item_id = $x['item_id'];
- update_remote_id($channel,$item_id,$arr['item_type'],$pagetitle,$namespace,$remote_id,$arr['mid']);
}
}
@@ -199,7 +190,8 @@ class Impel extends \Zotlabs\Web\Controller {
notice( sprintf( t('%s element installation failed'), $installed_type));
}
- //??? should perhaps return ret?
+ //??? should perhaps return ret?
+
json_return_and_die(true);
}