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..5323a0e4e6 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..4e70a4911c 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 (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']);
$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'];
}
@@ -451,6 +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_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/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',
diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php
index 756cb7ae0f..9141abc8eb 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 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 d6596203e5..68df81932a 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -44,7 +44,11 @@
- {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}