aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-06-09 10:58:01 +0200
committerMario Vavti <mario@mariovavti.com>2018-06-09 10:58:01 +0200
commitc4778e5e2494d262c18dd73815fb495964355fce (patch)
tree6960a7336c13e3aa6e0bd9b6a1cedf1d9595f95f
parentd5ee8d80ab2db542fb14bbeaab5707665b9e3590 (diff)
downloadvolse-hubzilla-c4778e5e2494d262c18dd73815fb495964355fce.tar.gz
volse-hubzilla-c4778e5e2494d262c18dd73815fb495964355fce.tar.bz2
volse-hubzilla-c4778e5e2494d262c18dd73815fb495964355fce.zip
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
-rw-r--r--Zotlabs/Module/Network.php2
-rw-r--r--Zotlabs/Widget/Activity_filter.php65
-rw-r--r--Zotlabs/Widget/Activity_order.php4
3 files changed, 35 insertions, 36 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index 132770608..2e9bcd2ce 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -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) {
diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php
index 78e439fdd..fadf39144 100644
--- a/Zotlabs/Widget/Activity_filter.php
+++ b/Zotlabs/Widget/Activity_filter.php
@@ -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[] = [
diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php
index 534d6caee..0e660afc3 100644
--- a/Zotlabs/Widget/Activity_order.php
+++ b/Zotlabs/Widget/Activity_order.php
@@ -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';
}