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. --- Zotlabs/Module/Blocks.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Zotlabs/Module/Blocks.php') diff --git a/Zotlabs/Module/Blocks.php b/Zotlabs/Module/Blocks.php index 32650a090..475cfa6b3 100644 --- a/Zotlabs/Module/Blocks.php +++ b/Zotlabs/Module/Blocks.php @@ -27,7 +27,7 @@ class Blocks extends \Zotlabs\Web\Controller { } - function get() { + function get() { if(! \App::$profile) { notice( t('Requested profile is not available.') . EOL ); @@ -111,8 +111,11 @@ class Blocks extends \Zotlabs\Web\Controller { $editor = status_editor($a,$x); - $r = q("select iid, sid, mid, title, body, mimetype, created, edited from item_id left join item on item_id.iid = item.id - where item_id.uid = %d and service = 'BUILDBLOCK' and item_type = %d order by item.created desc", + + $r = q("select iconfig.iid, iconfig.k, iconfig.v, mid, title, body, mimetype, created, edited from iconfig + left join item on iconfig.iid = item.id + where uid = %d and iconfig.cat = 'system' and iconfig.k = 'BUILDBLOCK' + and item_type = %d order by item.created desc", intval($owner), intval(ITEM_TYPE_BLOCK) ); @@ -129,12 +132,12 @@ class Blocks extends \Zotlabs\Web\Controller { 'created' => $rr['created'], 'edited' => $rr['edited'], 'mimetype' => $rr['mimetype'], - 'pagetitle' => $rr['sid'], + 'pagetitle' => $rr['v'], 'mid' => $rr['mid'] ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], - 'name' => $rr['sid'], + 'name' => $rr['v'], 'title' => $rr['title'], 'created' => $rr['created'], 'edited' => $rr['edited'], -- cgit v1.2.3