From 608e04c65eb2433a1cece9b5798f8577b611a288 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Wed, 14 Aug 2013 20:46:48 +0100 Subject: More progress on pages - extend writepages widget, add pagelist widget --- mod/webpages.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 8e3901d90..fb133eccf 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -21,13 +21,15 @@ function webpages_content(&$a) { profile_load($a,$which,$profile); +// Figure out who the page owner is. $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which) ); if($r) { $owner = intval($r[0]['channel_id']); } -// We can do better, but since editing only works for local users and all posts are webpages, return anyone else for now. + +// Get the observer, check their permissions $observer = $a->get_observer(); $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); @@ -40,6 +42,7 @@ function webpages_content(&$a) { } // Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages +// Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. require_once ('include/conversation.php'); $x = array( 'webpage' => 1, @@ -54,7 +57,7 @@ require_once ('include/conversation.php'); $o .= status_editor($a,$x); //Get a list of webpages. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. -// FIXME - we should sort these results, but it's not obvious what order yet. Alphabetical? Created order? +//TODO - this should be replaced with pagelist_widget $r = q("select * from item_id where uid = %d and service = 'WEBPAGE' order by sid asc", intval($owner) @@ -79,6 +82,7 @@ $r = q("select * from item_id where uid = %d and service = 'WEBPAGE' order by si '$pages' => $pages, '$channel' => $which, '$view' => t('View'), + '$preview' => '1', )); -- cgit v1.2.3