From 4091f873eaa108cebd3192ede979ce61ead09238 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 18 Oct 2010 21:25:52 +0800 Subject: [ticket/6712] Bump does not create new topic icon on index. Handle the topic bumping process more properly. PHPBB3-6712 --- phpBB/includes/functions_posting.php | 91 ++++++++++++++++++++++++++++++++++++ phpBB/posting.php | 30 +----------- 2 files changed, 92 insertions(+), 29 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 6fd87db663..041b549cd6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2611,4 +2611,95 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u return $url; } +/* +* Handle topic bumping +*/ +function bump_topic($forum_id, $topic_id, &$post_data, $current_time = false) +{ + global $config, $db, $user, $phpEx, $phpbb_root_path; + + if ($current_time === false) + { + $current_time = time(); + } + + // Begin bumping + $db->sql_transaction('begin'); + + // Update the topic's last post post_time + $sql = 'UPDATE ' . POSTS_TABLE . " + SET post_time = $current_time + WHERE post_id = {$post_data['topic_last_post_id']} + AND topic_id = $topic_id"; + $db->sql_query($sql); + + // Sync the topic's last post time, the rest of the topic's last post data isn't changed + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_last_post_time = $current_time, + topic_bumped = 1, + topic_bumper = " . $user->data['user_id'] . " + WHERE topic_id = $topic_id"; + $db->sql_query($sql); + + // Update the forum's last post info + $sql = 'UPDATE ' . FORUMS_TABLE . " + SET forum_last_post_id = " . $post_data['topic_last_post_id'] . ", + forum_last_poster_id = " . $post_data['topic_last_poster_id'] . ", + forum_last_post_subject = '" . $db->sql_escape($post_data['topic_last_post_subject']) . "', + forum_last_post_time = $current_time, + forum_last_poster_name = '" . $db->sql_escape($post_data['topic_last_poster_name']) . "', + forum_last_poster_colour = '" . $db->sql_escape($post_data['topic_last_poster_colour']) . "' + WHERE forum_id = $forum_id"; + $db->sql_query($sql); + + // Update bumper's time of the last posting to prevent flood + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_lastpost_time = $current_time + WHERE user_id = " . $user->data['user_id']; + $db->sql_query($sql); + + $db->sql_transaction('commit'); + + // Mark this topic as posted to + markread('post', $forum_id, $topic_id, $current_time); + + // Mark this topic as read + markread('topic', $forum_id, $topic_id, $current_time); + + // Update forum tracking info + if ($config['load_db_lastread'] && $user->data['is_registered']) + { + $sql = 'SELECT mark_time + FROM ' . FORUMS_TRACK_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . ' + AND forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $f_mark_time = (int) $db->sql_fetchfield('mark_time'); + $db->sql_freeresult($result); + } + else if ($config['load_anon_lastread'] || $user->data['is_registered']) + { + $f_mark_time = false; + } + + if (($config['load_db_lastread'] && $user->data['is_registered']) || $config['load_anon_lastread'] || $user->data['is_registered']) + { + // Update forum info + $sql = 'SELECT forum_last_post_time + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $forum_id; + $result = $db->sql_query($sql); + $forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time'); + $db->sql_freeresult($result); + + update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time, false); + } + + add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']); + + $url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; + + return $url; +} + ?> \ No newline at end of file diff --git a/phpBB/posting.php b/phpBB/posting.php index f775699cee..89f2dfa2a6 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -321,35 +321,7 @@ if ($mode == 'bump') if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id']) && check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}")) { - $db->sql_transaction('begin'); - - $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_time = $current_time - WHERE post_id = {$post_data['topic_last_post_id']} - AND topic_id = $topic_id"; - $db->sql_query($sql); - - $sql = 'UPDATE ' . TOPICS_TABLE . " - SET topic_last_post_time = $current_time, - topic_bumped = 1, - topic_bumper = " . $user->data['user_id'] . " - WHERE topic_id = $topic_id"; - $db->sql_query($sql); - - update_post_information('forum', $forum_id); - - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_lastpost_time = $current_time - WHERE user_id = " . $user->data['user_id']; - $db->sql_query($sql); - - $db->sql_transaction('commit'); - - markread('post', $forum_id, $topic_id, $current_time); - - add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']); - - $meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}"; + $meta_url = bump_topic($forum_id, $topic_id, $post_data, $current_time); meta_refresh(3, $meta_url); $message = $user->lang['TOPIC_BUMPED'] . '

' . sprintf($user->lang['VIEW_MESSAGE'], '', ''); -- cgit v1.2.1 From ac26bb458f2a2ea60848921826c69bfe03e676db Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 28 Oct 2010 21:41:14 +0200 Subject: [ticket/9764] Allow $config['mime_triggers'] to be an empty string. explode('|', '') and explode('|', NULL) both return array(0 => '') which can cause filespec::check_content() to reject everything starting with a '<' character in case $config['mime_triggers'] is an empty string or not set. fileupload::set_disallowed_content() now filters out empty strings by calling array_diff() on the passed array, so setting $config['mime_triggers'] to an empty string will turn off mime checking completely. On the other side we want to fail safe if $config['mime_triggers'] is not set at all. To do this, the array fileupload::$disallowed_content now contains some default strings to be filtered out. PHPBB3-9764 --- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_upload.php | 4 ++-- phpBB/includes/functions_user.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 6fd87db663..72331a73c6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -388,7 +388,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); $upload = new fileupload(); - if ($config['check_attachment_content']) + if ($config['check_attachment_content'] && isset($config['mime_triggers'])) { $upload->set_disallowed_content(explode('|', $config['mime_triggers'])); } diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 7f09cc1640..d5bbd80242 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -458,7 +458,7 @@ class fileerror extends filespec class fileupload { var $allowed_extensions = array(); - var $disallowed_content = array(); + var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title'); var $max_filesize = 0; var $min_width = 0; var $min_height = 0; @@ -539,7 +539,7 @@ class fileupload { if ($disallowed_content !== false && is_array($disallowed_content)) { - $this->disallowed_content = $disallowed_content; + $this->disallowed_content = array_diff($disallowed_content, array('')); } } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index f2c80705ba..90341cd926 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2080,7 +2080,7 @@ function avatar_upload($data, &$error) // Init upload class include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx); - $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], explode('|', $config['mime_triggers'])); + $upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], (isset($config['mime_triggers']) ? explode('|', $config['mime_triggers']) : false)); if (!empty($_FILES['uploadfile']['name'])) { -- cgit v1.2.1 From 87aa611a8e4b944ad3ba2cde1d3256570c5f45af Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Nov 2010 11:49:17 +0100 Subject: [develop-olympus] Incrementing the version number to 3.0.9-dev. --- phpBB/includes/constants.php | 4 ++-- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/schema_data.sql | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index a4635895b0..90440f74b8 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.0.8-RC1'); +define('PHPBB_VERSION', '3.0.9-dev'); // QA-related // define('PHPBB_QA', 1); @@ -275,4 +275,4 @@ define('ZEBRA_TABLE', $table_prefix . 'zebra'); // Additional tables -?> \ No newline at end of file +?> diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 01e8ef7658..87a80f6a30 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.8-RC1'; +$updates_to_version = '3.0.9-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index cbee2c9ba1..355af802ef 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -242,7 +242,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.8-RC1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.9-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -829,4 +829,4 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); -# POSTGRES COMMIT # \ No newline at end of file +# POSTGRES COMMIT # -- cgit v1.2.1 From 396af3853fc2d86b255db0f71e56a9f880ee2509 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Nov 2010 12:07:45 +0100 Subject: [develop-olympus] Remove accidentally added trailing newlines. --- phpBB/includes/constants.php | 2 +- phpBB/install/database_update.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 90440f74b8..2b19aa185d 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -275,4 +275,4 @@ define('ZEBRA_TABLE', $table_prefix . 'zebra'); // Additional tables -?> +?> \ No newline at end of file diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 87a80f6a30..78d9067003 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.9-dev'; +$updates_to_version = '3.0.8-RC1'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -477,7 +477,7 @@ else

-

" class="button1">

+

" class="button1">

'[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + 'mssqlnative' => array( 'INT:' => '[int]', 'BINT' => '[float]', @@ -2028,7 +2028,7 @@ class updater_db_tools 'VCHAR_CI' => '[varchar] (255)', 'VARBINARY' => '[varchar] (255)', ), - + 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', @@ -2175,7 +2175,7 @@ class updater_db_tools case 'mssql_odbc': $this->sql_layer = 'mssql'; break; - + case 'mssqlnative': $this->sql_layer = 'mssqlnative'; break; @@ -3797,4 +3797,4 @@ class updater_db_tools } } -?> +?> \ No newline at end of file -- cgit v1.2.1 From b02cec86d40345f7ad28d0cca4e409766f0e65c2 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 11 Nov 2010 12:13:51 +0100 Subject: [develop-olympus] Revert accidental revert of db update lang fix and version Really not my day, is it? --- phpBB/install/database_update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 78d9067003..8d1755f8a6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.8-RC1'; +$updates_to_version = '3.0.9-dev'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -477,7 +477,7 @@ else

-

" class="button1">

+

" class="button1">

