1.i. Changes since 3.0.3
-1.i. Changes since 3.0.2
+-
+
- [Fix] Allow mixed-case template directories to be inherited (Bug #36725) +
- [Fix] Regression bug from revision #8908 regarding log display in ACP +
- [Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375) +
- [Fix] Fix header list build for replying oldest PM in PM history (Bug #37275) +
- [Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175) +
- [Fix] Do not try to send jabber notifications if no jid entered (Bug #36775) +
- [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735) +
- [Fix] Properly treat punctuation marks after local urls (Bug #37055) +
- [Fix] Make searching for members by YIM address work in prosilver +
- [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345) +
- [Fix] Adjusted phpbb_chmod() to always set permissions for group bit. +
- [Fix] Do not increment users post count after post approval if post had been posted in a forum with no post count increasing set (Bug #37865) +
- [Fix] Extend vertical line for last post column if no posts in forum (Bug #37125) +
- [Fix] correctly update last topic/forum information if changing guest usernames through editing posts (Bug #38095) +
- [Fix] fix postcount resync for situations where low and high post ids are higher than step value, resulting in users having 0 posts. (Bug #38195) +
- [Fix] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005) +
- [Fix] Do not show 'Forward' button if the user cannot send PM's +
- [Change] Alllow applications to set custom module inclusion path (idea by HoL) +
- [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut) +
- [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life) +
- [Change] Performance increase for format_date() (Bug #37575 - Patch by BartVB) +
- [Change] Changed prosilver date separator from 'on' to '»' +
- [Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB) +
- [Change] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB) +
- [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB) +
- [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges. (Reported by Jorick) +
- [Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen) +
1.ii. Changes since 3.0.2
- [Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048) @@ -166,6 +198,7 @@
- [Change] MCP topic view checkboxes now default to unchecked.
- [Change] Adjust language key SPLIT_AFTER to make the action clearer.
- [Change] Add links to the post and forum when viewing a report from the MCP. (Bugs #33795, #33805) +
- [Change] Added CSRF protection to GET-only actions like marking forums.
- [Change] Remove NUL-Bytes directly in request_var() for strings and within the custom DBAL sql_escape() functions (MSSQL, Firebird, Oracle) (reported by AdhostMikeSw)
- [Feature] Allow limited inheritance for template sets. @@ -181,7 +214,7 @@
- [Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)
1.ii. Changes since 3.0.1
+1.iii. Changes since 3.0.1
- [Fix] Ability to set permissions on non-mysql dbms (Bug #24955) @@ -229,7 +262,7 @@
- [Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)
1.iii. Changes since 3.0.0
+1.iv. Changes since 3.0.0
- [Change] Validate birthdays (Bug #15004) @@ -300,7 +333,7 @@
- [Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)
1.iv. Changes since 3.0.RC8
+1.v. Changes since 3.0.RC8
- [Fix] Cleaned usernames contain only single spaces, so "a_name" and "a__name" are treated as the same name (Bug #15634) @@ -309,7 +342,7 @@
- [Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)
1.v. Changes since 3.0.RC7
+1.vi. Changes since 3.0.RC7
- [Fix] Fixed MSSQL related bug in the update system @@ -344,7 +377,7 @@
- [Fix] No duplication of active topics (Bug #15474)
1.vi. Changes since 3.0.RC6
+1.vii. Changes since 3.0.RC6
- [Fix] Submitting language changes using acp_language (Bug #14736) @@ -354,7 +387,7 @@
- [Fix] Able to request new password (Bug #14743)
1.vii. Changes since 3.0.RC5
+1.viii. Changes since 3.0.RC5
- [Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less. @@ -417,7 +450,7 @@
- [Sec] New password hashing mechanism for storing passwords (#i42)
1.viii. Changes since 3.0.RC4
+1.ix. Changes since 3.0.RC4
- [Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862) @@ -468,7 +501,7 @@
- [Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)
1.ix. Changes since 3.0.RC3
+1.x. Changes since 3.0.RC3
- [Fix] Fixing some subsilver2 and prosilver style issues @@ -577,7 +610,7 @@
1.x. Changes since 3.0.RC2
+1.xi. Changes since 3.0.RC2
- [Fix] Re-allow searching within the memberlist @@ -602,7 +635,7 @@
- [Fix] Use our global expression for checking email syntax in memberlist (Bug #12827)
- [Fix] Correctly retrieve/refresh templates stored in database if using subdirectories within template directory (Bug #12839)
- [Fix] Correctly translate special group names in ucp_groups.php (Bug #12597) -
- [Fix] Search boxes not loosing session id (changing method from get to post) (Bug #12643) +
- [Fix] Search boxes not losing session id (changing method from get to post) (Bug #12643)
- [Fix] Make sure the automatic update is also working for those having fsockopen disabled
- [Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed
- [Feature] Allow dropping in custom "info_[module class]_*.php" files to language/*/mods directory for inclusion into the menu structure without the need to modify phpBB language files for menu placements @@ -623,7 +656,7 @@
1.xi. Changes since 3.0.RC1
+1.xii. Changes since 3.0.RC1
- [Fix] (X)HTML issues within the templates (Bug #11255, #11255) diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 81e6f36e1b..6fa296709c 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -273,7 +273,7 @@
' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '
- - % +
- %
- {forumrow.POSTS} {L_POSTS}
-
{L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
- {LAST_POST_IMG}
{L_POSTED_ON_DATE} {forumrow.LAST_POST_TIME}{L_NO_POSTS} + {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html
index abca202c73..05e4e2c8a2 100644
--- a/phpBB/styles/prosilver/template/mcp_forum.html
+++ b/phpBB/styles/prosilver/template/mcp_forum.html
@@ -36,16 +36,16 @@
-
- style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;">
- [ {L_SELECT_MERGE} ]
+ [ {L_SELECT_MERGE} ]
{topicrow.TOPIC_TITLE}
{topicrow.UNAPPROVED_IMG}
{REPORTED_IMG}
[ {L_DELETE_SHADOW_TOPIC} ]
{topicrow.PAGINATION} - {topicrow.ATTACH_ICON_IMG} {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} {L_POSTED_ON_DATE} {topicrow.FIRST_POST_TIME}
+ {topicrow.ATTACH_ICON_IMG} {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} » {topicrow.FIRST_POST_TIME}
- {topicrow.REPLIES} {L_REPLIES} -
- {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} {L_POSTED_ON_DATE}
{topicrow.LAST_POST_TIME} +- {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
{topicrow.LAST_POST_TIME}- @@ -64,9 +64,9 @@ diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index 484179e2ac..e0152391b9 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -29,7 +29,7 @@
- {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
-
{unapproved.SUBJECT} {unapproved.ATTACH_ICON_IMG}
{report.PAGINATION} - {L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} {L_POSTED_ON_DATE} {unapproved.POST_TIME} + {L_POSTED} {L_POST_BY_AUTHOR} {unapproved.AUTHOR_FULL} » {unapproved.POST_TIME} -
{L_TOPIC}: {unapproved.TOPIC_TITLE} [{L_MODERATE}]
@@ -82,7 +82,7 @@-
{report.SUBJECT} {report.ATTACH_ICON_IMG}
- {L_POSTED} {L_POST_BY_AUTHOR} {report.AUTHOR_FULL} {L_POSTED_ON_DATE} {report.POST_TIME} + {L_POSTED} {L_POST_BY_AUTHOR} {report.AUTHOR_FULL} » {report.POST_TIME} -
{L_REPORTED} {L_POST_BY_AUTHOR} {report.REPORTER_FULL} {L_REPORTED_ON_DATE} {report.REPORT_TIME}
@@ -103,7 +103,7 @@- +{L_LATEST_LOGS}
@@ -129,7 +129,7 @@
- diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html index c8b2ffc56d..0e23148175 100644 --- a/phpBB/styles/prosilver/template/mcp_post.html +++ b/phpBB/styles/prosilver/template/mcp_post.html @@ -51,13 +51,13 @@{L_NO_ENTRIES} +{L_NO_ENTRIES} {POST_SUBJECT}
- + - +
-
{report.SUBJECT} {report.ATTACH_ICON_IMG}
- style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;">
- [ {L_SELECT_MERGE} ]
+ [ {L_SELECT_MERGE} ]
{topicrow.TOPIC_TITLE}
{topicrow.UNAPPROVED_IMG}
{REPORTED_IMG}
[ {L_DELETE_SHADOW_TOPIC} ]
This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.
-This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have 3.0.2 you should select the phpBB-3.0.2_to_3.0.3.zip/tar.gz file.
+This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have 3.0.3 you should select the phpBB-3.0.3_to_3.0.4.zip/tar.gz file.
The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.
@@ -285,7 +285,7 @@The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type patch application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the Automatic update package explained below. It is also the preferred update method.
-A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.2 you need the phpBB-3.0.2_to_3.0.3.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME] (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.
+A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.3 you need the phpBB-3.0.3_to_3.0.4.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME] (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.
If you do get failures you should look at using the Changed files only package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 577f893e77..f58f925506 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -93,6 +93,12 @@ class acm @flock($fp, LOCK_UN); fclose($fp); + if (!function_exists('phpbb_chmod')) + { + global $phpbb_root_path; + include($phpbb_root_path . 'includes/functions.' . $phpEx); + } + phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_WRITE); } else @@ -193,10 +199,16 @@ class acm if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = unserialize(" . var_export(serialize($var), true) . ");\n\n?>"); + fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); + if (!function_exists('phpbb_chmod')) + { + global $phpbb_root_path; + include($phpbb_root_path . 'includes/functions.' . $phpEx); + } + phpbb_chmod($this->cache_dir . "data{$var_name}.$phpEx", CHMOD_WRITE); } } @@ -412,10 +424,16 @@ class acm $file = " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n"; - fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");\n\n?>"); + fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();') . "\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); + if (!function_exists('phpbb_chmod')) + { + global $phpbb_root_path; + include($phpbb_root_path . 'includes/functions.' . $phpEx); + } + phpbb_chmod($filename, CHMOD_WRITE); $query_result = $query_id; diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index d100c49381..a558fe6712 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -185,12 +185,36 @@ class acp_main } // Resync post counts - $start = 0; - $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000; + $start = $max_post_id = 0; + // Find the maximum post ID, we can only stop the cycle when we've reached it + $sql = 'SELECT MAX(forum_last_post_id) as max_post_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + $max_post_id = (int) $db->sql_fetchfield('max_post_id'); + $db->sql_freeresult($result); + + // No maximum post id? :o + if (!$max_post_id) + { + $sql = 'SELECT MAX(post_id) + FROM ' . POSTS_TABLE; + $result = $db->sql_query($sql); + $max_post_id = (int) $db->sql_fetchfield('max_post_id'); + $db->sql_freeresult($result); + } + + // Still no maximum post id? Then we are finished + if (!$max_post_id) + { + add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); + break; + } + + $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000; $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0'); - do + while ($start < $max_post_id) { $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id FROM ' . POSTS_TABLE . ' @@ -207,16 +231,11 @@ class acp_main $db->sql_query($sql); } while ($row = $db->sql_fetchrow($result)); - - $start += $step; - } - else - { - $start = 0; } $db->sql_freeresult($result); + + $start += $step; } - while ($start); add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index f3540941df..75bc5766a9 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -658,6 +658,8 @@ class acp_modules $iteration++; } + $db->sql_freeresult($result); + unset($padding_store); return $module_list; diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 309f5d5e74..7ab6ff7cd6 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -77,7 +77,7 @@ class acp_profile FROM ' . PROFILE_LANG_TABLE . ' ORDER BY lang_id'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { // Which languages are available for each item @@ -206,7 +206,7 @@ class acp_profile 'field_id' => $field_id, ))); } - + break; case 'activate': @@ -216,7 +216,7 @@ class acp_profile { trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } - + $sql = 'SELECT lang_id FROM ' . LANG_TABLE . " WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; @@ -253,7 +253,7 @@ class acp_profile { trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING); } - + $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . " SET field_active = 0 WHERE field_id = $field_id"; @@ -285,7 +285,7 @@ class acp_profile case 'create': case 'edit': - + $field_id = request_var('field_id', 0); $step = request_var('step', 1); @@ -354,18 +354,19 @@ class acp_profile { // We are adding a new field, define basic params $lang_options = $field_row = array(); - + $field_type = request_var('field_type', 0); - + if (!$field_type) { trigger_error($user->lang['NO_FIELD_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); } $field_row = array_merge($default_values[$field_type], array( - 'field_ident' => utf8_clean_string(request_var('field_ident', '', true)), + 'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))), 'field_required' => 0, 'field_hide' => 0, + 'field_show_profile'=> 0, 'field_no_view' => 0, 'field_show_on_reg' => 0, 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), @@ -378,7 +379,7 @@ class acp_profile // $exclude contains the data we gather in each step $exclude = array( - 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option', 'field_no_view'), + 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'), 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') ); @@ -400,25 +401,20 @@ class acp_profile $cp->vars['lang_explain'] = utf8_normalize_nfc(request_var('lang_explain', $field_row['lang_explain'], true)); $cp->vars['lang_default_value'] = utf8_normalize_nfc(request_var('lang_default_value', $field_row['lang_default_value'], true)); - // Field option... - if (isset($_REQUEST['field_option'])) - { - $field_option = request_var('field_option', ''); + // Visibility Options... + $visibility_ary = array( + 'field_required', + 'field_show_on_reg', + 'field_show_profile', + 'field_hide', + ); - $cp->vars['field_required'] = ($field_option == 'field_required') ? 1 : 0; - $cp->vars['field_show_on_reg'] = ($field_option == 'field_show_on_reg') ? 1 : 0; - $cp->vars['field_hide'] = ($field_option == 'field_hide') ? 1 : 0; - } - else + foreach ($visibility_ary as $val) { - $cp->vars['field_required'] = $field_row['field_required']; - $cp->vars['field_show_on_reg'] = $field_row['field_show_on_reg']; - $cp->vars['field_hide'] = $field_row['field_hide']; - - $field_option = ($field_row['field_required']) ? 'field_required' : (($field_row['field_show_on_reg']) ? 'field_show_on_reg' : (($field_row['field_hide']) ? 'field_hide' : '')); + $cp->vars[$val] = ($submit || $save) ? request_var($val, 0) : $field_row[$val]; } - $cp->vars['field_no_view'] = request_var('field_no_view', $field_row['field_no_view']); + $cp->vars['field_no_view'] = request_var('field_no_view', (int) $field_row['field_no_view']); // A boolean field expects an array as the lang options if ($field_type == FIELD_BOOL) @@ -481,7 +477,7 @@ class acp_profile else if ($field_type == FIELD_DATE && $key == 'field_default_value') { $always_now = request_var('always_now', -1); - + if ($always_now == 1 || ($always_now === -1 && $var == 'now')) { $now = getdate(); @@ -504,7 +500,7 @@ class acp_profile { list($cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']) = explode('-', $var); } - } + } } /* else if ($field_type == FIELD_BOOL && $key == 'field_default_value') { @@ -533,7 +529,7 @@ class acp_profile } $db->sql_freeresult($result); - + $sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id <> ' . $this->edit_lang_id . " @@ -550,7 +546,7 @@ class acp_profile } $db->sql_freeresult($result); } - + foreach ($exclude[3] as $key) { $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true)); @@ -569,7 +565,7 @@ class acp_profile { $cp->vars[$key][$lang_id] = explode("\n", $options); } - + } } @@ -709,7 +705,7 @@ class acp_profile 'L_TITLE' => $user->lang['STEP_' . $step . '_TITLE_' . strtoupper($action)], 'L_EXPLAIN' => $user->lang['STEP_' . $step . '_EXPLAIN_' . strtoupper($action)], - + 'U_ACTION' => $this->u_action . "&action=$action&step=$step", 'U_BACK' => $this->u_action) ); @@ -719,13 +715,14 @@ class acp_profile { // Create basic options - only small differences between field types case 1: - + // Build common create options $template->assign_vars(array( 'S_STEP_ONE' => true, 'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false, 'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false, 'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false, + 'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false, 'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false, 'L_LANG_SPECIFIC' => sprintf($user->lang['LANG_SPECIFIC_OPTIONS'], $config['default_lang']), @@ -746,7 +743,7 @@ class acp_profile 'LANG_DEFAULT_VALUE' => $cp->vars['lang_default_value']) ); } - + if ($field_type == FIELD_BOOL || $field_type == FIELD_DROPDOWN) { // Initialize these array elements if we are creating a new field @@ -775,11 +772,11 @@ class acp_profile 'SECOND_LANG_OPTION' => ($field_type == FIELD_BOOL) ? $cp->vars['lang_options'][1] : '') ); } - + break; case 2: - + $template->assign_vars(array( 'S_STEP_TWO' => true, 'L_NEXT_STEP' => (sizeof($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS']) @@ -817,7 +814,7 @@ class acp_profile ); } } - + break; } @@ -829,7 +826,7 @@ class acp_profile break; } - + $sql = 'SELECT * FROM ' . PROFILE_FIELDS_TABLE . ' ORDER BY field_order'; @@ -905,14 +902,14 @@ class acp_profile $languages[$row['lang_id']] = $row['lang_iso']; } $db->sql_freeresult($result); - + $options = array(); $options['lang_name'] = 'string'; if ($cp->vars['lang_explain']) { $options['lang_explain'] = 'text'; } - + switch ($field_type) { case FIELD_BOOL: @@ -922,7 +919,7 @@ class acp_profile case FIELD_DROPDOWN: $options['lang_options'] = 'optionfield'; break; - + case FIELD_TEXT: case FIELD_STRING: if ($cp->vars['lang_default_value']) @@ -931,7 +928,7 @@ class acp_profile } break; } - + $lang_options = array(); foreach ($options as $field => $field_type) @@ -957,7 +954,7 @@ class acp_profile if ($field == 'lang_options') { $var = (!isset($cp->vars['l_lang_options'][$lang_id]) || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['l_lang_options'][$lang_id]; - + switch ($field_type) { case 'two_options': @@ -978,7 +975,7 @@ class acp_profile ); break; } - + if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) { $lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN']; @@ -992,7 +989,7 @@ class acp_profile 'TITLE' => $user->lang['CP_' . strtoupper($field)], 'FIELD' => ($field_type == 'string') ? '' : '' ); - + if (isset($user->lang['CP_' . strtoupper($field) . '_EXPLAIN'])) { $lang_options[$lang_id]['fields'][$field]['EXPLAIN'] = $user->lang['CP_' . strtoupper($field) . '_EXPLAIN']; @@ -1040,6 +1037,7 @@ class acp_profile 'field_required' => $cp->vars['field_required'], 'field_show_on_reg' => $cp->vars['field_show_on_reg'], 'field_hide' => $cp->vars['field_hide'], + 'field_show_profile' => $cp->vars['field_show_profile'], 'field_no_view' => $cp->vars['field_no_view'] ); @@ -1065,7 +1063,7 @@ class acp_profile WHERE field_id = $field_id"; $db->sql_query($sql); } - + if ($action == 'create') { $field_ident = 'pf_' . $field_ident; @@ -1082,7 +1080,7 @@ class acp_profile { $sql_ary['field_id'] = $field_id; $sql_ary['lang_id'] = $default_lang_id; - + $profile_sql[] = 'INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); } else @@ -1155,7 +1153,7 @@ class acp_profile AND lang_id = " . (int) $default_lang_id; $db->sql_query($sql); } - + foreach ($cp->vars['lang_options'] as $option_id => $value) { $sql_ary = array( @@ -1258,7 +1256,7 @@ class acp_profile $lang_id = $sql['lang_id']; $option_id = $sql['option_id']; unset($sql['lang_id'], $sql['field_id'], $sql['option_id']); - + $this->update_insert(PROFILE_FIELDS_LANG_TABLE, $sql, array( 'lang_id' => $lang_id, 'field_id' => $field_id, @@ -1278,7 +1276,7 @@ class acp_profile $db->sql_query($sql); } } - + $db->sql_transaction('commit'); if ($action == 'edit') @@ -1324,7 +1322,7 @@ class acp_profile if (!$row) { $sql_ary = array_merge($where_fields, $sql_ary); - + if (sizeof($sql_ary)) { $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql_ary)); @@ -1376,7 +1374,7 @@ class acp_profile case FIELD_BOOL: $sql .= 'TINYINT(2) '; break; - + case FIELD_DROPDOWN: $sql .= 'MEDIUMINT(8) '; break; @@ -1612,4 +1610,4 @@ class acp_profile } } -?> \ No newline at end of file +?> diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index e0fb1459c2..3a021bb4cf 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -2176,10 +2176,16 @@ parse_css_file = {PARSE_CSS_FILE} $style_default = request_var('style_default', 0); $store_db = request_var('store_db', 0); - $sql = "SELECT {$mode}_id + // If the admin selected the style to be the default style, but forgot to activate it... we will do it for him + if ($style_default) + { + $style_active = 1; + } + + $sql = "SELECT {$mode}_id, {$mode}_name FROM $sql_from WHERE {$mode}_id <> $style_id - AND {$mode}_name = '" . $db->sql_escape(strtolower($name)) . "'"; + AND LOWER({$mode}_name) = '" . $db->sql_escape(strtolower($name)) . "'"; $result = $db->sql_query($sql); $conflict = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -3206,7 +3212,7 @@ parse_css_file = {PARSE_CSS_FILE} { $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path, {$mode}_storedb FROM $sql_from - WHERE {$mode}_name = '" . $db->sql_escape(strtolower($cfg_data['inherit_from'])) . "' + WHERE {$mode}_name = '" . $db->sql_escape($cfg_data['inherit_from']) . "' AND {$mode}_inherits_id = 0"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 3a468e4952..61c1c963b8 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.3'); +define('PHPBB_VERSION', '3.0.4-RC1'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 179eff65d2..b530a572da 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -500,19 +500,62 @@ class dbal $sql = str_replace('_', ' ', $query) . ' ' . $array['SELECT'] . ' FROM '; - $table_array = array(); + // Build table array. We also build an alias array for later checks. + $table_array = $aliases = array(); + $used_multi_alias = false; + foreach ($array['FROM'] as $table_name => $alias) { if (is_array($alias)) { + $used_multi_alias = true; + foreach ($alias as $multi_alias) { $table_array[] = $table_name . ' ' . $multi_alias; + $aliases[] = $multi_alias; } } else { $table_array[] = $table_name . ' ' . $alias; + $aliases[] = $alias; + } + } + + // We run the following code to determine if we need to re-order the table array. ;) + // The reason for this is that for multi-aliased tables (two equal tables) in the FROM statement the last table need to match the first comparison. + // DBMS who rely on this: Oracle, PostgreSQL and MSSQL. For all other DBMS it makes absolutely no difference in which order the table is. + if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1 && $used_multi_alias !== false) + { + // Take first LEFT JOIN + $join = current($array['LEFT_JOIN']); + + // Determine the table used there (even if there are more than one used, we only want to have one + preg_match('/(' . implode('|', $aliases) . ')\.[^\s]+/U', str_replace(array('(', ')', 'AND', 'OR', ' '), '', $join['ON']), $matches); + + // If there is a first join match, we need to make sure the table order is correct + if (!empty($matches[1])) + { + $first_join_match = trim($matches[1]); + $table_array = $last = array(); + + foreach ($array['FROM'] as $table_name => $alias) + { + if (is_array($alias)) + { + foreach ($alias as $multi_alias) + { + ($multi_alias === $first_join_match) ? $last[] = $table_name . ' ' . $multi_alias : $table_array[] = $table_name . ' ' . $multi_alias; + } + } + else + { + ($alias === $first_join_match) ? $last[] = $table_name . ' ' . $alias : $table_array[] = $table_name . ' ' . $alias; + } + } + + $table_array = array_merge($table_array, $last); } } diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 8fdb29ce5b..a140c4b676 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -189,7 +189,7 @@ class dbal_oracle extends dbal $out .= ' ' . $val[1] . '('; $in_array = array(); - // constuct each IN() clause + // constuct each IN() clause foreach ($in_clause as $in_values) { $in_array[] = $val[2] . ' ' . (isset($val[6]) ? $val[6] : '') . 'IN(' . implode(', ', $in_values) . ')'; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b96024e4e3..55c4cc5b51 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -462,7 +462,7 @@ function _hash_crypt_private($password, $setting, &$itoa64) /** * Global function for chmodding directories and files for internal use * This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions. -* The function determines owner and group from common.php file and sets the same to the provided file. +* The function determines owner and group from common.php file and sets the same to the provided file. Permissions are mapped to the group, user always has rw(x) permission. * The function uses bit fields to build the permissions. * The function sets the appropiate execute bit on directories. * @@ -511,6 +511,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) // Will most likely not work if (@chown($filename, $common_php_owner)); { + clearstatcache(); $file_uid = fileowner($filename); } } @@ -520,6 +521,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) { if (@chgrp($filename, $common_php_group)); { + clearstatcache(); $file_gid = filegroup($filename); } } @@ -532,7 +534,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) // Who is PHP? if ($file_uid === false || $file_gid === false || $php_uid === false || $php_gids === false) { - $php = null; + $php = NULL; } else if ($file_uid == $php_uid /* && $common_php_owner !== false && $common_php_owner === $file_uid*/) { @@ -564,16 +566,23 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) { case null: case 'owner': + /* ATTENTION: if php is owner or NULL we set it to group here. This is the most failsafe combination for the vast majority of server setups. + $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0)); + clearstatcache(); + if (!is_null($php) || (is_readable($filename) && is_writable($filename))) { break; } + */ case 'group': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0)); + clearstatcache(); + if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { break; @@ -582,6 +591,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'other': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0)); + clearstatcache(); + if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { break; @@ -1820,6 +1831,33 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) } } + $params_is_array = is_array($params); + + // Get anchor + $anchor = ''; + if (strpos($url, '#') !== false) + { + list($url, $anchor) = explode('#', $url, 2); + $anchor = '#' . $anchor; + } + else if (!$params_is_array && strpos($params, '#') !== false) + { + list($params, $anchor) = explode('#', $params, 2); + $anchor = '#' . $anchor; + } + + // Handle really simple cases quickly + if ($_SID == '' && $session_id === false && empty($_EXTRA_URL) && !$params_is_array && !$anchor) + { + if ($params === false) + { + return $url; + } + + $url_delim = (strpos($url, '?') === false) ? '?' : (($is_amp) ? '&' : '&'); + return $url . ($params !== false ? $url_delim. $params : ''); + } + // Assign sid if session id is not specified if ($session_id === false) { @@ -1832,18 +1870,6 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) // Appending custom url parameter? $append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : ''; - $anchor = ''; - if (strpos($url, '#') !== false) - { - list($url, $anchor) = explode('#', $url, 2); - $anchor = '#' . $anchor; - } - else if (!is_array($params) && strpos($params, '#') !== false) - { - list($params, $anchor) = explode('#', $params, 2); - $anchor = '#' . $anchor; - } - // Use the short variant if possible ;) if ($params === false) { @@ -2190,12 +2216,17 @@ function build_url($strip_vars = false) /** * Meta refresh assignment +* Adds META template variable with meta http tag. +* +* @param int $time Time in seconds for meta refresh tag +* @param string $url URL to redirect to. The url will go through redirect() first before the template variable is assigned +* @param bool $disable_cd_check If true, meta_refresh() will redirect to an external domain. If false, the redirect point to the boards url if it does not match the current domain. Default is false. */ -function meta_refresh($time, $url) +function meta_refresh($time, $url, $disable_cd_check = false) { global $template; - $url = redirect($url, true); + $url = redirect($url, true, $disable_cd_check); $url = str_replace('&', '&', $url); // For XHTML compatibility we change back & to & diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 0349cbc6a8..5ec51e44cf 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2400,7 +2400,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id { // Check if there are more occurrences of % than arguments, if there are we fill out the arguments array // It doesn't matter if we add more arguments than placeholders - if (substr_count($log[$i]['action'], '%') - sizeof($log_data_ary)) + if ((substr_count($log[$i]['action'], '%') - sizeof($log_data_ary)) > 0) { $log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($log[$i]['action'], '%') - sizeof($log_data_ary), '')); } diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 627e6a71cd..1228f8e567 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -501,7 +501,8 @@ function generate_text_for_edit($text, $uid, $flags) */ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class) { - $orig_url = $url . $relative_url; + $orig_url = $url; + $orig_relative = $relative_url; $append = ''; $url = htmlspecialchars_decode($url); $relative_url = htmlspecialchars_decode($relative_url); @@ -566,6 +567,12 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class $url = substr($url, 0, -1); } break; + + // set last_char to empty here, so the variable can be used later to + // check whether a character was removed + default: + $last_char = ''; + break; } $short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; @@ -583,7 +590,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class // don't touch it and let MAGIC_URL_FULL take care of it. if (!$relative_url) { - return $whitespace . $orig_url . '/'; // slash is taken away by relative url pattern + return $whitespace . $orig_url . '/' . $orig_relative; // slash is taken away by relative url pattern } break; @@ -1137,6 +1144,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al /** * Get username details for placing into templates. +* This function caches all modes on first call, except for no_profile - determined by $user_id/$guest_username combination. * * @param string $mode Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour), full (for obtaining a html string representing a coloured link to the users profile) or no_profile (the same as full but forcing no profile link) * @param int $user_id The users id @@ -1146,12 +1154,30 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al * @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &u={user_id} * * @return string A string consisting of what is wanted based on $mode. +* @author BartVB, Acyd Burn */ function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false) { + static $_profile_cache; + static $_base_profile_url; + + $cache_key = $user_id . (string) $guest_username; + + // If the get_username_string() function had been executed once with an (to us) unkown mode, all modes are pre-filled and we can just grab it. + if (isset($_profile_cache[$cache_key][$mode])) + { + // If the mode is 'no_profile', we simply construct the TPL code due to calls to this mode being very very rare + if ($mode == 'no_profile') + { + $tpl = (!$_profile_cache[$cache_key]['colour']) ? '{USERNAME}' : '{USERNAME}'; + return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($_profile_cache[$cache_key]['colour'], $_profile_cache[$cache_key]['username']), $tpl); + } + + return $_profile_cache[$cache_key][$mode]; + } + global $phpbb_root_path, $phpEx, $user, $auth; - $profile_url = ''; $username_colour = ($username_colour) ? '#' . $username_colour : ''; if ($guest_username === false) @@ -1163,64 +1189,42 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']); } - // Only show the link if not anonymous - if ($mode != 'no_profile' && $user_id && $user_id != ANONYMOUS) + // Build cache for all modes + $_profile_cache[$cache_key]['colour'] = $username_colour; + $_profile_cache[$cache_key]['username'] = $username; + $_profile_cache[$cache_key]['no_profile'] = true; + + // Profile url - only show if not anonymous and permission to view profile if registered user + // For anonymous the link leads to a login page. + if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile'))) { - // Do not show the link if the user is already logged in but do not have u_viewprofile permissions (relevant for bots mostly). - // For all others the link leads to a login page or the profile. - if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) + if (empty($_base_profile_url)) { - $profile_url = ''; - } - else - { - $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id); + $_base_profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}'); } + + $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : str_replace('={USER_ID}', '=' . (int) $user_id, $_base_profile_url); + $tpl = (!$username_colour) ? '{USERNAME}' : '{USERNAME}'; + $_profile_cache[$cache_key]['full'] = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl); } else { + $tpl = (!$username_colour) ? '{USERNAME}' : '{USERNAME}'; + $_profile_cache[$cache_key]['full'] = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), $tpl); $profile_url = ''; } - switch ($mode) + // Use the profile url from above + $_profile_cache[$cache_key]['profile'] = $profile_url; + + // If - by any chance - no_profile is called before any other mode, we need to do the calculation here + if ($mode == 'no_profile') { - case 'profile': - return $profile_url; - break; - - case 'username': - return $username; - break; - - case 'colour': - return $username_colour; - break; - - case 'no_profile': - case 'full': - default: - - $tpl = ''; - if (!$profile_url && !$username_colour) - { - $tpl = '{USERNAME}'; - } - else if (!$profile_url && $username_colour) - { - $tpl = '{USERNAME}'; - } - else if ($profile_url && !$username_colour) - { - $tpl = '{USERNAME}'; - } - else if ($profile_url && $username_colour) - { - $tpl = '{USERNAME}'; - } - - return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl); - break; + $tpl = (!$_profile_cache[$cache_key]['colour']) ? '{USERNAME}' : '{USERNAME}'; + return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($_profile_cache[$cache_key]['colour'], $_profile_cache[$cache_key]['username']), $tpl); } + + return $_profile_cache[$cache_key][$mode]; } /** diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 44bd0214fa..14ab079202 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1150,6 +1150,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, * @param string &$rank_img the rank image as full img tag is stored here after execution * @param string &$rank_img_src the rank image source is stored here after execution * +* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false */ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src) { @@ -1167,7 +1168,7 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '
' . sprintf($l_edit_time_total, (!$message_row['message_edit_user']) ? $message_row['username'] : $message_row['message_edit_user'], $user->format_date($message_row['message_edit_time']), $message_row['message_edit_count']); + $l_edited_by = '
' . sprintf($l_edit_time_total, (!$message_row['message_edit_user']) ? $message_row['username'] : $message_row['message_edit_user'], $user->format_date($message_row['message_edit_time'], false, true), $message_row['message_edit_count']); } else { @@ -221,7 +221,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), '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_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') + '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'] : '') ); // Display not already displayed Attachments for this post, we already parsed them. ;) diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index f413e2555a..98bb2ecebe 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -32,7 +32,7 @@ unset($dbpasswd); $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', 'version' => '1.0.2', - 'phpbb_version' => '3.0.3', + 'phpbb_version' => '3.0.4', 'author' => 'phpBB Group', 'dbms' => $dbms, 'dbhost' => $dbhost, @@ -229,6 +229,9 @@ if (!$get_info) @define('DEFAULT_AVATAR_X_CUSTOM', get_config_value('avatar_max_width')); @define('DEFAULT_AVATAR_Y_CUSTOM', get_config_value('avatar_max_height')); + // additional table used only during conversion + @define('USERCONV_TABLE', $table_prefix . 'userconv'); + /** * Description on how to use the convertor framework. * @@ -316,7 +319,7 @@ if (!$get_info) // username_clean in phpBB3 which is not possible, so we'll give the admin a list // of user ids and usernames and let him deicde what he wants to do with them 'execute_first' => ' - phpbb_check_username_collisions(); + phpbb_create_userconv_table(); import_avatar_gallery(); if (defined("MOD_ATTACHMENT")) phpbb_import_attach_config(); phpbb_insert_forums(); @@ -339,6 +342,14 @@ if (!$get_info) '), 'schema' => array( + array( + 'target' => USERCONV_TABLE, + 'query_first' => array('target', $convert->truncate_statement . USERCONV_TABLE), + + + array('user_id', 'users.user_id', ''), + array('username_clean', 'users.username', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_clean_string')), + ), array( 'target' => (defined('MOD_ATTACHMENT')) ? ATTACHMENTS_TABLE : '', @@ -419,6 +430,7 @@ if (!$get_info) array( 'target' => BANLIST_TABLE, + 'execute_first' => 'phpbb_check_username_collisions();', 'query_first' => array('target', $convert->truncate_statement . BANLIST_TABLE), array('ban_ip', 'banlist.ban_ip', 'decode_ban_ip'), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 0acf666312..6452296782 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -1698,7 +1698,7 @@ function phpbb_disallowed_username($username) * Checks whether there are any usernames on the old board that would map to the same * username_clean on phpBB3. Prints out a list if any exist and exits. */ -function phpbb_check_username_collisions() +function phpbb_create_userconv_table() { global $db, $src_db, $convert, $table_prefix, $user, $lang; @@ -1735,53 +1735,53 @@ function phpbb_check_username_collisions() } // create a temporary table in which we store the clean usernames - $drop_sql = 'DROP TABLE ' . $table_prefix . 'userconv'; + $drop_sql = 'DROP TABLE ' . USERCONV_TABLE; switch ($map_dbms) { case 'firebird': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( user_id INTEGER NOT NULL, username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT \'\' NOT NULL COLLATE UNICODE )'; break; case 'mssql': - $create_sql = 'CREATE TABLE [' . $table_prefix . 'userconv] ( + $create_sql = 'CREATE TABLE [' . USERCONV_TABLE . '] ( [user_id] [int] NOT NULL , [username_clean] [varchar] (255) DEFAULT (\'\') NOT NULL )'; break; case 'mysql_40': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( user_id mediumint(8) NOT NULL, username_clean blob NOT NULL )'; break; case 'mysql_41': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( user_id mediumint(8) NOT NULL, username_clean varchar(255) DEFAULT \'\' NOT NULL ) CHARACTER SET `utf8` COLLATE `utf8_bin`'; break; case 'oracle': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( user_id number(8) NOT NULL, username_clean varchar2(255) DEFAULT \'\' )'; break; case 'postgres': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( user_id INT4 DEFAULT \'0\', username_clean varchar_ci DEFAULT \'\' NOT NULL )'; break; case 'sqlite': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( + $create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( user_id INTEGER NOT NULL DEFAULT \'0\', username_clean varchar(255) NOT NULL DEFAULT \'\' )'; @@ -1792,37 +1792,15 @@ function phpbb_check_username_collisions() $db->sql_query($drop_sql); $db->sql_return_on_error(false); $db->sql_query($create_sql); +} - // now select all user_ids and usernames and then convert the username (this can take quite a while!) - $sql = 'SELECT user_id, username - FROM ' . $convert->src_table_prefix . 'users'; - $result = $src_db->sql_query($sql); - - $insert_ary = array(); - $i = 0; - while ($row = $src_db->sql_fetchrow($result)) - { - $clean_name = utf8_clean_string(phpbb_set_default_encoding($row['username'])); - $insert_ary[] = array('user_id' => (int) $row['user_id'], 'username_clean' => (string) $clean_name); - - if ($i % 1000 == 999) - { - $db->sql_multi_insert($table_prefix . 'userconv', $insert_ary); - $insert_ary = array(); - } - $i++; - } - $src_db->sql_freeresult($result); - - if (sizeof($insert_ary)) - { - $db->sql_multi_insert($table_prefix . 'userconv', $insert_ary); - } - unset($insert_ary); +function phpbb_check_username_collisions() +{ + global $db, $src_db, $convert, $table_prefix, $user, $lang; // now find the clean version of the usernames that collide $sql = 'SELECT username_clean - FROM ' . $table_prefix . 'userconv + FROM ' . USERCONV_TABLE .' GROUP BY username_clean HAVING COUNT(user_id) > 1'; $result = $db->sql_query($sql); @@ -1838,7 +1816,7 @@ function phpbb_check_username_collisions() if (sizeof($colliding_names)) { $sql = 'SELECT user_id, username_clean - FROM ' . $table_prefix . 'userconv + FROM ' . USERCONV_TABLE . ' WHERE ' . $db->sql_in_set('username_clean', $colliding_names); $result = $db->sql_query($sql); unset($colliding_names); @@ -1881,6 +1859,7 @@ function phpbb_check_username_collisions() $convert->p_master->error('' . $user->lang['COLLIDING_USERNAMES_FOUND'] . '
' . $list . '', __LINE__, __FILE__); } + $drop_sql = 'DROP TABLE ' . USERCONV_TABLE; $db->sql_query($drop_sql); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 48fd4e3ad2..a0627a917f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.3'; +$updates_to_version = '3.0.4-RC1'; // Return if we "just include it" to find out for which version the database update is responsible for if (defined('IN_PHPBB') && defined('IN_INSTALL')) @@ -548,6 +548,45 @@ $database_update_info = array( // No changes from 3.0.3-RC1 to 3.0.3 '3.0.3-RC1' => array(), + + // Changes from 3.0.3 to 3.0.4-RC1 + '3.0.3' => array( + 'add_columns' => array( + PROFILE_FIELDS_TABLE => array( + 'field_show_profile' => array('BOOL', 0), + ), + ), + 'change_columns' => array( + STYLES_TABLE => array( + 'style_id' => array('UINT', NULL, 'auto_increment'), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + 'imageset_id' => array('UINT', 0), + ), + STYLES_IMAGESET_TABLE => array( + 'imageset_id' => array('UINT', NULL, 'auto_increment'), + ), + STYLES_IMAGESET_DATA_TABLE => array( + 'image_id' => array('UINT', NULL, 'auto_increment'), + 'imageset_id' => array('UINT', 0), + ), + STYLES_THEME_TABLE => array( + 'theme_id' => array('UINT', NULL, 'auto_increment'), + ), + STYLES_TEMPLATE_TABLE => array( + 'template_id' => array('UINT', NULL, 'auto_increment'), + ), + STYLES_TEMPLATE_DATA_TABLE => array( + 'template_id' => array('UINT', 0), + ), + FORUMS_TABLE => array( + 'forum_style' => array('USINT', 0), + ), + USERS_TABLE => array( + 'user_style' => array('UINT', 0), + ), + ), + ), ); // Determine mapping database type @@ -1948,6 +1987,47 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; + + // Changes from 3.0.3 to 3.0.4-RC1 + case '3.0.3': + // Update the Custom Profile Fields based on previous settings to the new format + $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide + FROM ' . PROFILE_FIELDS_TABLE; + $result = _sql($sql, $errored, $error_ary); + + while ($row = $db->sql_fetchrow($result)) + { + $sql_ary = array( + 'field_required' => 0, + 'field_show_on_reg' => 0, + 'field_hide' => 0, + 'field_show_profile'=> 0, + ); + + if ($row['field_required']) + { + $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; + } + else if ($row['field_show_on_reg']) + { + $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1; + } + else if ($row['field_hide']) + { + // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module + $sql_ary['field_hide'] = 1; + } + else + { + // equivelant to "none", which is the "Display in user control panel" option + $sql_ary['field_show_profile'] = 1; + } + + _sql('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary); + } + + $no_updates = false; + break; } } @@ -3082,4 +3162,4 @@ function utf8_new_clean_string($text) return trim($text); } -?> \ No newline at end of file +?> diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index e3e2e43723..8ac371b9ed 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -786,6 +786,7 @@ CREATE TABLE phpbb_profile_fields ( field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_required INTEGER DEFAULT 0 NOT NULL, field_show_on_reg INTEGER DEFAULT 0 NOT NULL, + field_show_profile INTEGER DEFAULT 0 NOT NULL, field_hide INTEGER DEFAULT 0 NOT NULL, field_no_view INTEGER DEFAULT 0 NOT NULL, field_active INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 3a3d3fcbd4..445a0eda08 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -942,6 +942,7 @@ CREATE TABLE [phpbb_profile_fields] ( [field_validation] [varchar] (20) DEFAULT ('') NOT NULL , [field_required] [int] DEFAULT (0) NOT NULL , [field_show_on_reg] [int] DEFAULT (0) NOT NULL , + [field_show_profile] [int] DEFAULT (0) NOT NULL , [field_hide] [int] DEFAULT (0) NOT NULL , [field_no_view] [int] DEFAULT (0) NOT NULL , [field_active] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 01d8efa921..a18b99eecd 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -228,7 +228,7 @@ CREATE TABLE phpbb_forums ( forum_desc_uid varbinary(8) DEFAULT '' NOT NULL, forum_link blob NOT NULL, forum_password varbinary(120) DEFAULT '' NOT NULL, - forum_style smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_image varbinary(255) DEFAULT '' NOT NULL, forum_rules blob NOT NULL, forum_rules_link blob NOT NULL, @@ -550,6 +550,7 @@ CREATE TABLE phpbb_profile_fields ( field_validation varbinary(60) DEFAULT '' NOT NULL, field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -717,13 +718,13 @@ CREATE TABLE phpbb_smilies ( # Table: 'phpbb_styles' CREATE TABLE phpbb_styles ( - style_id smallint(4) UNSIGNED NOT NULL auto_increment, + style_id mediumint(8) UNSIGNED NOT NULL auto_increment, style_name blob NOT NULL, style_copyright blob NOT NULL, style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - template_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - theme_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - imageset_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + theme_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (style_id), UNIQUE style_name (style_name(255)), KEY template_id (template_id), @@ -734,7 +735,7 @@ CREATE TABLE phpbb_styles ( # Table: 'phpbb_styles_template' CREATE TABLE phpbb_styles_template ( - template_id smallint(4) UNSIGNED NOT NULL auto_increment, + template_id mediumint(8) UNSIGNED NOT NULL auto_increment, template_name blob NOT NULL, template_copyright blob NOT NULL, template_path varbinary(100) DEFAULT '' NOT NULL, @@ -749,7 +750,7 @@ CREATE TABLE phpbb_styles_template ( # Table: 'phpbb_styles_template_data' CREATE TABLE phpbb_styles_template_data ( - template_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, template_filename varbinary(100) DEFAULT '' NOT NULL, template_included blob NOT NULL, template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL, @@ -761,7 +762,7 @@ CREATE TABLE phpbb_styles_template_data ( # Table: 'phpbb_styles_theme' CREATE TABLE phpbb_styles_theme ( - theme_id smallint(4) UNSIGNED NOT NULL auto_increment, + theme_id mediumint(8) UNSIGNED NOT NULL auto_increment, theme_name blob NOT NULL, theme_copyright blob NOT NULL, theme_path varbinary(100) DEFAULT '' NOT NULL, @@ -775,7 +776,7 @@ CREATE TABLE phpbb_styles_theme ( # Table: 'phpbb_styles_imageset' CREATE TABLE phpbb_styles_imageset ( - imageset_id smallint(4) UNSIGNED NOT NULL auto_increment, + imageset_id mediumint(8) UNSIGNED NOT NULL auto_increment, imageset_name blob NOT NULL, imageset_copyright blob NOT NULL, imageset_path varbinary(100) DEFAULT '' NOT NULL, @@ -786,13 +787,13 @@ CREATE TABLE phpbb_styles_imageset ( # Table: 'phpbb_styles_imageset_data' CREATE TABLE phpbb_styles_imageset_data ( - image_id smallint(4) UNSIGNED NOT NULL auto_increment, + image_id mediumint(8) UNSIGNED NOT NULL auto_increment, image_name varbinary(200) DEFAULT '' NOT NULL, image_filename varbinary(200) DEFAULT '' NOT NULL, image_lang varbinary(30) DEFAULT '' NOT NULL, image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - imageset_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (image_id), KEY i_d (imageset_id) ); @@ -920,7 +921,7 @@ CREATE TABLE phpbb_users ( user_timezone decimal(5,2) DEFAULT '0' NOT NULL, user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, user_dateformat varbinary(90) DEFAULT 'd M Y H:i' NOT NULL, - user_style smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_colour varbinary(6) DEFAULT '' NOT NULL, user_new_privmsg int(4) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 0119e4ce9d..8b001f4d1b 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -228,7 +228,7 @@ CREATE TABLE phpbb_forums ( forum_desc_uid varchar(8) DEFAULT '' NOT NULL, forum_link varchar(255) DEFAULT '' NOT NULL, forum_password varchar(40) DEFAULT '' NOT NULL, - forum_style smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + forum_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_image varchar(255) DEFAULT '' NOT NULL, forum_rules text NOT NULL, forum_rules_link varchar(255) DEFAULT '' NOT NULL, @@ -550,6 +550,7 @@ CREATE TABLE phpbb_profile_fields ( field_validation varchar(20) DEFAULT '' NOT NULL, field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_active tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -717,13 +718,13 @@ CREATE TABLE phpbb_smilies ( # Table: 'phpbb_styles' CREATE TABLE phpbb_styles ( - style_id smallint(4) UNSIGNED NOT NULL auto_increment, + style_id mediumint(8) UNSIGNED NOT NULL auto_increment, style_name varchar(255) DEFAULT '' NOT NULL, style_copyright varchar(255) DEFAULT '' NOT NULL, style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - template_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - theme_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - imageset_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + theme_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (style_id), UNIQUE style_name (style_name), KEY template_id (template_id), @@ -734,7 +735,7 @@ CREATE TABLE phpbb_styles ( # Table: 'phpbb_styles_template' CREATE TABLE phpbb_styles_template ( - template_id smallint(4) UNSIGNED NOT NULL auto_increment, + template_id mediumint(8) UNSIGNED NOT NULL auto_increment, template_name varchar(255) DEFAULT '' NOT NULL, template_copyright varchar(255) DEFAULT '' NOT NULL, template_path varchar(100) DEFAULT '' NOT NULL, @@ -749,7 +750,7 @@ CREATE TABLE phpbb_styles_template ( # Table: 'phpbb_styles_template_data' CREATE TABLE phpbb_styles_template_data ( - template_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, template_filename varchar(100) DEFAULT '' NOT NULL, template_included text NOT NULL, template_mtime int(11) UNSIGNED DEFAULT '0' NOT NULL, @@ -761,7 +762,7 @@ CREATE TABLE phpbb_styles_template_data ( # Table: 'phpbb_styles_theme' CREATE TABLE phpbb_styles_theme ( - theme_id smallint(4) UNSIGNED NOT NULL auto_increment, + theme_id mediumint(8) UNSIGNED NOT NULL auto_increment, theme_name varchar(255) DEFAULT '' NOT NULL, theme_copyright varchar(255) DEFAULT '' NOT NULL, theme_path varchar(100) DEFAULT '' NOT NULL, @@ -775,7 +776,7 @@ CREATE TABLE phpbb_styles_theme ( # Table: 'phpbb_styles_imageset' CREATE TABLE phpbb_styles_imageset ( - imageset_id smallint(4) UNSIGNED NOT NULL auto_increment, + imageset_id mediumint(8) UNSIGNED NOT NULL auto_increment, imageset_name varchar(255) DEFAULT '' NOT NULL, imageset_copyright varchar(255) DEFAULT '' NOT NULL, imageset_path varchar(100) DEFAULT '' NOT NULL, @@ -786,13 +787,13 @@ CREATE TABLE phpbb_styles_imageset ( # Table: 'phpbb_styles_imageset_data' CREATE TABLE phpbb_styles_imageset_data ( - image_id smallint(4) UNSIGNED NOT NULL auto_increment, + image_id mediumint(8) UNSIGNED NOT NULL auto_increment, image_name varchar(200) DEFAULT '' NOT NULL, image_filename varchar(200) DEFAULT '' NOT NULL, image_lang varchar(30) DEFAULT '' NOT NULL, image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - imageset_id smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + imageset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (image_id), KEY i_d (imageset_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; @@ -920,7 +921,7 @@ CREATE TABLE phpbb_users ( user_timezone decimal(5,2) DEFAULT '0' NOT NULL, user_dst tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, - user_style smallint(4) UNSIGNED DEFAULT '0' NOT NULL, + user_style mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_rank mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_colour varchar(6) DEFAULT '' NOT NULL, user_new_privmsg int(4) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index c9b138b8d8..401106ac83 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -485,7 +485,7 @@ CREATE TABLE phpbb_forums ( forum_desc_uid varchar2(8) DEFAULT '' , forum_link varchar2(765) DEFAULT '' , forum_password varchar2(120) DEFAULT '' , - forum_style number(4) DEFAULT '0' NOT NULL, + forum_style number(8) DEFAULT '0' NOT NULL, forum_image varchar2(255) DEFAULT '' , forum_rules clob DEFAULT '' , forum_rules_link varchar2(765) DEFAULT '' , @@ -1056,6 +1056,7 @@ CREATE TABLE phpbb_profile_fields ( field_validation varchar2(60) DEFAULT '' , field_required number(1) DEFAULT '0' NOT NULL, field_show_on_reg number(1) DEFAULT '0' NOT NULL, + field_show_profile number(1) DEFAULT '0' NOT NULL, field_hide number(1) DEFAULT '0' NOT NULL, field_no_view number(1) DEFAULT '0' NOT NULL, field_active number(1) DEFAULT '0' NOT NULL, @@ -1387,13 +1388,13 @@ END; Table: 'phpbb_styles' */ CREATE TABLE phpbb_styles ( - style_id number(4) NOT NULL, + style_id number(8) NOT NULL, style_name varchar2(765) DEFAULT '' , style_copyright varchar2(765) DEFAULT '' , style_active number(1) DEFAULT '1' NOT NULL, - template_id number(4) DEFAULT '0' NOT NULL, - theme_id number(4) DEFAULT '0' NOT NULL, - imageset_id number(4) DEFAULT '0' NOT NULL, + template_id number(8) DEFAULT '0' NOT NULL, + theme_id number(8) DEFAULT '0' NOT NULL, + imageset_id number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id), CONSTRAINT u_phpbb_style_name UNIQUE (style_name) ) @@ -1426,7 +1427,7 @@ END; Table: 'phpbb_styles_template' */ CREATE TABLE phpbb_styles_template ( - template_id number(4) NOT NULL, + template_id number(8) NOT NULL, template_name varchar2(765) DEFAULT '' , template_copyright varchar2(765) DEFAULT '' , template_path varchar2(100) DEFAULT '' , @@ -1460,7 +1461,7 @@ END; Table: 'phpbb_styles_template_data' */ CREATE TABLE phpbb_styles_template_data ( - template_id number(4) DEFAULT '0' NOT NULL, + template_id number(8) DEFAULT '0' NOT NULL, template_filename varchar2(100) DEFAULT '' , template_included clob DEFAULT '' , template_mtime number(11) DEFAULT '0' NOT NULL, @@ -1477,7 +1478,7 @@ CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (templ Table: 'phpbb_styles_theme' */ CREATE TABLE phpbb_styles_theme ( - theme_id number(4) NOT NULL, + theme_id number(8) NOT NULL, theme_name varchar2(765) DEFAULT '' , theme_copyright varchar2(765) DEFAULT '' , theme_path varchar2(100) DEFAULT '' , @@ -1510,7 +1511,7 @@ END; Table: 'phpbb_styles_imageset' */ CREATE TABLE phpbb_styles_imageset ( - imageset_id number(4) NOT NULL, + imageset_id number(8) NOT NULL, imageset_name varchar2(765) DEFAULT '' , imageset_copyright varchar2(765) DEFAULT '' , imageset_path varchar2(100) DEFAULT '' , @@ -1540,13 +1541,13 @@ END; Table: 'phpbb_styles_imageset_data' */ CREATE TABLE phpbb_styles_imageset_data ( - image_id number(4) NOT NULL, + image_id number(8) NOT NULL, image_name varchar2(200) DEFAULT '' , image_filename varchar2(200) DEFAULT '' , image_lang varchar2(30) DEFAULT '' , image_height number(4) DEFAULT '0' NOT NULL, image_width number(4) DEFAULT '0' NOT NULL, - imageset_id number(4) DEFAULT '0' NOT NULL, + imageset_id number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_styles_imageset_data PRIMARY KEY (image_id) ) / @@ -1738,7 +1739,7 @@ CREATE TABLE phpbb_users ( user_timezone number(5, 2) DEFAULT '0' NOT NULL, user_dst number(1) DEFAULT '0' NOT NULL, user_dateformat varchar2(90) DEFAULT 'd M Y H:i' NOT NULL, - user_style number(4) DEFAULT '0' NOT NULL, + user_style number(8) DEFAULT '0' NOT NULL, user_rank number(8) DEFAULT '0' NOT NULL, user_colour varchar2(6) DEFAULT '' , user_new_privmsg number(4) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 32f3f0cd4a..077078c40f 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -361,7 +361,7 @@ CREATE TABLE phpbb_forums ( forum_desc_uid varchar(8) DEFAULT '' NOT NULL, forum_link varchar(255) DEFAULT '' NOT NULL, forum_password varchar(40) DEFAULT '' NOT NULL, - forum_style INT2 DEFAULT '0' NOT NULL CHECK (forum_style >= 0), + forum_style INT4 DEFAULT '0' NOT NULL CHECK (forum_style >= 0), forum_image varchar(255) DEFAULT '' NOT NULL, forum_rules varchar(4000) DEFAULT '' NOT NULL, forum_rules_link varchar(255) DEFAULT '' NOT NULL, @@ -737,6 +737,7 @@ CREATE TABLE phpbb_profile_fields ( field_validation varchar(20) DEFAULT '' NOT NULL, field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0), field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0), + field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0), field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0), field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0), field_active INT2 DEFAULT '0' NOT NULL CHECK (field_active >= 0), @@ -946,13 +947,13 @@ CREATE INDEX phpbb_smilies_display_on_post ON phpbb_smilies (display_on_posting) CREATE SEQUENCE phpbb_styles_seq; CREATE TABLE phpbb_styles ( - style_id INT2 DEFAULT nextval('phpbb_styles_seq'), + style_id INT4 DEFAULT nextval('phpbb_styles_seq'), style_name varchar(255) DEFAULT '' NOT NULL, style_copyright varchar(255) DEFAULT '' NOT NULL, style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0), - template_id INT2 DEFAULT '0' NOT NULL CHECK (template_id >= 0), - theme_id INT2 DEFAULT '0' NOT NULL CHECK (theme_id >= 0), - imageset_id INT2 DEFAULT '0' NOT NULL CHECK (imageset_id >= 0), + template_id INT4 DEFAULT '0' NOT NULL CHECK (template_id >= 0), + theme_id INT4 DEFAULT '0' NOT NULL CHECK (theme_id >= 0), + imageset_id INT4 DEFAULT '0' NOT NULL CHECK (imageset_id >= 0), PRIMARY KEY (style_id) ); @@ -967,7 +968,7 @@ CREATE INDEX phpbb_styles_imageset_id ON phpbb_styles (imageset_id); CREATE SEQUENCE phpbb_styles_template_seq; CREATE TABLE phpbb_styles_template ( - template_id INT2 DEFAULT nextval('phpbb_styles_template_seq'), + template_id INT4 DEFAULT nextval('phpbb_styles_template_seq'), template_name varchar(255) DEFAULT '' NOT NULL, template_copyright varchar(255) DEFAULT '' NOT NULL, template_path varchar(100) DEFAULT '' NOT NULL, @@ -984,7 +985,7 @@ CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (te Table: 'phpbb_styles_template_data' */ CREATE TABLE phpbb_styles_template_data ( - template_id INT2 DEFAULT '0' NOT NULL CHECK (template_id >= 0), + template_id INT4 DEFAULT '0' NOT NULL CHECK (template_id >= 0), template_filename varchar(100) DEFAULT '' NOT NULL, template_included varchar(8000) DEFAULT '' NOT NULL, template_mtime INT4 DEFAULT '0' NOT NULL CHECK (template_mtime >= 0), @@ -1000,7 +1001,7 @@ CREATE INDEX phpbb_styles_template_data_tfn ON phpbb_styles_template_data (templ CREATE SEQUENCE phpbb_styles_theme_seq; CREATE TABLE phpbb_styles_theme ( - theme_id INT2 DEFAULT nextval('phpbb_styles_theme_seq'), + theme_id INT4 DEFAULT nextval('phpbb_styles_theme_seq'), theme_name varchar(255) DEFAULT '' NOT NULL, theme_copyright varchar(255) DEFAULT '' NOT NULL, theme_path varchar(100) DEFAULT '' NOT NULL, @@ -1018,7 +1019,7 @@ CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_n CREATE SEQUENCE phpbb_styles_imageset_seq; CREATE TABLE phpbb_styles_imageset ( - imageset_id INT2 DEFAULT nextval('phpbb_styles_imageset_seq'), + imageset_id INT4 DEFAULT nextval('phpbb_styles_imageset_seq'), imageset_name varchar(255) DEFAULT '' NOT NULL, imageset_copyright varchar(255) DEFAULT '' NOT NULL, imageset_path varchar(100) DEFAULT '' NOT NULL, @@ -1033,13 +1034,13 @@ CREATE UNIQUE INDEX phpbb_styles_imageset_imgset_nm ON phpbb_styles_imageset (im CREATE SEQUENCE phpbb_styles_imageset_data_seq; CREATE TABLE phpbb_styles_imageset_data ( - image_id INT2 DEFAULT nextval('phpbb_styles_imageset_data_seq'), + image_id INT4 DEFAULT nextval('phpbb_styles_imageset_data_seq'), image_name varchar(200) DEFAULT '' NOT NULL, image_filename varchar(200) DEFAULT '' NOT NULL, image_lang varchar(30) DEFAULT '' NOT NULL, image_height INT2 DEFAULT '0' NOT NULL CHECK (image_height >= 0), image_width INT2 DEFAULT '0' NOT NULL CHECK (image_width >= 0), - imageset_id INT2 DEFAULT '0' NOT NULL CHECK (imageset_id >= 0), + imageset_id INT4 DEFAULT '0' NOT NULL CHECK (imageset_id >= 0), PRIMARY KEY (image_id) ); @@ -1183,7 +1184,7 @@ CREATE TABLE phpbb_users ( user_timezone decimal(5,2) DEFAULT '0' NOT NULL, user_dst INT2 DEFAULT '0' NOT NULL CHECK (user_dst >= 0), user_dateformat varchar(30) DEFAULT 'd M Y H:i' NOT NULL, - user_style INT2 DEFAULT '0' NOT NULL CHECK (user_style >= 0), + user_style INT4 DEFAULT '0' NOT NULL CHECK (user_style >= 0), user_rank INT4 DEFAULT '0' NOT NULL CHECK (user_rank >= 0), user_colour varchar(6) DEFAULT '' NOT NULL, user_new_privmsg INT4 DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 1fd0f96332..f469436e00 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -218,7 +218,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.3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.4-RC1'); 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'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 8033b2d583..e60a194839 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -533,6 +533,7 @@ CREATE TABLE phpbb_profile_fields ( field_validation varchar(20) NOT NULL DEFAULT '', field_required INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0', + field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0', field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0', field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0', field_active INTEGER UNSIGNED NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index ca63c9c639..83e0fa06ca 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -64,10 +64,10 @@ $lang = array_merge($lang, array( 'DELETE_PROFILE_FIELD_CONFIRM' => 'Are you sure you want to delete this profile field?', 'DISPLAY_AT_PROFILE' => 'Display in user control panel', 'DISPLAY_AT_PROFILE_EXPLAIN' => 'The user is able to change this profile field within the user control panel.', - 'DISPLAY_AT_REGISTER' => 'Display at registration screen', - 'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration and able to be changed within the user control panel.', + 'DISPLAY_AT_REGISTER' => 'Display on registration screen', + 'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration.', 'DISPLAY_PROFILE_FIELD' => 'Display profile field', - 'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown in all places allowed within the load settings. Setting this to “no” will hide the field from topic pages, profiles and the memberlist.', + 'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown in all locations allowed within the load settings. Setting this to “no” will hide the field from topic pages, profiles and the memberlist.', 'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line.', 'EDIT_DROPDOWN_LANG_EXPLAIN' => 'Please note that you are able to change your options text and also able to add new options to the end. It is not advised to add new options between existing options - this could result in wrong options assigned to your users. This can also happen if you remove options in-between. Removing options from the end result in users having assigned this item now reverting back to the default one.', @@ -95,7 +95,7 @@ $lang = array_merge($lang, array( 'FIRST_OPTION' => 'First option', 'HIDE_PROFILE_FIELD' => 'Hide profile field', - 'HIDE_PROFILE_FIELD_EXPLAIN' => 'Only administrators and moderators are able to see/fill out this profile field. If this option is enabled, the profile field will be only displayed in users’ profiles.', + 'HIDE_PROFILE_FIELD_EXPLAIN' => 'Hide the profile field from all other users except the user, administrators and moderators who are still able to see this field. If the Display in user control panel option is disabled, the user will not be able to see or change this field and the field can only be changed by administrators.', 'INVALID_CHARS_FIELD_IDENT' => 'Field identification can only contain lowercase a-z and _', 'INVALID_FIELD_IDENT_LEN' => 'Field identification can only be 17 characters long', @@ -124,7 +124,7 @@ $lang = array_merge($lang, array( 'RADIO_BUTTONS' => 'Radio buttons', 'REMOVED_PROFILE_FIELD' => 'Successfully removed profile field.', 'REQUIRED_FIELD' => 'Required field', - 'REQUIRED_FIELD_EXPLAIN' => 'Force profile field to be filled out or specified by user. This will display the profile field at registration and within the user control panel.', + 'REQUIRED_FIELD_EXPLAIN' => 'Force profile field to be filled out or specified by user or administrator. If display at registration screen option is disabled, the field will only be required when the user edits their profile.', 'ROWS' => 'Rows', 'SAVE' => 'Save', @@ -148,7 +148,7 @@ $lang = array_merge($lang, array( 'USER_FIELD_NAME' => 'Field name/title presented to the user', - 'VISIBILITY_OPTION' => 'Visibility option', + 'VISIBILITY_OPTION' => 'Visibility options', )); ?> \ No newline at end of file diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php index 33aeccbc22..8d7efa3308 100644 --- a/phpBB/language/en/acp/search.php +++ b/phpBB/language/en/acp/search.php @@ -40,7 +40,7 @@ $lang = array_merge($lang, array( 'ACP_SEARCH_SETTINGS_EXPLAIN' => 'Here you can define what search backend will be used for indexing posts and performing searches. You can set various options that can influence how much processing these actions require. Some of these settings are the same for all search engine backends.', 'COMMON_WORD_THRESHOLD' => 'Common word threshold', - 'COMMON_WORD_THRESHOLD_EXPLAIN' => 'Words which are contained in a greater percentage of all posts will be regarded as common. Common words are ignored in search queries. Set to zero to disable. Only takes effect if there are more than 100 posts.', + 'COMMON_WORD_THRESHOLD_EXPLAIN' => 'Words which are contained in a greater percentage of all posts will be regarded as common. Common words are ignored in search queries. Set to zero to disable. Only takes effect if there are more than 100 posts. If you want words that are currently regarded as common to be reconsidered you have to recreate the index.', 'CONFIRM_SEARCH_BACKEND' => 'Are you sure you wish to switch to a different search backend? After changing the search backend you will have to create an index for the new search backend. If you don’t plan on switching back to the old search backend you can also delete the old backend’s index in order to free system resources.', 'CONTINUE_DELETING_INDEX' => 'Continue previous index removal process', 'CONTINUE_DELETING_INDEX_EXPLAIN' => 'An index removal process has been started. In order to access the search index page you will have to complete it or cancel it.', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 93ad31e127..7e889db7d8 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -697,6 +697,12 @@ $lang = array_merge($lang, array( 'TODAY' => 'Today', 'TOMORROW' => 'Tomorrow', 'YESTERDAY' => 'Yesterday', + 'AGO' => array( + 0 => 'less than a minute ago', + 1 => '%d minute ago', + 2 => '%d minutes ago', + 60 => '1 hour ago', + ), 'Sunday' => 'Sunday', 'Monday' => 'Monday', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index e6555f5a41..ac3e90543b 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -379,7 +379,8 @@ $lang = array_merge($lang, array( 'COLLECTED_INFORMATION_EXPLAIN' => 'The list below shows information about the files needing an update. Please read the information in front of every status block to see what they mean and what you may need to do to perform a successful update.', 'COLLECTING_FILE_DIFFS' => 'Collecting file differences', 'COMPLETE_LOGIN_TO_BOARD' => '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!', - 'CONTINUE_UPDATE_NOW' => 'Continue the update process now', + 'CONTINUE_UPDATE_NOW' => 'Continue the update process now', // Shown within the database update script at the end if called from the updater + 'CONTINUE_UPDATE' => 'Continue update now', // Shown after file upload to indicate the update process is not yet finished 'CURRENT_FILE' => 'Beginning of current original file', 'CURRENT_VERSION' => 'Current version', @@ -408,7 +409,7 @@ $lang = array_merge($lang, array( 'FILE_DIFF_NOT_ALLOWED' => 'File not allowed to be diffed.', 'FILE_USED' => 'Information used from', // Single file 'FILES_CONFLICT' => 'Conflict files', - 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', + 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in losing the changes from the newer file.', 'FILES_MODIFIED' => 'Modified files', 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', 'FILES_NEW' => 'New files', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index f18ebbaf8b..4ece142031 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -118,7 +118,7 @@ $lang = array_merge($lang, array( 'CHANGE_PASSWORD' => 'Change password', 'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s” folder%2$s', 'CONFIRMATION' => 'Confirmation of registration', - 'CONFIRM_CHANGES' => 'Confirm changes', + 'CONFIRM_CHANGES' => 'Confirm changes', 'CONFIRM_EMAIL' => 'Confirm e-mail address', 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your e-mail address.', 'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', @@ -378,7 +378,7 @@ $lang = array_merge($lang, array( 'SAME_PASSWORD_ERROR' => 'The new password you entered is the same as your current password.', 'SEARCH_YOUR_POSTS' => 'Show your posts', 'SEND_PASSWORD' => 'Send password', - 'SENT_AT' => 'Sent at', + 'SENT_AT' => 'Sent', // Used before dates in private messages 'SHOW_EMAIL' => 'Users can contact me by e-mail', 'SIGNATURE_EXPLAIN' => 'This is a block of text that can be added to posts you make. There is a %d character limit.', 'SIGNATURE_PREVIEW' => 'Your signature will appear like this in posts', @@ -421,7 +421,7 @@ $lang = array_merge($lang, array( 'UCP_PREFS_PERSONAL' => 'Edit global settings', 'UCP_PREFS_POST' => 'Edit posting defaults', 'UCP_PREFS_VIEW' => 'Edit display options', - + 'UCP_PM' => 'Private messages', 'UCP_PM_COMPOSE' => 'Compose message', 'UCP_PM_DRAFTS' => 'Manage PM drafts', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index c78acaf92d..38d5efad2f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -238,7 +238,7 @@ switch ($mode) } $rank_title = $rank_img = ''; - get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src); + get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src); $template->assign_block_vars($which_row, array( 'USER_ID' => $row['user_id'], @@ -570,7 +570,7 @@ switch ($mode) 'S_CUSTOM_FIELDS' => (isset($profile_fields['row']) && sizeof($profile_fields['row'])) ? true : false, 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '', - 'U_USER_BAN' => ($auth->acl_get('m_ban')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&mode=user&u=' . $user_id, true, $user->session_id) : '', + 'U_USER_BAN' => ($auth->acl_get('m_ban') && $user_id != $user->data['user_id']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=ban&mode=user&u=' . $user_id, true, $user->session_id) : '', 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '', 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}") : '', @@ -1276,11 +1276,21 @@ switch ($mode) $s_group_select = ''; $group_ids = array(); + /** + * @todo add this to a separate function (function is responsible for returning the groups the user is able to see based on the users group membership) + */ + if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) { $sql = 'SELECT group_id, group_name, group_type - FROM ' . GROUPS_TABLE . ' - ORDER BY group_name ASC'; + FROM ' . GROUPS_TABLE; + + if (!$config['coppa_enable']) + { + $sql .= " WHERE group_name <> 'REGISTERED_COPPA'"; + } + + $sql .= ' ORDER BY group_name ASC'; } else { @@ -1292,8 +1302,14 @@ switch ($mode) AND ug.user_id = ' . $user->data['user_id'] . ' AND ug.user_pending = 0 ) - WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ') - ORDER BY g.group_name ASC'; + WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')'; + + if (!$config['coppa_enable']) + { + $sql .= " AND g.group_name <> 'REGISTERED_COPPA'"; + } + + $sql .= ' ORDER BY g.group_name ASC'; } $result = $db->sql_query($sql); @@ -1523,7 +1539,7 @@ function show_profile($data) $user_id = $data['user_id']; $rank_title = $rank_img = $rank_img_src = ''; - get_user_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src); + get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src); if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_user')) { diff --git a/phpBB/styles/prosilver/imageset/imageset.cfg b/phpBB/styles/prosilver/imageset/imageset.cfg index 3e1ea21dce..074631ea60 100644 --- a/phpBB/styles/prosilver/imageset/imageset.cfg +++ b/phpBB/styles/prosilver/imageset/imageset.cfg @@ -19,7 +19,7 @@ # General Information about this style name = prosilver copyright = © phpBB Group, 2007 -version = 3.0.3 +version = 3.0.4 # Images img_site_logo = site_logo.gif*52*139 diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg index faf4401c3d..1d87dc8cf1 100644 --- a/phpBB/styles/prosilver/style.cfg +++ b/phpBB/styles/prosilver/style.cfg @@ -19,4 +19,4 @@ # General Information about this style name = prosilver copyright = © phpBB Group, 2007 -version = 3.0.3 \ No newline at end of file +version = 3.0.4 \ No newline at end of file diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 8ed80883e9..f19f3c3075 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -42,7 +42,7 @@