From 1e68d4fb75b9831ed763328b7982e44d1d4cdc5b Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 13 Jun 2016 19:58:24 -0700 Subject: 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. --- include/import.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'include/import.php') diff --git a/include/import.php b/include/import.php index be456bfa9..0f52f3ff8 100644 --- a/include/import.php +++ b/include/import.php @@ -624,19 +624,14 @@ function import_item_ids($channel,$itemids) { ); if(! $r) continue; - $z = q("select * from item_id where service = '%s' and sid = '%s' and iid = %d and uid = %d limit 1", + $z = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = '%s' + and iconfig.v = '%s' and iid = %d limit 1", dbesc($i['service']), dbesc($i['sid']), - intval($r[0]['id']), - intval($channel['channel_id']) + intval($r[0]['id']) ); if(! $z) { - q("insert into item_id (iid,uid,sid,service) values(%d,%d,'%s','%s')", - intval($r[0]['id']), - intval($channel['channel_id']), - dbesc($i['sid']), - dbesc($i['service']) - ); + \Zotlabs\Lib\IConfig::Set($r[0]['id'],'system',$i['service'],$i['sid'],true); } } } -- cgit v1.2.3