Date: Sun, 21 Nov 2010 23:18:09 +0100 Subject: [ticket/9910] Make sure S_BBCODE_ALLOWED exists when viewing PMs PHPBB3-9910 --- phpBB/includes/ucp/ucp_pm_viewmessage.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 16700c490c..b91636a9c8 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -172,6 +172,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Number of "to" recipients $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); + $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false; + $template->assign_vars(array( 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), 'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), @@ -229,6 +231,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), 'S_PM_RECIPIENTS' => $num_recipients, + 'S_BBCODE_ALLOWED' => ($bbcode_status) ? 1 : 0, 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', 'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') -- cgit v1.2.1 From 7e934c6362a219bd3e9c11c6461bc6a32a9cf930 Mon Sep 17 00:00:00 2001 From: RMcGirr83 Date: Thu, 11 Nov 2010 18:50:08 -0500 Subject: [ticket/9897] A few language fixes PHPBB3-9897 --- phpBB/language/en/acp/board.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 753decd517..5293b835d6 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -51,7 +51,7 @@ $lang = array_merge($lang, array( 'SITE_NAME' => 'Site name', 'SYSTEM_DST' => 'Enable Summer Time/DST', 'SYSTEM_TIMEZONE' => 'Guest timezone', - 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in user control panel.', + 'SYSTEM_TIMEZONE_EXPLAIN' => 'Timezone to use for displaying times to users who are not logged in (guests, bots). Logged in users set their timezone during registration and can change it in their user control panel.', 'WARNINGS_EXPIRE' => 'Warning duration', 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a user’s record.', )); @@ -325,7 +325,7 @@ $lang = array_merge($lang, array( 'VISUAL_CONFIRM_REG' => 'Enable spambot countermeasures for registrations', 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to pass the anti-spambot task to help prevent automated registrations.', 'VISUAL_CONFIRM_REFRESH' => 'Allow users to refresh the anti-spambot task', - 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request a new anti-spambot task if they are unable to solve the currunt task during registration. Some plugins might not support this option.', + 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request a new anti-spambot task if they are unable to solve the current task during registration. Some plugins might not support this option.', )); // Cookie Settings @@ -394,7 +394,7 @@ $lang = array_merge($lang, array( 'LDAP_NO_EMAIL' => 'The specified e-mail attribute does not exist.', 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.', 'LDAP_PASSWORD' => 'LDAP password', - 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding. Else fill in the password for the above user. Required for Active Directory Servers.
Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', + 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous binding, otherwise fill in the password for the above user. Required for Active Directory Servers.
Warning: This password will be stored as plain text in the database, visible to everybody who can access your database or who can view this configuration page.', 'LDAP_PORT' => 'LDAP server port', 'LDAP_PORT_EXPLAIN' => 'Optionally you can specify a port which should be used to connect to the LDAP server instead of the default port 389.', 'LDAP_SERVER' => 'LDAP server name', -- cgit v1.2.1 From 053cf790a93e9cfb521f484901d79c72783f868f Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 23 Nov 2010 16:09:09 +0100 Subject: [ticket/9924] Pass template instance into $template->display hook PHPBB3-9924 --- phpBB/docs/hook_system.html | 2 ++ phpBB/includes/template.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html index 1bf4630a9f..34055c4661 100644 --- a/phpBB/docs/hook_system.html +++ b/phpBB/docs/hook_system.html @@ -380,6 +380,8 @@ a:active { color: #368AD2; } $template->display($handle, $include_once = true); which is called directly before outputting the (not-yet-compiled) template.
exit_handler(); which is called at the very end of phpBB3's execution.

+

Please note: The $template->display hook takes a third $template argument, which is the template instance being used, which should be used instead of the global.

+

There are also valid external constants you may want to use if you embed phpBB3 into your application:

diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index f1c8094a9b..6347633b14 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -205,7 +205,7 @@ class template
 	{
 		global $user, $phpbb_hook;
 
-		if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once))
+		if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once, $this))
 		{
 			if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__)))
 			{
-- 
cgit v1.2.1


From 5ec1c887959be5629c8a4c712b152d58058929a8 Mon Sep 17 00:00:00 2001
From: Joas Schilling 
Date: Thu, 25 Nov 2010 23:29:12 +0100
Subject: [ticket/9930] Redirect failes with open_basedir enabled.

Open_basedir does not allow file_exists() for "." and directories without a
trayling-slash. Therefor we must append it on the check.

PHPBB3-9930
---
 phpBB/includes/functions.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 561a9906c4..c7f19b709d 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2353,12 +2353,12 @@ function redirect($url, $return = false, $disable_cd_check = false)
 		// Relative uri
 		$pathinfo = pathinfo($url);
 
-		if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
+		if (!$disable_cd_check && !file_exists($pathinfo['dirname'] . '/'))
 		{
 			$url = str_replace('../', '', $url);
 			$pathinfo = pathinfo($url);
 
-			if (!file_exists($pathinfo['dirname']))
+			if (!file_exists($pathinfo['dirname'] . '/'))
 			{
 				// fallback to "last known user page"
 				// at least this way we know the user does not leave the phpBB root
-- 
cgit v1.2.1


From 23765fa6684ab8a4764ce944ac0469d2973eb12f Mon Sep 17 00:00:00 2001
From: Richard Foote 
Date: Sun, 28 Nov 2010 13:32:35 +0100
Subject: [ticket/9932] Add the Bing bot when converting

PHPBB3-9932
---
 phpBB/includes/functions_convert.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 9e26043b39..4a359dcade 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1816,6 +1816,7 @@ function add_bots()
 		'Alta Vista [Bot]'			=> array('Scooter/', ''),
 		'Ask Jeeves [Bot]'			=> array('Ask Jeeves', ''),
 		'Baidu [Spider]'			=> array('Baiduspider+(', ''),
+		'Bing [Bot]'				=> array('bingbot/', ''),
 		'Exabot [Bot]'				=> array('Exabot/', ''),
 		'FAST Enterprise [Crawler]'	=> array('FAST Enterprise Crawler', ''),
 		'FAST WebCrawler [Crawler]'	=> array('FAST-WebCrawler/', ''),
-- 
cgit v1.2.1


From 90ff30b7a08fa3c80314f12bf5bcf8ff23cf860b Mon Sep 17 00:00:00 2001
From: Igor Wiedler 
Date: Tue, 23 Nov 2010 22:10:07 +0100
Subject: [task/github-readme] Add README file for GitHub

PHPBB3-9788
---
 README.md | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 README.md

diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..6b94f898a3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,20 @@
+[![phpBB](http://www.phpbb.com/theme/images/logos/blue/160x52.png)](http://www.phpbb.com)
+
+## ABOUT
+
+phpBB is a free bulletin board written in PHP.
+
+## COMMUNITY
+
+Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the development on [area51](http://area51.phpbb.com/phpBB/index.php).
+
+## CONTRIBUTE
+
+1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
+2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
+3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
+4. Send us a pull request
+
+## LICENSE
+
+[GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php)
-- 
cgit v1.2.1


From b017f54ac9c923e74325f8cca96b11c6b684f115 Mon Sep 17 00:00:00 2001
From: Ingo Migliarina 
Date: Wed, 1 Dec 2010 18:33:53 +0100
Subject: [ticket/9921] Adding sample configuration file for the lighttpd
 webserver.

PHPBB3-9921
---
 phpBB/docs/lighttpd.sample.conf | 60 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 phpBB/docs/lighttpd.sample.conf

diff --git a/phpBB/docs/lighttpd.sample.conf b/phpBB/docs/lighttpd.sample.conf
new file mode 100644
index 0000000000..5873d1c945
--- /dev/null
+++ b/phpBB/docs/lighttpd.sample.conf
@@ -0,0 +1,60 @@
+# Sample lighttpd configuration file for phpBB.
+# Global settings have been removed, copy them
+# from your system's lighttpd.conf.
+# Tested with lighttpd 1.4.26
+
+# Load moules
+server.modules += ( 
+	"mod_access",
+	"mod_fastcgi",
+	"mod_accesslog"
+)
+
+# If you have domains with and without www prefix,
+# redirect one to the other.
+$HTTP["host"] =~ "^(myforums\.com)$" {
+	url.redirect = (
+		".*"	=> "http://www.%1$0"
+	)
+}
+
+$HTTP["host"] == "www.myforums.com" {
+	server.name				= "www.myforums.com"
+	server.document-root	= "/path/to/phpbb"
+	server.dir-listing		= "disable"
+	
+	index-file.names		= ( "index.php", "index.htm", "index.html" )
+	accesslog.filename		= "/var/log/lighttpd/access-www.myforums.com.log"
+	
+	# Deny access to internal phpbb files.	
+	$HTTP["url"] =~ "^/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload)" {
+		url.access-deny = ( "" )
+	}
+
+	# Deny access to version control system directories.
+	$HTTP["url"] =~ "/\.svn|/\.git" {
+		url.access-deny = ( "" )
+	}
+	
+	# Deny access to apache configuration files.
+	$HTTP["url"] =~ "/\.htaccess|/\.htpasswd|/\.htgroups" {
+		url.access-deny = ( "" )
+	}
+
+	fastcgi.server = ( ".php" => 
+		((
+			"bin-path" => "/usr/bin/php-cgi",
+			"socket" => "/tmp/php.socket",
+			"max-procs" => 4,
+			"idle-timeout" => 30,
+			"bin-environment" => ( 
+				"PHP_FCGI_CHILDREN" => "10",
+				"PHP_FCGI_MAX_REQUESTS" => "10000"
+			),
+			"bin-copy-environment" => (
+				"PATH", "SHELL", "USER"
+			),
+			"broken-scriptfilename" => "enable"
+		))
+	)
+}
-- 
cgit v1.2.1


From 8b3d068e8321a16451dddcef6da2cf1245506e55 Mon Sep 17 00:00:00 2001
From: Adam Reyher 
Date: Wed, 1 Dec 2010 14:14:46 -0500
Subject: [ticket/9575] Change 'administrate' to 'administer'

PHPBB3-9575
---
 phpBB/language/en/acp/common.php | 2 +-
 phpBB/language/en/acp/groups.php | 2 +-
 phpBB/language/en/memberlist.php | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 2c549f8130..8c71e936b3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -255,7 +255,7 @@ $lang = array_merge($lang, array(
 	'MOVE_UP'				=> 'Move up',
 
 	'NOTIFY'				=> 'Notification',
-	'NO_ADMIN'				=> 'You are not authorised to administrate this board.',
+	'NO_ADMIN'				=> 'You are not authorised to administer this board.',
 	'NO_EMAILS_DEFINED'		=> 'No valid e-mail addresses found.',
 	'NO_PASSWORD_SUPPLIED'	=> 'You need to enter your password to access the Administration Control Panel.',
 
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index e8c1a3c494..3444b98303 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -36,7 +36,7 @@ if (empty($lang) || !is_array($lang))
 // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
 
 $lang = array_merge($lang, array(
-	'ACP_GROUPS_MANAGE_EXPLAIN'		=> 'From this panel you can administrate all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
+	'ACP_GROUPS_MANAGE_EXPLAIN'		=> 'From this panel you can administer all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.',
 	'ADD_USERS'						=> 'Add users',
 	'ADD_USERS_EXPLAIN'				=> 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.',
 
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index e7a9c6b88d..213f766610 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -131,7 +131,7 @@ $lang = array_merge($lang, array(
 	'SORT_POST_COUNT'		=> 'Post count',
 
 	'USERNAME_BEGINS_WITH'	=> 'Username begins with',
-	'USER_ADMIN'			=> 'Administrate user',
+	'USER_ADMIN'			=> 'Administer user',
 	'USER_BAN'				=> 'Banning',
 	'USER_FORUM'			=> 'User statistics',
 	'USER_LAST_REMINDED'	=> array(
-- 
cgit v1.2.1


From e6a6f00562953f507bb05f4c61d40a0800f70bff Mon Sep 17 00:00:00 2001
From: Adam Reyher 
Date: Wed, 1 Dec 2010 14:29:28 -0500
Subject: [ticket/9928] Do not link "login to your board" to the "send
 statistics" page.

PHPBB3-9928
---
 phpBB/language/en/install.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 14923e836e..91ecb10848 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -370,7 +370,7 @@ $lang = array_merge($lang, array(
 
 // Updater
 $lang = array_merge($lang, array(
-	'ALL_FILES_UP_TO_DATE'		=> 'All files are up to date with the latest phpBB version. You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the Send statistics module in your ACP.',
+	'ALL_FILES_UP_TO_DATE'		=> 'All files are up to date with the latest phpBB version. You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the Send statistics module in your ACP.',
 	'ARCHIVE_FILE'				=> 'Source file within archive',
 
 	'BACK'				=> 'Back',
-- 
cgit v1.2.1


From 7a3d6a8168c7cd7da4f3ff462579ed562d0432a1 Mon Sep 17 00:00:00 2001
From: RMcGirr83 
Date: Mon, 29 Nov 2010 07:10:19 -0500
Subject: [ticket/8736] guest can have 255 chars long username

when you post as a guest (anonymous) you can fill the field username with 255
chars. that will destroy the prosilver and subsilver2 style at viewtopic.
settings for username in ACP: 6-16 Chars

PHPBB3-8736
---
 phpBB/posting.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/phpBB/posting.php b/phpBB/posting.php
index f775699cee..7368026136 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -861,11 +861,18 @@ if ($submit || $preview || $refresh)
 	{
 		include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
 
+		$user->add_lang('ucp');
+
 		if (($result = validate_username($post_data['username'], (!empty($post_data['post_username'])) ? $post_data['post_username'] : '')) !== false)
 		{
-			$user->add_lang('ucp');
 			$error[] = $user->lang[$result . '_USERNAME'];
 		}
+
+		if (($result = validate_string($post_data['username'], false, $config['min_name_chars'], $config['max_name_chars'])) !== false)
+		{
+			$min_max_amount = ($result == 'TOO_SHORT') ? $config['min_name_chars'] : $config['max_name_chars'];
+			$error[] = sprintf($user->lang['FIELD_' . $result], $user->lang['USERNAME'], $min_max_amount);
+		}
 	}
 
 	if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
-- 
cgit v1.2.1


From 0491bfbc2d5e7d98a7a15b5d0096c2647b821709 Mon Sep 17 00:00:00 2001
From: Igor Wiedler 
Date: Sun, 5 Dec 2010 14:09:39 +0100
Subject: [ticket/9575] Also change 'administrate' to 'administer' in templates

PHPBB3-9575
---
 phpBB/adm/style/acp_forums.html | 2 +-
 phpBB/adm/style/acp_styles.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 9f9216a068..d27cea28f7 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -58,7 +58,7 @@
 
 		/**
 		* Init the wanted display functionality if javascript is enabled.
-		* If javascript is not available, the user is still able to properly administrate.
+		* If javascript is not available, the user is still able to properly administer.
 		*/
 		onload = function()
 		{
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index 5bde4008ad..cb4361dd6f 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -77,7 +77,7 @@
 
 		/**
 		* Init the wanted display functionality if javascript is enabled.
-		* If javascript is not available, the user is still able to properly administrate.
+		* If javascript is not available, the user is still able to properly administer.
 		*/
 		onload = function()
 		{
-- 
cgit v1.2.1


From 7dd06e8113d4a571d8681a9a11f2b06ca7a7beb8 Mon Sep 17 00:00:00 2001
From: Igor Wiedler 
Date: Sun, 5 Dec 2010 14:35:19 +0100
Subject: [ticket/9939] Fix JavaScript error in admin recaptcha template

PHPBB3-9939
---
 phpBB/adm/style/captcha_recaptcha.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/phpBB/adm/style/captcha_recaptcha.html b/phpBB/adm/style/captcha_recaptcha.html
index 586c494868..d3038fd714 100644
--- a/phpBB/adm/style/captcha_recaptcha.html
+++ b/phpBB/adm/style/captcha_recaptcha.html
@@ -5,7 +5,7 @@
 		// 
 		
-- 
cgit v1.2.1


From d7287ec633577886e5f92543c2a610d4aaa93d53 Mon Sep 17 00:00:00 2001
From: ChrisTX 
Date: Sun, 21 Nov 2010 23:02:56 +0100
Subject: [feature/acm-wincache] Adding caching module for WinCache's User
 Cache.

PHPBB3-9942
---
 phpBB/includes/acm/acm_wincache.php | 84 +++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 phpBB/includes/acm/acm_wincache.php

diff --git a/phpBB/includes/acm/acm_wincache.php b/phpBB/includes/acm/acm_wincache.php
new file mode 100644
index 0000000000..0501ab74c5
--- /dev/null
+++ b/phpBB/includes/acm/acm_wincache.php
@@ -0,0 +1,84 @@
+key_prefix . $var, $success);
+
+		return ($success) ? $result : false;
+	}
+
+	/**
+	* Store data in the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @param mixed $data Data to store
+	* @param int $ttl Time-to-live of cached data
+	* @return bool True if the operation succeeded
+	*/
+	function _write($var, $data, $ttl = 2592000)
+	{
+		return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
+	}
+
+	/**
+	* Remove an item from the cache
+	*
+	* @access protected
+	* @param string $var Cache key
+	* @return bool True if the operation succeeded
+	*/
+	function _delete($var)
+	{
+		return wincache_ucache_delete($this->key_prefix . $var);
+	}
+}
-- 
cgit v1.2.1


From 41184e5d7621d19f8349facb9c1cc9217ae7189e Mon Sep 17 00:00:00 2001
From: Nils Adermann 
Date: Mon, 13 Dec 2010 14:21:32 +0100
Subject: [task/phpdoc] Added a configuration file for phpDocumentor.

PHPBB3-9943
---
 build/phpdoc-phpbb.ini | 106 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 build/phpdoc-phpbb.ini

diff --git a/build/phpdoc-phpbb.ini b/build/phpdoc-phpbb.ini
new file mode 100644
index 0000000000..86d33549c0
--- /dev/null
+++ b/build/phpdoc-phpbb.ini
@@ -0,0 +1,106 @@
+;; phpDocumentor parse configuration file
+;;
+;; This file is designed to cut down on repetitive typing on the command-line or web interface
+;; You can copy this file to create a number of configuration files that can be used with the
+;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini.  The web
+;; interface will automatically generate a list of .ini files that can be used.
+;;
+;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs
+;;
+;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini
+;;
+;; Copyright 2002, Greg Beaver 
+;;
+;; WARNING: do not change the name of any command-line parameters, phpDocumentor will ignore them
+
+[Parse Data]
+;; title of all the documentation
+;; legal values: any string
+title = phpBB3 Sourcecode Documentation
+
+;; parse files that start with a . like .bash_profile
+;; legal values: true, false
+hidden = false
+
+;; show elements marked @access private in documentation by setting this to on
+;; legal values: on, off
+parseprivate = on
+
+;; parse with javadoc-like description (first sentence is always the short description)
+;; legal values: on, off
+javadocdesc = off
+
+;; add any custom @tags separated by commas here
+;; legal values: any legal tagname separated by commas.
+;customtags = mytag1,mytag2
+
+;; This is only used by the XML:DocBook/peardoc2 converter
+defaultcategoryname = sourcecode
+
+;; what is the main package?
+;; legal values: alphanumeric string plus - and _
+defaultpackagename = phpBB3
+
+;; output any parsing information?  set to on for cron jobs
+;; legal values: on
+;quiet = on
+
+;; parse a PEAR-style repository.  Do not turn this on if your project does
+;; not have a parent directory named "pear"
+;; legal values: on/off
+;pear = on
+
+;; where should the documentation be written?
+;; legal values: a legal path
+target = api
+
+;; Which files should be parsed out as special documentation files, such as README,
+;; INSTALL and CHANGELOG?  This overrides the default files found in
+;; phpDocumentor.ini (this file is not a user .ini file, but the global file)
+readmeinstallchangelog = README.html, INSTALL.html, CHANGELOG.html, COPYING
+
+;; limit output to the specified packages, even if others are parsed
+;; legal values: package names separated by commas
+;packageoutput = phpBB3,ACP,SEARCH,DBAL,ACM,MCP,UCP,LOGIN,lang_english
+
+;; comma-separated list of files to parse
+;; legal values: paths separated by commas
+;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory
+
+;; comma-separated list of directories to parse
+;; legal values: directory paths separated by commas
+;directory = /path1,/path2,.,..,subdirectory
+;directory = /home/jeichorn/cvs/pear
+directory = ../phpBB/
+
+;; template base directory (the equivalent directory of /phpDocumentor)
+;templatebase = /path/to/my/templates
+
+;; directory to find any example files in through @example and {@example} tags
+;examplesdir = c:\wamp\www\examples
+
+;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore
+;; legal values: any wildcard strings separated by commas
+;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/
+ignore = templates_c/,*HTML/default/*,spec/,*config.php*,*CVS/,test_chora.php,testupdate/,cache/,store/,*proSilver/,develop/,includes/utf/data/,includes/captcha/fonts/,install/update/,install/update.new/,files/,*phpinfo.php*,*update_script.php*,*upgrade.php*,*convert.php*,install/converter/,language/de/,script/,*swatch.php*,*test.php*,*test2.php*,*install.php*,*functions_diff.php*,*acp_update.php*
+
+;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format
+;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,
+;;               HTML:frames:earthli,
+;;               HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,
+;;               HTML:frames:DOM/phphtmllib,HTML:frames:DOM/earthli
+;;               HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
+;;               PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default
+;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS,CHM:default:default,PDF:default:default
+;output=HTML:frames:DOM/default,XML:DocBook/peardoc2:default,CHM:default:default,HTML:frames:DOM/earthli,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/phphtmllib,HTML:frames:phphtmllib
+;HTML:frames:earthli
+;output=XML:DocBook/peardoc2:default
+
+;output=HTML:frames:DOM/earthli
+;output=HTML:frames:earthli,HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,HTML:frames:DOM/earthli,HTML:frames:DOM/phphtmllib,HTML:frames:phpedit,HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS,CHM:default:default,PDF:default:default
+;output=HTML:Smarty:PHP
+output=HTML:frames:earthli
+
+;; turn this option on if you want highlighted source code for every file
+;; legal values: on/off
+sourcecode = off
-- 
cgit v1.2.1


From 03c52e79b909158a1461bc1c6a48b44fd4a2a97a Mon Sep 17 00:00:00 2001
From: Nils Adermann 
Date: Mon, 13 Dec 2010 14:24:33 +0100
Subject: [task/phpdoc] Added a phpdoc task to the build process

PHPBB3-9943
---
 build/build.xml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/build/build.xml b/build/build.xml
index bf77d82f6c..8d2afcb00c 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -12,7 +12,7 @@
 
 	
 	
-	
+	
 
 	
 		
@@ -64,6 +64,12 @@
 		-->
 	
 
+	
+		
+	
+
 	
 		
 	
-- 
cgit v1.2.1


From b88582199d09931e23b939784fc266fbc0473d30 Mon Sep 17 00:00:00 2001
From: rxu 
Date: Sun, 17 Oct 2010 15:42:13 +0800
Subject: [ticket/9851] "Search new posts" should require login.

The newposts search uses user_lastvisit, so it should require user to log in.

PHPBB3-9851
---
 phpBB/language/en/search.php |  1 +
 phpBB/search.php             | 56 +++++++++++++++++++++++++++-----------------
 2 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index d93fe6b56a..cd38cd615f 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -54,6 +54,7 @@ $lang = array_merge($lang, array(
 
 	'LOGIN_EXPLAIN_EGOSEARCH'	=> 'The board requires you to be registered and logged in to view your own posts.',
 	'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.',
+	'LOGIN_EXPLAIN_NEWPOSTS'	=> 'The board requires you to be registered and logged in to view new posts since your last visit.',
 
 	'MAX_NUM_SEARCH_KEYWORDS_REFINE'	=> 'You specified too many words to search for. Please do not enter more than %1$d words.',
 
diff --git a/phpBB/search.php b/phpBB/search.php
index 2a13e20477..2aa61401cf 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -47,32 +47,44 @@ $sort_dir		= request_var('sd', 'd');
 $return_chars	= request_var('ch', ($topic_id) ? -1 : 300);
 $search_forum	= request_var('fid', array(0));
 
-// We put login boxes for the case if search_id is egosearch or unreadposts
+// We put login boxes for the case if search_id is newposts, egosearch or unreadposts
 // because a guest should be able to log in even if guests search is not permitted
 
-// Egosearch is an author search
-if ($search_id == 'egosearch')
+switch ($search_id)
 {
-	$author_id = $user->data['user_id'];
-
-	if ($user->data['user_id'] == ANONYMOUS)
-	{
-		login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
-	}
-}
+	// Egosearch is an author search
+	case 'egosearch':
+		$author_id = $user->data['user_id'];
+		if ($user->data['user_id'] == ANONYMOUS)
+		{
+			login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
+		}
+	break;
 
-// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
-if ($search_id == 'unreadposts')
-{
-	if (!$config['load_unreads_search'])
-	{
-		$template->assign_var('S_NO_SEARCH', true);
-		trigger_error('NO_SEARCH_UNREADS');
-	}
-	else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
-	{
-		login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
-	}
+	// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
+	case 'unreadposts':
+		if (!$config['load_unreads_search'])
+		{
+			$template->assign_var('S_NO_SEARCH', true);
+			trigger_error('NO_SEARCH_UNREADS');
+		}
+		else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
+		{
+			login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+		}
+	break;
+	
+	// The "new posts" search uses user_lastvisit which is user based, so it should require user to log in.
+	case 'newposts':
+		if ($user->data['user_id'] == ANONYMOUS)
+		{
+			login_box('', $user->lang['LOGIN_EXPLAIN_NEWPOSTS']);
+		}
+	break;
+	
+	default:
+		// There's nothing to do here for now ;)
+	break;
 }
 
 // Is user able to search? Has search been disabled?
-- 
cgit v1.2.1


From e4488fe78819b5dd7b1e7edd8c8defe07d264b37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= 
Date: Wed, 15 Dec 2010 09:39:28 +0100
Subject: [ticket/9948] Inline quicktime files won't show

When attaching a quicktime file and placing it
inline the movie won't be shown due to the size
the movie box is being given.

PHPBB3-9948
---
 phpBB/styles/prosilver/template/attachment.html  | 4 ++--
 phpBB/styles/subsilver2/template/attachment.html | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html
index cc5aacff2f..4c0a326f1e 100644
--- a/phpBB/styles/prosilver/template/attachment.html
+++ b/phpBB/styles/prosilver/template/attachment.html
@@ -70,12 +70,12 @@
 				
 			
 		
-			
+			
 				
 				
 				
 				
-				
+				
 			
 		
 			
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
index 833bd4d55f..b5b547b2e6 100644
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ b/phpBB/styles/subsilver2/template/attachment.html
@@ -67,12 +67,12 @@
 				
 			
 		
-			
+			
 				
 				
 				
 				
-				 
+				 
 			
 		
 			
-- 
cgit v1.2.1


From fc9516a2e3e4b039b8f4f07604b6914a54a71757 Mon Sep 17 00:00:00 2001
From: Andreas Fischer 
Date: Thu, 16 Dec 2010 01:19:40 +0100
Subject: [ticket/9859] Remove years from the credit line.

PHPBB3-9859
---
 phpBB/styles/prosilver/template/overall_footer.html  | 2 +-
 phpBB/styles/subsilver2/template/overall_footer.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 4da1308e14..aeb6dc9ba3 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -30,7 +30,7 @@
 	The phpBB Group : 2006
 //-->
 
-	
 	
 
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index 79c2c0355f..1840732b64 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -2,7 +2,7 @@
 
 
 
-		
+	
 
 
 
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css
index e28887d60f..aed88831a8 100644
--- a/phpBB/styles/prosilver/theme/cp.css
+++ b/phpBB/styles/prosilver/theme/cp.css
@@ -358,7 +358,7 @@ dl.mini dd {
 }
 
 .reply-all {
-    font-size: 11px;
+	font-size: 11px;
 	padding-top: 5px;
 }
 
-- 
cgit v1.2.1


From 45f39c6d1f2adc318d521bd9eb75d80f0750fdb8 Mon Sep 17 00:00:00 2001
From: Joas Schilling 
Date: Sat, 18 Feb 2012 12:16:21 +0100
Subject: [ticket/10605] Delete orphan private messages on update

PHPBB3-10605
---
 phpBB/install/database_update.php | 42 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a1b7dcd47f..b6298ca651 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2024,6 +2024,48 @@ function change_database_data(&$no_updates, $version)
 		// No changes from 3.0.10-RC3 to 3.0.10
 		case '3.0.10-RC3':
 		break;
+
+		// Changes from 3.0.10 to 3.0.11-RC1
+		case '3.0.10':
+			// Delete orphan private messages
+			$batch_size = 500;
+
+			$sql_array = array(
+				'SELECT'	=> 'p.msg_id',
+				'FROM'		=> array(
+					PRIVMSGS_TABLE	=> 'p',
+				),
+				'LEFT_JOIN'	=> array(
+					array(
+						'FROM'	=> array(PRIVMSGS_TO_TABLE, 't'),
+						'ON'	=> 'p.msg_id = t.msg_id',
+					),
+				),
+				'WHERE'		=> 't.user_id IS NULL';
+			$sql = $db->sql_build_query('SELECT', $sql_array);
+
+			do
+			{
+				$result = $db->sql_query_limit($sql, $batch_size);
+
+				$delete_pms = array();
+				while ($row = $db->sql_fetchrow($result))
+				{
+					$delete_pms[] = (int) $row['msg_id'];
+				}
+				$db->sql_freeresult($result);
+
+				if (!empty($delete_pms))
+				{
+					$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
+						WHERE ' . $db->sql_in_set('msg_id', $delete_pms);
+					$db->sql_query($sql);
+				}
+			}
+			while (sizeof($delete_pms) == $batch_size);
+
+			$no_updates = false;
+		break;
 	}
 }
 
-- 
cgit v1.2.1


From d3091da5eade90aac1b13244d04bd1fb342bcc59 Mon Sep 17 00:00:00 2001
From: Joas Schilling 
Date: Tue, 21 Feb 2012 01:08:04 +0100
Subject: [ticket/9220] Remove margin on table.table1 so it's centered in the
 blue box.

The problem here was, that we use width: 100% in combination with the negative
margin. This causes the element to be just moved to the side, so it's not
centered anymore. width: auto would fix this, but it causes strange behaviour
on IE and looks even more ugly. So I decided to just remove the margin at all.
The border is now 1px thicker for all sides.

PHPBB3-9220
---
 phpBB/styles/prosilver/template/memberlist_body.html    |  2 +-
 phpBB/styles/prosilver/template/memberlist_leaders.html |  4 ++--
 phpBB/styles/prosilver/template/search_body.html        |  2 +-
 phpBB/styles/prosilver/template/viewonline_body.html    |  2 +-
 phpBB/styles/prosilver/theme/common.css                 | 14 +++++++++++++-
 phpBB/styles/prosilver/theme/tweaks.css                 |  4 ----
 6 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 9e6f8c3aab..5ea774bf06 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -80,7 +80,7 @@
 	
 
 
-
+
diff --git a/phpBB/styles/prosilver/template/memberlist_leaders.html b/phpBB/styles/prosilver/template/memberlist_leaders.html index 3917498050..26e299d261 100644 --- a/phpBB/styles/prosilver/template/memberlist_leaders.html +++ b/phpBB/styles/prosilver/template/memberlist_leaders.html @@ -4,7 +4,7 @@ -
+
@@ -37,7 +37,7 @@ -
+
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index 6616b95a73..4b1d30d77d 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -98,7 +98,7 @@ -
+
diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html index b111d743f9..3f1f0e64bf 100644 --- a/phpBB/styles/prosilver/template/viewonline_body.html +++ b/phpBB/styles/prosilver/template/viewonline_body.html @@ -7,7 +7,7 @@ -
+
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 8b5e09297e..7eb00bd808 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -418,7 +418,19 @@ table.info tbody th { } .forumbg table.table1 { - margin: 0 -2px -1px -1px; + margin: 0; +} + +.forumbg-table > .inner { + margin: 0 -1px; +} + +.forumbg-table > .inner > span.corners-top { + margin: 0 -4px -1px -4px; +} + +.forumbg-table > .inner > span.corners-bottom { + margin: -1px -4px 0 -4px; } /* Misc layout styles diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css index f7322c2cce..5e11b2122b 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -87,10 +87,6 @@ dl.icon { float: none; } -* html .forumbg table.table1 { - margin: 0 -2px 0px -1px; -} - /* Headerbar height fix for IE7 and below */ * html #site-description p { margin-bottom: 1.0em; -- cgit v1.2.1 From 17dc8c6c5c0e651a305961fae579c59d09abf88d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 Feb 2012 17:16:42 +0100 Subject: [ticket/9089] Add tabindex to pm/topic/post icon-options aswell PHPBB3-9089 --- phpBB/styles/prosilver/template/posting_editor.html | 4 ++-- phpBB/styles/subsilver2/template/posting_body.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index e7c1dc21eb..67ba74a690 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -87,8 +87,8 @@
- - + +
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index fec6d7ff6c..dbdf6b230c 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -127,7 +127,7 @@
-- cgit v1.2.1 From 470b79c9e38ea5c37fe5f4685618e5794b6954ad Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Fri, 24 Feb 2012 07:41:08 +0000 Subject: [ticket/8652] Sending 2 emails on 2 replies This is a fix for the problem of the system sending 2 emails when there are 2 replies to a topic where the user is subscribed in a topic and the forum that contains the topic. This simple fix seems to solve the problem. In simple tests I made it shows it does. PHPBB3-8652 --- phpBB/includes/functions_posting.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 77d92e26e2..38f542264c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,6 +1286,12 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + if ($row['notify_type'] === 'topic') + { + // Using SQL characteristics. If it didn't exist it isn't added. + // It's very rare to find someone that is registered in topic and noone is registered in the forum + $update_notification['forum'][] = $row['user_id']; + } } } unset($notify_rows); -- cgit v1.2.1 From b74530259faa6197d7215d957c180280210a93e0 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 2 Mar 2012 00:19:42 +0100 Subject: [ticket/8652] Comment for also updating forum watch table in user_notification. PHPBB3-8652 --- phpBB/includes/functions_posting.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 38f542264c..f920be9c4b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,10 +1286,18 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + + /* + * We also update the forums watch table for this user when we are + * sending out a topic notification to prevent sending out another + * notification in case this user is also subscribed to the forum + * this topic was posted in. + * Since an UPDATE query is used, this has no effect on users only + * subscribed to the topic (i.e. no row is created) and should not + * be a performance issue. + */ if ($row['notify_type'] === 'topic') { - // Using SQL characteristics. If it didn't exist it isn't added. - // It's very rare to find someone that is registered in topic and noone is registered in the forum $update_notification['forum'][] = $row['user_id']; } } -- cgit v1.2.1 From efe25a0b49c7445bef665ab28fc979e485e49289 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 29 Oct 2011 15:31:29 +0200 Subject: [ticket/9813] Use SHOW TABLE STATUS to get search stats for native on MySQL. PHPBB3-9813 --- phpBB/includes/search/fulltext_native.php | 38 +++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index b63205fd76..e5eee50fdb 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1461,17 +1461,35 @@ class fulltext_native extends search_backend { global $db; - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); + switch ($db->sql_layer) + { + case 'mysql4': + case 'mysqli': + $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDLIST_TABLE . "'"; + $result = $db->sql_query($sql); + $this->stats['total_words'] = (int) $db->sql_fetchfield('Rows'); + $db->sql_freeresult($result); + + $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDMATCH_TABLE . "'"; + $result = $db->sql_query($sql); + $this->stats['total_matches'] = (int) $db->sql_fetchfield('Rows'); + $db->sql_freeresult($result); + break; - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); + default: + $sql = 'SELECT COUNT(*) as total_words + FROM ' . SEARCH_WORDLIST_TABLE; + $result = $db->sql_query($sql); + $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); + $db->sql_freeresult($result); + + $sql = 'SELECT COUNT(*) as total_matches + FROM ' . SEARCH_WORDMATCH_TABLE; + $result = $db->sql_query($sql); + $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); + $db->sql_freeresult($result); + break; + } } /** -- cgit v1.2.1 From 97cf433dea658127ed60c70ea47d1c3830964f25 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 12 Dec 2011 02:41:48 +0100 Subject: [ticket/9813] Use table status row count only if greater than 100000 or exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_native.php | 67 +++++++++++++++++++------------ 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index e5eee50fdb..69937ff9c9 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1458,38 +1458,53 @@ class fulltext_native extends search_backend } function get_stats() + { + $this->stats['total_words'] = $this->get_table_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $this->get_table_row_count(SEARCH_WORDMATCH_TABLE); + } + + /** + * Gets statistics for a specific database table. + * + * @param string $table_name Table name + * + * @return string Row count. Prefixed with ~ if estimated. + * + * @access protected + */ + function get_table_row_count($table_name) { global $db; - switch ($db->sql_layer) + if (stripos($db->sql_layer, 'mysql') === 0) { - case 'mysql4': - case 'mysqli': - $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDLIST_TABLE . "'"; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('Rows'); - $db->sql_freeresult($result); - - $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDMATCH_TABLE . "'"; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('Rows'); - $db->sql_freeresult($result); - break; + $sql = "SHOW TABLE STATUS + LIKE '" . $table_name . "'"; + $result = $db->sql_query($sql); + $table_status = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - default: - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); - - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); - break; + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } } + + // Get exact row count by actually counting rows + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $table_name; + $result = $db->sql_query($sql); + $rows_total = $db->sql_fetchfield('rows_total'); + $db->sql_freeresult($result); + + return $rows_total; } /** -- cgit v1.2.1 From f9953fc3395e6b206c0789d40f89f9d2463348e7 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 18 Feb 2012 19:29:32 +0100 Subject: [ticket/10653] Add ability to count table rows to database abstraction layer. PHPBB3-10653 --- phpBB/includes/db/dbal.php | 35 ++++++++++++++++ phpBB/includes/db/mysql.php | 70 +++++++++++++++++++++++++++++++ phpBB/includes/db/mysqli.php | 70 +++++++++++++++++++++++++++++++ phpBB/includes/search/fulltext_native.php | 46 +------------------- 4 files changed, 177 insertions(+), 44 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 230c9c8ed7..5d456c2ff0 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -900,6 +900,41 @@ class dbal return true; } + + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $this->sql_escape($table_name); + $result = $this->sql_query($sql); + $rows_total = $this->sql_fetchfield('rows_total'); + $this->sql_freeresult($result); + + return $rows_total; + } } /** diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 1e24c79577..87413e808d 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -318,6 +318,76 @@ class dbal_mysql extends dbal return @mysql_real_escape_string($msg, $this->db_connect_id); } + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + /** * Build LIKE expression * @access private diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 456ce906d0..49b2789ce6 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -315,6 +315,76 @@ class dbal_mysqli extends dbal return @mysqli_real_escape_string($this->db_connect_id, $msg); } + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + /** * Build LIKE expression * @access private diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 69937ff9c9..dc961f3c8a 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1458,53 +1458,11 @@ class fulltext_native extends search_backend } function get_stats() - { - $this->stats['total_words'] = $this->get_table_row_count(SEARCH_WORDLIST_TABLE); - $this->stats['total_matches'] = $this->get_table_row_count(SEARCH_WORDMATCH_TABLE); - } - - /** - * Gets statistics for a specific database table. - * - * @param string $table_name Table name - * - * @return string Row count. Prefixed with ~ if estimated. - * - * @access protected - */ - function get_table_row_count($table_name) { global $db; - if (stripos($db->sql_layer, 'mysql') === 0) - { - $sql = "SHOW TABLE STATUS - LIKE '" . $table_name . "'"; - $result = $db->sql_query($sql); - $table_status = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (isset($table_status['Engine'])) - { - if ($table_status['Engine'] === 'MyISAM') - { - return $table_status['Rows']; - } - else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) - { - return '~' . $table_status['Rows']; - } - } - } - - // Get exact row count by actually counting rows - $sql = 'SELECT COUNT(*) AS rows_total - FROM ' . $table_name; - $result = $db->sql_query($sql); - $rows_total = $db->sql_fetchfield('rows_total'); - $db->sql_freeresult($result); - - return $rows_total; + $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); } /** -- cgit v1.2.1 From 6df721b21528e4d9881fa191159b123bb2b6b33f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Mar 2012 01:59:40 +0100 Subject: [ticket/10653] Unit tests for get_row_count() and get_estimated_row_count(). PHPBB3-10653 --- tests/dbal/select_test.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 05b0e68e29..9d46b47b17 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -357,4 +357,29 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertSame(false, $row); } + + public function test_get_row_count() + { + $this->assertSame( + 3, + (int) $this->new_dbal()->get_row_count('phpbb_users'), + "Failed asserting that user table has exactly 3 rows." + ); + } + + public function test_get_estimated_row_count() + { + $actual = $this->new_dbal()->get_estimated_row_count('phpbb_users'); + + if (is_string($actual) && isset($actual[0]) && $actual[0] === '~') + { + $actual = substr($actual, -1); + } + + $this->assertGreaterThan( + 1, + $actual, + "Failed asserting that estimated row count of user table is greater than 1." + ); + } } -- cgit v1.2.1 From f3af5945e3675c4d799000908c88475ee7016ac4 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Mar 2012 22:11:45 +0100 Subject: [ticket/10653] Fix parameter to substr() in unit tests. Should be 1, not -1. PHPBB3-10653 --- tests/dbal/select_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 9d46b47b17..21b12777dc 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -373,7 +373,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case if (is_string($actual) && isset($actual[0]) && $actual[0] === '~') { - $actual = substr($actual, -1); + $actual = substr($actual, 1); } $this->assertGreaterThan( -- cgit v1.2.1 From 785c75254e763a24cf56765ca9a7e02140982497 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:29:28 +0100 Subject: [ticket/9813] Also use estimated row count of posts table for fulltext mysql. Since this is 'only' for statistics anyway, using an estimated value does no harm. Also, if MyISAM is the underlying storage engine for the posts table, the value will actually be exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 52372a14d8..54cc894f6a 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,11 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $sql = 'SELECT COUNT(post_id) as total_posts - FROM ' . POSTS_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts'); - $db->sql_freeresult($result); + $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); } /** -- cgit v1.2.1 From 89a0cbc57e98d182f2696c49e182c57fb63b88c7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 7 Mar 2012 18:00:57 -0500 Subject: [ticket/7432] Delete redundant reference to "appropriate menu item". PHPBB3-7432 --- phpBB/language/en/acp/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 79caa07d98..958b9c7598 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -405,7 +405,7 @@ $lang = array_merge($lang, array( 'INACTIVE_REASON_UNKNOWN' => 'Unknown', 'INACTIVE_USERS' => 'Inactive users', 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.', - 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', 'NO_INACTIVE_USERS' => 'No inactive users', -- cgit v1.2.1 From 01d90e59a8c311778a832ba4920e4c5a85b1256f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:42:36 +0100 Subject: [ticket/9813] Only get posts table row count if we detected a fulltext index. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 54cc894f6a..779ec1d216 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,7 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); + $this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE); } /** -- cgit v1.2.1 From c11607bdd1ad4209a7697f0dc8d46ea81795b14c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 7 Mar 2012 12:11:18 +0100 Subject: [ticket/10653] Call get_row_count of base class in mysql get_estimated_row_count There is no point in fetching the table status again. PHPBB3-10653 --- phpBB/includes/db/mysql.php | 2 +- phpBB/includes/db/mysqli.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 87413e808d..1ccb785150 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -344,7 +344,7 @@ class dbal_mysql extends dbal } } - return $this->get_row_count($table_name); + return parent::get_row_count($table_name); } /** diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 49b2789ce6..a311b8cda6 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -341,7 +341,7 @@ class dbal_mysqli extends dbal } } - return $this->get_row_count($table_name); + return parent::get_row_count($table_name); } /** -- cgit v1.2.1 From bb7e86c2b1920c5820d4c9cca7ec76bd25835fa1 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 8 Mar 2012 15:19:15 +0100 Subject: [ticket/10658] Do not fetch ranks into the $ranks array, it is no longer used. PHPBB3-10658 --- phpBB/memberlist.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index cfa1631dbe..3dd5bd24b6 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -62,11 +62,6 @@ $default_key = 'c'; $sort_key = request_var('sk', $default_key); $sort_dir = request_var('sd', 'a'); - -// Grab rank information for later -$ranks = $cache->obtain_ranks(); - - // What do you want to do today? ... oops, I think that line is taken ... switch ($mode) { -- cgit v1.2.1 From 025de9ee191654825f6ba09a4804e6ef3633b8cb Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 8 Mar 2012 14:57:47 +0800 Subject: [ticket/10684] Send notifications for users with stale bans PHPBB3-10684 --- phpBB/includes/functions_posting.php | 36 +++++++++++++++++++----------------- phpBB/includes/functions_user.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index f920be9c4b..faf904467f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1180,28 +1180,23 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = ($topic_notification) ? $topic_title : $subject; $topic_title = censor_text($topic_title); - // Get banned User ID's - $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ban_userid <> 0 - AND ban_exclude <> 1'; - $result = $db->sql_query($sql); - - $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; - while ($row = $db->sql_fetchrow($result)) + // Exclude guests, current user and banned users from notifications + if (!function_exists('phpbb_get_banned_users_ids')) { - $sql_ignore_users .= ', ' . (int) $row['ban_userid']; + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $sql_ignore_users = phpbb_get_banned_users_ids(); + $sql_ignore_users[ANONYMOUS] = ANONYMOUS; + $sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; $notify_rows = array(); // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u - WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " - AND w.user_id NOT IN ($sql_ignore_users) - AND w.notify_status = " . NOTIFY_YES . ' + WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . ' + AND ' . $db->sql_in_set('w.user_id', $sql_ignore_users, true) . ' + AND w.notify_status = ' . NOTIFY_YES . ' AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') AND u.user_id = w.user_id'; $result = $db->sql_query($sql); @@ -1225,16 +1220,23 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { + // Add users who has been already notified to ignore list if (sizeof($notify_rows)) { - $sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows)); + foreach ($notify_rows as $user_id => $row) + { + if (!isset($sql_ignore_users[$user_id])) + { + $sql_ignore_users[$user_id] = $user_id; + } + } } $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id - AND fw.user_id NOT IN ($sql_ignore_users) - AND fw.notify_status = " . NOTIFY_YES . ' + AND " . $db->sql_in_set('fw.user_id', $sql_ignore_users, true) . ' + AND fw.notify_status = ' . NOTIFY_YES . ' AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') AND u.user_id = fw.user_id'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6b5cca8abb..aea94a0d34 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3587,4 +3587,33 @@ function remove_newly_registered($user_id, $user_data = false) return $user_data['group_id']; } +/** +* Get a list of banned users' ids, ignoring stale buns which were not wiped yet. +* +* @return array Array of banned users' ids if any, empty array otherwise +*/ +function phpbb_get_banned_users_ids() +{ + global $db; + + // Get banned User ID's + // Ignore stale bans which were not wiped yet + $banned_ids_list = array(); + $sql = 'SELECT ban_userid + FROM ' . BANLIST_TABLE . ' + WHERE ban_userid <> 0 + AND ban_exclude <> 1 + AND (ban_end > ' . time() . ' + OR ban_end = 0)'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $user_id = (int) $row['ban_userid']; + $banned_ids_list[$user_id] = $user_id; + } + $db->sql_freeresult($result); + + return $banned_ids_list; +} + ?> \ No newline at end of file -- cgit v1.2.1 From ee6783109ad7af70665c98d6bbc12d170bc0f892 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 9 Mar 2012 16:41:49 +0800 Subject: [ticket/10684] Fix 2 typos in comment lines. PHPBB3-10684 --- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_user.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index faf904467f..ce9762284d 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1220,7 +1220,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { - // Add users who has been already notified to ignore list + // Add users who have been already notified to ignore list if (sizeof($notify_rows)) { foreach ($notify_rows as $user_id => $row) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index aea94a0d34..dec8d09082 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,7 +3588,7 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale buns which were not wiped yet. +* Get a list of banned users' ids, ignoring stale bans which were not wiped yet. * * @return array Array of banned users' ids if any, empty array otherwise */ -- cgit v1.2.1 From cd61de4bfdd1818d173e7413e53d8fd3d7ce1913 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 9 Mar 2012 04:31:03 -0500 Subject: [ticket/9084] Explain the logic. PHPBB3-9084 --- phpBB/includes/functions_profile_fields.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 79701429e6..d44be16184 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -571,6 +571,11 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false); } + // If a dropdown field is required, users + // cannot choose the "no value" option. + // They must choose one of the other options. + // Therefore, here we treat a value equal to + // the "no value" as a lack of value, i.e. NULL. if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required']) { return NULL; -- cgit v1.2.1 From f563647e4b97fc62aa91bc3bf7c81fcc715f17c3 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 9 Mar 2012 22:35:13 +0800 Subject: [ticket/10684] Remove isset() for $sql_ignore_users update PHPBB3-10684 --- phpBB/includes/functions_posting.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index ce9762284d..c9b4267c35 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1225,10 +1225,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { foreach ($notify_rows as $user_id => $row) { - if (!isset($sql_ignore_users[$user_id])) - { - $sql_ignore_users[$user_id] = $user_id; - } + $sql_ignore_users[$user_id] = $user_id; } } -- cgit v1.2.1 From fbe8086697481f5068a9897c9e629f048a553ee4 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 9 Mar 2012 16:10:02 +0000 Subject: [ticket/10694] Update PHP warning to 5.3.2 PHPBB3-10694 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index c8df21f5a9..5ecf54a9bc 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -398,7 +398,7 @@ class acp_main // Version check $user->add_lang('install'); - if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.2.0', '<')) + if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.2', '<')) { $template->assign_vars(array( 'S_PHP_VERSION_OLD' => true, -- cgit v1.2.1 From 89a6cb2886dfd4659e6db67e27e42c4df763f723 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 10 Mar 2012 00:17:39 +0800 Subject: [ticket/10684] Refactor $sql_ignore_users array update PHPBB3-10684 --- phpBB/includes/functions_posting.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index c9b4267c35..af26d8ed0f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1214,21 +1214,15 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'method' => $row['user_notify_type'], 'allowed' => false ); + + // Add users who have been already notified to ignore list + $sql_ignore_users[$row['user_id']] = $row['user_id']; } $db->sql_freeresult($result); // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { - // Add users who have been already notified to ignore list - if (sizeof($notify_rows)) - { - foreach ($notify_rows as $user_id => $row) - { - $sql_ignore_users[$user_id] = $user_id; - } - } - $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id @@ -1272,7 +1266,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id } } - // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) $msg_users = $delete_ids = $update_notification = array(); foreach ($notify_rows as $user_id => $row) -- cgit v1.2.1 From 668c61686b09e12e7f245fc6a402a1b1f6272f1c Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Sat, 10 Mar 2012 16:47:07 +0000 Subject: [ticket/10694] Adjusting details link to 5.3 announcement PHPBB3-10694 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 5ecf54a9bc..e529ae0e5a 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -402,7 +402,7 @@ class acp_main { $template->assign_vars(array( 'S_PHP_VERSION_OLD' => true, - 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '', ''), + 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '', ''), )); } -- cgit v1.2.1 From a79b3490c2b21d283d7bc1f15c4923180e0f10b2 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 11 Mar 2012 00:56:07 +0800 Subject: [ticket/10684] Cast user_id to integer PHPBB3-10684 --- phpBB/includes/functions_posting.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index af26d8ed0f..073ce1ff4e 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1203,8 +1203,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id while ($row = $db->sql_fetchrow($result)) { - $notify_rows[$row['user_id']] = array( - 'user_id' => $row['user_id'], + $notify_user_id = (int) $row['user_id']; + $notify_rows[$notify_user_id] = array( + 'user_id' => $notify_user_id, 'username' => $row['username'], 'user_email' => $row['user_email'], 'user_jabber' => $row['user_jabber'], @@ -1216,7 +1217,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id ); // Add users who have been already notified to ignore list - $sql_ignore_users[$row['user_id']] = $row['user_id']; + $sql_ignore_users[$notify_user_id] = $notify_user_id; } $db->sql_freeresult($result); @@ -1234,8 +1235,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id while ($row = $db->sql_fetchrow($result)) { - $notify_rows[$row['user_id']] = array( - 'user_id' => $row['user_id'], + $notify_user_id = (int) $row['user_id']; + $notify_rows[$notify_user_id] = array( + 'user_id' => $notify_user_id, 'username' => $row['username'], 'user_email' => $row['user_email'], 'user_jabber' => $row['user_jabber'], -- cgit v1.2.1 From 24f1896b3c1591fd73eedd014dc6ebb214804f4d Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Sun, 11 Mar 2012 09:42:56 +0000 Subject: [ticket/10697] Updating gitignore to match develop branch PHPBB3-10697 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7d789c59a1..d875beb784 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ *~ /phpunit.xml +/phpBB/cache/*.html /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php +/phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* -- cgit v1.2.1 From 321d0d9b56011e049b245b6d54975b6c67b3b15b Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:44:00 +0800 Subject: [ticket/10684] Adjust pm_notifications() to handle stale bans - Add parameter (array) to the function phpbb_get_banned_users_ids() - Fix function pm_notification() to handle users with stale bans PHPBB3-10684 --- phpBB/includes/functions_privmsgs.php | 17 ++++++----------- phpBB/includes/functions_user.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index c40ceb088f..8303fc3754 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1622,6 +1622,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $subject = censor_text($subject); + // Exclude guests, current user and banned users from notifications unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]); if (!sizeof($recipients)) @@ -1629,18 +1630,12 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - // Get banned User ID's - $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . ' - AND ban_exclude = 0'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) + if (!function_exists('phpbb_get_banned_users_ids')) { - unset($recipients[$row['ban_userid']]); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); + $recipients = array_diff(array_map('intval', array_keys($recipients)), $banned_users); if (!sizeof($recipients)) { @@ -1649,7 +1644,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients))); + WHERE ' . $db->sql_in_set('user_id', $recipients); $result = $db->sql_query($sql); $msg_list_ary = array(); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index dec8d09082..8f40401f0b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,22 +3588,26 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale bans which were not wiped yet. +* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * +* @param array $users_ids_array Array of users' ids to check for banning, +* leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids() +function phpbb_get_banned_users_ids($users_ids_array = array()) { global $db; + $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0'; + // Get banned User ID's // Ignore stale bans which were not wiped yet $banned_ids_list = array(); $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ban_userid <> 0 + FROM ' . BANLIST_TABLE . " + WHERE $sql_users_ids AND ban_exclude <> 1 - AND (ban_end > ' . time() . ' + AND (ban_end > " . time() . ' OR ban_end = 0)'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) -- cgit v1.2.1 From da395edbca3e25d1758a6b8c26d14c2e48f112d9 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:47:28 +0800 Subject: [ticket/10684] Remove intval mapping for array keys PHP manual for arrays http://php.net/manual/en/language.types.array.php states that the following key cast will occur: Strings containing valid integers will be cast to the integer type. E.g. the key "8" will actually be stored under 8. Thus, no intval mapping for numeric array keys is needed. PHPBB3-10684 --- phpBB/includes/functions_privmsgs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 8303fc3754..4ea8f74153 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1635,7 +1635,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); - $recipients = array_diff(array_map('intval', array_keys($recipients)), $banned_users); + $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) { -- cgit v1.2.1 From ff8d5237688beee9ea36848e1ac49565e538c2cd Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:57:51 +0800 Subject: [ticket/10684] Rename function phpbb_get_banned_users_ids() parameter PHPBB3-10684 --- phpBB/includes/functions_user.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8f40401f0b..8c42a5bb42 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3590,15 +3590,15 @@ function remove_newly_registered($user_id, $user_data = false) /** * Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * -* @param array $users_ids_array Array of users' ids to check for banning, -* leave empty to get complete list of banned ids +* @param array $users_ids Array of users' ids to check for banning, +* leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids($users_ids_array = array()) +function phpbb_get_banned_users_ids($users_ids = array()) { global $db; - $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0'; + $sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; // Get banned User ID's // Ignore stale bans which were not wiped yet -- cgit v1.2.1 From 3b7a6a3eface3389b48358206fff3cb22615dc30 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Mar 2012 00:39:12 +0100 Subject: [ticket/10689] Fix "First character"-option in "Find a member"-search PHPBB3-10689 --- phpBB/memberlist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b3c0bae16a..2a2ee407a0 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1346,6 +1346,7 @@ switch ($mode) if ($mode) { $params[] = "mode=$mode"; + $u_first_char_params[] = "mode=$mode"; } $sort_params[] = "mode=$mode"; -- cgit v1.2.1 From ba6943a6a0ea50af772dc6e94f13b56292cd9f37 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Mar 2012 10:11:52 +0100 Subject: [ticket/10605] Prefix function with phpbb_ and use true instead of 1 PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 4 ++-- phpBB/includes/functions_user.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 30cff8ed72..34f16ea9da 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1086,7 +1086,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) /** * Delete all PM(s) for a given user and delete the ones without references */ -function delete_user_pms($user_id) +function phpbb_delete_user_pms($user_id) { global $db, $user, $phpbb_root_path, $phpEx; @@ -1116,7 +1116,7 @@ function delete_user_pms($user_id) $undelivered_user[$row['user_id']][] = true; } - $delete_rows[$row['msg_id']] = 1; + $delete_rows[$row['msg_id']] = true; } $db->sql_freeresult($result); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 20923ea495..92a7b8e0e9 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -529,11 +529,11 @@ function user_delete($mode, $user_id, $post_username = false) $db->sql_query($sql); // Clean the private messages tables from the user - if (!function_exists('delete_user_pms')) + if (!function_exists('phpbb_delete_user_pms')) { include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); } - delete_user_pms($user_id); + phpbb_delete_user_pms($user_id); $db->sql_transaction('commit'); -- cgit v1.2.1 From 71afba0dedd2fcc4e478e191acc23277df8209c9 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Mar 2012 22:46:06 -0400 Subject: [task/php54] Refactor error_reporting call slightly. Separate error level assignment into a variable in this commit so that the only difference between Olympus and Ascraeus is the addition of logic altering $level. PHPBB3-10615 --- phpBB/includes/startup.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index bbe2f127f1..178fb30435 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -19,7 +19,8 @@ if (!defined('E_DEPRECATED')) { define('E_DEPRECATED', 8192); } -error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); +$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; +error_reporting($level); /* * Remove variables created by register_globals from the global scope -- cgit v1.2.1 From 5efdbfa5e4e3c00c08167cdfff912ee4937f4fd2 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Mar 2012 22:47:42 -0400 Subject: [task/php54] Disable E_STRICT in Olympus when running on PHP 5.4. We cannot use static in Olympus because it must be PHP 4 compatible. Therefore disable E_STRICT for Olympus. This commit should be reverted for Ascraeus. PHPBB3-10615 --- phpBB/includes/startup.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index 178fb30435..cf216a65db 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -20,6 +20,21 @@ if (!defined('E_DEPRECATED')) define('E_DEPRECATED', 8192); } $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; +if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) +{ + // PHP 5.4 adds E_STRICT to E_ALL. + // Our utf8 normalizer triggers E_STRICT output on PHP 5.4. + // Unfortunately it cannot be made E_STRICT-clean while + // continuing to work on PHP 4. + // Therefore, in phpBB 3.0.x we disable E_STRICT on PHP 5.4+, + // while phpBB 3.1 will fix utf8 normalizer. + // E_STRICT is defined starting with PHP 5 + if (!defined('E_STRICT')) + { + define('E_STRICT', 2048); + } + $level &= ~E_STRICT; +} error_reporting($level); /* -- cgit v1.2.1 From c551b46115c889ac955649fe5513fb1d39d9979e Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Mon, 19 Mar 2012 17:11:30 +0530 Subject: [ticket/10691] Fixed the speed of creating search index $time is now initialized after each batch iteration. Speed for each batch iteration of creating search index is fixed. PHPBB3-10691 --- phpBB/develop/create_search_index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 28001035f6..c1a7125d61 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -36,7 +36,6 @@ $search_errors = array(); $search = new $class_name($search_errors); $batch_size = isset($argv[2]) ? $argv[2] : 2000; -$time = time(); if (method_exists($search, 'create_index')) { @@ -68,6 +67,7 @@ else while ($post_counter <= $max_post_id) { $row_count = 0; + $time = time(); printf("Processing posts with %d <= post_id <= %d\n", $post_counter + 1, -- cgit v1.2.1 From 97d4f168f588288df071e4a8b107b9ffb8b0355f Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Mon, 19 Mar 2012 15:08:28 -0400 Subject: [ticket/10675] Add disk full language string when posting attachments Add language string visible by admins only for when the disk does not have enough free space to upload attachments. PHPBB3-10675 --- phpBB/includes/functions_posting.php | 9 ++++++++- phpBB/language/en/posting.php | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index f920be9c4b..b40fd67927 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -497,7 +497,14 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage { if ($free_space <= $file->get('filesize')) { - $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + if ($auth->acl_get('a_')) + { + $filedata['error'][] = $user->lang['ATTACH_DISK_FULL']; + } + else + { + $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + } $filedata['post_attach'] = false; $file->remove(); diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index f8d265dddd..dd0ba7fc6d 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -42,6 +42,7 @@ $lang = array_merge($lang, array( 'ADD_POLL' => 'Poll creation', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.', + 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', -- cgit v1.2.1 From 70d88965c795a5e392605fe556df580773a505c3 Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Mon, 19 Mar 2012 23:19:21 -0400 Subject: [ticket/10708] Check converted passwords for multi-byte characters Check for multi-byte characters in converted passwords. PHPBB3-10708 --- phpBB/includes/auth/auth_db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index c20196d019..1c6cdf7832 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -163,7 +163,7 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format; $password_new_format = ''; - set_var($password_new_format, stripslashes($password_old_format), 'string'); + set_var($password_new_format, stripslashes($password_old_format), 'string', true); if ($password == $password_new_format) { -- cgit v1.2.1 From 2005c339ff26bf189fb818f0e25d6c0954b9702a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Mar 2012 17:45:08 +0100 Subject: =?UTF-8?q?[ticket/10717]=20Fix=20profile=20field=20sample=20in=20?= =?UTF-8?q?prosilver=C2=B4s=20memberlist=5Fview.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-10717 --- phpBB/styles/prosilver/template/memberlist_view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index cfec07cff0..2758a7e6cc 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -69,7 +69,7 @@
{L_JABBER}:
{L_SEND_JABBER_MESSAGE}
{L_JABBER}:
{USER_JABBER}
-
{postrow.PROFILE_FIELD1_NAME}:
{postrow.PROFILE_FIELD1_VALUE}
+
{PROFILE_FIELD1_NAME}:
{PROFILE_FIELD1_VALUE}
-- cgit v1.2.1 From c2169f689955dfb3d6fe48bd0186e06583d7f7a4 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 09:17:16 +0000 Subject: [feature/events-dispatcher] Adding phpBB/vendor to .gitignore PHPBB3-9550 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d789c59a1..59f7f49e65 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* /phpBB/store/* +/phpBB/vendor /tests/phpbb_unit_tests.sqlite2 /tests/test_config.php /tests/tmp/* -- cgit v1.2.1 From 4dafcc2525fa72f2bd91760fae49e51ff9d1a0ef Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 22:57:29 +0000 Subject: [task/travis] Adding Travis Continuous Intergration Support PHPBB3-10718 --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ travis/mysql.travis.xml | 28 ++++++++++++++++++++++++++++ travis/postgres.travis.xml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .travis.yml create mode 100644 travis/mysql.travis.xml create mode 100644 travis/postgres.travis.xml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..e091954e0e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +language: php +php: + - 5.2 + - 5.3 + - 5.4 + +env: + - DB=mysql + - DB=postgres + +before_script: + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then pyrus install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ]; then pyrus install --force phpunit/DbUnit; fi" + - phpenv rehash + +script: + - phpunit --configuration travis/$DB.travis.xml + +notifications: + email: + recipients: + - m@michaelcullum.com + on_success: never + on_failure: always + +branches: + only: + develop + task/travis diff --git a/travis/mysql.travis.xml b/travis/mysql.travis.xml new file mode 100644 index 0000000000..a849f50136 --- /dev/null +++ b/travis/mysql.travis.xml @@ -0,0 +1,28 @@ + + + + + ../tests/ + + + + + + + + + + + + + diff --git a/travis/postgres.travis.xml b/travis/postgres.travis.xml new file mode 100644 index 0000000000..e44696a335 --- /dev/null +++ b/travis/postgres.travis.xml @@ -0,0 +1,30 @@ + + + + + ../tests/ + + + + + + + + + + + + + + + -- cgit v1.2.1 From 9120c7691e28ca298eb83ebbe12a82c2723cfeee Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:25:50 +0000 Subject: [task/travis] Removing development information PHPBB3-10718 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e091954e0e..8e870ca9c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,12 @@ script: notifications: email: recipients: - - m@michaelcullum.com + - dev-team@phpbb.com on_success: never - on_failure: always + on_failure: change branches: only: develop + develop-olympus task/travis -- cgit v1.2.1 From 4325bbf4c601332614f456df969983d85829e931 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:30:56 +0000 Subject: [task/travis] Add automated testing to readme PHPBB3-10718 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6b94f898a3..f7dfc4926e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev 3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git) 4. Send us a pull request +## AUTOMATED TESTING + +We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below. +Develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) +Develop-Olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) + ## LICENSE [GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php) -- cgit v1.2.1 From 5a9dd1994fc20aaebe3145540b630826d7333998 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 22 Mar 2012 21:19:01 +0800 Subject: [ticket/10684] Adjust function and parameter name, minor changes. PHPBB3-10684 --- phpBB/includes/functions_posting.php | 4 ++-- phpBB/includes/functions_privmsgs.php | 4 ++-- phpBB/includes/functions_user.php | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 073ce1ff4e..7f45b2da8c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1181,11 +1181,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = censor_text($topic_title); // Exclude guests, current user and banned users from notifications - if (!function_exists('phpbb_get_banned_users_ids')) + if (!function_exists('phpbb_get_banned_user_ids')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $sql_ignore_users = phpbb_get_banned_users_ids(); + $sql_ignore_users = phpbb_get_banned_user_ids(); $sql_ignore_users[ANONYMOUS] = ANONYMOUS; $sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 4ea8f74153..447920cfd5 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1630,11 +1630,11 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - if (!function_exists('phpbb_get_banned_users_ids')) + if (!function_exists('phpbb_get_banned_user_ids')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); + $banned_users = phpbb_get_banned_user_ids(array_keys($recipients)); $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8c42a5bb42..10fb57ea97 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,24 +3588,24 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. +* Gets user ids of currently banned registered users. * -* @param array $users_ids Array of users' ids to check for banning, +* @param array $user_ids Array of users' ids to check for banning, * leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids($users_ids = array()) +function phpbb_get_banned_user_ids($user_ids = array()) { global $db; - $sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; + $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0'; // Get banned User ID's // Ignore stale bans which were not wiped yet $banned_ids_list = array(); $sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE . " - WHERE $sql_users_ids + WHERE $sql_user_ids AND ban_exclude <> 1 AND (ban_end > " . time() . ' OR ban_end = 0)'; -- cgit v1.2.1 From d1980f6ad616e800ff82299ceafc5c8c763c6570 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 13:32:58 +0000 Subject: [task/travis] Fixing some travis issues PHPBB3-10718 --- .travis.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e870ca9c2..bf97a20850 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ notifications: email: recipients: - dev-team@phpbb.com - on_success: never + on_success: change on_failure: change branches: diff --git a/README.md b/README.md index f7dfc4926e..51e65176c6 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev ## AUTOMATED TESTING We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below. -Develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) -Develop-Olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) +develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) +develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) ## LICENSE -- cgit v1.2.1 From c7f65fba627680e7de81ae6c7ea9c1e0fc4359ea Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:13:25 +0000 Subject: [task/travis] Rename travis phpunit config files PHPBB3-10718 --- .travis.yml | 2 +- travis/mysql.travis.xml | 28 ---------------------------- travis/phpunit-mysql-travis.xml | 28 ++++++++++++++++++++++++++++ travis/phpunit-postgres-travis.xml | 30 ++++++++++++++++++++++++++++++ travis/postgres.travis.xml | 30 ------------------------------ 5 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 travis/mysql.travis.xml create mode 100644 travis/phpunit-mysql-travis.xml create mode 100644 travis/phpunit-postgres-travis.xml delete mode 100644 travis/postgres.travis.xml diff --git a/.travis.yml b/.travis.yml index bf97a20850..d638e1cccd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - phpenv rehash script: - - phpunit --configuration travis/$DB.travis.xml + - phpunit --configuration travis/phpunit-$DB-travis.xml notifications: email: diff --git a/travis/mysql.travis.xml b/travis/mysql.travis.xml deleted file mode 100644 index a849f50136..0000000000 --- a/travis/mysql.travis.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ../tests/ - - - - - - - - - - - - - diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml new file mode 100644 index 0000000000..a849f50136 --- /dev/null +++ b/travis/phpunit-mysql-travis.xml @@ -0,0 +1,28 @@ + + + + + ../tests/ + + + + + + + + + + + + + diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml new file mode 100644 index 0000000000..e44696a335 --- /dev/null +++ b/travis/phpunit-postgres-travis.xml @@ -0,0 +1,30 @@ + + + + + ../tests/ + + + + + + + + + + + + + + + diff --git a/travis/postgres.travis.xml b/travis/postgres.travis.xml deleted file mode 100644 index e44696a335..0000000000 --- a/travis/postgres.travis.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - ../tests/ - - - - - - - - - - - - - - - -- cgit v1.2.1 From 115ee7f3b815567cf598178225022b2d7d7f5310 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:44:36 +0000 Subject: [task/travis] Some more small travis fixes PHPBB3-10718 --- .travis.yml | 6 ------ travis/phpunit-mysql-travis.xml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d638e1cccd..78221d588c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,3 @@ notifications: - dev-team@phpbb.com on_success: change on_failure: change - -branches: - only: - develop - develop-olympus - task/travis diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index a849f50136..807dfbcdaa 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -8,7 +8,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="true" - strict="true" + strict="true" bootstrap="../tests/bootstrap.php"> -- cgit v1.2.1 From 0ed66ad0e8d11c802520046b446aa5622a637df9 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 16:00:10 +0000 Subject: [task/travis] Exclude functional and slow tests PHPBB3-10718 --- travis/phpunit-mysql-travis.xml | 6 ++++++ travis/phpunit-postgres-travis.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index 807dfbcdaa..79215c8de1 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -16,6 +16,12 @@ + + + slow + + + diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index e44696a335..02db76ae78 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -16,6 +16,12 @@ + + + slow + + + -- cgit v1.2.1 From 841d11c6cd90d331c2923ba7851dd5f813203ddf Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 16:09:58 +0000 Subject: [task/travis] Refactor php version check for dbunit install PHPBB3-10718 --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78221d588c..d73bbd2a48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,7 @@ before_script: - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then pyrus install --force phpunit/DbUnit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ]; then pyrus install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi" - phpenv rehash script: -- cgit v1.2.1 From 5bcdfe94dd487441565c00450b3a8efcaeecd840 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 23 Mar 2012 06:40:15 +0000 Subject: [ticket/10723] Stop Travis running all tests on sqlite Correct information so all tests don't run on sqlite PHPBB3-10723 --- travis/phpunit-mysql-travis.xml | 14 +++++++------- travis/phpunit-postgres-travis.xml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index 79215c8de1..36845a7f71 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -23,12 +23,12 @@ - - - - - - - + + + + + + + diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index 02db76ae78..461a53bcb1 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -25,12 +25,12 @@ - - - - - - - + + + + + + + -- cgit v1.2.1 From 2768db44f557cd5db4b54a287ecb1d2fcbe94140 Mon Sep 17 00:00:00 2001 From: HTF Date: Sat, 24 Mar 2012 15:13:04 +0000 Subject: [ticket/10129] Remove apostrophes and plurals in ACP user management -> permissions language file as per ticket. PHPBB3-10129 --- phpBB/language/en/acp/common.php | 8 ++++---- phpBB/language/en/acp/permissions.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 958b9c7598..e64ba3c371 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -96,10 +96,10 @@ $lang = array_merge($lang, array( 'ACP_GLOBAL_MODERATORS' => 'Global moderators', 'ACP_GLOBAL_PERMISSIONS' => 'Global permissions', 'ACP_GROUPS' => 'Groups', - 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Groups’ forum permissions', + 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Group forum permissions', 'ACP_GROUPS_MANAGE' => 'Manage groups', 'ACP_GROUPS_MANAGEMENT' => 'Group management', - 'ACP_GROUPS_PERMISSIONS' => 'Groups’ permissions', + 'ACP_GROUPS_PERMISSIONS' => 'Group permissions', 'ACP_ICONS' => 'Topic icons', 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', @@ -172,9 +172,9 @@ $lang = array_merge($lang, array( 'ACP_THEMES' => 'Themes', 'ACP_UPDATE' => 'Updating', - 'ACP_USERS_FORUM_PERMISSIONS' => 'Users’ forum permissions', + 'ACP_USERS_FORUM_PERMISSIONS' => 'User forum permissions', 'ACP_USERS_LOGS' => 'User logs', - 'ACP_USERS_PERMISSIONS' => 'Users’ permissions', + 'ACP_USERS_PERMISSIONS' => 'User permissions', 'ACP_USER_ATTACH' => 'Attachments', 'ACP_USER_AVATAR' => 'Avatar', 'ACP_USER_FEEDBACK' => 'Feedback', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 016be51282..c0396cc247 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -40,10 +40,10 @@ $lang = array_merge($lang, array(

Permissions are highly granular and grouped into four major sections, which are:

Global Permissions

-

These are used to control access on a global level and apply to the entire bulletin board. They are further divided into Users’ Permissions, Groups’ Permissions, Administrators and Global Moderators.

+

These are used to control access on a global level and apply to the entire bulletin board. They are further divided into User Permissions, Group Permissions, Administrators and Global Moderators.

Forum Based Permissions

-

These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, Users’ Forum Permissions and Groups’ Forum Permissions.

+

These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, User Forum Permissions and Group Forum Permissions.

Permission Roles

These are used to create different sets of permissions for the different permission types later being able to be assigned on a role-based basis. The default roles should cover the administration of bulletin boards large and small, though within each of the four divisions, you can add/edit/delete roles as you see fit.

@@ -83,13 +83,13 @@ $lang = array_merge($lang, array( 'ACP_FORUM_PERMISSIONS_COPY_EXPLAIN' => 'Here you can copy forum permissions from one forum to one or more other forums.', 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.', 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', - 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual users permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', + 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual user permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', - 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User’s permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', + 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups.', 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the global moderative permissions assigned to the selected users/groups.', 'ACP_VIEW_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can view the forum permissions assigned to the selected users/groups and forums.', @@ -225,8 +225,8 @@ $lang = array_merge($lang, array( 'SELECT_TYPE' => 'Select type', 'SET_PERMISSIONS' => 'Set permissions', 'SET_ROLE_PERMISSIONS' => 'Set role permissions', - 'SET_USERS_PERMISSIONS' => 'Set users permissions', - 'SET_USERS_FORUM_PERMISSIONS' => 'Set users forum permissions', + 'SET_USERS_PERMISSIONS' => 'Set user permissions', + 'SET_USERS_FORUM_PERMISSIONS' => 'Set user forum permissions', 'TRACE_DEFAULT' => 'By default every permission is NO (unset). So the permission can be overwritten by other settings.', 'TRACE_FOR' => 'Trace for', -- cgit v1.2.1 From e8830f605f73a0c8fa5c3ea579ee18f295b81600 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:18:02 +0200 Subject: [ticket/10605] Use unset() instead of checking user_id over and over again. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 34f16ea9da..59dea50094 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1134,13 +1134,9 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } + unset($undelivered_user[$user_id]); foreach ($undelivered_user as $_user_id => $ary) { - if ($_user_id == $user_id) - { - continue; - } - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' -- cgit v1.2.1 From 2203bc204e55c33e2e9b212eeb0c7bf2e3060851 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:29:29 +0200 Subject: [ticket/10605] Turn $undelivered_user into a real array of counters. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 59dea50094..352bd4d15d 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1113,7 +1113,15 @@ function phpbb_delete_user_pms($user_id) { // Undelivered messages $undelivered_msg[] = $row['msg_id']; - $undelivered_user[$row['user_id']][] = true; + + if (isset($undelivered_user[$row['user_id']])) + { + ++$undelivered_user[$row['user_id']]; + } + else + { + $undelivered_user[$row['user_id']] = 1; + } } $delete_rows[$row['msg_id']] = true; @@ -1135,11 +1143,11 @@ function phpbb_delete_user_pms($user_id) } unset($undelivered_user[$user_id]); - foreach ($undelivered_user as $_user_id => $ary) + foreach ($undelivered_user as $_user_id => $count) { $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', - user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' + SET user_new_privmsg = user_new_privmsg - ' . $count . ', + user_unread_privmsg = user_unread_privmsg - ' . $count . ' WHERE user_id = ' . $_user_id; $db->sql_query($sql); } -- cgit v1.2.1 From dbc7a69ad2bf6b062a4d7a40d62be29a410b5c18 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:30:52 +0200 Subject: [ticket/10605] Remove unused variable declarations. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 352bd4d15d..4ff0c53420 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1106,7 +1106,6 @@ function phpbb_delete_user_pms($user_id) $result = $db->sql_query($sql); $undelivered_msg = $undelivered_user = $delete_rows = array(); - $num_unread = $num_new = $num_deleted = 0; while ($row = $db->sql_fetchrow($result)) { if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) -- cgit v1.2.1 From 9040f18d7cf9de137acbac6072dc2ffd3cede1b5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:35:01 +0200 Subject: [ticket/10605] Remove unnecessary array_keys calls on $delete_rows. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 4ff0c53420..00029a1986 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1123,7 +1123,7 @@ function phpbb_delete_user_pms($user_id) } } - $delete_rows[$row['msg_id']] = true; + $delete_rows[(int) $row['msg_id']] = (int) $row['msg_id']; } $db->sql_freeresult($result); @@ -1154,13 +1154,13 @@ function phpbb_delete_user_pms($user_id) // Delete private message data $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id - AND " . $db->sql_in_set('msg_id', array_keys($delete_rows)); + AND " . $db->sql_in_set('msg_id', $delete_rows); $db->sql_query($sql); // Now we have to check which messages we can delete completely $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); + WHERE ' . $db->sql_in_set('msg_id', $delete_rows); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) -- cgit v1.2.1 From dd53d0576d8256e37074cc23dd5b9769acc12d1a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:39:49 +0200 Subject: [ticket/10605] Remove unnecessary $delete_ids array. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 00029a1986..23f582641b 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1169,9 +1169,7 @@ function phpbb_delete_user_pms($user_id) } $db->sql_freeresult($result); - $delete_ids = array_keys($delete_rows); - - if (sizeof($delete_ids)) + if (!empty($delete_rows)) { // Check if there are any attachments we need to remove if (!function_exists('delete_attachments')) @@ -1179,10 +1177,10 @@ function phpbb_delete_user_pms($user_id) include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } - delete_attachments('message', $delete_ids, false); + delete_attachments('message', $delete_rows, false); $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_ids); + WHERE ' . $db->sql_in_set('msg_id', $delete_rows); $db->sql_query($sql); } -- cgit v1.2.1 From ad073d22b9e543d5842af7b8ef94fe7e6b443504 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:43:09 +0200 Subject: [ticket/10605] Break long comment into multiple lines 80 chars short. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 23f582641b..e7beae3fab 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1184,7 +1184,8 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } - // Set the remaining author id to anonymous - this way users are still able to read messages from users being removed + // Set the remaining author id to anonymous + // This way users are still able to read messages from users being removed $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET author_id = ' . ANONYMOUS . ' WHERE author_id = ' . $user_id; -- cgit v1.2.1 From 9c8aab4d32a001ae66fe005b7124737fc5ad7dd6 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 02:02:17 +0200 Subject: [ticket/10605] Rename $delete_rows to $delete_ids. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index e7beae3fab..576da4d439 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1105,7 +1105,7 @@ function phpbb_delete_user_pms($user_id) AND folder_id = ' . PRIVMSGS_NO_BOX . ')'; $result = $db->sql_query($sql); - $undelivered_msg = $undelivered_user = $delete_rows = array(); + $undelivered_msg = $undelivered_user = $delete_ids = array(); while ($row = $db->sql_fetchrow($result)) { if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) @@ -1123,11 +1123,11 @@ function phpbb_delete_user_pms($user_id) } } - $delete_rows[(int) $row['msg_id']] = (int) $row['msg_id']; + $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id']; } $db->sql_freeresult($result); - if (!sizeof($delete_rows)) + if (empty($delete_ids)) { return false; } @@ -1154,22 +1154,22 @@ function phpbb_delete_user_pms($user_id) // Delete private message data $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id - AND " . $db->sql_in_set('msg_id', $delete_rows); + AND " . $db->sql_in_set('msg_id', $delete_ids); $db->sql_query($sql); // Now we have to check which messages we can delete completely $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_rows); + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - unset($delete_rows[$row['msg_id']]); + unset($delete_ids[$row['msg_id']]); } $db->sql_freeresult($result); - if (!empty($delete_rows)) + if (!empty($delete_ids)) { // Check if there are any attachments we need to remove if (!function_exists('delete_attachments')) @@ -1177,10 +1177,10 @@ function phpbb_delete_user_pms($user_id) include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } - delete_attachments('message', $delete_rows, false); + delete_attachments('message', $delete_ids, false); $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_rows); + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); $db->sql_query($sql); } -- cgit v1.2.1 From 0397b462174887bda3fea4bcebf9a26f6b591a3e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 27 Mar 2012 17:29:03 +0200 Subject: [ticket/10605] Split query to be able to use indexes PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 576da4d439..dd81e8f92d 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1098,11 +1098,11 @@ function phpbb_delete_user_pms($user_id) } // Get PM Information for later deleting + // The two queries where split, so we can use our indexes + // Part 1: get PMs the user received $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE user_id = ' . $user_id . ' - OR (author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX . ')'; + WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); $undelivered_msg = $undelivered_user = $delete_ids = array(); @@ -1127,6 +1127,34 @@ function phpbb_delete_user_pms($user_id) } $db->sql_freeresult($result); + // Part 2: get PMs the user sent + $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) + { + // Undelivered messages + $undelivered_msg[] = $row['msg_id']; + + if (isset($undelivered_user[$row['user_id']])) + { + ++$undelivered_user[$row['user_id']]; + } + else + { + $undelivered_user[$row['user_id']] = 1; + } + } + + $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + if (empty($delete_ids)) { return false; -- cgit v1.2.1 From b9324577aca6f7f7632b609e975e510e25d8ec86 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 27 Mar 2012 17:32:55 +0200 Subject: =?UTF-8?q?[ticket/10605]=20Reset=20user=C2=B4s=20pm=20count=20to?= =?UTF-8?q?=200=20when=20deleting=20his=20PMs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index dd81e8f92d..14a6d83b2a 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1169,7 +1169,17 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } - unset($undelivered_user[$user_id]); + // Reset the users pm count to 0 + if (isset($undelivered_user[$user_id])) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = 0, + user_unread_privmsg = 0 + WHERE user_id = ' . $user_id; + $db->sql_query($sql); + unset($undelivered_user[$user_id]); + } + foreach ($undelivered_user as $_user_id => $count) { $sql = 'UPDATE ' . USERS_TABLE . ' -- cgit v1.2.1 From 1789e0948bd3a06392d8f919d80889ed5bbf2583 Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 28 Mar 2012 17:05:45 -0400 Subject: [ticket/10732] Add config_dev.php and config_test.php to .gitignore PHPBB3-10732 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index d875beb784..e6e017f85e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php +/phpBB/config_dev.php +/phpBB/config_test.php /phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* -- cgit v1.2.1 From fff9f6611eddffb4c509d6e5126c0b0c9723f345 Mon Sep 17 00:00:00 2001 From: Jan Schejbal Date: Thu, 29 Mar 2012 04:16:34 +0200 Subject: [ticket/10730] Added label tag around "select" text in post splitting UI Added label tags around the "select" text in the post splitting UI in the MCP. Had to add IDs based on the post ID to the select boxes to allow label to work. Tested in Firefox and Chrome. PHPBB3-10730 --- phpBB/styles/prosilver/template/mcp_topic.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 2a5f52f038..5dbc8d670c 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -106,7 +106,7 @@ onload_functions.push('subPanels()');
- +

{postrow.POST_SUBJECT}

{postrow.MINI_POST_IMG} {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} [ {L_POST_DETAILS} ]

-- cgit v1.2.1 From 9391d423c05818e5f18ddbe051e1713c835f4404 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 30 Mar 2012 19:04:20 +0100 Subject: [feature/event-dispatcher] Adding composer.phar to .gitignore for olympus To keep the .gitignore's the same. PHPBB3-9550 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e6e017f85e..de26e1dd1e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /phpBB/cache/*.html /phpBB/cache/*.php /phpBB/cache/queue.php.lock +/phpBB/composer.phar /phpBB/config.php /phpBB/config_dev.php /phpBB/config_test.php -- cgit v1.2.1 From b8b342be2d238616b96ace9acbe8af2e18ba1e7a Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Sat, 31 Mar 2012 12:46:44 -0400 Subject: [Ticket/10675] Correct language string ATTACH_DISK_FULL Add period to ATTACH_DISK_FULL language string PHPBB3-10675 --- phpBB/language/en/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index dd0ba7fc6d..24f3204c57 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -42,7 +42,7 @@ $lang = array_merge($lang, array( 'ADD_POLL' => 'Poll creation', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.', - 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment', + 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment.', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', -- cgit v1.2.1 From b1b530f92cca7eb115e096ea8901133d421771d2 Mon Sep 17 00:00:00 2001 From: Hari Sankar R Date: Sun, 1 Apr 2012 18:25:50 +0530 Subject: [ticket/10731] Fixed addquote() to work on opera browser. In opera, window.getSelection() returned incorrect values, should be using document.getSelection() instead. Fixed in prosilver and subsilver2 templates. PHPBB3-10731 --- phpBB/styles/prosilver/template/editor.js | 4 ++-- phpBB/styles/subsilver2/template/editor.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index cfdb54f54b..c16b0ef703 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -219,7 +219,7 @@ function addquote(post_id, username, l_wrote) // Get text selection - not only the post content :( // IE9 must use the document.selection method but has the *.getSelection so we just force no IE - if (window.getSelection && !is_ie) + if (window.getSelection && !is_ie && !window.opera) { theSelection = window.getSelection().toString(); } @@ -456,4 +456,4 @@ function getCaretPosition(txtarea) } return caretPos; -} \ No newline at end of file +} diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js index 7cc5de9034..151cf53ff1 100644 --- a/phpBB/styles/subsilver2/template/editor.js +++ b/phpBB/styles/subsilver2/template/editor.js @@ -221,7 +221,7 @@ function addquote(post_id, username, l_wrote) // Get text selection - not only the post content :( // IE9 must use the document.selection method but has the *.getSelection so we just force no IE - if (window.getSelection && !is_ie) + if (window.getSelection && !is_ie && !window.opera) { theSelection = window.getSelection().toString(); } @@ -459,4 +459,4 @@ function getCaretPosition(txtarea) } return caretPos; -} \ No newline at end of file +} -- cgit v1.2.1 From 42101fe8d48cbdbe1a4e73bd9cc388a9e4b490c5 Mon Sep 17 00:00:00 2001 From: Hari Sankar R Date: Mon, 2 Apr 2012 16:26:23 +0530 Subject: [ticket/10699] Long h2 title breaks div.minitabs in MCP Fixed overlapping of Subject title over the minitabs. Added css property to cp.css under MCP Specific tweaks. Wrapped h2 and #minitabs under .tabs-container with clear: both PHPBB3-10699 --- phpBB/styles/prosilver/template/mcp_topic.html | 4 ++-- phpBB/styles/prosilver/theme/cp.css | 17 +++++++++++++++++ phpBB/styles/prosilver/theme/tweaks.css | 10 ++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 5dbc8d670c..e8d5ceada4 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -1,5 +1,5 @@ - +

{L_TOPIC}: {TOPIC_TITLE}

- +
{L_NO_TOPIC_ICON}{L_NO_PM_ICON} {L_NO_TOPIC_ICON}{L_NO_PM_ICON}