diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-01-02 22:14:31 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-01-02 22:14:31 +0100 |
commit | f826c09abc48a522c1a27b44a3fda1e337d90a1a (patch) | |
tree | f53302b072bae510e4d07d72c89b4238614df458 /Zotlabs/Module/Settings | |
parent | e418a6b3d498cb237bd8f6dd01f40fe57d4a868d (diff) | |
parent | 3bd7133ba32d758df935a566c45515a530b35538 (diff) | |
download | volse-hubzilla-f826c09abc48a522c1a27b44a3fda1e337d90a1a.tar.gz volse-hubzilla-f826c09abc48a522c1a27b44a3fda1e337d90a1a.tar.bz2 volse-hubzilla-f826c09abc48a522c1a27b44a3fda1e337d90a1a.zip |
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'Zotlabs/Module/Settings')
-rw-r--r-- | Zotlabs/Module/Settings/Featured.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Zotlabs/Module/Settings/Featured.php b/Zotlabs/Module/Settings/Featured.php index ebe2996d3..9c5a7b16c 100644 --- a/Zotlabs/Module/Settings/Featured.php +++ b/Zotlabs/Module/Settings/Featured.php @@ -11,15 +11,17 @@ class Featured { call_hooks('feature_settings_post', $_POST); if($_POST['affinity_slider-submit']) { - if(intval($_POST['affinity_cmax'])) { - set_pconfig(local_channel(),'affinity','cmax',intval($_POST['affinity_cmax'])); - } - if(intval($_POST['affinity_cmin'])) { - set_pconfig(local_channel(),'affinity','cmin',intval($_POST['affinity_cmin'])); - } - if(intval($_POST['affinity_cmax']) || intval($_POST['affinity_cmin'])) { - info( t('Affinity Slider settings updated.') . EOL); - } + $cmax = intval($_POST['affinity_cmax']); + if($cmax < 0 || $cmax > 99) + $cmax = 99; + $cmin = intval($_POST['affinity_cmin']); + if($cmin < 0 || $cmin > 99) + $cmin = 0; + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); + + info( t('Affinity Slider settings updated.') . EOL); + } build_sync_packet(); @@ -40,12 +42,12 @@ class Featured { $cmax = intval(get_pconfig(local_channel(),'affinity','cmax')); $cmax = (($cmax) ? $cmax : 99); $setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array( - '$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, '') + '$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, t('0-99 default 99')) )); $cmin = intval(get_pconfig(local_channel(),'affinity','cmin')); $cmin = (($cmin) ? $cmin : 0); $setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array( - '$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, '') + '$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, t('0-99 - default 0')) )); $settings_addons .= replace_macros(get_markup_template('generic_addon_settings.tpl'), array( |