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 /include/page_widgets.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 'include/page_widgets.php')
-rw-r--r-- | include/page_widgets.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/page_widgets.php b/include/page_widgets.php index 49d1439be..3270de4a3 100644 --- a/include/page_widgets.php +++ b/include/page_widgets.php @@ -1,7 +1,8 @@ <?php // A basic toolbar for observers with write_pages permissions -function writepages_widget ($who,$which){ + +function writepages_widget ($who,$which) { return replace_macros(get_markup_template('write_pages.tpl'), array( '$new' => t('New Page'), '$newurl' => "webpages/$who", @@ -13,9 +14,11 @@ function writepages_widget ($who,$which){ // Chan is channel_id, $which is channel_address - we'll need to pass observer later too. -function pagelist_widget ($owner,$which){ - $r = q("select * from item_id left join item on item_id.iid = item.id where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc", +function pagelist_widget ($owner,$which) { + + $r = q("select * from iconfig left join item on iconfig.iid = item.id where item_id.uid = %d + and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' order by item.created desc", intval($owner) ); @@ -24,7 +27,7 @@ function pagelist_widget ($owner,$which){ if($r) { $pages = array(); foreach($r as $rr) { - $pages[$rr['iid']][] = array('url' => $rr['iid'],'pagetitle' => $rr['sid'],'title' => $rr['title'],'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited'])); + $pages[$rr['iid']][] = array('url' => $rr['iid'],'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'])); } } |