diff options
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 35 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 6 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_styles.php | 22 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/functions_display.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 30 | 
6 files changed, 80 insertions, 17 deletions
| diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 3cfe5de293..2480f1f025 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -922,6 +922,9 @@ class acp_attachments  			case 'orphan': +				/* @var $pagination \phpbb\pagination */ +				$pagination = $this->phpbb_container->get('pagination'); +  				if ($submit)  				{  					$delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array(); @@ -1064,13 +1067,29 @@ class acp_attachments  					'S_ORPHAN'		=> true)  				); +				$attachments_per_page = (int) $config['topics_per_page']; + +				// Get total number or orphans older than 3 hours +				$sql = 'SELECT COUNT(attach_id) as num_files, SUM(filesize) as total_size +					FROM ' . ATTACHMENTS_TABLE . ' +					WHERE is_orphan = 1 +						AND filetime < ' . (time() - 3*60*60); +				$result = $this->db->sql_query($sql); +				$row = $this->db->sql_fetchrow($result); +				$num_files = (int) $row['num_files']; +				$total_size = (int) $row['total_size']; +				$this->db->sql_freeresult($result); + +				$start = $request->variable('start', 0); +				$start = $pagination->validate_start($start, $attachments_per_page, $num_files); +  				// Just get the files with is_orphan set and older than 3 hours  				$sql = 'SELECT *  					FROM ' . ATTACHMENTS_TABLE . '  					WHERE is_orphan = 1  						AND filetime < ' . (time() - 3*60*60) . '  					ORDER BY filetime DESC'; -				$result = $db->sql_query($sql); +				$result = $db->sql_query_limit($sql, $attachments_per_page, $start);  				while ($row = $db->sql_fetchrow($result))  				{ @@ -1086,6 +1105,20 @@ class acp_attachments  				}  				$db->sql_freeresult($result); +				$pagination->generate_template_pagination( +					$this->u_action, +					'pagination', +					'start', +					$num_files, +					$attachments_per_page, +					$start +				); + +				$template->assign_vars(array( +					'TOTAL_FILES'		=> $num_files, +					'TOTAL_SIZE'		=> get_formatted_filesize($total_size), +				)); +  			break;  			case 'manage': diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index f958ae93c7..18d574081a 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -553,10 +553,10 @@ class acp_bbcodes  		}  		// Lowercase tags -		$bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+=?).*/i', '$1', $bbcode_match); -		$bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+)=?.*/i', '$1', $bbcode_match); +		$bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+).*/i', '$1', $bbcode_match); +		$bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+).*/i', '$1', $bbcode_match); -		if (!preg_match('/^[a-zA-Z0-9_-]+=?$/', $bbcode_tag)) +		if (!preg_match('/^[a-zA-Z0-9_-]+$/', $bbcode_tag))  		{  			global $user;  			trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 5b31417b83..4c390c5f0e 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1355,18 +1355,18 @@ class acp_styles  		}  		// Hardcoded template bitfield to add for new templates +		$default_bitfield = '1111111111111'; +  		$bitfield = new bitfield(); -		$bitfield->set(0); -		$bitfield->set(1); -		$bitfield->set(2); -		$bitfield->set(3); -		$bitfield->set(4); -		$bitfield->set(8); -		$bitfield->set(9); -		$bitfield->set(11); -		$bitfield->set(12); -		$value = $bitfield->get_base64(); -		return $value; +		for ($i = 0; $i < strlen($default_bitfield); $i++) +		{ +			if ($default_bitfield[$i] == '1') +			{ +				$bitfield->set($i); +			} +		} + +		return $bitfield->get_base64();  	}  } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 090cb32ebb..beaa1d11f1 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2497,7 +2497,7 @@ class acp_users  							'U_DELETE'			=> $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],  							'U_APPROVE'			=> ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '', -							'GROUP_NAME'		=> ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'], +							'GROUP_NAME'		=> $group_helper->get_name($data['group_name']),  							'L_DEMOTE_PROMOTE'	=> ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],  							'S_IS_MEMBER'		=> ($group_type != 'pending') ? true : false, diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 32bee14eef..171a73a8de 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -537,7 +537,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod  		// Create last post link information, if appropriate  		if ($row['forum_last_post_id'])  		{ -			if ($row['forum_password_last_post'] === '' && $auth->acl_get('f_read', $row['forum_id_last_post'])) +			if ($row['forum_password_last_post'] === '' && $auth->acl_gets('f_read', 'f_list_topics', $row['forum_id_last_post']))  			{  				$last_post_subject = censor_text($row['forum_last_post_subject']);  				$last_post_subject_truncated = truncate_string($last_post_subject, 30, 255, false, $user->lang['ELLIPSIS']); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 48d14a133c..cf767a7cce 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -267,6 +267,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  	* @var 	array	user_info	User data of the sender  	* @since 3.1.0-a1  	* @changed 3.1.6-RC1		Added user_info into event +	* @changed 3.2.2-RC1		Deprecated +	* @deprecated 4.0.0			Event name is misspelled and is replaced with new event with correct name  	*/  	$vars = array(  		'id', @@ -281,6 +283,34 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  	);  	extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars))); +	/** +	 * Modify pm and sender data before it is assigned to the template +	 * +	 * @event core.ucp_pm_view_message +	 * @var	mixed	id			Active module category (can be int or string) +	 * @var	string	mode		Active module +	 * @var	int		folder_id	ID of the folder the message is in +	 * @var	int		msg_id		ID of the private message +	 * @var	array	folder		Array with data of user's message folders +	 * @var	array	message_row	Array with message data +	 * @var	array	cp_row		Array with senders custom profile field data +	 * @var	array	msg_data	Template array with message data +	 * @var array	user_info	User data of the sender +	 * @since 3.2.2-RC1 +	 */ +	$vars = array( +		'id', +		'mode', +		'folder_id', +		'msg_id', +		'folder', +		'message_row', +		'cp_row', +		'msg_data', +		'user_info', +	); +	extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_message', compact($vars))); +  	$template->assign_vars($msg_data);  	$contact_fields = array( | 
