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/Webpages.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/Webpages.php')
-rw-r--r-- | Zotlabs/Module/Webpages.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index bb8d454c8..fc292be6f 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -28,7 +28,7 @@ class Webpages extends \Zotlabs\Web\Controller { } - function get() { + function get() { if(! \App::$profile) { notice( t('Requested profile is not available.') . EOL ); @@ -138,11 +138,19 @@ class Webpages extends \Zotlabs\Web\Controller { $sql_extra = item_permissions_sql($owner); - $r = q("select * from item_id left join item on item_id.iid = item.id - where item_id.uid = %d and service = 'WEBPAGE' and item_type = %d $sql_extra order by item.created desc", + + $r = q("select * from iconfig left join item on iconfig.iid = item.id + where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item_type = %d + $sql_extra order by item.created desc", intval($owner), intval(ITEM_TYPE_WEBPAGE) ); + +// $r = q("select * from item_id left join item on item_id.iid = item.id +// where item_id.uid = %d and service = 'WEBPAGE' and item_type = %d $sql_extra order by item.created desc", +// intval($owner), +// intval(ITEM_TYPE_WEBPAGE) +// ); $pages = null; @@ -160,13 +168,13 @@ class Webpages extends \Zotlabs\Web\Controller { 'created' => $rr['created'], 'edited' => $rr['edited'], 'mimetype' => $rr['mimetype'], - 'pagetitle' => $rr['sid'], + 'pagetitle' => $rr['v'], 'mid' => $rr['mid'], 'layout_mid' => $rr['layout_mid'] ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], - 'pagetitle' => $rr['sid'], + 'pagetitle' => $rr['v'], 'title' => $rr['title'], 'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']), 'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']), |