restrict cid filter to unthreaded order (makes much more sense that way imho and the query is a lot faster) and slighty change order of the filters

This commit is contained in:
Mario Vavti 2018-06-09 10:58:01 +02:00
parent d5ee8d80ab
commit c4778e5e24
3 changed files with 35 additions and 36 deletions

View File

@ -140,7 +140,7 @@ class Network extends \Zotlabs\Web\Controller {
$deftag = '';
if(x($_GET,'search') || x($_GET,'file'))
if(x($_GET,'search') || $file || (!$pf && $cid))
$nouveau = true;
if($cid) {

View File

@ -76,6 +76,38 @@ class Activity_filter {
}
}
if(feature_enabled(local_channel(),'forums_tab')) {
$forums = get_forum_channels(local_channel());
if($forums) {
foreach($forums as $f) {
if(x($_GET,'pf') && x($_GET,'cid')) {
$forum_active = ((x($_GET,'pf') && $_GET['cid'] == $f['abook_id']) ? 'active' : '');
$filter_active = 'forums';
}
$fsub[] = [
'label' => $f['xchan_name'],
'img' => $f['xchan_photo_s'],
'url' => (($f['private_forum']) ? $f['xchan_url'] : z_root() . '/' . $cmd . '/?f=&pf=1&cid=' . $f['abook_id']),
'sel' => $forum_active,
'title' => t('Show posts to this forum'),
'lock' => (($f['private_forum']) ? 'lock' : '')
];
}
$tabs[] = [
'id' => 'forums',
'label' => t('Forums'),
'icon' => 'comments-o',
'url' => '#',
'sel' => (($filter_active == 'forums') ? true : false),
'title' => t('Show forums'),
'sub' => $fsub
];
}
}
if(feature_enabled(local_channel(),'filing')) {
$terms = q("select distinct term from term where uid = %d and ttype = %d order by term asc",
intval(local_channel()),
@ -110,39 +142,6 @@ class Activity_filter {
}
}
if(feature_enabled(local_channel(),'forums_tab')) {
$forums = get_forum_channels(local_channel());
if($forums) {
foreach($forums as $f) {
if(x($_GET,'pf') && x($_GET,'cid')) {
$forum_active = ((x($_GET,'pf') && $_GET['cid'] == $f['abook_id']) ? 'active' : '');
$filter_active = 'forums';
}
$fsub[] = [
'label' => $f['xchan_name'],
'img' => $f['xchan_photo_s'],
'url' => (($f['private_forum']) ? $f['xchan_url'] : z_root() . '/' . $cmd . '/?f=&pf=1&cid=' . $f['abook_id']),
'sel' => $forum_active,
'title' => t('Show posts to this forum'),
'lock' => (($f['private_forum']) ? 'lock' : '')
];
}
$tabs[] = [
'id' => 'forums',
'label' => t('Forums'),
'icon' => 'comments-o',
'url' => '#',
'sel' => (($filter_active == 'forums') ? true : false),
'title' => t('Show forums'),
'sub' => $fsub
];
}
}
if(x($_GET,'search')) {
$filter_active = 'search';
$tabs[] = [

View File

@ -53,8 +53,8 @@ class Activity_order {
}
}
// override order for search results and filer results
if(x($_GET,'search') || x($_GET,'file')) {
// override order for search, filer and cid results
if(x($_GET,'search') || x($_GET,'file') || (! x($_GET,'pf') && x($_GET,'cid'))) {
$unthreaded_active = 'active';
$commentord_active = $postord_active = 'disabled';
}