aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorRahul <rahulr92@phpbb.com>2012-03-24 12:57:28 +0530
committerRahul R <rahulr92@gmail.com>2012-04-05 00:45:26 +0530
commitf32547c2150a3e6201edf0f856a93229040c73be (patch)
tree62372de7b4c8a2caf1e43367c95a96c45027e1e9 /phpBB
parentadd130fa3a0ee5d2037aa7f10bea5bbef8f2824a (diff)
downloadforums-f32547c2150a3e6201edf0f856a93229040c73be.tar
forums-f32547c2150a3e6201edf0f856a93229040c73be.tar.gz
forums-f32547c2150a3e6201edf0f856a93229040c73be.tar.bz2
forums-f32547c2150a3e6201edf0f856a93229040c73be.tar.xz
forums-f32547c2150a3e6201edf0f856a93229040c73be.zip
[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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_forums.html5
-rw-r--r--phpBB/develop/create_schema_files.php1
-rw-r--r--phpBB/includes/acp/acp_forums.php4
-rw-r--r--phpBB/includes/functions_display.php1
-rw-r--r--phpBB/install/database_update.php3
-rw-r--r--phpBB/language/en/acp/forums.php2
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html5
7 files changed, 20 insertions, 1 deletions
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
@@ -238,6 +238,11 @@
<label><input type="radio" class="radio" name="display_recent" value="0"<!-- IF not S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
+ <dt><label for="display_last_subject">{L_DISPLAY_LAST_SUBJECT}:</label><br /><span>{L_DISPLAY_LAST_SUBJECT_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" name="display_last_subject" value="1"<!-- IF S_DISPLAY_SUBJECT --> id="display_subject" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="display_last_subject" value="0"<!-- IF not S_DISPLAY_SUBJECT --> id="display_subject" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+ </dl>
+ <dl>
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
<dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd>
</dl>
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 @@
<dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd>
<dd class="lastpost"><span>
<!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
- <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
+ <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
+ <!-- IF forumrow.S_DISPLAY_SUBJECT -->
+ <a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_SUBJECT}</a><!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>
</dd>
<!-- ENDIF -->