aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorRahul R <rahulr92@gmail.com>2012-04-08 12:25:25 +0530
committerRahul R <rahulr92@gmail.com>2012-04-08 12:25:25 +0530
commit094dbe7ccc22119aa50963ae4714a00e76aef9a5 (patch)
tree1473c7afca8c4e56ae46a7c634da2ef189e4a5f6 /phpBB
parentb0f5db152f2c24fe6fe821f91d05d7e327a587c0 (diff)
downloadforums-094dbe7ccc22119aa50963ae4714a00e76aef9a5.tar
forums-094dbe7ccc22119aa50963ae4714a00e76aef9a5.tar.gz
forums-094dbe7ccc22119aa50963ae4714a00e76aef9a5.tar.bz2
forums-094dbe7ccc22119aa50963ae4714a00e76aef9a5.tar.xz
forums-094dbe7ccc22119aa50963ae4714a00e76aef9a5.zip
[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
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_display.php7
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html2
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, '&#133;');
$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'];
}
@@ -470,6 +466,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'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_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 @@
<!-- 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.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_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>