From 9b30bd639201ffbbf1d1b3ae32fda7e75d3253dd Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 24 Mar 2012 12:57:28 +0530 Subject: [PATCH 01/20] [ticket/10650] Displaying last topic on forum list The most recent topic title of the forum can now be displayed on the board index. An option is provided in the ACP under the 'General Forum Setting' which allows the admin to enable or disable this feature. PHPBB3-10650 --- phpBB/adm/style/acp_forums.html | 5 +++++ phpBB/develop/create_schema_files.php | 1 + phpBB/includes/acp/acp_forums.php | 4 ++++ phpBB/includes/functions_display.php | 1 + phpBB/install/database_update.php | 3 +++ phpBB/language/en/acp/forums.php | 2 ++ phpBB/styles/prosilver/template/forumlist_body.html | 5 ++++- 7 files changed, 20 insertions(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 048a24a328..ec82947f92 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -237,6 +237,11 @@
+
+

{L_DISPLAY_LAST_SUBJECT_EXPLAIN}
+
+
+

{L_FORUM_TOPICS_PAGE_EXPLAIN}
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 4088657743..067ad198e3 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1109,6 +1109,7 @@ function get_schema_struct() 'forum_options' => array('UINT:20', 0), 'display_subforum_list' => array('BOOL', 1), 'display_on_index' => array('BOOL', 1), + 'display_last_subject' => array('BOOL', 1), 'enable_indexing' => array('BOOL', 1), 'enable_icons' => array('BOOL', 1), 'enable_prune' => array('BOOL', 0), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 3a3b2021eb..29eabba0c7 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -133,6 +133,7 @@ class acp_forums 'forum_style' => request_var('forum_style', 0), 'display_subforum_list' => request_var('display_subforum_list', false), 'display_on_index' => request_var('display_on_index', false), + 'display_last_subject' => request_var('display_last_subject',true), 'forum_topics_per_page' => request_var('topics_per_page', 0), 'enable_indexing' => request_var('enable_indexing', true), 'enable_icons' => request_var('enable_icons', false), @@ -444,6 +445,7 @@ class acp_forums 'enable_prune' => false, 'prune_days' => 7, 'prune_viewed' => 7, + 'display_last_subject' => 0, 'prune_freq' => 1, 'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS, 'forum_options' => 0, @@ -636,6 +638,7 @@ class acp_forums 'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false, 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, 'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false, + 'S_DISPLAY_SUBJECT' => ($forum_data['display_last_subject']) ? true : false, 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false, @@ -804,6 +807,7 @@ class acp_forums 'FORUM_TOPICS' => $row['forum_topics'], 'FORUM_POSTS' => $row['forum_posts'], + 'S_DISPLAY_SUBJECT' => ($row['display_last_subject']) ? true : false, 'S_FORUM_LINK' => ($forum_type == FORUM_LINK) ? true : false, 'S_FORUM_POST' => ($forum_type == FORUM_POST) ? true : false, diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 18db64cc68..9b80763ee4 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -451,6 +451,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, + 'S_DISPLAY_SUBJECT' => ($row['display_last_subject']) ? true : false, 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false, 'FORUM_ID' => $row['forum_id'], diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a84136388c..509e991c81 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1084,6 +1084,9 @@ function database_update_info() GROUPS_TABLE => array( 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), ), + FORUMS_TABLE => array( + 'display_last_subject' => array('BOOL', 1), + ), PROFILE_FIELDS_TABLE => array( 'field_show_on_pm' => array('BOOL', 0), ), diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 756cb7ae0f..d456e8693d 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -57,6 +57,8 @@ $lang = array_merge($lang, array( 'DELETE_ALL_POSTS' => 'Delete posts', 'DELETE_SUBFORUMS' => 'Delete subforums and posts', 'DISPLAY_ACTIVE_TOPICS' => 'Enable active topics', + 'DISPLAY_LAST_SUBJECT' => 'Display last added post title on forum list', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'If set to yes the title of the last added post will be displayed in the forum list with a hyperlink to the post.', 'DISPLAY_ACTIVE_TOPICS_EXPLAIN' => 'If set to yes active topics in selected subforums will be displayed under this category.', 'EDIT_FORUM' => 'Edit forum', diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index d6596203e5..e1070ca23d 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -44,7 +44,10 @@
{forumrow.POSTS} {L_POSTS}
{UNAPPROVED_IMG} - {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} + {L_LAST_POST} + + {forumrow.LAST_POST_SUBJECT} + {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
 
From 668e47721c3566667c07c6892dcd2d55012e43b3 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sun, 25 Mar 2012 01:39:34 +0530 Subject: [PATCH 02/20] [ticket/10650] Added static sql files Ran create_schema_files.php and added the generated static sql files to the commit. PHPBB3-10650 --- 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 | 1 + phpBB/install/schemas/sqlite_schema.sql | 1 + 7 files changed, 7 insertions(+) diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 51565ef2d4..950362e746 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -376,6 +376,7 @@ CREATE TABLE phpbb_forums ( forum_options INTEGER DEFAULT 0 NOT NULL, display_subforum_list INTEGER DEFAULT 1 NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL, + display_last_subject INTEGER DEFAULT 1 NOT NULL, enable_indexing INTEGER DEFAULT 1 NOT NULL, enable_icons INTEGER DEFAULT 1 NOT NULL, enable_prune INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 2c78dd009f..90a9563760 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -455,6 +455,7 @@ CREATE TABLE [phpbb_forums] ( [forum_options] [int] DEFAULT (0) NOT NULL , [display_subforum_list] [int] DEFAULT (1) NOT NULL , [display_on_index] [int] DEFAULT (1) NOT NULL , + [display_last_subject] [int] DEFAULT (1) NOT NULL , [enable_indexing] [int] DEFAULT (1) NOT NULL , [enable_icons] [int] DEFAULT (1) NOT NULL , [enable_prune] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index d19f1930d0..7f7225463d 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -262,6 +262,7 @@ CREATE TABLE phpbb_forums ( forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + display_last_subject tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_prune 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 3fd8d4f1d1..cd23c6ec86 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -262,6 +262,7 @@ CREATE TABLE phpbb_forums ( forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, + display_last_subject tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 8a0f3e56b1..0fe1eb9acb 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -522,6 +522,7 @@ CREATE TABLE phpbb_forums ( forum_options number(20) DEFAULT '0' NOT NULL, display_subforum_list number(1) DEFAULT '1' NOT NULL, display_on_index number(1) DEFAULT '1' NOT NULL, + display_last_subject number(1) DEFAULT '1' NOT NULL, enable_indexing number(1) DEFAULT '1' NOT NULL, enable_icons number(1) DEFAULT '1' NOT NULL, enable_prune number(1) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index c624024362..91e5629791 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -398,6 +398,7 @@ CREATE TABLE phpbb_forums ( forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0), display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0), display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0), + display_last_subject INT2 DEFAULT '1' NOT NULL CHECK (display_last_subject >= 0), enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0), enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0), enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0), diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index bd002c93ed..090ae0911b 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -255,6 +255,7 @@ CREATE TABLE phpbb_forums ( forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0', display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1', display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1', + display_last_subject INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0', From 492c27a6935aa1fe3165ee3cd89897496fa153d1 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 31 Mar 2012 22:41:41 +0530 Subject: [PATCH 03/20] [ticket/10650] Changed language files and forumlist The entry in languages have been changed from title to subject. Also the IF condition in forumlist_body.html has been properly intented. PHPBB3-10650 --- phpBB/language/en/acp/forums.php | 4 ++-- phpBB/styles/prosilver/template/forumlist_body.html | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index d456e8693d..9141abc8eb 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -57,8 +57,8 @@ $lang = array_merge($lang, array( 'DELETE_ALL_POSTS' => 'Delete posts', 'DELETE_SUBFORUMS' => 'Delete subforums and posts', 'DISPLAY_ACTIVE_TOPICS' => 'Enable active topics', - 'DISPLAY_LAST_SUBJECT' => 'Display last added post title on forum list', - 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'If set to yes the title of the last added post will be displayed in the forum list with a hyperlink to the post.', + 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'If set to yes the subject of the last added post will be displayed in the forum list with a hyperlink to the post.', 'DISPLAY_ACTIVE_TOPICS_EXPLAIN' => 'If set to yes active topics in selected subforums will be displayed under this category.', 'EDIT_FORUM' => 'Edit forum', diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index e1070ca23d..17454ed330 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -46,7 +46,8 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT} + {forumrow.LAST_POST_SUBJECT} + {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
  From bc21dec9c07a9566d60d775b2c25d8065b503764 Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 31 Mar 2012 23:25:13 +0530 Subject: [PATCH 04/20] [ticket/10650] Corrected space before true Inserted a space before 'true' as per coding guidelines. PHPBB3-10650 --- phpBB/includes/acp/acp_forums.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 29eabba0c7..5323a0e4e6 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -133,7 +133,7 @@ class acp_forums 'forum_style' => request_var('forum_style', 0), 'display_subforum_list' => request_var('display_subforum_list', false), 'display_on_index' => request_var('display_on_index', false), - 'display_last_subject' => request_var('display_last_subject',true), + 'display_last_subject' => request_var('display_last_subject', true), 'forum_topics_per_page' => request_var('topics_per_page', 0), 'enable_indexing' => request_var('enable_indexing', true), 'enable_icons' => request_var('enable_icons', false), From 720fc46807f92364321bcb26291eafea1688c5ca Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 3 Apr 2012 21:36:26 +0530 Subject: [PATCH 05/20] [ticket/10650] Cropped subject and inserted newline The subject being displayed in the forum list have been shortened to 30 characters. Also it is now being shown in a separate line. PHPBB3-10650 --- phpBB/includes/functions_display.php | 5 +++++ phpBB/styles/prosilver/template/forumlist_body.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 9b80763ee4..b331ed7d71 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,6 +397,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_id']) { $last_post_subject = $row['forum_last_post_subject']; + if (strlen($last_post_subject) > 30) + { + $last_post_subject = substr($last_post_subject, 0, 30); + $last_post_subject .= '...'; + } $last_post_time = $user->format_date($row['forum_last_post_time']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; } diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 17454ed330..68df81932a 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -46,7 +46,7 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT} + {forumrow.LAST_POST_SUBJECT}
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
  From 4bb20d7ceaf4d8f2cf19fa7f79ba239156326045 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 5 Apr 2012 00:39:52 +0530 Subject: [PATCH 06/20] [ticket/10650]Added permission checking and utf8 functions Passworded forums and ones in which user doesn't have read access will be excluded. Also uft8 based string functions and html encode/decode functions have been used to sanitise subject. PHPBB3-10650 --- phpBB/includes/functions_display.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index b331ed7d71..8e0005eadf 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,9 +397,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_id']) { $last_post_subject = $row['forum_last_post_subject']; - if (strlen($last_post_subject) > 30) - { - $last_post_subject = substr($last_post_subject, 0, 30); + if (utf8_strlen(htmlspecialchars_decode($last_post_subject)) > 30) + { + $last_post_subject = htmlspecialchars(utf8_substr(htmlspecialchars_decode($last_post_subject, 0, 30))); $last_post_subject .= '...'; } $last_post_time = $user->format_date($row['forum_last_post_time']); @@ -456,7 +456,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, - 'S_DISPLAY_SUBJECT' => ($row['display_last_subject']) ? true : false, + 'S_DISPLAY_SUBJECT' => ($row['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false, 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false, 'FORUM_ID' => $row['forum_id'], From 630c0397b9a1735fc60ef3704be41d05e4929ceb Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 5 Apr 2012 01:19:46 +0530 Subject: [PATCH 07/20] [ticket/10650] Corrected intendation Corrected the intendation of if condition. PHPBB3-10650 --- phpBB/includes/functions_display.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 8e0005eadf..a28f546be0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -398,10 +398,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { $last_post_subject = $row['forum_last_post_subject']; if (utf8_strlen(htmlspecialchars_decode($last_post_subject)) > 30) - { - $last_post_subject = htmlspecialchars(utf8_substr(htmlspecialchars_decode($last_post_subject, 0, 30))); - $last_post_subject .= '...'; - } + { + $last_post_subject = htmlspecialchars(utf8_substr(htmlspecialchars_decode($last_post_subject, 0, 30))); + $last_post_subject .= '...'; + } $last_post_time = $user->format_date($row['forum_last_post_time']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; } From 2a8481d68188480061e9769711195091f05f7134 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 5 Apr 2012 02:02:02 +0530 Subject: [PATCH 08/20] [ticket/10650] Added checking for empty subjects Now empty subjects will not be displayed in a new line on the forum list. PHPBB3-10650 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a28f546be0..4e70a4911c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -456,7 +456,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, - 'S_DISPLAY_SUBJECT' => ($row['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false, + 'S_DISPLAY_SUBJECT' => ($last_post_subject && $row['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false, 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false, 'FORUM_ID' => $row['forum_id'], From c524236ef6d84f6ef78f684aeb7bb469ca844db4 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Fri, 6 Apr 2012 01:07:23 +0530 Subject: [PATCH 09/20] [ticket/10650] Changed acp option from per forum to global Changed the display last subject acp toggle option from per forum to global. Modified associated database entries. New option is available in ACP General->Board Features. Also corrected
in forumlist_body.html. PHPBB3-10650 --- phpBB/adm/style/acp_forums.html | 5 ----- phpBB/develop/create_schema_files.php | 1 - phpBB/includes/acp/acp_board.php | 1 + phpBB/includes/functions_display.php | 2 +- phpBB/install/database_update.php | 10 +++++++--- 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 | 1 - phpBB/install/schemas/sqlite_schema.sql | 1 - phpBB/language/en/acp/board.php | 2 ++ phpBB/language/en/acp/forums.php | 2 -- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- 15 files changed, 12 insertions(+), 20 deletions(-) diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index ec82947f92..048a24a328 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -237,11 +237,6 @@
-
-

{L_DISPLAY_LAST_SUBJECT_EXPLAIN}
-
-
-

{L_FORUM_TOPICS_PAGE_EXPLAIN}
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 067ad198e3..4088657743 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1109,7 +1109,6 @@ function get_schema_struct() 'forum_options' => array('UINT:20', 0), 'display_subforum_list' => array('BOOL', 1), 'display_on_index' => array('BOOL', 1), - 'display_last_subject' => array('BOOL', 1), 'enable_indexing' => array('BOOL', 1), 'enable_icons' => array('BOOL', 1), 'enable_prune' => array('BOOL', 0), diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 58b55eeddb..7bd51b5e0d 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -88,6 +88,7 @@ class acp_board 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'display_last_subject' => array('lang' => 'DISPLAY_LAST_SUBJECT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true), 'legend2' => 'ACP_LOAD_SETTINGS', diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 4e70a4911c..99adf6f6a7 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -456,7 +456,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, - 'S_DISPLAY_SUBJECT' => ($last_post_subject && $row['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false, + 'S_DISPLAY_SUBJECT' => ($last_post_subject && $config['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? true : false, 'S_FEED_ENABLED' => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options']) && $row['forum_type'] == FORUM_POST) ? true : false, 'FORUM_ID' => $row['forum_id'], diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 509e991c81..89b252e3fa 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1084,9 +1084,6 @@ function database_update_info() GROUPS_TABLE => array( 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), ), - FORUMS_TABLE => array( - 'display_last_subject' => array('BOOL', 1), - ), PROFILE_FIELDS_TABLE => array( 'field_show_on_pm' => array('BOOL', 0), ), @@ -2397,8 +2394,15 @@ function change_database_data(&$no_updates, $version) $sql = 'INSERT INTO ' . STYLES_TABLE . " (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '© phpBB Group', 1, 'prosilver', 'kNg=', 0, '')"; _sql($sql, $errored, $error_ary); + //Create config value for displaying last subject on forum list + if(!isset($config['display_last_subject'])) + { + $config->set("display_last_subject", '1'); + } + $no_updates = false; break; } } + diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 950362e746..51565ef2d4 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -376,7 +376,6 @@ CREATE TABLE phpbb_forums ( forum_options INTEGER DEFAULT 0 NOT NULL, display_subforum_list INTEGER DEFAULT 1 NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL, - display_last_subject INTEGER DEFAULT 1 NOT NULL, enable_indexing INTEGER DEFAULT 1 NOT NULL, enable_icons INTEGER DEFAULT 1 NOT NULL, enable_prune INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 90a9563760..2c78dd009f 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -455,7 +455,6 @@ CREATE TABLE [phpbb_forums] ( [forum_options] [int] DEFAULT (0) NOT NULL , [display_subforum_list] [int] DEFAULT (1) NOT NULL , [display_on_index] [int] DEFAULT (1) NOT NULL , - [display_last_subject] [int] DEFAULT (1) NOT NULL , [enable_indexing] [int] DEFAULT (1) NOT NULL , [enable_icons] [int] DEFAULT (1) NOT NULL , [enable_prune] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 7f7225463d..d19f1930d0 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -262,7 +262,6 @@ CREATE TABLE phpbb_forums ( forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - display_last_subject tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_prune 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 cd23c6ec86..3fd8d4f1d1 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -262,7 +262,6 @@ CREATE TABLE phpbb_forums ( forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - display_last_subject tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 0fe1eb9acb..8a0f3e56b1 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -522,7 +522,6 @@ CREATE TABLE phpbb_forums ( forum_options number(20) DEFAULT '0' NOT NULL, display_subforum_list number(1) DEFAULT '1' NOT NULL, display_on_index number(1) DEFAULT '1' NOT NULL, - display_last_subject number(1) DEFAULT '1' NOT NULL, enable_indexing number(1) DEFAULT '1' NOT NULL, enable_icons number(1) DEFAULT '1' NOT NULL, enable_prune number(1) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 91e5629791..c624024362 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -398,7 +398,6 @@ CREATE TABLE phpbb_forums ( forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0), display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0), display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0), - display_last_subject INT2 DEFAULT '1' NOT NULL CHECK (display_last_subject >= 0), enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0), enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0), enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0), diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 090ae0911b..bd002c93ed 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -255,7 +255,6 @@ CREATE TABLE phpbb_forums ( forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0', display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1', display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1', - display_last_subject INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 0bb99b5449..187d823fd0 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -44,6 +44,8 @@ $lang = array_merge($lang, array( 'DEFAULT_STYLE' => 'Default style', 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', + 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and ones in which user doesnt have read access are not shown.', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'SITE_DESC' => 'Site description', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 9141abc8eb..756cb7ae0f 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -57,8 +57,6 @@ $lang = array_merge($lang, array( 'DELETE_ALL_POSTS' => 'Delete posts', 'DELETE_SUBFORUMS' => 'Delete subforums and posts', 'DISPLAY_ACTIVE_TOPICS' => 'Enable active topics', - 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', - 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'If set to yes the subject of the last added post will be displayed in the forum list with a hyperlink to the post.', 'DISPLAY_ACTIVE_TOPICS_EXPLAIN' => 'If set to yes active topics in selected subforums will be displayed under this category.', 'EDIT_FORUM' => 'Edit forum', diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 68df81932a..ca38d3b5c0 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -46,7 +46,7 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT}
+ {forumrow.LAST_POST_SUBJECT}
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
  From b6957aa5252544fe0b52af94e35bc93b47e3518e Mon Sep 17 00:00:00 2001 From: Rahul R Date: Fri, 6 Apr 2012 01:15:12 +0530 Subject: [PATCH 10/20] [ticket/10650]Removed incorrect newline Deleted additional line in the end of database_update.php PHPBB3-10650 --- phpBB/install/database_update.php | 1 - 1 file changed, 1 deletion(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 89b252e3fa..4f5fe142c9 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2405,4 +2405,3 @@ function change_database_data(&$no_updates, $version) break; } } - From b0f5db152f2c24fe6fe821f91d05d7e327a587c0 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Sun, 8 Apr 2012 11:12:29 +0530 Subject: [PATCH 11/20] [ticket/10650] Removed changes from acp_forums.php Removed unneccesary changes from acp_forums.php PHPBB3-10650 --- phpBB/includes/acp/acp_forums.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 5323a0e4e6..3a3b2021eb 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -133,7 +133,6 @@ class acp_forums 'forum_style' => request_var('forum_style', 0), 'display_subforum_list' => request_var('display_subforum_list', false), 'display_on_index' => request_var('display_on_index', false), - 'display_last_subject' => request_var('display_last_subject', true), 'forum_topics_per_page' => request_var('topics_per_page', 0), 'enable_indexing' => request_var('enable_indexing', true), 'enable_icons' => request_var('enable_icons', false), @@ -445,7 +444,6 @@ class acp_forums 'enable_prune' => false, 'prune_days' => 7, 'prune_viewed' => 7, - 'display_last_subject' => 0, 'prune_freq' => 1, 'forum_flags' => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS, 'forum_options' => 0, @@ -638,7 +636,6 @@ class acp_forums 'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false, 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, 'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false, - 'S_DISPLAY_SUBJECT' => ($forum_data['display_last_subject']) ? true : false, 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false, @@ -807,7 +804,6 @@ class acp_forums 'FORUM_TOPICS' => $row['forum_topics'], 'FORUM_POSTS' => $row['forum_posts'], - 'S_DISPLAY_SUBJECT' => ($row['display_last_subject']) ? true : false, 'S_FORUM_LINK' => ($forum_type == FORUM_LINK) ? true : false, 'S_FORUM_POST' => ($forum_type == FORUM_POST) ? true : false, From 094dbe7ccc22119aa50963ae4714a00e76aef9a5 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Sun, 8 Apr 2012 12:25:25 +0530 Subject: [PATCH 12/20] [ticket/10650] Made use of truncate_string() function Removed manual cropping and used truncate_string function. Also made a new variable so that is preserved. PHPBB3-10650 --- phpBB/includes/functions_display.php | 7 ++----- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 99adf6f6a7..fbb6d65b92 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,11 +397,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_id']) { $last_post_subject = $row['forum_last_post_subject']; - if (utf8_strlen(htmlspecialchars_decode($last_post_subject)) > 30) - { - $last_post_subject = htmlspecialchars(utf8_substr(htmlspecialchars_decode($last_post_subject, 0, 30))); - $last_post_subject .= '...'; - } + $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255 ,false, '…'); $last_post_time = $user->format_date($row['forum_last_post_time']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; } @@ -470,6 +466,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'LAST_POST_SUBJECT' => censor_text($last_post_subject), + 'LAST_POST_SUBJECT_TRUNCATED' => censor_text($last_post_subject_truncated), 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index ca38d3b5c0..55f8e6df30 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -46,7 +46,7 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT}
+ {forumrow.LAST_POST_SUBJECT_TRUNCATED}
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
  From dd3b8e74b33da4dabb60001c2bffa5d8b2cec236 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Sun, 8 Apr 2012 12:45:51 +0530 Subject: [PATCH 13/20] [ticket/10650] Added href title to subject link Added title attribute to anchor tag which displays last_post_subject so that the full subject can be seen by hovering over the truncated subject displayed in forumlist. PHPBB3-10650 --- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 55f8e6df30..be12f1e89a 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -46,7 +46,7 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT_TRUNCATED}
+ {forumrow.LAST_POST_SUBJECT_TRUNCATED}
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
{forumrow.LAST_POST_TIME}{L_NO_POSTS}
  From 2dec700aabcb8b5bebf707b41378ede61512e745 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Sun, 8 Apr 2012 22:52:49 +0530 Subject: [PATCH 14/20] [ticket/10650] Added ellipsis to language file Added ELLIPSIS to language file common.php and also corrected language explanation of ACP option. PHPBB3-10650 --- phpBB/includes/functions_display.php | 2 +- phpBB/language/en/acp/board.php | 2 +- phpBB/language/en/common.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index fbb6d65b92..138749d2db 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,7 +397,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_id']) { $last_post_subject = $row['forum_last_post_subject']; - $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255 ,false, '…'); + $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255 ,false, $user->lang['ELLIPSIS']); $last_post_time = $user->format_date($row['forum_last_post_time']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; } diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 187d823fd0..7329f8dcaf 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -45,7 +45,7 @@ $lang = array_merge($lang, array( 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', - 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and ones in which user doesnt have read access are not shown.', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesnt have read access are not shown.', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'SITE_DESC' => 'Site description', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 12f8edad9e..f46e5df4db 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -169,6 +169,7 @@ $lang = array_merge($lang, array( ), 'EDIT_POST' => 'Edit post', + 'ELLIPSIS' => ' …', // ... 'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS 'EMAIL_ADDRESS' => 'E-mail address', 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at Line %1$s. Response: %2$s.', From 303748b02db2aa76391f60770c292edf45cee360 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Apr 2012 01:43:44 +0530 Subject: [PATCH 15/20] [ticket/10650] Added space after if and comment Added space in proper places in database_update.php. Also corrected language entry of ELLIPSIS to utf8 PHPBB3-10650 --- phpBB/install/database_update.php | 6 +++--- phpBB/language/en/common.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4f5fe142c9..5c70a07f1e 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2394,10 +2394,10 @@ function change_database_data(&$no_updates, $version) $sql = 'INSERT INTO ' . STYLES_TABLE . " (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '© phpBB Group', 1, 'prosilver', 'kNg=', 0, '')"; _sql($sql, $errored, $error_ary); - //Create config value for displaying last subject on forum list - if(!isset($config['display_last_subject'])) + // Create config value for displaying last subject on forum list + if (!isset($config['display_last_subject'])) { - $config->set("display_last_subject", '1'); + $config->set('display_last_subject', '1'); } $no_updates = false; diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index f46e5df4db..bf44ba0796 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -169,7 +169,7 @@ $lang = array_merge($lang, array( ), 'EDIT_POST' => 'Edit post', - 'ELLIPSIS' => ' …', // ... + 'ELLIPSIS' => ' ...', 'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS 'EMAIL_ADDRESS' => 'E-mail address', 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at Line %1$s. Response: %2$s.', From db275d0a907f60fc437710b099b21061ef3b0daf Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Apr 2012 02:51:18 +0530 Subject: [PATCH 16/20] [ticket/10650] Inserted correct utf ELLIPSIS character Inserted the correct utf-8 ellipsis to the language file. PHPBB3-10650 --- phpBB/language/en/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index bf44ba0796..91c37e82bd 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -169,7 +169,7 @@ $lang = array_merge($lang, array( ), 'EDIT_POST' => 'Edit post', - 'ELLIPSIS' => ' ...', + 'ELLIPSIS' => '…', 'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS 'EMAIL_ADDRESS' => 'E-mail address', 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at Line %1$s. Response: %2$s.', From 6661c92dd3ce4dc9b414bb39706298725057b7c0 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Mon, 9 Apr 2012 03:22:35 +0530 Subject: [PATCH 17/20] [ticket/10650] Added apostrophe in explanation in language file A missing apostrophe was added to the language file entry of DISPLAY_LAST_SUBJECT_EXPLAIN PHPBB3-10650 --- phpBB/language/en/acp/board.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 7329f8dcaf..a448c0ee7d 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -45,7 +45,7 @@ $lang = array_merge($lang, array( 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', - 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesnt have read access are not shown.', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn\'t have read access are not shown.', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'SITE_DESC' => 'Site description', From 1e4710b1949155543a729d36b5da89c9c965f6c0 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 10 Apr 2012 08:22:52 +0530 Subject: [PATCH 18/20] [ticket/10650] Moving censoring to before truncation The censor_text function is now being applied to the last_post_subject before being truncated. PHPBB3-10650 --- phpBB/includes/functions_display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 138749d2db..950c1f0cd8 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,7 +397,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($row['forum_last_post_id']) { $last_post_subject = $row['forum_last_post_subject']; - $last_post_subject_truncated = truncate_string($last_post_subject, 30, 255 ,false, $user->lang['ELLIPSIS']); + $last_post_subject_truncated = truncate_string(censor_text($last_post_subject), 30, 255, false, $user->lang['ELLIPSIS']); $last_post_time = $user->format_date($row['forum_last_post_time']); $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; } @@ -466,7 +466,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'LAST_POST_SUBJECT' => censor_text($last_post_subject), - 'LAST_POST_SUBJECT_TRUNCATED' => censor_text($last_post_subject_truncated), + 'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated, 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), From bab32bd56afefb97634f7c9ac336c7ac2fe3f7c1 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Wed, 11 Apr 2012 06:23:56 +0530 Subject: [PATCH 19/20] [ticket/10650] Changed apostrophe to utf8 single quote The apostrophe in language entry DISPLAY_LAST_SUBJECT_EXPLAIN was changed to utf8 single quote character. PHPBB3-10650 --- phpBB/language/en/acp/board.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index a448c0ee7d..19c380e0a6 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -45,7 +45,7 @@ $lang = array_merge($lang, array( 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list', - 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn\'t have read access are not shown.', + 'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'SITE_DESC' => 'Site description', From e2d286d9f133ffb5128262fc88bfd86766f7b50f Mon Sep 17 00:00:00 2001 From: Rahul R Date: Sat, 19 May 2012 01:59:25 +0530 Subject: [PATCH 20/20] [ticket/10650] Subject is cleared if no permissions exist The subject line will be cleared before passing to the template in case the user doesn't have sufficient permissions. PHPBB3-10650 --- phpBB/includes/functions_display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 950c1f0cd8..0c5b80c609 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -465,8 +465,8 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '', 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', - 'LAST_POST_SUBJECT' => censor_text($last_post_subject), - 'LAST_POST_SUBJECT_TRUNCATED' => $last_post_subject_truncated, + 'LAST_POST_SUBJECT' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? censor_text($last_post_subject) : "", + 'LAST_POST_SUBJECT_TRUNCATED' => (!$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? $last_post_subject_truncated : "", 'LAST_POST_TIME' => $last_post_time, 'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),