diff options
author | Marc Alexander <admin@m-a-styles.de> | 2017-06-24 21:42:39 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2017-06-24 21:42:39 +0200 |
commit | b59073cf3ed54d040aef0f02cb3e5c28fb768b5b (patch) | |
tree | 0c6bfaf0696ed1498b3e68d43721a530a90312db /phpBB | |
parent | 909976f0761622fd0b6ecd00bef4919513c738df (diff) | |
parent | aa37e9b7fc60bd443c6abbcdc3adbf28ae010f32 (diff) | |
download | forums-b59073cf3ed54d040aef0f02cb3e5c28fb768b5b.tar forums-b59073cf3ed54d040aef0f02cb3e5c28fb768b5b.tar.gz forums-b59073cf3ed54d040aef0f02cb3e5c28fb768b5b.tar.bz2 forums-b59073cf3ed54d040aef0f02cb3e5c28fb768b5b.tar.xz forums-b59073cf3ed54d040aef0f02cb3e5c28fb768b5b.zip |
Merge pull request #4794 from lr94/ticket/15176
[ticket/15176] Add setting for user activity display limit.
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 1 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 7 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 1 | ||||
-rw-r--r-- | phpBB/language/en/acp/board.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php | 36 |
5 files changed, 44 insertions, 3 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 9b5078b941..e044384c9f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -353,6 +353,7 @@ class acp_board 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_user_activity_limit' => array('lang' => 'LOAD_USER_ACTIVITY_LIMIT', 'validate' => 'int:0:99999999', 'type' => 'number:0:99999999', 'explain' => true), 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_cdn' => array('lang' => 'ALLOW_CDN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_live_searches' => array('lang' => 'ALLOW_LIVE_SEARCHES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index c8b5ec8b1a..32bee14eef 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1165,12 +1165,13 @@ function display_reasons($reason_id = 0) */ function display_user_activity(&$userdata_ary) { - global $auth, $template, $db, $user; + global $auth, $template, $db, $user, $config; global $phpbb_root_path, $phpEx; global $phpbb_container, $phpbb_dispatcher; - // Do not display user activity for users having more than 5000 posts... - if ($userdata_ary['user_posts'] > 5000) + // Do not display user activity for users having too many posts... + $limit = $config['load_user_activity_limit']; + if ($userdata_ary['user_posts'] > $limit && $limit != 0) { return; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 998cf17c3d..263200d8ff 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -197,6 +197,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1') INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_unreads_search', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity_limit', '5000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_autologin_time', '0'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 4db8a02405..e6c56a5bbb 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -398,6 +398,8 @@ $lang = array_merge($lang, array( 'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on topic pages', 'LOAD_USER_ACTIVITY' => 'Show user’s activity', 'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.', + 'LOAD_USER_ACTIVITY_LIMIT' => 'User’s activity post limit', + 'LOAD_USER_ACTIVITY_LIMIT_EXPLAIN' => 'The active topic/forum won’t be shown for users having more than this number of posts. Set to 0 to disable the limit.', 'READ_NOTIFICATION_EXPIRE_DAYS' => 'Read Notification Expiration', 'READ_NOTIFICATION_EXPIRE_DAYS_EXPLAIN' => 'Number of days that will elapse before a read notification will automatically be deleted. Set this value to 0 to make notifications permanent.', 'RECOMPILE_STYLES' => 'Recompile stale style components', diff --git a/phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php b/phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php new file mode 100644 index 0000000000..71bb6c00bf --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php @@ -0,0 +1,36 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class load_user_activity_limit extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + ); + } + + public function effectively_installed() + { + return isset($this->config['load_user_activity_limit']); + } + + public function update_data() + { + return array( + array('config.add', array('load_user_activity_limit', '5000')), + ); + } +} |