diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_board.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/functions_admin.php | 31 | ||||
| -rw-r--r-- | phpBB/includes/functions_posting.php | 2 | 
3 files changed, 24 insertions, 11 deletions
| diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index cec621e89d..e004d2e81f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -449,7 +449,7 @@ class acp_board  						'legend2'				=> 'SMTP_SETTINGS',  						'smtp_delivery'			=> array('lang' => 'USE_SMTP',				'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true), -						'smtp_host'				=> array('lang' => 'SMTP_SERVER',			'validate' => 'string',	'type' => 'text:25:50', 'explain' => false), +						'smtp_host'				=> array('lang' => 'SMTP_SERVER',			'validate' => 'string',	'type' => 'text:25:50', 'explain' => true),  						'smtp_port'				=> array('lang' => 'SMTP_PORT',				'validate' => 'int:0:99999',	'type' => 'number:0:99999', 'explain' => true),  						'smtp_auth_method'		=> array('lang' => 'SMTP_AUTH_METHOD',		'validate' => 'string',	'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),  						'smtp_username'			=> array('lang' => 'SMTP_USERNAME',			'validate' => 'string',	'type' => 'text:25:255', 'explain' => true), diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 4ecb7b9354..7d52491086 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2531,7 +2531,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,  /**  * Prune function  */ -function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true) +function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true, $prune_limit = 0)  {  	global $db, $phpbb_dispatcher; @@ -2583,9 +2583,19 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync  	* @var int		prune_flags		The prune flags  	* @var bool		auto_sync		Whether or not to perform auto sync  	* @var string	sql_and			SQL text appended to where clause +	* @var int		prune_limit		The prune limit  	* @since 3.1.3-RC1 +	* @changed 3.1.10-RC1			Added prune_limit  	*/ -	$vars = array('forum_id', 'prune_mode', 'prune_date', 'prune_flags', 'auto_sync', 'sql_and'); +	$vars = array( +		'forum_id', +		'prune_mode', +		'prune_date', +		'prune_flags', +		'auto_sync', +		'sql_and', +		'prune_limit', +	);  	extract($phpbb_dispatcher->trigger_event('core.prune_sql', compact($vars)));  	$sql = 'SELECT topic_id @@ -2593,7 +2603,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync  		WHERE ' . $db->sql_in_set('forum_id', $forum_id) . "  			AND poll_start = 0  			$sql_and"; -	$result = $db->sql_query($sql); +	$result = $db->sql_query_limit($sql, $prune_limit);  	$topic_list = array();  	while ($row = $db->sql_fetchrow($result)) @@ -2610,7 +2620,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync  				AND poll_start > 0  				AND poll_last_vote < $prune_date  				$sql_and"; -		$result = $db->sql_query($sql); +		$result = $db->sql_query_limit($sql, $prune_limit);  		while ($row = $db->sql_fetchrow($result))  		{ @@ -2643,12 +2653,15 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr  		$prune_date = time() - ($prune_days * 86400);  		$next_prune = time() + ($prune_freq * 86400); -		prune($forum_id, $prune_mode, $prune_date, $prune_flags, true); +		$result = prune($forum_id, $prune_mode, $prune_date, $prune_flags, true, 300); -		$sql = 'UPDATE ' . FORUMS_TABLE . " -			SET prune_next = $next_prune -			WHERE forum_id = $forum_id"; -		$db->sql_query($sql); +		if ($result['topics'] == 0 && $result['posts'] == 0) +		{ +			$sql = 'UPDATE ' . FORUMS_TABLE . " +				SET prune_next = $next_prune +				WHERE forum_id = $forum_id"; +			$db->sql_query($sql); +		}  		add_log('admin', 'LOG_AUTO_PRUNE', $row['forum_name']);  	} diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index b2713fef07..57c68d4935 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -702,7 +702,7 @@ function create_thumbnail($source, $destination, $mimetype)  	$used_imagick = false; -	// Only use imagemagick if defined and the passthru function not disabled +	// Only use ImageMagick if defined and the passthru function not disabled  	if ($config['img_imagick'] && function_exists('passthru'))  	{  		if (substr($config['img_imagick'], -1) !== '/') | 
