diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index c6173792c2..2381c4850b 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -219,7 +219,8 @@ $template->assign_vars(array( "L_NEW_POSTS" => $lang['New_posts'], "L_NO_NEW_POSTS_HOT" => $lang['No_new_posts_hot'], "L_NEW_POSTS_HOT" => $lang['New_posts_hot'], - "L_TOPIC_IS_LOCKED" => $lang['Topic_is_locked'], + "L_NO_NEW_POSTS_LOCKED" => $lang['No_new_posts_locked'], + "L_NEW_POSTS_LOCKED" => $lang['New_posts_locked'], "L_ANNOUNCEMENT" => $lang['Post_Announcement'], "L_STICKY" => $lang['Post_Sticky'], "L_POSTED" => $lang['Posted'], diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php index 954e78ab24..ba9e3c3319 100644 --- a/phpBB/language/lang_english/lang_main.php +++ b/phpBB/language/lang_english/lang_main.php @@ -151,7 +151,8 @@ $lang['New_posts'] = "New posts"; $lang['New_post'] = "New post"; $lang['No_new_posts_hot'] = "No new posts [ Popular ]"; $lang['New_posts_hot'] = "New posts [ Popular ]"; -$lang['Topic_is_locked'] = "Topic is locked"; +$lang['No_new_posts_locked'] = "No new posts [ Locked ]"; +$lang['New_posts_locked'] = "New posts [ Locked ]"; $lang['Forum_is_locked'] = "Forum is locked"; diff --git a/phpBB/templates/subSilver/viewforum_body.tpl b/phpBB/templates/subSilver/viewforum_body.tpl index ce6104cf52..dca0909574 100644 --- a/phpBB/templates/subSilver/viewforum_body.tpl +++ b/phpBB/templates/subSilver/viewforum_body.tpl @@ -74,6 +74,8 @@ {L_NO_NEW_POSTS} {L_NO_NEW_POSTS}    + {L_ANNOUNCEMENT} + {L_ANNOUNCEMENT} {L_NEW_POSTS_HOT} @@ -81,16 +83,16 @@    {L_NO_NEW_POSTS_HOT} {L_NO_NEW_POSTS_HOT} - - +    {L_STICKY} {L_STICKY} + + + {L_NEW_POSTS_TOPIC_LOCKED} + {L_NEW_POSTS_LOCKED}    - {L_ANNOUNCEMENT} - {L_ANNOUNCEMENT} -    - {L_TOPIC_IS_LOCKED} - {L_TOPIC_IS_LOCKED} + {L_NO_NEW_POSTS_TOPIC_LOCKED} + {L_NO_NEW_POSTS_LOCKED} {S_AUTH_LIST} diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 8c8482a9a1..cf2329870e 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -112,46 +112,49 @@ if( !$is_auth['auth_read'] || !$is_auth['auth_view'] ) // if( $mark_read == "topics" ) { - $sql = "SELECT t.topic_id, p.post_time - FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p - WHERE t.forum_id = $forum_id - AND p.post_id = t.topic_last_post_id - AND p.post_time > " . $userdata['session_last_visit'] . " - AND t.topic_moved_id IS NULL"; - if(!$t_result = $db->sql_query($sql)) + if( $userdata['session_last_visit'] ) { - message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); - } - - if( $mark_read_rows = $db->sql_numrows($t_result) ) - { - $mark_read_list = $db->sql_fetchrowset($t_result); - - for($i = 0; $i < $mark_read_rows; $i++ ) + $sql = "SELECT t.topic_id, p.post_time + FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p + WHERE t.forum_id = $forum_id + AND p.post_id = t.topic_last_post_id + AND p.post_time > " . $userdata['session_last_visit'] . " + AND t.topic_moved_id IS NULL"; + if(!$t_result = $db->sql_query($sql)) { - $topic_id = $mark_read_list[$i]['topic_id']; - $post_time = $mark_read_list[$i]['post_time']; + message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); + } - if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) ) + if( $mark_read_rows = $db->sql_numrows($t_result) ) + { + $mark_read_list = $db->sql_fetchrowset($t_result); + + for($i = 0; $i < $mark_read_rows; $i++ ) { - setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); - } - else - { - if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) ) + $topic_id = $mark_read_list[$i]['topic_id']; + $post_time = $mark_read_list[$i]['post_time']; + + if( empty($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) ) { setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); } + else + { + if( isset($HTTP_COOKIE_VARS['phpbb2_' . $forum_id . '_' . $topic_id]) ) + { + setcookie('phpbb2_' . $forum_id . '_' . $topic_id, time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); + } + } } } + + $template->assign_vars(array( + "META" => '') + ); + + $message = $lang['Topics_marked_read'] . "

" . sprintf($lang['Click_return_forum'], "", " "); + message_die(GENERAL_MESSAGE, $message); } - - $template->assign_vars(array( - "META" => '') - ); - - $message = $lang['Topics_marked_read'] . "

" . sprintf($lang['Click_return_forum'], "", " "); - message_die(GENERAL_MESSAGE, $message); } // // End handle marking posts @@ -474,12 +477,7 @@ if($total_topics) $goto_page = ""; } - if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) - { - $folder_image = "\"""; - $newest_post_img = ""; - } - else if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED ) + if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED ) { $topic_type = $lang['Topic_Moved'] . " "; $topic_id = $topic_rowset[$i]['topic_moved_id']; @@ -489,7 +487,12 @@ if($total_topics) } else { - if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE ) + if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) + { + $folder = $images['folder_locked']; + $folder_new = $images['folder_locked_new']; + } + else if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE ) { $folder = $images['folder_announce']; $folder_new = $images['folder_announce_new']; @@ -504,7 +507,7 @@ if($total_topics) if($replies >= $board_config['hot_threshold']) { $folder = $images['folder_hot']; - $folder_new = $images['folder_new_hot']; + $folder_new = $images['folder_hot_new']; } else { @@ -531,13 +534,15 @@ if($total_topics) } else { - $folder_image = "\"""; + $folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts']; + $folder_image = "\"$folder_alt\""; $newest_post_img = ""; } } else { - $folder_image = "\"""; + $folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts']; + $folder_image = "\"$folder_alt\""; $newest_post_img = ""; } }