From db3015e34ed3827e68d8debc70321ed6df5dc699 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 17 Nov 2014 23:48:03 -0800 Subject: allow members to set the per-item "show more" height (separately for network and matrix, display and search are system pages and therefore set at 400) --- mod/channel.php | 7 ++++++- mod/network.php | 9 ++++++++- mod/settings.php | 11 +++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/channel.php b/mod/channel.php index b91b6bcef..54b25ad8b 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -251,9 +251,14 @@ function channel_content(&$a, $update = 0, $load = false) { // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, // because browser prefetching might change it on us. We have to deliver it with the page. + $maxheight = get_pconfig($a->profile['profile_uid'],'system','channel_divmore_height'); + if(! $maxheight) + $maxheight = 400; + $o .= '
' . "\r\n"; $o .= "\r\n"; + . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] + . "; divmore_height = " . intval($maxheight) . "; \r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( '$baseurl' => z_root(), diff --git a/mod/network.php b/mod/network.php index c79ff8d6a..522622f03 100644 --- a/mod/network.php +++ b/mod/network.php @@ -208,8 +208,15 @@ function network_content(&$a, $update = 0, $load = false) { if($gid || $cid || $cmin || ($cmax != 99) || $star || $liked || $conv || $spam || $nouveau || $list) $firehose = 0; + $maxheight = get_pconfig(local_user(),'system','network_divmore_height'); + if(! $maxheight) + $maxheight = 400; + + $o .= '
' . "\r\n"; - $o .= ""; + $o .= "\r\n"; $a->page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( '$baseurl' => z_root(), diff --git a/mod/settings.php b/mod/settings.php index 725825b34..ab6638ccb 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -143,6 +143,12 @@ function settings_post(&$a) { $channel_list_mode = ((x($_POST,'channel_list_mode')) ? intval($_POST['channel_list_mode']) : 0); $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); + $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); + if($channel_divmore_height < 50) + $channel_divmore_height = 50; + $network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400); + if($network_divmore_height < 50) + $network_divmore_height = 50; $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; @@ -165,6 +171,8 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','title_tosource',$title_tosource); set_pconfig(local_user(),'system','channel_list_mode', $channel_list_mode); set_pconfig(local_user(),'system','network_list_mode', $network_list_mode); + set_pconfig(local_user(),'system','channel_divmore_height', $channel_divmore_height); + set_pconfig(local_user(),'system','network_divmore_height', $network_divmore_height); if ($theme == $a->channel['channel_theme']){ // call theme_post only if theme has not been changed @@ -810,6 +818,9 @@ function settings_content(&$a) { '$expert' => feature_enabled(local_user(),'expert'), '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_user(),'system','channel_list_mode'), t('(comments displayed separately)')), '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on matrix page'), get_pconfig(local_user(),'system','network_list_mode'), t('(comments displayed separately)')), + '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_user(),'system','channel_divmore_height')) ? get_pconfig(local_user(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), + '$network_divmore_height' => array('network_divmore_height', t('Matrix page max height of content (in pixels)'), ((get_pconfig(local_user(),'system','network_divmore_height')) ? get_pconfig(local_user(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), + )); -- cgit v1.2.3