1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-20 23:51:28 +01:00

Merge pull request #4794 from lr94/ticket/15176

[ticket/15176] Add setting for user activity display limit.
This commit is contained in:
Marc Alexander 2017-06-24 21:42:39 +02:00
commit b59073cf3e
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
5 changed files with 44 additions and 3 deletions

View File

@ -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),

View File

@ -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;
}

View File

@ -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');

View File

@ -398,6 +398,8 @@ $lang = array_merge($lang, array(
'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on topic pages',
'LOAD_USER_ACTIVITY' => 'Show users 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' => 'Users activity post limit',
'LOAD_USER_ACTIVITY_LIMIT_EXPLAIN' => 'The active topic/forum wont 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',

View File

@ -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')),
);
}
}