[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 <br /> in forumlist_body.html.

PHPBB3-10650
This commit is contained in:
Rahul R 2012-04-06 01:07:23 +05:30
parent 2a8481d681
commit c524236ef6
15 changed files with 12 additions and 20 deletions

View file

@ -237,11 +237,6 @@
<dd><label><input type="radio" class="radio" name="display_recent" value="1"<!-- IF S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <dd><label><input type="radio" class="radio" name="display_recent" value="1"<!-- IF S_DISPLAY_ACTIVE_TOPICS --> id="display_recent" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<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> <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>
<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> <dl>
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}:</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt> <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> <dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd>

View file

@ -1109,7 +1109,6 @@ function get_schema_struct()
'forum_options' => array('UINT:20', 0), 'forum_options' => array('UINT:20', 0),
'display_subforum_list' => array('BOOL', 1), 'display_subforum_list' => array('BOOL', 1),
'display_on_index' => array('BOOL', 1), 'display_on_index' => array('BOOL', 1),
'display_last_subject' => array('BOOL', 1),
'enable_indexing' => array('BOOL', 1), 'enable_indexing' => array('BOOL', 1),
'enable_icons' => array('BOOL', 1), 'enable_icons' => array('BOOL', 1),
'enable_prune' => array('BOOL', 0), 'enable_prune' => array('BOOL', 0),

View file

@ -88,6 +88,7 @@ class acp_board
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), '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_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), '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), 'allow_quick_reply' => array('lang' => 'ALLOW_QUICK_REPLY', 'validate' => 'bool', 'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
'legend2' => 'ACP_LOAD_SETTINGS', 'legend2' => 'ACP_LOAD_SETTINGS',

View file

@ -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_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false,
'S_SUBFORUMS' => (sizeof($subforums_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, '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'], 'FORUM_ID' => $row['forum_id'],

View file

@ -1084,9 +1084,6 @@ function database_update_info()
GROUPS_TABLE => array( GROUPS_TABLE => array(
'group_teampage' => array('UINT', 0, 'after' => 'group_legend'), 'group_teampage' => array('UINT', 0, 'after' => 'group_legend'),
), ),
FORUMS_TABLE => array(
'display_last_subject' => array('BOOL', 1),
),
PROFILE_FIELDS_TABLE => array( PROFILE_FIELDS_TABLE => array(
'field_show_on_pm' => array('BOOL', 0), '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', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '')"; $sql = 'INSERT INTO ' . STYLES_TABLE . " (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '')";
_sql($sql, $errored, $error_ary); _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; $no_updates = false;
break; break;
} }
} }

View file

@ -376,7 +376,6 @@ CREATE TABLE phpbb_forums (
forum_options INTEGER DEFAULT 0 NOT NULL, forum_options INTEGER DEFAULT 0 NOT NULL,
display_subforum_list INTEGER DEFAULT 1 NOT NULL, display_subforum_list INTEGER DEFAULT 1 NOT NULL,
display_on_index 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_indexing INTEGER DEFAULT 1 NOT NULL,
enable_icons INTEGER DEFAULT 1 NOT NULL, enable_icons INTEGER DEFAULT 1 NOT NULL,
enable_prune INTEGER DEFAULT 0 NOT NULL, enable_prune INTEGER DEFAULT 0 NOT NULL,

View file

@ -455,7 +455,6 @@ CREATE TABLE [phpbb_forums] (
[forum_options] [int] DEFAULT (0) NOT NULL , [forum_options] [int] DEFAULT (0) NOT NULL ,
[display_subforum_list] [int] DEFAULT (1) NOT NULL , [display_subforum_list] [int] DEFAULT (1) NOT NULL ,
[display_on_index] [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_indexing] [int] DEFAULT (1) NOT NULL ,
[enable_icons] [int] DEFAULT (1) NOT NULL , [enable_icons] [int] DEFAULT (1) NOT NULL ,
[enable_prune] [int] DEFAULT (0) NOT NULL , [enable_prune] [int] DEFAULT (0) NOT NULL ,

View file

@ -262,7 +262,6 @@ CREATE TABLE phpbb_forums (
forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
display_on_index 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_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
enable_icons 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, enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,

View file

@ -262,7 +262,6 @@ CREATE TABLE phpbb_forums (
forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL, forum_options int(20) UNSIGNED DEFAULT '0' NOT NULL,
display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
display_on_index 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_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
enable_icons 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, enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,

View file

@ -522,7 +522,6 @@ CREATE TABLE phpbb_forums (
forum_options number(20) DEFAULT '0' NOT NULL, forum_options number(20) DEFAULT '0' NOT NULL,
display_subforum_list number(1) DEFAULT '1' NOT NULL, display_subforum_list number(1) DEFAULT '1' NOT NULL,
display_on_index 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_indexing number(1) DEFAULT '1' NOT NULL,
enable_icons number(1) DEFAULT '1' NOT NULL, enable_icons number(1) DEFAULT '1' NOT NULL,
enable_prune number(1) DEFAULT '0' NOT NULL, enable_prune number(1) DEFAULT '0' NOT NULL,

View file

@ -398,7 +398,6 @@ CREATE TABLE phpbb_forums (
forum_options INT4 DEFAULT '0' NOT NULL CHECK (forum_options >= 0), 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_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_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_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0),
enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0), enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0),
enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0), enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0),

View file

@ -255,7 +255,6 @@ CREATE TABLE phpbb_forums (
forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0', forum_options INTEGER UNSIGNED NOT NULL DEFAULT '0',
display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1', display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1',
display_on_index 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_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1',
enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1',
enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0', enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0',

View file

@ -44,6 +44,8 @@ $lang = array_merge($lang, array(
'DEFAULT_STYLE' => 'Default style', 'DEFAULT_STYLE' => 'Default style',
'DISABLE_BOARD' => 'Disable board', '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.', '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' => 'Override user style',
'OVERRIDE_STYLE_EXPLAIN' => 'Replaces users style with the default.', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces users style with the default.',
'SITE_DESC' => 'Site description', 'SITE_DESC' => 'Site description',

View file

@ -57,8 +57,6 @@ $lang = array_merge($lang, array(
'DELETE_ALL_POSTS' => 'Delete posts', 'DELETE_ALL_POSTS' => 'Delete posts',
'DELETE_SUBFORUMS' => 'Delete subforums and posts', 'DELETE_SUBFORUMS' => 'Delete subforums and posts',
'DISPLAY_ACTIVE_TOPICS' => 'Enable active topics', '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.', 'DISPLAY_ACTIVE_TOPICS_EXPLAIN' => 'If set to yes active topics in selected subforums will be displayed under this category.',
'EDIT_FORUM' => 'Edit forum', 'EDIT_FORUM' => 'Edit forum',

View file

@ -46,7 +46,7 @@
<!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF --> <!-- 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> <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
<!-- IF forumrow.S_DISPLAY_SUBJECT --> <!-- IF forumrow.S_DISPLAY_SUBJECT -->
<a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_SUBJECT}</a></br> <a href="{forumrow.U_LAST_POST}">{forumrow.LAST_POST_SUBJECT}</a> <br />
<!-- ENDIF --> <!-- ENDIF -->
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {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> <!-- 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>