aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Pubstream.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Pubstream.php')
-rw-r--r--Zotlabs/Module/Pubstream.php41
1 files changed, 11 insertions, 30 deletions
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 234e73792..65d3be955 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -84,7 +84,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
- 'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
+ 'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'member/permissions'),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
@@ -137,7 +137,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => '',
'$xchan' => '',
- '$order' => 'comment',
+ '$order' => 'post',
'$file' => '',
'$cats' => '',
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
@@ -173,16 +173,15 @@ class Pubstream extends \Zotlabs\Web\Controller {
$site_firehose_sql = " and owner_xchan in (select channel_hash from channel where channel_system = 0 and channel_removed = 0) ";
}
- if(Config::Get('system','public_list_mode'))
- $page_mode = 'list';
- else
- $page_mode = 'client';
+ $page_mode = 'client';
+ $blog_mode = Config::Get('system',' public_list_mode');
+ if ($blog_mode) {
+ $page_mode = 'list';
+ }
if(x($hashtags)) {
$sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
- $sql_extra_order = " ORDER BY item.created DESC ";
- $thread_top = '';
}
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
@@ -196,7 +195,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($update) {
- $ordering = Config::Get('system', 'pubstream_ordering', 'commented');
+ $ordering = Config::Get('system', 'pubstream_ordering', 'created');
if($load) {
if($mid) {
@@ -246,38 +245,20 @@ class Pubstream extends \Zotlabs\Web\Controller {
}
}
- // Then fetch all the children of the parents that are on this page
- $parents_str = '';
-
if($r) {
-
- $parents_str = ids_to_querystr($r,'item_id');
-
- $items = dbq("SELECT item.*, item.id AS item_id FROM item
- WHERE true $uids $item_normal
- AND item.parent IN ( $parents_str )
- $sql_extra $sql_extra_order"
- );
-
+ $items = items_by_parent_ids($r, blog_mode: $blog_mode);
// use effective_uid param of xchan_query to help sort out comment permission
// for sys_channel owned items.
xchan_query($items, true, local_channel());
$items = fetch_post_tags($items,true);
-
- if (!$hashtags) {
- $items = conv_sort($items, $ordering);
- }
-
-
+ $items = conv_sort($items, $ordering);
}
}
- $mode = (($hashtags) ? 'pubstream-new' : 'pubstream');
-
- $o .= conversation($items,$mode,$update,$page_mode);
+ $o .= conversation($items, 'pubstream', $update, $page_mode);
if($mid)
$o .= '<div id="content-complete"></div>';