aboutsummaryrefslogtreecommitdiffstats
path: root/mod/webpages.php
diff options
context:
space:
mode:
authorThomas Willingham <founder@kakste.com>2013-08-14 20:46:48 +0100
committerThomas Willingham <founder@kakste.com>2013-08-14 20:46:48 +0100
commit608e04c65eb2433a1cece9b5798f8577b611a288 (patch)
treec63c91f20d0bd5fd71e9afda20998d00ea28e3a8 /mod/webpages.php
parenta0dfd44f9178796eaf55e4a2ab0194c12e7dfd21 (diff)
downloadvolse-hubzilla-608e04c65eb2433a1cece9b5798f8577b611a288.tar.gz
volse-hubzilla-608e04c65eb2433a1cece9b5798f8577b611a288.tar.bz2
volse-hubzilla-608e04c65eb2433a1cece9b5798f8577b611a288.zip
More progress on pages - extend writepages widget, add pagelist widget
Diffstat (limited to 'mod/webpages.php')
-rw-r--r--mod/webpages.php8
1 files changed, 6 insertions, 2 deletions
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',
));