From 41d8a777dc73350a2f3bba6aaae2686921110d08 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 31 Mar 2012 01:26:04 +0200 Subject: [feature/ajax] Add entirely unrelated but nice newlines PHPBB3-10270 --- phpBB/includes/functions_display.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 9335cabc15..18db64cc68 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -273,6 +273,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod markread('topics', $forum_ids); $message = sprintf($user->lang['RETURN_FORUM'], '', ''); meta_refresh(3, $redirect); + trigger_error($user->lang['FORUMS_MARKED'] . '

' . $message); } else -- cgit v1.2.1 From f32547c2150a3e6201edf0f856a93229040c73be Mon Sep 17 00:00:00 2001 From: Rahul Date: Sat, 24 Mar 2012 12:57:28 +0530 Subject: [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 --- phpBB/includes/functions_display.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/includes/functions_display.php') 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'], -- cgit v1.2.1 From 663b5f6542cc3088919836324f71413320997fe8 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Tue, 3 Apr 2012 21:36:26 +0530 Subject: [ticket/10650] Cropped subject and inserted newline The subject being displayed in the forum list have been shortened to 30 characters. Also it is now being shown in a separate line. PHPBB3-10650 --- phpBB/includes/functions_display.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 9b80763ee4..b331ed7d71 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 (strlen($last_post_subject) > 30) + { + $last_post_subject = substr($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']; } -- cgit v1.2.1 From 08bee4c522dd68f7da591fd8ea7a674ac5b9bf67 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 5 Apr 2012 00:39:52 +0530 Subject: [ticket/10650]Added permission checking and utf8 functions Passworded forums and ones in which user doesn't have read access will be excluded. Also uft8 based string functions and html encode/decode functions have been used to sanitise subject. PHPBB3-10650 --- phpBB/includes/functions_display.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index b331ed7d71..8e0005eadf 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,9 +397,9 @@ 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 (strlen($last_post_subject) > 30) - { - $last_post_subject = substr($last_post_subject, 0, 30); + 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']); @@ -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_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_DISPLAY_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'], -- cgit v1.2.1 From 7bb9e301994cb9789478b32c1282238e5762acee Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 5 Apr 2012 01:19:46 +0530 Subject: [ticket/10650] Corrected intendation Corrected the intendation of if condition. PHPBB3-10650 --- phpBB/includes/functions_display.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 8e0005eadf..a28f546be0 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -398,10 +398,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { $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 = 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']; } -- cgit v1.2.1 From 3e9711d6a4c1786ec4702b1d87810c4ed0182953 Mon Sep 17 00:00:00 2001 From: Rahul R Date: Thu, 5 Apr 2012 02:02:02 +0530 Subject: [ticket/10650] Added checking for empty subjects Now empty subjects will not be displayed in a new line on the forum list. PHPBB3-10650 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a28f546be0..4e70a4911c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -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_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, - 'S_DISPLAY_SUBJECT' => ($row['display_last_subject'] && !$row['forum_password'] && $auth->acl_get('f_read', $row['forum_id'])) ? 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'], -- cgit v1.2.1 From 98964a913cb22761553d04170aa4830e324f7488 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 4 Apr 2012 18:28:36 -0400 Subject: [ticket/10650] Revert merge of 'rahulr92/ticket/10650' into develop The pull request (#654) was merged a little too quickly. In particular, display_last_subject per-forum option needs consensus. This reverts commit b1fb34a4d7e446768b9f66ba6dd359173cd2a5fb, reversing changes made to 7d6b289671c51694f17dd5f9849abf2534b55e59. PHPBB3-10650 --- phpBB/includes/functions_display.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'phpBB/includes/functions_display.php') diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 4e70a4911c..18db64cc68 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -397,11 +397,6 @@ 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']; } @@ -456,7 +451,6 @@ 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'], -- cgit v1.2.1