aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-05-21 23:42:48 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-05-21 23:42:48 -0400
commit3b6ca178aa622fb1cc64c977fdc9eb47e3843cc7 (patch)
tree2bf15639450d275ce8f318dbd11b314355989f84
parent3c5eca4aed405afd425b165f7b6fd21fb3fe1095 (diff)
parente2d286d9f133ffb5128262fc88bfd86766f7b50f (diff)
downloadforums-3b6ca178aa622fb1cc64c977fdc9eb47e3843cc7.tar
forums-3b6ca178aa622fb1cc64c977fdc9eb47e3843cc7.tar.gz
forums-3b6ca178aa622fb1cc64c977fdc9eb47e3843cc7.tar.bz2
forums-3b6ca178aa622fb1cc64c977fdc9eb47e3843cc7.tar.xz
forums-3b6ca178aa622fb1cc64c977fdc9eb47e3843cc7.zip
Merge PR #721 branch 'rahulr92/ticket/10650' into develop
* rahulr92/ticket/10650: [ticket/10650] Subject is cleared if no permissions exist [ticket/10650] Changed apostrophe to utf8 single quote [ticket/10650] Moving censoring to before truncation [ticket/10650] Added apostrophe in explanation in language file [ticket/10650] Inserted correct utf ELLIPSIS character [ticket/10650] Added space after if and comment [ticket/10650] Added ellipsis to language file [ticket/10650] Added href title to subject link [ticket/10650] Made use of truncate_string() function [ticket/10650] Removed changes from acp_forums.php [ticket/10650]Removed incorrect newline [ticket/10650] Changed acp option from per forum to global [ticket/10650] Added checking for empty subjects [ticket/10650] Corrected intendation [ticket/10650]Added permission checking and utf8 functions [ticket/10650] Cropped subject and inserted newline [ticket/10650] Corrected space before true [ticket/10650] Changed language files and forumlist [ticket/10650] Added static sql files [ticket/10650] Displaying last topic on forum list Conflicts: phpBB/install/database_update.php phpBB/language/en/common.php
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/functions_display.php5
-rw-r--r--phpBB/install/database_update.php6
-rw-r--r--phpBB/language/en/acp/board.php2
-rw-r--r--phpBB/language/en/common.php1
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html6
6 files changed, 19 insertions, 2 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 951166f086..d537885ef1 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 18db64cc68..0c5b80c609 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -397,6 +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(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'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
@@ -451,6 +452,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 && $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'],
@@ -463,7 +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']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $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' => (!$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']),
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index ac304f24c6..1892ab07a3 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2572,6 +2572,12 @@ function change_database_data(&$no_updates, $version)
}
}
+ // 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;
if (!isset($config['assets_version']))
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 7e3c227893..6e5557d9be 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 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',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 615f5711d0..a6da52d4ef 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' => 'Email', // Short form for EMAIL_ADDRESS
'EMAIL_ADDRESS' => 'Email address',
'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending email at <strong>Line %1$s</strong>. Response: %2$s.',
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index ed08aa791a..ca5e8abb1d 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -44,7 +44,11 @@
<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}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br />
+ <!-- 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 -->