aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-06-15 02:02:03 -0700
committerzotlabs <mike@macgirvin.com>2018-06-15 15:34:27 -0700
commit3fc955abfdfdc098af1c8889b62817f44c78cdee (patch)
tree1fdffe59839e3ab1dee0c8e2a6bf2ccfe733f0b2
parent615fa1119f10e182bc5be1b5b08c2be86ef69f06 (diff)
downloadvolse-hubzilla-3fc955abfdfdc098af1c8889b62817f44c78cdee.tar.gz
volse-hubzilla-3fc955abfdfdc098af1c8889b62817f44c78cdee.tar.bz2
volse-hubzilla-3fc955abfdfdc098af1c8889b62817f44c78cdee.zip
hubzilla core issue #1227 - affinity slider unable to reach 0,99 when slider saved default changes
-rw-r--r--Zotlabs/Module/Network.php11
-rwxr-xr-xview/tpl/build_query.tpl4
2 files changed, 8 insertions, 7 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index 2656cb1dc..edbcd2ea7 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -107,9 +107,8 @@ class Network extends \Zotlabs\Web\Controller {
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
}
-
- $default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
- $default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
+ $default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
+ $default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
// if no tabs are selected, defaults to comments
@@ -130,6 +129,7 @@ class Network extends \Zotlabs\Web\Controller {
if(x($_GET,'search') || x($_GET,'file'))
$nouveau = true;
+
if($cid) {
$r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
intval($cid),
@@ -395,8 +395,9 @@ class Network extends \Zotlabs\Web\Controller {
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
}
-
- if(($cmin != 0) || ($cmax != 99)) {
+ // cmin and cmax are both -1 when the affinity tool is disabled
+
+ if(($cmin != (-1)) || ($cmax != (-1))) {
// Not everybody who shows up in the network stream will be in your address book.
// By default those that aren't are assumed to have closeness = 99; but this isn't
diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl
index 1d938d395..6ee97e171 100755
--- a/view/tpl/build_query.tpl
+++ b/view/tpl/build_query.tpl
@@ -35,8 +35,8 @@
var udargs = ((page_load) ? "/load" : "");
var bCmd = bParam_cmd + udargs + "?f=" ;
if(bParam_uid) bCmd = bCmd + "&p=" + bParam_uid;
- if(bParam_cmin != 0) bCmd = bCmd + "&cmin=" + bParam_cmin;
- if(bParam_cmax != 99) bCmd = bCmd + "&cmax=" + bParam_cmax;
+ if(bParam_cmin != (-1)) bCmd = bCmd + "&cmin=" + bParam_cmin;
+ if(bParam_cmax != (-1)) bCmd = bCmd + "&cmax=" + bParam_cmax;
if(bParam_gid != 0) { bCmd = bCmd + "&gid=" + bParam_gid; } else
if(bParam_cid != 0) { bCmd = bCmd + "&cid=" + bParam_cid; }
if(bParam_static != 0) { bCmd = bCmd + "&static=" + bParam_static; }