diff options
author | redmatrix <git@macgirvin.com> | 2016-06-13 19:58:24 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-13 19:58:24 -0700 |
commit | 1e68d4fb75b9831ed763328b7982e44d1d4cdc5b (patch) | |
tree | 5379f5803f4aa3ec8b5bced6b3151cd08cf89d0f /Zotlabs/Module/Impel.php | |
parent | 6d4188f05e2a8e92508b1d38e4b7ef5156ba6c42 (diff) | |
download | volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.gz volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.bz2 volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.zip |
deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication.
Diffstat (limited to 'Zotlabs/Module/Impel.php')
-rw-r--r-- | Zotlabs/Module/Impel.php | 26 |
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); } |