From 2e2ec887d74b7f0253b609b5944caad968118b4b Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 13 Nov 2008 11:38:14 +0000 Subject: [PATCH 01/56] #36695 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9060 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/memberlist_body.html | 2 -- phpBB/styles/prosilver/template/ucp_pm_history.html | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 007f29a64b..957e3781f7 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -87,8 +87,6 @@ - - diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html index 29e3a75c05..d4ef61c4a9 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_history.html +++ b/phpBB/styles/prosilver/template/ucp_pm_history.html @@ -12,7 +12,7 @@
From 9d4e7aeab10c1a4665ec45b8b0be60f73beb0c94 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 13 Nov 2008 12:56:24 +0000 Subject: [PATCH 02/56] problems with case handling #36725 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9063 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index e0fb1459c2..c9ef818a67 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -2176,10 +2176,10 @@ parse_css_file = {PARSE_CSS_FILE} $style_default = request_var('style_default', 0); $store_db = request_var('store_db', 0); - $sql = "SELECT {$mode}_id + $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 +3206,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); From b9bf3dafd3704b01a01b37b5277b4f7621c4c690 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 13 Nov 2008 17:32:55 +0000 Subject: [PATCH 03/56] Fix a bug in r8908 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9065 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), '')); } From 4a38e5cc3f19bb74bbcad70bd5f52ece9fea65cf Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 14 Nov 2008 02:01:04 +0000 Subject: [PATCH 04/56] Before we forget git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9066 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/schema_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 1fd0f96332..71a7a8436a 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-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'); From bbfe3b0b7baaf9620b4f5faea7f2a3a801bec870 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 21 Nov 2008 13:21:53 +0000 Subject: [PATCH 05/56] 37375 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9067 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_activate.php | 2 +- phpBB/includes/ucp/ucp_groups.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 7de2511423..ad9dcc3659 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -51,7 +51,7 @@ class ucp_activate trigger_error('ALREADY_ACTIVATED'); } - if ($user_row['user_actkey'] != $key) + if (($user_row['user_inactive_reason'] == INACTIVE_MANUAL) || $user_row['user_actkey'] != $key) { trigger_error('WRONG_ACTIVATION'); } diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 32d24337c9..db3dbc5cac 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -414,6 +414,9 @@ class ucp_groups $this->page_title = 'UCP_USERGROUPS_MANAGE'; $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''); $group_id = request_var('g', 0); + + include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + add_form_key('ucp_groups'); if ($group_id) @@ -438,6 +441,7 @@ class ucp_groups $group_name = $group_row['group_name']; $group_type = $group_row['group_type']; + $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : ''; $template->assign_vars(array( @@ -458,8 +462,6 @@ class ucp_groups { case 'edit': - include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - if (!$group_id) { trigger_error($user->lang['NO_GROUP'] . $return_page); From d24a82aaacde1b1b574f1e6fa5094cafa7e98ef2 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 21 Nov 2008 14:01:58 +0000 Subject: [PATCH 06/56] changelog for 9067 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9069 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index efb9dcd815..0b8777e440 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -53,6 +53,7 @@
  1. Changelog
      +
    1. Changes since 3.0.2
    2. Changes since 3.0.2
    3. Changes since 3.0.1
    4. Changes since 3.0.0
    5. @@ -82,7 +83,12 @@
      +

      1.i. Changes since 3.0.3

      +
        +
      • [Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375)
      • +
      +

      1.i. Changes since 3.0.2

        From 72662eeb044820bc068a2d4e397b755793e66169 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 21 Nov 2008 14:11:49 +0000 Subject: [PATCH 07/56] changelog, up indexes git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9070 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0b8777e440..4a44f94d0e 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -89,7 +89,7 @@
      • [Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375)
      -

      1.i. Changes since 3.0.2

      +

      1.ii. Changes since 3.0.2

      • [Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)
      • @@ -187,7 +187,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)
      • @@ -235,7 +235,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)
      • @@ -306,7 +306,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)
      • @@ -315,7 +315,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
      • @@ -350,7 +350,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)
      • @@ -360,7 +360,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.
      • @@ -423,7 +423,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)
      • @@ -474,7 +474,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
      • @@ -583,7 +583,7 @@
      -

      1.x. Changes since 3.0.RC2

      +

      1.xi. Changes since 3.0.RC2

      • [Fix] Re-allow searching within the memberlist
      • @@ -629,7 +629,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)
      • From cf2a0852cabc000aa0ee5bdaa9b52173780838a1 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 17:21:01 +0000 Subject: [PATCH 08/56] add the first fixed bugs from after the release git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9071 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 4a44f94d0e..9d85cdc5a5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -53,7 +53,7 @@
        1. Changelog
            -
          1. Changes since 3.0.2
          2. +
          3. Changes since 3.0.3
          4. Changes since 3.0.2
          5. Changes since 3.0.1
          6. Changes since 3.0.0
          7. @@ -86,9 +86,11 @@

            1.i. Changes since 3.0.3

              +
            • [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)
            - +

            1.ii. Changes since 3.0.2

              From 7d1e8ed70e07730f740166ed8d70be4a490c4827 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 17:53:27 +0000 Subject: [PATCH 09/56] Fix header list build for replying oldest PM in PM history (Bug #37275) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9072 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/ucp/ucp_pm_compose.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 9d85cdc5a5..8355dbf1e1 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -89,6 +89,7 @@
            • [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)

            1.ii. Changes since 3.0.2

            diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 060baaefa0..ba06315363 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -424,7 +424,9 @@ function compose_pm($id, $mode, $action) { // We try to include every previously listed member from the TO Header $list = rebuild_header(array('to' => $post['to_address'])); - $list = $list['u']; + + // Can be an empty array too ;) + $list = (!empty($list['u'])) ? $list['u'] : array(); $list[$post['author_id']] = 'to'; if (isset($list[$user->data['user_id']])) From 3d9eb90d728df67b86206d969a182a3871c44d50 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 18:00:45 +0000 Subject: [PATCH 10/56] make sure phpbb_chmod is able to be called git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9073 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 577f893e77..ece2a96779 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 @@ -197,6 +203,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{$var_name}.$phpEx", CHMOD_WRITE); } } @@ -416,6 +428,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($filename, CHMOD_WRITE); $query_result = $query_id; From 127750f89d114b7ab9a2e9442c7b3bd28084c5df Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 18:13:18 +0000 Subject: [PATCH 11/56] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9075 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/memberlist.php | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8355dbf1e1..b78fa1f373 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -90,6 +90,7 @@
          8. [Fix] Regression bug from revision #8908 regarding log display in ACP
          9. [Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375)
          10. [Fix] Fix header list build for replying oldest PM in PM history (Bug #37275)
          11. +
          12. [Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175)

      1.ii. Changes since 3.0.2

      diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index c78acaf92d..ad2efe5229 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -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 .= " WHERE group_name <> 'REGISTERED_COPPA'"; + } + + $sql .= ' ORDER BY g.group_name ASC'; } $result = $db->sql_query($sql); From f588f58fa9e5a08fef4f480e17ae25f4f7e94071 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 19:06:42 +0000 Subject: [PATCH 12/56] small adjustement... only add an empty array if cached data is empty (from 3.2.x) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9076 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index ece2a96779..f58f925506 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -199,7 +199,7 @@ 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); @@ -424,7 +424,7 @@ 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); From c831a3edce4d0f1b0a358b0201f689fe23ca2628 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 19:55:00 +0000 Subject: [PATCH 13/56] Do not try to send jabber notifications if no jid entered (Bug #36775) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9078 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_messenger.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index b78fa1f373..483d97491c 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -91,6 +91,7 @@
    6. [Fix] Allow the UCP group management to work for groups with avatars. (Bug #37375)
    7. [Fix] Fix header list build for replying oldest PM in PM history (Bug #37275)
    8. [Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175)
    9. +
    10. [Fix] Do not try to send jabber notifications if no jid entered (Bug #36775)
    11. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index b125a1586a..cbec2582a9 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -97,6 +97,12 @@ class messenger */ function im($address, $realname = '') { + // IM-Addresses could be empty + if (!$address) + { + return; + } + $pos = isset($this->addresses['im']) ? sizeof($this->addresses['im']) : 0; $this->addresses['im'][$pos]['uid'] = trim($address); $this->addresses['im'][$pos]['name'] = trim($realname); @@ -443,6 +449,11 @@ class messenger return false; } + if (empty($this->addresses['im'])) + { + return false; + } + $use_queue = false; if ($config['jab_package_size'] && $this->use_queue) { From d2f4a17ebf957e570bc8a47619f1d0ca11966b68 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 20:03:47 +0000 Subject: [PATCH 14/56] define cookie var for styleswitcher.js for popups (Bug #36765) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9080 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/simple_header.html | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 5acf19f000..d14f89935e 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -19,6 +19,7 @@ var onload_functions = new Array(); var onunload_functions = new Array(); + var style_cookie_settings = '{A_COOKIE_SETTINGS}'; /** * New function for handling multiple calls to window.onload and window.unload by pentapenguin From e02c3e3b4aeb0a0588cacb4d96ef3d8c4ba0ef8a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 22 Nov 2008 20:26:09 +0000 Subject: [PATCH 15/56] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735) [a bit ugly, but retains backward compatibility] git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9082 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_display.php | 3 ++- phpBB/memberlist.php | 4 ++-- phpBB/viewtopic.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 483d97491c..6b389b9f17 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -92,6 +92,7 @@
    12. [Fix] Fix header list build for replying oldest PM in PM history (Bug #37275)
    13. [Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175)
    14. [Fix] Do not try to send jabber notifications if no jid entered (Bug #36775)
    15. +
    16. [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
    17. 1.ii. Changes since 3.0.2

      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'])) ? '' . $ranks['special'][$user_rank]['rank_title'] . '' : ''; $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : ''; } - else + else if ($user_posts !== false) { if (!empty($ranks['normal'])) { diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index ad2efe5229..bede7442fc 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'], @@ -1539,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/viewtopic.php b/phpBB/viewtopic.php index 3241c9c21a..b7b130bbd1 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1047,7 +1047,7 @@ while ($row = $db->sql_fetchrow($result)) 'allow_pm' => 0, ); - get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']); + get_user_rank($row['user_rank'], false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']); } else { From dcea9f082a3392f09f2753f1cba761f36a6b74ec Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 22 Nov 2008 21:18:35 +0000 Subject: [PATCH 16/56] - Properly treat punctuation marks after local urls [Bug #37055] git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9084 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_content.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 6b389b9f17..11f1dc319a 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -93,6 +93,7 @@
    18. [Fix] Do not display COPPA group in memberlist find member dialog if COPPA disabled (Bug #37175)
    19. [Fix] Do not try to send jabber notifications if no jid entered (Bug #36775)
    20. [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
    21. +
    22. [Fix] Properly treat punctuation marks after local urls (Bug #37055)
    23. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 627e6a71cd..caa1b470d6 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -565,6 +565,14 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class { $url = substr($url, 0, -1); } + // appends last_char to orig_url to retrieve real original url + $orig_url = substr($orig_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; } @@ -583,7 +591,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 . '/' . $last_char; // slash is taken away by relative url pattern } break; From 81a1803c439f99863a499685b0e519b03b5362a1 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 22 Nov 2008 23:17:05 +0000 Subject: [PATCH 17/56] better fix for (Bug #37055) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9085 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_content.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index caa1b470d6..88b7e77caa 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); @@ -565,8 +566,6 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class { $url = substr($url, 0, -1); } - // appends last_char to orig_url to retrieve real original url - $orig_url = substr($orig_url, 0, -1); break; // set last_char to empty here, so the variable can be used later to @@ -591,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 . '/' . $last_char; // slash is taken away by relative url pattern + return $whitespace . $orig_url . '/' . $orig_relative; // slash is taken away by relative url pattern } break; From f1b1d0c83947a2807dc4db95a8a224b1bcb65e65 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 23 Nov 2008 00:37:30 +0000 Subject: [PATCH 18/56] Make searching for members by YIM address work in prosilver git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9090 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/styles/prosilver/template/memberlist_search.html | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 11f1dc319a..4897535416 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -94,6 +94,7 @@
    24. [Fix] Do not try to send jabber notifications if no jid entered (Bug #36775)
    25. [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
    26. [Fix] Properly treat punctuation marks after local urls (Bug #37055)
    27. +
    28. [Fix] Make searching for members by YIM address work in prosilver
    29. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index 65c4707944..b95185a6f2 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -68,8 +68,8 @@ function insert_single(user)
      -
      -
      +
      +
      From 9a7d2a3736f876d1aae7735c9a2d00a35d037e2b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 23 Nov 2008 12:42:34 +0000 Subject: [PATCH 19/56] [Change] Alllow applications to set custom module inclusion path (idea by HoL) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9095 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 ++ phpBB/includes/functions_module.php | 38 ++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 4897535416..0a1ad6b4bb 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -95,6 +95,8 @@
    30. [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
    31. [Fix] Properly treat punctuation marks after local urls (Bug #37055)
    32. [Fix] Make searching for members by YIM address work in prosilver
    33. +
    34. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    35. +

      1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 3f1c6b39e2..d0e7c8cfc8 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -28,11 +28,47 @@ class p_master var $p_mode; var $p_parent; + var $include_path = false; var $active_module = false; var $active_module_row_id = false; var $acl_forum_id = false; var $module_ary = array(); + /** + * Constuctor + * Set module include path + */ + function p_master($include_path = false) + { + global $phpbb_root_path; + + $this->include_path = ($include_path !== false) ? $include_path : $phpbb_root_path . 'includes/'; + + // Make sure the path ends with / + if (substr($this->include_path, -1) !== '/') + { + $this->include_path .= '/'; + } + } + + /** + * Set custom include path for modules + * Schema for inclusion is include_path . modulebase + * + * @param string $include_path include path to be used. + * @access public + */ + function set_custom_include_path($include_path) + { + $this->include_path = $include_path; + + // Make sure the path ends with / + if (substr($this->include_path, -1) !== '/') + { + $this->include_path .= '/'; + } + } + /** * List modules * @@ -395,7 +431,7 @@ class p_master { global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user; - $module_path = $phpbb_root_path . 'includes/' . $this->p_class; + $module_path = $this->include_path . $this->p_class; $icat = request_var('icat', ''); if ($this->active_module === false) From 05e8d9ee095ca4ea1039092fc75e93f888e60397 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 24 Nov 2008 19:23:23 +0000 Subject: [PATCH 20/56] Ha- ndle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)t) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9113 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 +- phpBB/install/convertors/convert_phpbb20.php | 14 ++++- .../install/convertors/functions_phpbb20.php | 53 ++++++------------- 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0a1ad6b4bb..3d3c31a8b1 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -96,7 +96,7 @@
    36. [Fix] Properly treat punctuation marks after local urls (Bug #37055)
    37. [Fix] Make searching for members by YIM address work in prosilver
    38. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    39. - +
    40. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    41. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index f413e2555a..da9bea3c05 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -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); } From 63b089f6535cf53ec8bec87decf56caab30bd0ad Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 26 Nov 2008 19:17:52 +0000 Subject: [PATCH 21/56] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9126 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/search/fulltext_native.php | 2 +- phpBB/language/en/acp/search.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 3d3c31a8b1..221a255390 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -97,6 +97,7 @@
    42. [Fix] Make searching for members by YIM address work in prosilver
    43. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    44. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    45. +
    46. [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
    47. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 9bd3c81311..0a3fe3754f 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1674,7 +1674,7 @@ class fulltext_native extends search_backend

      ' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '
      -
      %
      +
      %
      '; 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.', From fb77cdd0513994dca478c06a3c9ac5912da07872 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 26 Nov 2008 19:58:35 +0000 Subject: [PATCH 22/56] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9127 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_profile.html | 10 +- phpBB/develop/create_schema_files.php | 1 + phpBB/develop/mysql_upgrader.php | 9 +- phpBB/docs/CHANGELOG.html | 3 +- phpBB/includes/acp/acp_profile.php | 100 ++++++++++---------- phpBB/includes/functions_profile_fields.php | 42 ++++---- phpBB/install/database_update.php | 52 +++++++++- phpBB/install/schemas/firebird_schema.sql | 1 + phpBB/install/schemas/mssql_schema.sql | 1 + phpBB/install/schemas/mysql_40_schema.sql | 1 + phpBB/install/schemas/mysql_41_schema.sql | 1 + phpBB/install/schemas/oracle_schema.sql | 1 + phpBB/install/schemas/postgres_schema.sql | 3 +- phpBB/install/schemas/sqlite_schema.sql | 3 +- phpBB/language/en/acp/profile.php | 14 +-- 15 files changed, 150 insertions(+), 92 deletions(-) diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index eec975ad25..a2dcc4ebbd 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -48,20 +48,20 @@
      {L_VISIBILITY_OPTION}
      -

      {L_DISPLAY_AT_PROFILE_EXPLAIN}
      -
      checked="checked" />
      +

      {L_DISPLAY_AT_PROFILE_EXPLAIN}
      +
      checked="checked" />

      {L_DISPLAY_AT_REGISTER_EXPLAIN}
      -
      checked="checked" />
      +
      checked="checked" />

      {L_REQUIRED_FIELD_EXPLAIN}
      -
      checked="checked" />
      +
      checked="checked" />

      {L_HIDE_PROFILE_FIELD_EXPLAIN}
      -
      checked="checked" />
      +
      checked="checked" />
      diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 3c8e5275a0..32b9eceb6c 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1404,6 +1404,7 @@ function get_schema_struct() 'field_validation' => array('VCHAR_UNI:20', ''), 'field_required' => array('BOOL', 0), 'field_show_on_reg' => array('BOOL', 0), + 'field_show_profile' => array('BOOL', 0), 'field_hide' => array('BOOL', 0), 'field_no_view' => array('BOOL', 0), 'field_active' => array('BOOL', 0), diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index 82fbfb09eb..752cb9ac5b 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -1,10 +1,10 @@ $table_data) $line = "ALTER TABLE {$table_name} $newline"; // Table specific so we don't get overlap - $modded_array = array(); + $modded_array = array(); // Write columns one by one... foreach ($table_data['COLUMNS'] as $column_name => $column_data) @@ -876,6 +876,7 @@ function get_schema_struct() 'field_validation' => array('VCHAR_UNI:20', ''), 'field_required' => array('BOOL', 0), 'field_show_on_reg' => array('BOOL', 0), + 'field_show_profile' => array('BOOL', 0), 'field_hide' => array('BOOL', 0), 'field_no_view' => array('BOOL', 0), 'field_active' => array('BOOL', 0), diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 221a255390..c83bd2cc72 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -95,9 +95,10 @@
    48. [Fix] Only display special ranks to guests; no longer display normal ranks for guests (Bug #36735)
    49. [Fix] Properly treat punctuation marks after local urls (Bug #37055)
    50. [Fix] Make searching for members by YIM address work in prosilver
    51. +
    52. [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
    53. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    54. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    55. -
    56. [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
    57. +
    58. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    59. 1.ii. Changes since 3.0.2

      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/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index b621095df4..cc59648e54 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -40,14 +40,14 @@ class custom_profile { case 'register': // If the field is required we show it on the registration page and do not show hidden fields - $sql_where .= ' AND (f.field_show_on_reg = 1 OR f.field_required = 1) AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0'; break; case 'profile': // Show hidden fields to moderators/admins if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { - $sql_where .= ' AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_profile = 1'; } break; @@ -106,7 +106,7 @@ class custom_profile { case FIELD_DATE: $field_validate = explode('-', $field_value); - + $day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0; $month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0; $year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0; @@ -154,14 +154,14 @@ class custom_profile return 'FIELD_TOO_LARGE'; } break; - + case FIELD_DROPDOWN: if ($field_value == $field_data['field_novalue'] && $field_data['field_required']) { return 'FIELD_REQUIRED'; } break; - + case FIELD_STRING: case FIELD_TEXT: if (empty($field_value) && !$field_data['field_required']) @@ -205,7 +205,7 @@ class custom_profile global $db, $user, $auth; $this->profile_cache = array(); - + // Display hidden/no_view fields for admin/moderator $sql = 'SELECT l.*, f.* FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f @@ -234,7 +234,7 @@ class custom_profile if ($preview) { $lang_options = (!is_array($this->vars['lang_options'])) ? explode("\n", $this->vars['lang_options']) : $this->vars['lang_options']; - + foreach ($lang_options as $num => $var) { $this->options_lang[$field_id][$lang_id][($num + 1)] = $var; @@ -271,14 +271,14 @@ class custom_profile { case 'register': // If the field is required we show it on the registration page and do not show hidden fields - $sql_where .= ' AND (f.field_show_on_reg = 1 OR f.field_required = 1) AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0'; break; case 'profile': // Show hidden fields to moderators/admins if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { - $sql_where .= ' AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_profile = 1'; } break; @@ -316,12 +316,12 @@ class custom_profile case 'FIELD_TOO_SMALL': $error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']); break; - + case 'FIELD_TOO_LONG': case 'FIELD_TOO_LARGE': $error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']); break; - + case 'FIELD_INVALID_CHARS': switch ($row['field_validation']) { @@ -339,7 +339,7 @@ class custom_profile } break; } - + if ($error != '') { $cp_error[] = $error; @@ -434,7 +434,7 @@ class custom_profile 'S_PROFILE_' . strtoupper($ident) => true ); } - + return $tpl_fields; } else @@ -589,7 +589,7 @@ class custom_profile else { $value = (isset($_REQUEST[$profile_row['field_ident']])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); - + if (gettype($value) == 'string') { $value = utf8_normalize_nfc($value); @@ -672,7 +672,7 @@ class custom_profile $profile_row['s_year_options'] .= '"; } unset($now); - + $profile_row['field_value'] = 0; $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER)); } @@ -826,7 +826,7 @@ class custom_profile $cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value']; } $db->sql_freeresult($result); - + return $cp_data; } @@ -838,9 +838,9 @@ class custom_profile { global $phpbb_root_path, $phpEx; global $config; - + $var_name = 'pf_' . $profile_row['field_ident']; - + switch ($profile_row['field_type']) { case FIELD_DATE: @@ -860,7 +860,7 @@ class custom_profile $month = request_var($var_name . '_month', 0); $year = request_var($var_name . '_year', 0); } - + $var = sprintf('%2d-%2d-%4d', $day, $month, $year); break; @@ -931,7 +931,7 @@ class custom_profile_admin extends custom_profile return $validate_options; } - + /** * Get string options for second step in ACP */ @@ -1086,4 +1086,4 @@ class custom_profile_admin extends custom_profile } } -?> \ No newline at end of file +?> diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 48fd4e3ad2..b5839f517a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -548,6 +548,15 @@ $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), + ), + ), + ), ); // Determine mapping database type @@ -1948,6 +1957,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 +3132,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..b4830a977c 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -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, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 0119e4ce9d..e546c66f0a 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -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, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index c9b138b8d8..85a0526071 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -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, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 32f3f0cd4a..cb9a30b423 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -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), @@ -1274,4 +1275,4 @@ CREATE TABLE phpbb_zebra ( -COMMIT; \ No newline at end of file +COMMIT; diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 8033b2d583..725c09169e 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', @@ -968,4 +969,4 @@ CREATE TABLE phpbb_zebra ( -COMMIT; \ No newline at end of file +COMMIT; diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index ca63c9c639..96d9fec0f8 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 +?> From ee2fd4610d2550c2fa2f9d3ab67ebdd2b785bd3c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 26 Nov 2008 20:10:29 +0000 Subject: [PATCH 23/56] no newline git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9128 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index 96d9fec0f8..83e0fa06ca 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -151,4 +151,4 @@ $lang = array_merge($lang, array( 'VISIBILITY_OPTION' => 'Visibility options', )); -?> +?> \ No newline at end of file From 481e5c193fa21bd2cb8d7086fcdccd3d6964604d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 27 Nov 2008 13:44:24 +0000 Subject: [PATCH 24/56] extend the style columns (style_id, template_id, imageset_id, image_id...) No, not only because of possible style demos. :o git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9129 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/create_schema_files.php | 24 ++++++++--------- phpBB/develop/mysql_upgrader.php | 24 ++++++++--------- phpBB/install/database_update.php | 32 ++++++++++++++++++++++- phpBB/install/schemas/mysql_40_schema.sql | 24 ++++++++--------- phpBB/install/schemas/mysql_41_schema.sql | 24 ++++++++--------- phpBB/install/schemas/oracle_schema.sql | 24 ++++++++--------- phpBB/install/schemas/postgres_schema.sql | 26 +++++++++--------- phpBB/install/schemas/sqlite_schema.sql | 2 +- 8 files changed, 105 insertions(+), 75 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 32b9eceb6c..4d39d0c6b0 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1052,7 +1052,7 @@ function get_schema_struct() 'forum_desc_uid' => array('VCHAR:8', ''), 'forum_link' => array('VCHAR_UNI', ''), 'forum_password' => array('VCHAR_UNI:40', ''), - 'forum_style' => array('USINT', 0), + 'forum_style' => array('UINT', 0), 'forum_image' => array('VCHAR', ''), 'forum_rules' => array('TEXT_UNI', ''), 'forum_rules_link' => array('VCHAR_UNI', ''), @@ -1585,13 +1585,13 @@ function get_schema_struct() $schema_data['phpbb_styles'] = array( 'COLUMNS' => array( - 'style_id' => array('USINT', NULL, 'auto_increment'), + 'style_id' => array('UINT', NULL, 'auto_increment'), 'style_name' => array('VCHAR_UNI:255', ''), 'style_copyright' => array('VCHAR_UNI', ''), 'style_active' => array('BOOL', 1), - 'template_id' => array('USINT', 0), - 'theme_id' => array('USINT', 0), - 'imageset_id' => array('USINT', 0), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + 'imageset_id' => array('UINT', 0), ), 'PRIMARY_KEY' => 'style_id', 'KEYS' => array( @@ -1604,7 +1604,7 @@ function get_schema_struct() $schema_data['phpbb_styles_template'] = array( 'COLUMNS' => array( - 'template_id' => array('USINT', NULL, 'auto_increment'), + 'template_id' => array('UINT', NULL, 'auto_increment'), 'template_name' => array('VCHAR_UNI:255', ''), 'template_copyright' => array('VCHAR_UNI', ''), 'template_path' => array('VCHAR:100', ''), @@ -1621,7 +1621,7 @@ function get_schema_struct() $schema_data['phpbb_styles_template_data'] = array( 'COLUMNS' => array( - 'template_id' => array('USINT', 0), + 'template_id' => array('UINT', 0), 'template_filename' => array('VCHAR:100', ''), 'template_included' => array('TEXT', ''), 'template_mtime' => array('TIMESTAMP', 0), @@ -1635,7 +1635,7 @@ function get_schema_struct() $schema_data['phpbb_styles_theme'] = array( 'COLUMNS' => array( - 'theme_id' => array('USINT', NULL, 'auto_increment'), + 'theme_id' => array('UINT', NULL, 'auto_increment'), 'theme_name' => array('VCHAR_UNI:255', ''), 'theme_copyright' => array('VCHAR_UNI', ''), 'theme_path' => array('VCHAR:100', ''), @@ -1651,7 +1651,7 @@ function get_schema_struct() $schema_data['phpbb_styles_imageset'] = array( 'COLUMNS' => array( - 'imageset_id' => array('USINT', NULL, 'auto_increment'), + 'imageset_id' => array('UINT', NULL, 'auto_increment'), 'imageset_name' => array('VCHAR_UNI:255', ''), 'imageset_copyright' => array('VCHAR_UNI', ''), 'imageset_path' => array('VCHAR:100', ''), @@ -1664,13 +1664,13 @@ function get_schema_struct() $schema_data['phpbb_styles_imageset_data'] = array( 'COLUMNS' => array( - 'image_id' => array('USINT', NULL, 'auto_increment'), + 'image_id' => array('UINT', NULL, 'auto_increment'), 'image_name' => array('VCHAR:200', ''), 'image_filename' => array('VCHAR:200', ''), 'image_lang' => array('VCHAR:30', ''), 'image_height' => array('USINT', 0), 'image_width' => array('USINT', 0), - 'imageset_id' => array('USINT', 0), + 'imageset_id' => array('UINT', 0), ), 'PRIMARY_KEY' => 'image_id', 'KEYS' => array( @@ -1808,7 +1808,7 @@ function get_schema_struct() 'user_timezone' => array('DECIMAL', 0), 'user_dst' => array('BOOL', 0), 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'), - 'user_style' => array('USINT', 0), + 'user_style' => array('UINT', 0), 'user_rank' => array('UINT', 0), 'user_colour' => array('VCHAR:6', ''), 'user_new_privmsg' => array('INT:4', 0), diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index 752cb9ac5b..bc1994bcb3 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -524,7 +524,7 @@ function get_schema_struct() 'forum_desc_uid' => array('VCHAR:8', ''), 'forum_link' => array('VCHAR_UNI', ''), 'forum_password' => array('VCHAR_UNI:40', ''), - 'forum_style' => array('USINT', 0), + 'forum_style' => array('UINT', 0), 'forum_image' => array('VCHAR', ''), 'forum_rules' => array('TEXT_UNI', ''), 'forum_rules_link' => array('VCHAR_UNI', ''), @@ -1057,13 +1057,13 @@ function get_schema_struct() $schema_data['phpbb_styles'] = array( 'COLUMNS' => array( - 'style_id' => array('USINT', NULL, 'auto_increment'), + 'style_id' => array('UINT', NULL, 'auto_increment'), 'style_name' => array('VCHAR_UNI:255', ''), 'style_copyright' => array('VCHAR_UNI', ''), 'style_active' => array('BOOL', 1), - 'template_id' => array('USINT', 0), - 'theme_id' => array('USINT', 0), - 'imageset_id' => array('USINT', 0), + 'template_id' => array('UINT', 0), + 'theme_id' => array('UINT', 0), + 'imageset_id' => array('UINT', 0), ), 'PRIMARY_KEY' => 'style_id', 'KEYS' => array( @@ -1076,7 +1076,7 @@ function get_schema_struct() $schema_data['phpbb_styles_template'] = array( 'COLUMNS' => array( - 'template_id' => array('USINT', NULL, 'auto_increment'), + 'template_id' => array('UINT', NULL, 'auto_increment'), 'template_name' => array('VCHAR_UNI:255', ''), 'template_copyright' => array('VCHAR_UNI', ''), 'template_path' => array('VCHAR:100', ''), @@ -1091,7 +1091,7 @@ function get_schema_struct() $schema_data['phpbb_styles_template_data'] = array( 'COLUMNS' => array( - 'template_id' => array('USINT', 0), + 'template_id' => array('UINT', 0), 'template_filename' => array('VCHAR:100', ''), 'template_included' => array('TEXT', ''), 'template_mtime' => array('TIMESTAMP', 0), @@ -1105,7 +1105,7 @@ function get_schema_struct() $schema_data['phpbb_styles_theme'] = array( 'COLUMNS' => array( - 'theme_id' => array('USINT', NULL, 'auto_increment'), + 'theme_id' => array('UINT', NULL, 'auto_increment'), 'theme_name' => array('VCHAR_UNI:255', ''), 'theme_copyright' => array('VCHAR_UNI', ''), 'theme_path' => array('VCHAR:100', ''), @@ -1121,7 +1121,7 @@ function get_schema_struct() $schema_data['phpbb_styles_imageset'] = array( 'COLUMNS' => array( - 'imageset_id' => array('USINT', NULL, 'auto_increment'), + 'imageset_id' => array('UINT', NULL, 'auto_increment'), 'imageset_name' => array('VCHAR_UNI:255', ''), 'imageset_copyright' => array('VCHAR_UNI', ''), 'imageset_path' => array('VCHAR:100', ''), @@ -1134,13 +1134,13 @@ function get_schema_struct() $schema_data['phpbb_styles_imageset_data'] = array( 'COLUMNS' => array( - 'image_id' => array('USINT', NULL, 'auto_increment'), + 'image_id' => array('UINT', NULL, 'auto_increment'), 'image_name' => array('VCHAR:200', ''), 'image_filename' => array('VCHAR:200', ''), 'image_lang' => array('VCHAR:30', ''), 'image_height' => array('USINT', 0), 'image_width' => array('USINT', 0), - 'imageset_id' => array('USINT', 0), + 'imageset_id' => array('UINT', 0), ), 'PRIMARY_KEY' => 'image_id', 'KEYS' => array( @@ -1278,7 +1278,7 @@ function get_schema_struct() 'user_timezone' => array('DECIMAL', 0), 'user_dst' => array('BOOL', 0), 'user_dateformat' => array('VCHAR_UNI:30', 'd M Y H:i'), - 'user_style' => array('USINT', 0), + 'user_style' => array('UINT', 0), 'user_rank' => array('UINT', 0), 'user_colour' => array('VCHAR:6', ''), 'user_new_privmsg' => array('INT:4', 0), diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index b5839f517a..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')) @@ -556,6 +556,36 @@ $database_update_info = 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), + ), + ), ), ); diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index b4830a977c..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, @@ -718,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), @@ -735,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, @@ -750,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, @@ -762,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, @@ -776,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, @@ -787,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) ); @@ -921,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 e546c66f0a..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, @@ -718,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), @@ -735,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, @@ -750,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, @@ -762,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, @@ -776,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, @@ -787,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`; @@ -921,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 85a0526071..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 '' , @@ -1388,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) ) @@ -1427,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 '' , @@ -1461,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, @@ -1478,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 '' , @@ -1511,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 '' , @@ -1541,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) ) / @@ -1739,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 cb9a30b423..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, @@ -947,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) ); @@ -968,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, @@ -985,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), @@ -1001,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, @@ -1019,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, @@ -1034,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) ); @@ -1184,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, @@ -1275,4 +1275,4 @@ CREATE TABLE phpbb_zebra ( -COMMIT; +COMMIT; \ No newline at end of file diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 725c09169e..e60a194839 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -969,4 +969,4 @@ CREATE TABLE phpbb_zebra ( -COMMIT; +COMMIT; \ No newline at end of file From a3cbc3d671b9941e0859bd5e5694a115fde59a57 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Nov 2008 11:48:33 +0000 Subject: [PATCH 25/56] Let's face it - the most common setup we see with phpBB is having group-specific settings for external users (FTP, whatever). Changed phpbb_chmod() to set the group bit, even if the PHP user is the owner. (somehow this sounds complicated, i hope you get the idea). git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9131 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index c83bd2cc72..dad0e468d7 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -96,6 +96,7 @@
    60. [Fix] Properly treat punctuation marks after local urls (Bug #37055)
    61. [Fix] Make searching for members by YIM address work in prosilver
    62. [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
    63. +
    64. [Fix] Adjusted phpbb_chmod() to always set permissions for group bit.
    65. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    66. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    67. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    68. diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b96024e4e3..d6f112e8d6 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. * @@ -532,7 +532,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,12 +564,15 @@ 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)); if (!is_null($php) || (is_readable($filename) && is_writable($filename))) { break; } + */ case 'group': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0)); From 2e63b9b0667c27ce1edc7fb015300a0d97933ead Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Nov 2008 12:03:43 +0000 Subject: [PATCH 26/56] 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) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9133 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/mcp/mcp_queue.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index dad0e468d7..1684814d6b 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -97,6 +97,7 @@
    69. [Fix] Make searching for members by YIM address work in prosilver
    70. [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
    71. [Fix] Adjusted phpbb_chmod() to always set permissions for group bit.
    72. +
    73. [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)
    74. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    75. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    76. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    77. diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 1e368c4fc6..aa77dbdf16 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -505,8 +505,12 @@ function approve_post($post_id_list, $id, $mode) $forum_id_list[$post_data['forum_id']] = 1; } - // User post update (we do not care about topic or post, since user posts are strictly connected to posts - $user_posts_sql[$post_data['poster_id']] = (empty($user_posts_sql[$post_data['poster_id']])) ? 1 : $user_posts_sql[$post_data['poster_id']] + 1; + // User post update (we do not care about topic or post, since user posts are strictly connected to posts) + // But we care about forums where post counts get not increased. ;) + if ($post_data['post_postcount']) + { + $user_posts_sql[$post_data['poster_id']] = (empty($user_posts_sql[$post_data['poster_id']])) ? 1 : $user_posts_sql[$post_data['poster_id']] + 1; + } // Topic or Post. ;) if ($post_data['topic_first_post_id'] == $post_id) From fbabed373a908d2def316edad6e9d173b25589a8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Nov 2008 12:12:24 +0000 Subject: [PATCH 27/56] typo? git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9135 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 +- phpBB/language/en/install.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 1684814d6b..618dd9d883 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -622,7 +622,7 @@
    78. [Fix] Use our global expression for checking email syntax in memberlist (Bug #12827)
    79. [Fix] Correctly retrieve/refresh templates stored in database if using subdirectories within template directory (Bug #12839)
    80. [Fix] Correctly translate special group names in ucp_groups.php (Bug #12597)
    81. -
    82. [Fix] Search boxes not loosing session id (changing method from get to post) (Bug #12643)
    83. +
    84. [Fix] Search boxes not losing session id (changing method from get to post) (Bug #12643)
    85. [Fix] Make sure the automatic update is also working for those having fsockopen disabled
    86. [Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed
    87. [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
    88. diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index e6555f5a41..0549495b47 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -408,7 +408,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', From a752a424de3d250c2bc79f7b680c936fc9ea987f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Nov 2008 14:36:59 +0000 Subject: [PATCH 28/56] =?UTF-8?q?[Change]=20Performance=20increase=20for?= =?UTF-8?q?=20format=5Fdate()=20(Bug=20#37575=20-=20Patch=20by=20BartVB)?= =?UTF-8?q?=20[Change]=20Changed=20prosilver=20date=20separator=20from=20'?= =?UTF-8?q?on'=20to=20'=C2=BB'=20[Feature]=20Added=20'AGO'=20setting=20to?= =?UTF-8?q?=20relative=20date=20strings.=20For=20example:=20posted=2014=20?= =?UTF-8?q?minutes=20ago.=20(Patch=20by=20BartVB)=20[Fix]=20Extend=20verti?= =?UTF-8?q?cal=20line=20for=20last=20post=20column=20if=20no=20posts=20in?= =?UTF-8?q?=20forum=20(Bug=20#37125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9136 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 4 + phpBB/includes/session.php | 105 ++++++++++++------ phpBB/includes/ucp/ucp_main.php | 11 +- phpBB/language/en/common.php | 6 + .../prosilver/template/forumlist_body.html | 2 +- .../styles/prosilver/template/mcp_forum.html | 12 +- .../styles/prosilver/template/mcp_front.html | 6 +- phpBB/styles/prosilver/template/mcp_post.html | 14 +-- .../styles/prosilver/template/mcp_queue.html | 14 +-- .../prosilver/template/mcp_reports.html | 6 +- .../prosilver/template/posting_review.html | 6 +- .../template/posting_topic_review.html | 4 +- .../prosilver/template/search_results.html | 32 +++--- .../template/ucp_main_bookmarks.html | 10 +- .../prosilver/template/ucp_main_front.html | 4 +- .../template/ucp_main_subscribed.html | 19 ++-- .../prosilver/template/viewforum_body.html | 4 +- .../prosilver/template/viewtopic_body.html | 2 +- 18 files changed, 157 insertions(+), 104 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 618dd9d883..dcdebe91ef 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -98,9 +98,13 @@
    89. [Fix] Tell users to recreate the search index after changing the common word threshold for fulltext_native (Bug #36345)
    90. [Fix] Adjusted phpbb_chmod() to always set permissions for group bit.
    91. [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)
    92. +
    93. [Fix] Extend vertical line for last post column if no posts in forum (Bug #37125)
    94. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    95. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    96. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    97. +
    98. [Change] Performance increase for format_date() (Bug #37575 - Patch by BartVB)
    99. +
    100. [Change] Changed prosilver date separator from 'on' to '»'
    101. +
    102. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    103. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 2e697f6359..c1741de0fd 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1851,22 +1851,36 @@ class user extends session $args = func_get_args(); $key = $args[0]; + if (is_array($key)) + { + $lang = &$this->lang[array_shift($key)]; + + foreach ($key as $_key) + { + $lang = &$lang[$_key]; + } + } + else + { + $lang = &$this->lang[$key]; + } + // Return if language string does not exist - if (!isset($this->lang[$key]) || (!is_string($this->lang[$key]) && !is_array($this->lang[$key]))) + if (!isset($lang) || (!is_string($lang) && !is_array($lang))) { return $key; } // If the language entry is a string, we simply mimic sprintf() behaviour - if (is_string($this->lang[$key])) + if (is_string($lang)) { if (sizeof($args) == 1) { - return $this->lang[$key]; + return $lang; } // Replace key with language entry and simply pass along... - $args[0] = $this->lang[$key]; + $args[0] = $lang; return call_user_func_array('sprintf', $args); } @@ -1878,7 +1892,7 @@ class user extends session { if (is_int($args[$i])) { - $numbers = array_keys($this->lang[$key]); + $numbers = array_keys($lang); foreach ($numbers as $num) { @@ -1895,12 +1909,12 @@ class user extends session // Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form) if ($key_found === false) { - $numbers = array_keys($this->lang[$key]); + $numbers = array_keys($lang); $key_found = end($numbers); } // Use the language string we determined and pass it to sprintf() - $args[0] = $this->lang[$key][$key_found]; + $args[0] = $lang[$key_found]; return call_user_func_array('sprintf', $args); } @@ -2001,50 +2015,75 @@ class user extends session /** * Format user date + * + * @param int $gmepoch unix timestamp + * @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i. + * @param bool $forcedate force non-relative date format. + * + * @return mixed translated date */ function format_date($gmepoch, $format = false, $forcedate = false) { static $midnight; + static $date_cache; - $lang_dates = $this->lang['datetime']; $format = (!$format) ? $this->date_format : $format; + $delta = time() - $gmepoch; - // Short representation of month in format - if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) + if (!isset($date_cache[$format])) { - $lang_dates['May'] = $lang_dates['May_short']; + // Is the user requesting a friendly date format (i.e. 'Today 12:42')? + $date_cache[$format] = array( + 'is_short' => strpos($format, '|'), + 'zone_offset' => $this->timezone + $this->dst, + 'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1), + 'format_long' => str_replace('|', '', $format), + 'lang' => $this->lang['datetime'], + ); + + // Short representation of month in format? Some languages use different terms for the long and short format of May + if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false)) + { + $date_cache[$format]['lang']['May'] = $this->lang['datetime']['May_short']; + } } - unset($lang_dates['May_short']); + // Show date < 1 hour ago as 'xx min ago' + if ($delta <= 3600 && $delta && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO'])) + { + return $this->lang(array('datetime', 'AGO'), (int) floor($delta / 60)); + } if (!$midnight) { - list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $this->timezone + $this->dst)); - $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $this->timezone - $this->dst; + list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $date_cache[$format]['zone_offset'])); + $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $date_cache[$format]['zone_offset']; } - if (strpos($format, '|') === false || ($gmepoch < $midnight - 86400 && !$forcedate) || ($gmepoch > $midnight + 172800 && !$forcedate)) + if ($date_cache[$format]['is_short'] !== false && !$forcedate) { - return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); + $day = false; + + if ($gmepoch > $midnight + 86400) + { + $day = 'TOMORROW'; + } + else if ($gmepoch > $midnight) + { + $day = 'TODAY'; + } + else if ($gmepoch > $midnight - 86400) + { + $day = 'YESTERDAY'; + } + + if ($day !== false) + { + return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $date_cache[$format]['zone_offset']), $date_cache[$format]['lang'])); + } } - if ($gmepoch > $midnight + 86400 && !$forcedate) - { - $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); - return str_replace('||', $this->lang['datetime']['TOMORROW'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); - } - else if ($gmepoch > $midnight && !$forcedate) - { - $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); - return str_replace('||', $this->lang['datetime']['TODAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); - } - else if ($gmepoch > $midnight - 86400 && !$forcedate) - { - $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); - return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); - } - - return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates); + return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $date_cache[$format]['zone_offset']), $date_cache[$format]['lang']); } /** diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 73e4af8b04..6f4e525b2f 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -25,7 +25,7 @@ class ucp_main { var $p_master; var $u_action; - + function ucp_main(&$p_master) { $this->p_master = &$p_master; @@ -70,7 +70,7 @@ class ucp_main $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . ' WHERE forum_type = ' . FORUM_POST; - + if (sizeof($forum_ary)) { $sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true); @@ -258,7 +258,7 @@ class ucp_main { $forbidden_forums = $auth->acl_getf('!f_read', true); $forbidden_forums = array_unique(array_keys($forbidden_forums)); - + $sql_array = array( 'SELECT' => 'f.*', @@ -339,6 +339,7 @@ class ucp_main 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'FORUM_NAME' => $row['forum_name'], + 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'LAST_POST_SUBJECT' => $row['forum_last_post_subject'], 'LAST_POST_TIME' => $last_post_time, @@ -420,7 +421,7 @@ class ucp_main } $forbidden_forums = $auth->acl_getf('!f_read', true); $forbidden_forums = array_unique(array_keys($forbidden_forums)); - + $this->assign_topiclist('bookmarks', $forbidden_forums); break; @@ -676,7 +677,7 @@ class ucp_main 'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), - + 'ORDER_BY' => 't.topic_last_post_time DESC' ); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 93ad31e127..fab72b1780 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 => '%d minutes ago', + 1 => '%d minute ago', + 2 => '%d minutes ago', + 60 => '1 hour ago', + ), 'Sunday' => 'Sunday', 'Monday' => 'Monday', 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 @@
      {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 @@
    104. 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 @@
      {L_NEXT} - {L_PREVIOUS} - - + {L_PREVIOUS} + +
      diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index 484179e2ac..5dd1d9a823 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -29,7 +29,7 @@
      {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}

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

      {POST_SUBJECT}

      -

      {MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {POST_DATE}

      +

      {MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} » {POST_DATE}

      -   +   {S_FORM_TOKEN} @@ -70,7 +70,7 @@ {REPORTED_IMG} {L_MESSAGE_REPORTED}

      - +
      {POST_PREVIEW}
      @@ -125,7 +125,7 @@ - + @@ -174,7 +174,7 @@ {L_REPORTED_BY}: {usernotes.REPORT_BY} {L_REPORTED_ON_DATE} {usernotes.REPORT_AT}
      {usernotes.ACTION}
      - +
      @@ -194,7 +194,7 @@
      -   +   {S_FORM_TOKEN}
      @@ -214,7 +214,7 @@ {L_REPORTED_BY}: {reports.REPORTER}{reports.REPORTER} {L_REPORTED_ON_DATE} {reports.REPORT_TIME}

      {reports.REASON_TITLE}: {reports.REASON_DESC}
      {reports.REPORT_TEXT}

      - + diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index 0af3032fcf..57fb149257 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -21,7 +21,7 @@ {TOTAL} • {PAGE_NUMBER}{PAGINATION} • {PAGE_NUMBER} - +
      • @@ -38,12 +38,12 @@
      • {L_DELETED_TOPIC}

      • - +
      • {postrow.POST_SUBJECT}
        - {L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {postrow.POST_TIME} + {L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} » {postrow.POST_TIME}
        @@ -51,8 +51,8 @@ {L_FORUM}: {postrow.FORUM_NAME}
        - - + +
      • @@ -62,7 +62,7 @@
        {L_NEXT} - {L_PREVIOUS} + {L_PREVIOUS} @@ -76,7 +76,7 @@ {TOTAL} {PAGE_NUMBER}{PAGINATION} • {PAGE_NUMBER}
      • -
      +

      {L_NO_TOPICS_QUEUE}{L_UNAPPROVED_POSTS_ZERO_TOTAL}

      diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html index bc878f496c..4e9db078c2 100644 --- a/phpBB/styles/prosilver/template/mcp_reports.html +++ b/phpBB/styles/prosilver/template/mcp_reports.html @@ -21,7 +21,7 @@ {TOTAL_REPORTS} • {PAGE_NUMBER}{PAGINATION} • {PAGE_NUMBER} - +
      • @@ -38,7 +38,7 @@
        {postrow.POST_SUBJECT} {postrow.ATTACH_ICON_IMG}
        - {L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {postrow.POST_TIME} + {L_POSTED} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} » {postrow.POST_TIME}
        {postrow.REPORTER_FULL} {L_REPORTED_ON_DATE} {postrow.REPORT_TIME}
        @@ -74,7 +74,7 @@ -
        +
          diff --git a/phpBB/styles/prosilver/template/posting_review.html b/phpBB/styles/prosilver/template/posting_review.html index 5953ea11f9..10616901b6 100644 --- a/phpBB/styles/prosilver/template/posting_review.html +++ b/phpBB/styles/prosilver/template/posting_review.html @@ -5,10 +5,10 @@
        - +

        {post_review_row.POST_SUBJECT}

        -

        {post_review_row.MINI_POST_IMG}{post_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {post_review_row.POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {post_review_row.POST_DATE}

        +

        {post_review_row.MINI_POST_IMG}{post_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {post_review_row.POST_AUTHOR_FULL} » {post_review_row.POST_DATE}

        {post_review_row.MESSAGE}
        @@ -21,7 +21,7 @@
        - +
        diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index ad51e4f264..3f9c25cb2a 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -8,7 +8,7 @@
        - +
          @@ -17,7 +17,7 @@

          {topic_review_row.POST_SUBJECT}

          -

          {topic_review_row.MINI_POST_IMG}{topic_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {topic_review_row.POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {topic_review_row.POST_DATE}

          +

          {topic_review_row.MINI_POST_IMG}{topic_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {topic_review_row.POST_AUTHOR_FULL} » {topic_review_row.POST_DATE}

          {topic_review_row.MESSAGE}
          diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 9159b126f1..86b86e3d94 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -59,20 +59,20 @@ {searchresults.UNAPPROVED_IMG} {REPORTED_IMG}
          {searchresults.PAGINATION} - {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} {L_POSTED_ON_DATE} {searchresults.FIRST_POST_TIME} + {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} » {searchresults.FIRST_POST_TIME} {L_IN} {searchresults.FORUM_TITLE} ({L_GLOBAL})
          {searchresults.TOPIC_REPLIES}
          {searchresults.TOPIC_VIEWS}
          {L_POST_BY_AUTHOR} {searchresults.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
          {L_POSTED_ON_DATE} {searchresults.LAST_POST_TIME}
          + {LAST_POST_IMG}
          {searchresults.LAST_POST_TIME}
      - + @@ -87,37 +87,37 @@
      -
      - +
      + -
      +
      {searchresults.L_IGNORE_POST}
      -

      {searchresults.POST_SUBJECT}

      +

      {searchresults.POST_SUBJECT}

      {searchresults.MESSAGE}
      - +
      {L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}
      -
      {L_POSTED_ON_DATE} {searchresults.POST_DATE}
      -
       
      +
      {searchresults.POST_DATE}
      +
       
      {L_FORUM}: {searchresults.FORUM_TITLE}
      -
      {L_TOPIC}: {searchresults.TOPIC_TITLE}
      +
      {L_TOPIC}: {searchresults.TOPIC_TITLE}
      -
      {L_GLOBAL}: {searchresults.TOPIC_TITLE}
      +
      {L_GLOBAL}: {searchresults.TOPIC_TITLE}
      {L_REPLIES}: {searchresults.TOPIC_REPLIES}
      -
      {L_VIEWS}: {searchresults.TOPIC_VIEWS}
      -
      +
      {L_VIEWS}: {searchresults.TOPIC_VIEWS}
      + - + +
      diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html index a2bfb6cb9e..e92242223d 100644 --- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html @@ -6,9 +6,9 @@
      - +

      {L_BOOKMARKS_EXPLAIN}

      - +

      {L_BOOKMARKS_DISABLED}

      @@ -37,10 +37,10 @@ {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
      {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}
      {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
      {L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}
      + {LAST_POST_IMG}
      {topicrow.LAST_POST_TIME}
      @@ -64,7 +64,7 @@
      -
      +
      {S_FORM_TOKEN} diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index fa27a81ecb..a1b9fa440e 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -17,10 +17,10 @@
      style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
      {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}
      {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
      {L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}
      + {LAST_POST_IMG}
      {topicrow.LAST_POST_TIME}
      diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html index 582ee37459..49dc2d5625 100644 --- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html @@ -13,6 +13,7 @@
    105. {L_WATCHED_FORUMS}
      +
      {L_LAST_POST}
      {L_MARK}
    106. @@ -22,10 +23,11 @@
    107. -
      {forumrow.FORUM_NAME}
      - {L_LAST_POST} {forumrow.LAST_POST_AUTHOR_FULL} {LAST_POST_IMG} {L_POSTED_ON_DATE} {forumrow.LAST_POST_TIME} - {L_NO_POSTS} -
      +
      {forumrow.FORUM_NAME}
      {forumrow.FORUM_DESC}
      +
      {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR_FULL} + {LAST_POST_IMG}
      {forumrow.LAST_POST_TIME}
      + {L_NO_POSTS}
        +
    108. @@ -41,6 +43,7 @@
      {L_WATCHED_TOPICS}
      {L_LAST_POST}
      +
      {L_MARK}
      @@ -54,10 +57,10 @@ {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
      {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}
      {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
      {L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}
      + {LAST_POST_IMG}
      {topicrow.LAST_POST_TIME}
      @@ -73,12 +76,12 @@

      {L_NO_WATCHED_TOPICS}

      - +
      -
      +
      {S_FORM_TOKEN} diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index b3f81df865..6c69341bc2 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -142,12 +142,12 @@ {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
      {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}
      {topicrow.VIEWS} {L_VIEWS}
      {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} - {LAST_POST_IMG}
      {L_POSTED_ON_DATE} {topicrow.LAST_POST_TIME}
      + {LAST_POST_IMG}
      {topicrow.LAST_POST_TIME}
      diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index d949ba55e3..2b8ce06ace 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -136,7 +136,7 @@

      class="first"> {postrow.POST_SUBJECT}

      -

      {postrow.MINI_POST_IMG}{postrow.MINI_POST_IMG}{L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {postrow.POST_DATE}

      +

      {postrow.MINI_POST_IMG}{postrow.MINI_POST_IMG}{L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} » {postrow.POST_DATE}

      From 7752023b44d1b9283d9b5d6d6294d783b5ba42dc Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Nov 2008 16:53:36 +0000 Subject: [PATCH 29/56] force full date on "edited by" line. ;) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9138 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_pm_viewmessage.php | 2 +- phpBB/viewtopic.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 3f109b0771..45f5cf87a6 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -83,7 +83,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) if ($message_row['message_edit_count'] && $config['display_last_edited']) { $l_edit_time_total = ($message_row['message_edit_count'] == 1) ? $user->lang['EDITED_TIME_TOTAL'] : $user->lang['EDITED_TIMES_TOTAL']; - $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']), $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 { diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index b7b130bbd1..995874b6b5 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1348,7 +1348,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $display_username = get_username_string('full', $row['post_edit_user'], $post_edit_list[$row['post_edit_user']]['username'], $post_edit_list[$row['post_edit_user']]['user_colour']); } - $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time']), $row['post_edit_count']); + $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time'], false, true), $row['post_edit_count']); } else { @@ -1367,7 +1367,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $display_username = get_username_string('full', $row['post_edit_user'], $user_cache[$row['post_edit_user']]['username'], $user_cache[$row['post_edit_user']]['user_colour']); } - $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time']), $row['post_edit_count']); + $l_edited_by = sprintf($l_edit_time_total, $display_username, $user->format_date($row['post_edit_time'], false, true), $row['post_edit_count']); } } else From eac61e53f60f393c8db8c4058816392bfe367f1c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 30 Nov 2008 17:45:22 +0000 Subject: [PATCH 30/56] do not display ban link for own profile git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9140 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/memberlist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index bede7442fc..24dd5a9d49 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -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}") : '', From 5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 1 Dec 2008 17:04:11 +0000 Subject: [PATCH 31/56] Fix potential issues with the stat cache and phpbb_chmod() git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9144 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index d6f112e8d6..edb6d8ea5e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -511,6 +511,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) // Will most likely not work if (@chown($filename, $common_php_owner)); { + clearstatcache(false, $filename); $file_uid = fileowner($filename); } } @@ -520,6 +521,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) { if (@chgrp($filename, $common_php_group)); { + clearstatcache(false, $filename); $file_gid = filegroup($filename); } } @@ -568,6 +570,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0)); + clearstatcache(false, $filename); + if (!is_null($php) || (is_readable($filename) && is_writable($filename))) { break; @@ -577,6 +581,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'group': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0)); + clearstatcache(false, $filename); + if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { break; @@ -585,6 +591,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'other': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0)); + clearstatcache(false, $filename); + if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { break; From 30021ca5bce07eecaaee807baf5170482d2efa13 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 1 Dec 2008 17:27:59 +0000 Subject: [PATCH 32/56] stupid PHP manual :@ the two parameters to clearstatcache() are 5.3 only. Fix r9144 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9146 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index edb6d8ea5e..f92b4f91ab 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -511,7 +511,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) // Will most likely not work if (@chown($filename, $common_php_owner)); { - clearstatcache(false, $filename); + clearstatcache(); $file_uid = fileowner($filename); } } @@ -521,7 +521,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) { if (@chgrp($filename, $common_php_group)); { - clearstatcache(false, $filename); + clearstatcache(); $file_gid = filegroup($filename); } } @@ -570,7 +570,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0)); - clearstatcache(false, $filename); + clearstatcache(); if (!is_null($php) || (is_readable($filename) && is_writable($filename))) { @@ -581,7 +581,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'group': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0)); - clearstatcache(false, $filename); + clearstatcache(); if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { @@ -591,7 +591,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'other': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0)); - clearstatcache(false, $filename); + clearstatcache(); if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { From f766dccc3b7edaf850b0aff2dec6335b413cd4a3 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 2 Dec 2008 16:19:09 +0000 Subject: [PATCH 33/56] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9148 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_content.php | 93 ++++++++++++++-------------- 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index dcdebe91ef..21fbeff610 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -104,6 +104,7 @@

    109. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    110. [Change] Performance increase for format_date() (Bug #37575 - Patch by BartVB)
    111. [Change] Changed prosilver date separator from 'on' to '»'
    112. +
    113. [Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB)
    114. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    115. diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 88b7e77caa..2741d5ed17 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1144,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 @@ -1153,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][$mode]['colour']) ? '{USERNAME}' : '{USERNAME}'; + return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($_profile_cache[$cache_key][$mode]['colour'], $_profile_cache[$cache_key][$mode]['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) @@ -1170,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]; } /** From 353b7edc9abad9ceb0d9dc929e3efd9e2d75ee79 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 2 Dec 2008 16:23:32 +0000 Subject: [PATCH 34/56] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9150 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions.php | 39 +++++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 21fbeff610..0e6814d394 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -105,6 +105,7 @@
    116. [Change] Performance increase for format_date() (Bug #37575 - Patch by BartVB)
    117. [Change] Changed prosilver date separator from 'on' to '»'
    118. [Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB)
    119. +
    120. [Change] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB)
    121. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    122. diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f92b4f91ab..3ed71add61 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1831,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) { @@ -1843,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) { From 3cc422b22c43708bff474ede42f2a59ac9a97e20 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 2 Dec 2008 16:49:59 +0000 Subject: [PATCH 35/56] Make sure a style set to "default" is also always active. ;) (Bug #37475) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9152 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index c9ef818a67..3a021bb4cf 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -2176,6 +2176,12 @@ parse_css_file = {PARSE_CSS_FILE} $style_default = request_var('style_default', 0); $store_db = request_var('store_db', 0); + // 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 From 9ad79023b1bb6b088dc1426bb26f5f8675ee1ee2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 2 Dec 2008 17:02:56 +0000 Subject: [PATCH 36/56] Add same redirect disable_cd_check parameter to meta_refresh - #38065 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9153 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3ed71add61..55c4cc5b51 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2216,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 & From 83839139e6b55edadf3b0fb6fde75504f88d7364 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 2 Dec 2008 17:13:34 +0000 Subject: [PATCH 37/56] dumdidum... git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9155 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/INSTALL.html | 4 ++-- phpBB/includes/constants.php | 2 +- phpBB/install/convertors/convert_phpbb20.php | 2 +- phpBB/install/schemas/schema_data.sql | 2 +- phpBB/styles/prosilver/imageset/imageset.cfg | 2 +- phpBB/styles/prosilver/style.cfg | 2 +- phpBB/styles/prosilver/template/template.cfg | 2 +- phpBB/styles/prosilver/theme/theme.cfg | 2 +- phpBB/styles/subsilver2/imageset/imageset.cfg | 2 +- phpBB/styles/subsilver2/style.cfg | 2 +- phpBB/styles/subsilver2/template/template.cfg | 2 +- phpBB/styles/subsilver2/theme/theme.cfg | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) 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 @@

      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/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/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index da9bea3c05..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, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 71a7a8436a..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.4-dev'); +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/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/template.cfg b/phpBB/styles/prosilver/template/template.cfg index ebfc3f0d6b..372704e2b9 100644 --- a/phpBB/styles/prosilver/template/template.cfg +++ b/phpBB/styles/prosilver/template/template.cfg @@ -19,7 +19,7 @@ # General Information about this template name = prosilver copyright = © phpBB Group, 2007 -version = 3.0.3 +version = 3.0.4 # Defining a different template bitfield template_bitfield = lNg= diff --git a/phpBB/styles/prosilver/theme/theme.cfg b/phpBB/styles/prosilver/theme/theme.cfg index efed06babb..bbbf54109b 100644 --- a/phpBB/styles/prosilver/theme/theme.cfg +++ b/phpBB/styles/prosilver/theme/theme.cfg @@ -21,7 +21,7 @@ # General Information about this theme name = prosilver copyright = © phpBB Group, 2007 -version = 3.0.3 +version = 3.0.4 # Some configuration options diff --git a/phpBB/styles/subsilver2/imageset/imageset.cfg b/phpBB/styles/subsilver2/imageset/imageset.cfg index 16aced113d..81aefed058 100644 --- a/phpBB/styles/subsilver2/imageset/imageset.cfg +++ b/phpBB/styles/subsilver2/imageset/imageset.cfg @@ -19,7 +19,7 @@ # General Information about this style name = subsilver2 copyright = © phpBB Group, 2003 -version = 3.0.3 +version = 3.0.4 # Images img_site_logo = site_logo.gif*94*170 diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg index c9a93c15de..da327e16de 100644 --- a/phpBB/styles/subsilver2/style.cfg +++ b/phpBB/styles/subsilver2/style.cfg @@ -19,4 +19,4 @@ # General Information about this style name = subsilver2 copyright = © 2005 phpBB Group -version = 3.0.3 +version = 3.0.4 diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg index 47099947fc..104f7fbc4a 100644 --- a/phpBB/styles/subsilver2/template/template.cfg +++ b/phpBB/styles/subsilver2/template/template.cfg @@ -19,5 +19,5 @@ # General Information about this template name = subsilver2 copyright = © phpBB Group, 2003 -version = 3.0.3 +version = 3.0.4 diff --git a/phpBB/styles/subsilver2/theme/theme.cfg b/phpBB/styles/subsilver2/theme/theme.cfg index 7d5bdd0615..1b81ad3528 100644 --- a/phpBB/styles/subsilver2/theme/theme.cfg +++ b/phpBB/styles/subsilver2/theme/theme.cfg @@ -21,7 +21,7 @@ # General Information about this theme name = subsilver2 copyright = © phpBB Group, 2003 -version = 3.0.3 +version = 3.0.4 # Some configuration options From 41ad04c1550bd01a9eaa0a65e9d44e928194cc35 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 2 Dec 2008 18:48:25 +0000 Subject: [PATCH 38/56] Fix a regression from r9075 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9156 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/memberlist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 24dd5a9d49..38d5efad2f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1306,7 +1306,7 @@ switch ($mode) if (!$config['coppa_enable']) { - $sql .= " WHERE group_name <> 'REGISTERED_COPPA'"; + $sql .= " AND g.group_name <> 'REGISTERED_COPPA'"; } $sql .= ' ORDER BY g.group_name ASC'; From 10da18e82974374dda9dc6f4e1a90f2ccb403153 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Dec 2008 11:15:50 +0000 Subject: [PATCH 39/56] fix the no_profile one called after another mode with the same user_id and guest_username git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9160 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_content.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 2741d5ed17..1228f8e567 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1169,8 +1169,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', // 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][$mode]['colour']) ? '{USERNAME}' : '{USERNAME}'; - return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($_profile_cache[$cache_key][$mode]['colour'], $_profile_cache[$cache_key][$mode]['username']), $tpl); + $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]; From d4a7d7a8ad49fae04112f641dfc147b77320e993 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Dec 2008 11:18:31 +0000 Subject: [PATCH 40/56] Use "less than a minute ago" instead of "0 minutes ago" Use "Sent: {DATE}" in pm's, instead of "Sent at: {DATE}" git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9162 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/common.php | 2 +- phpBB/language/en/ucp.php | 6 +++--- phpBB/styles/prosilver/template/ucp_pm_viewfolder.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index fab72b1780..7e889db7d8 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -698,7 +698,7 @@ $lang = array_merge($lang, array( 'TOMORROW' => 'Tomorrow', 'YESTERDAY' => 'Yesterday', 'AGO' => array( - 0 => '%d minutes ago', + 0 => 'less than a minute ago', 1 => '%d minute ago', 2 => '%d minutes ago', 60 => '1 hour ago', 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/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index 86323a1c42..8211a4887e 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -74,7 +74,7 @@ {REPORTED_IMG} {messagerow.ATTACH_ICON_IMG}
      {L_MESSAGE_TO} {messagerow.RECIPIENTS}{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} {L_MESSAGE_SENT_ON} {messagerow.SENT_TIME} -
      {L_SENT_AT} {messagerow.SENT_TIME}
      +
      {L_SENT_AT}: {messagerow.SENT_TIME}
      {messagerow.FOLDER}{L_UNKNOWN_FOLDER}
      From 7261a3be677152d1fed7e28a3385d6d9237ea2e7 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 3 Dec 2008 11:59:42 +0000 Subject: [PATCH 41/56] missing entry git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9164 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0e6814d394..844254bf22 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -107,6 +107,7 @@
    123. [Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB)
    124. [Change] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB)
    125. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    126. +
    127. [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges.(Thanks Jorick)
    128. 1.ii. Changes since 3.0.2

      @@ -192,6 +193,7 @@
    129. [Change] MCP topic view checkboxes now default to unchecked.
    130. [Change] Adjust language key SPLIT_AFTER to make the action clearer.
    131. [Change] Add links to the post and forum when viewing a report from the MCP. (Bugs #33795, #33805)
    132. +
    133. [Change] Added CSRF protection to GET-only actions like marking forums.
    134. [Change] Remove NUL-Bytes directly in request_var() for strings and within the custom DBAL sql_escape() functions (MSSQL, Firebird, Oracle) (reported by AdhostMikeSw)
    135. [Feature] Allow limited inheritance for template sets.
    136. From 951a83546d9058f1bcff0c05a31932b1a765707f Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 3 Dec 2008 15:26:01 +0000 Subject: [PATCH 42/56] #38315 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9165 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/memberlist_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 957e3781f7..883f05b514 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -91,7 +91,7 @@ - +
      From 88ddcceb3bf8c15fee9c9bf0aee090bd9cab3fec Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Dec 2008 16:40:53 +0000 Subject: [PATCH 43/56] correctly update last topic/forum information if changing guest usernames through editing posts - Bug #38095 (Changelog follows) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9166 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 030ce72d7c..4d96fb9537 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -2137,10 +2137,20 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // this post is the latest post in the forum, better update if ($row['forum_last_post_id'] == $data['post_id']) { - if ($post_approved && $row['forum_last_post_subject'] !== $subject) + // If post approved and subject changed, or poster is anonymous, we need to update the forum_last* rows + if ($post_approved && ($row['forum_last_post_subject'] !== $subject || $data['poster_id'] == ANONYMOUS)) { - // the only data that can really be changed is the post's subject - $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = \'' . $db->sql_escape($subject) . '\''; + // the post's subject changed + if ($row['forum_last_post_subject'] !== $subject) + { + $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = \'' . $db->sql_escape($subject) . '\''; + } + + // Update the user name if poster is anonymous... just in case an admin changed it + if ($data['poster_id'] == ANONYMOUS) + { + $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape($username) . "'"; + } } else if ($data['post_approved'] !== $post_approved) { @@ -2277,6 +2287,12 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u { // only the subject can be changed from edit $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; + + // Maybe not only the subject, but also changing anonymous usernames. ;) + if ($data['poster_id'] == ANONYMOUS) + { + $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_poster_name = '" . $db->sql_escape($username) . "'"; + } } } else if (!$data['post_approved'] && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))) From 866e4196f4f50a41a1f176a17cc56609a13d4a10 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Dec 2008 16:48:06 +0000 Subject: [PATCH 44/56] every second commit an pre/post-commit error... :/ Ask for forum password if post within passworded forum quoted in private message (Reported by nickvergessen) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9168 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 4 +++- phpBB/includes/ucp/ucp_pm_compose.php | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 844254bf22..8185eba3a0 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -99,6 +99,7 @@
    137. [Fix] Adjusted phpbb_chmod() to always set permissions for group bit.
    138. [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)
    139. [Fix] Extend vertical line for last post column if no posts in forum (Bug #37125)
    140. +
    141. [Fix] correctly update last topic/forum information if changing guest usernames through editing posts (Bug #38095)
    142. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    143. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    144. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    145. @@ -107,7 +108,8 @@
    146. [Change] Performance increase for get_username_string() (Bug #37545 - Patch by BartVB)
    147. [Change] Slight performance increase for common parameter calls to append_sid() (Bug #37555 - Patch by BartVB)
    148. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    149. -
    150. [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges.(Thanks Jorick)
    151. +
    152. [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges. (Reported by Jorick)
    153. +
    154. [Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)
    155. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index ba06315363..d451e25be4 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -259,6 +259,25 @@ function compose_pm($id, $mode, $action) { trigger_error('NOT_AUTHORISED'); } + + // Passworded forum? + if ($post['forum_id']) + { + $sql = 'SELECT forum_password + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . (int) $post['forum_id']; + $result = $db->sql_query($sql); + $forum_password = (string) $db->sql_fetchfield('forum_password'); + $db->sql_freeresult($result); + + if ($forum_password) + { + login_forum_box(array( + 'forum_id' => $post['forum_id'], + 'forum_password' => $forum_password, + )); + } + } } $msg_id = (int) $post['msg_id']; From 23d9700f0737fdd547bda3e7d910300be4127120 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 4 Dec 2008 12:56:12 +0000 Subject: [PATCH 45/56] Give a small tolerence to timestamps in the future when displaying times as 'minutes ago' git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9170 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index c1741de0fd..c7d287181b 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2028,7 +2028,8 @@ class user extends session static $date_cache; $format = (!$format) ? $this->date_format : $format; - $delta = time() - $gmepoch; + $now = time(); + $delta = $now - $gmepoch; if (!isset($date_cache[$format])) { @@ -2048,10 +2049,11 @@ class user extends session } } - // Show date < 1 hour ago as 'xx min ago' - if ($delta <= 3600 && $delta && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO'])) + // Show date <= 1 hour ago as 'xx min ago' + // A small tolerence is given for times in the future and times in the future but in the same minute are displayed as '< than a minute ago' + if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO'])) { - return $this->lang(array('datetime', 'AGO'), (int) floor($delta / 60)); + return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60))); } if (!$midnight) From a41e8c101d3211b915cc065b27f494aa3bb8a741 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 4 Dec 2008 14:53:04 +0000 Subject: [PATCH 46/56] fix postcount resync for situations where low and high post ids are higher than step value, resulting in users having 0 posts. (Bug #38195) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9171 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/acp/acp_main.php | 39 ++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8185eba3a0..d0f72a9784 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -100,6 +100,7 @@
    156. [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)
    157. [Fix] Extend vertical line for last post column if no posts in forum (Bug #37125)
    158. [Fix] correctly update last topic/forum information if changing guest usernames through editing posts (Bug #38095)
    159. +
    160. [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)
    161. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    162. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    163. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    164. 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'); From 945e6e1e78d610fcbf116a2ecf45d47ec4370a97 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 4 Dec 2008 16:56:56 +0000 Subject: [PATCH 47/56] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9172 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/search/fulltext_native.php | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d0f72a9784..d0de2c9a50 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -111,6 +111,7 @@
    165. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    166. [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges. (Reported by Jorick)
    167. [Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)
    168. +
    169. [Fix] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005)
    170. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 0a3fe3754f..b1a035ff43 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -455,6 +455,7 @@ class fulltext_native extends search_backend ); $title_match = ''; + $left_join_topics = false; $group_by = true; // Build some display specific sql strings switch ($fields) @@ -464,7 +465,7 @@ class fulltext_native extends search_backend $group_by = false; // no break case 'firstpost': - $sql_array['FROM'][TOPICS_TABLE] = 't'; + $left_join_topics = true; $sql_where[] = 'p.post_id = t.topic_first_post_id'; break; @@ -476,11 +477,7 @@ class fulltext_native extends search_backend if ($type == 'topics') { - if (!isset($sql_array['FROM'][TOPICS_TABLE])) - { - $sql_array['FROM'][TOPICS_TABLE] = 't'; - $sql_where[] = 'p.topic_id = t.topic_id'; - } + $left_join_topics = true; $group_by = true; } @@ -688,11 +685,7 @@ class fulltext_native extends search_backend break; case 't': - if (!isset($sql_array['FROM'][TOPICS_TABLE])) - { - $sql_array['FROM'][TOPICS_TABLE] = 't'; - $sql_where[] = 'p.topic_id = t.topic_id'; - } + $left_join_topics = true; break; case 'f': @@ -700,6 +693,14 @@ class fulltext_native extends search_backend $sql_where[] = 'f.forum_id = p.forum_id'; break; } + + if ($left_join_topics) + { + $sql_array['LEFT_JOIN'][$left_join_topics] = array( + 'FROM' => TOPICS_TABLE => 't', + 'ON' => 'p.topic_id = t.topic_id' + ); + } $sql_array['WHERE'] = implode(' AND ', $sql_where); $sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : ''; From c931ce3a54bb76543a133cef0d91984a083874ae Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 4 Dec 2008 17:01:39 +0000 Subject: [PATCH 48/56] not quite git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9173 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/search/fulltext_native.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index b1a035ff43..1c6a64d07c 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -697,7 +697,7 @@ class fulltext_native extends search_backend if ($left_join_topics) { $sql_array['LEFT_JOIN'][$left_join_topics] = array( - 'FROM' => TOPICS_TABLE => 't', + 'FROM' => array(TOPICS_TABLE => 't'), 'ON' => 'p.topic_id = t.topic_id' ); } From 00d870676574b7555625f1573c73d4a22f16be38 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 4 Dec 2008 19:58:42 +0000 Subject: [PATCH 49/56] - Do not show 'Forward' button if the user cannot send PM's. - Correct colspan on prosilver mcp_front.html. #37515 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9174 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 3 ++- phpBB/includes/ucp/ucp_pm_viewmessage.php | 2 +- phpBB/styles/prosilver/template/mcp_front.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d0de2c9a50..a468ef6976 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -101,6 +101,8 @@
    171. [Fix] Extend vertical line for last post column if no posts in forum (Bug #37125)
    172. [Fix] correctly update last topic/forum information if changing guest usernames through editing posts (Bug #38095)
    173. [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)
    174. +
    175. [Fix] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005)
    176. +
    177. [Fix] Do not show 'Forward' button if the user cannot send PM's
    178. [Change] Alllow applications to set custom module inclusion path (idea by HoL)
    179. [Change] Handle checking for duplicate usernames in chunks (Bug #17285 - Patch by A_Jelly_Doughnut)
    180. [Change] Better handling and finer control for custom profile fields visibility options. (Patch by Highway of Life)
    181. @@ -111,7 +113,6 @@
    182. [Feature] Added 'AGO' setting to relative date strings. For example: posted 14 minutes ago. (Patch by BartVB)
    183. [Sec] Fixed an issue where deactivated accounts could be re-activated without the required privileges. (Reported by Jorick)
    184. [Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)
    185. -
    186. [Fix] Use a left join for the topics table on search to avoid trouble with FROM syntax on some databases (Bug #37005)
    187. 1.ii. Changes since 3.0.2

      diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 45f5cf87a6..bdd0e44ea8 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -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/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index 5dd1d9a823..e0152391b9 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -129,7 +129,7 @@
      - + From 5c7dcec0738c8c99535a0789a357e4f92a8dad9f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 5 Dec 2008 11:18:59 +0000 Subject: [PATCH 50/56] Enforce a requirement for some DBMS (Oracle, PostgreSQL, MSSQL) where the table order is quite important in some situations. ;) Since this does not affect the operation of the other DBMS the code is placed into dbal.php. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9175 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/dbal.php | 47 +++++++++++++++++++++++++++++++++++- phpBB/includes/db/oracle.php | 2 +- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 179eff65d2..c4ae50dea0 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -500,7 +500,8 @@ 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(); foreach ($array['FROM'] as $table_name => $alias) { if (is_array($alias)) @@ -508,14 +509,58 @@ class dbal 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 multiple tables in the FROM statement the last table need to match the first LEFT JOIN'ed table. + // DBMS who rely on this (at the moment i only spotted it on multi-aliases): Oracle, PostgreSQL and MSSQL + $first_join_match = false; + + if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1) + { + // 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 (!empty($matches[1])) + { + $first_join_match = trim($matches[1]); + } + } + + // If there is a first join match, we need to make sure the table order is correct + if ($first_join_match !== false) + { + $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); + } + $sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array)); if (!empty($array['LEFT_JOIN'])) 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) . ')'; From 23de8dd0ce9249105711dfbf2d28e7042476af8b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 5 Dec 2008 11:36:51 +0000 Subject: [PATCH 51/56] make it obvious that even if the files got uploaded on an update that it is not finished yet... by replacing "Check files again" with "Continue update now" git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9177 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_update.html | 2 +- phpBB/language/en/install.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 2448f1d39b..c0dc185361 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -63,7 +63,7 @@

      {L_UPDATE_SUCCESS_EXPLAIN}

      - +
      diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 0549495b47..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', From 689831ecddd66ce35adcb807aae3be1645df376c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 6 Dec 2008 11:11:10 +0000 Subject: [PATCH 52/56] Re-arrange the re-order code to only run if multi-aliases are used git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9178 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/dbal.php | 44 ++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index c4ae50dea0..b530a572da 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -502,10 +502,14 @@ class dbal // 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; @@ -520,11 +524,9 @@ class dbal } // We run the following code to determine if we need to re-order the table array. ;) - // The reason for this is that for multiple tables in the FROM statement the last table need to match the first LEFT JOIN'ed table. - // DBMS who rely on this (at the moment i only spotted it on multi-aliases): Oracle, PostgreSQL and MSSQL - $first_join_match = false; - - if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1) + // 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']); @@ -532,33 +534,29 @@ class dbal // 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(); - // If there is a first join match, we need to make sure the table order is correct - if ($first_join_match !== false) - { - $table_array = $last = array(); - - foreach ($array['FROM'] as $table_name => $alias) - { - if (is_array($alias)) + foreach ($array['FROM'] as $table_name => $alias) { - foreach ($alias as $multi_alias) + if (is_array($alias)) { - ($multi_alias === $first_join_match) ? $last[] = $table_name . ' ' . $multi_alias : $table_array[] = $table_name . ' ' . $multi_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; } } - else - { - ($alias === $first_join_match) ? $last[] = $table_name . ' ' . $alias : $table_array[] = $table_name . ' ' . $alias; - } - } - $table_array = array_merge($table_array, $last); + $table_array = array_merge($table_array, $last); + } } $sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array)); From ba3dc57ca267af51d46ad55407f68590297a6fe4 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sat, 6 Dec 2008 18:23:42 +0000 Subject: [PATCH 53/56] Add in missing free result on DB query git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9179 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_modules.php | 2 ++ 1 file changed, 2 insertions(+) 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; From b34f4623146798e18a1021b2ebe716566e68cea8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Dec 2008 15:18:42 +0000 Subject: [PATCH 54/56] forgot to change this one - related to revision #r9136 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9182 89ea8834-ac86-4346-8a33-228a782c2dd0 --- .../prosilver/template/ucp_pm_viewfolder.html | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index 8211a4887e..a8750a03f0 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -9,7 +9,7 @@

      {L_EXPORT_AS_CSV}

      -
      +

      {L_OPTIONS}

      @@ -19,10 +19,10 @@
      -
      +
      -
      -
      +
      +
        @@ -38,13 +38,13 @@

      {RULE_REMOVED_MESSAGES}

      - +

      {NOT_MOVED_MESSAGES}
      {RELEASE_MESSAGE_INFO}

      -
      + - +
      • @@ -55,7 +55,7 @@
        - +
      • @@ -72,7 +72,7 @@ {REPORTED_IMG} {messagerow.ATTACH_ICON_IMG}
        - {L_MESSAGE_TO} {messagerow.RECIPIENTS}{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} {L_MESSAGE_SENT_ON} {messagerow.SENT_TIME} + {L_MESSAGE_TO} {messagerow.RECIPIENTS}{L_MESSAGE_BY_AUTHOR} {messagerow.MESSAGE_AUTHOR_FULL} » {messagerow.SENT_TIME}
        {L_SENT_AT}: {messagerow.SENT_TIME}
        {messagerow.FOLDER}{L_UNKNOWN_FOLDER}
        @@ -80,21 +80,21 @@
      • - +

      {L_NO_MESSAGES}

      - +

      - +

      - + - - + +
      {L_PREVIOUS} {L_NEXT} - - + +
      From 141eeec9153ae000be02478e0b85813ad3cf0b91 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 8 Dec 2008 14:37:33 +0000 Subject: [PATCH 55/56] Tag phpBB 3.0.4-RC1 git-svn-id: file:///svn/phpbb/tags/release_3_0_4_RC1@9183 89ea8834-ac86-4346-8a33-228a782c2dd0 From a94c760650a9454d1ac33b30243898eae57f8f4f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 13 Dec 2008 12:03:47 +0000 Subject: [PATCH 56/56] Move tag 3_0_0_RC1 to 3_0_0-RC1, i tagged it wrongly git-svn-id: file:///svn/phpbb/tags/release_3_0_4-RC1@9189 89ea8834-ac86-4346-8a33-228a782c2dd0
       
      {L_NO_ENTRIES}{L_NO_ENTRIES}