diff options
Diffstat (limited to 'phpBB/viewforum.php')
| -rw-r--r-- | phpBB/viewforum.php | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index adb26d24dd..e119af7dcf 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -117,8 +117,7 @@ if( $mark_read == "topics" ) 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 - LIMIT $start, " . $board_config['topics_per_page']; + AND t.topic_moved_id IS NULL"; if(!$t_result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); @@ -148,10 +147,10 @@ if( $mark_read == "topics" ) } $template->assign_vars(array( - "META" => '<meta http-equiv="refresh" content="3;url=viewforum.' . $phpEx . '?' . POST_FORUM_URL . '=' . $forum_id . '">') + "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">') ); - $message = $lang['Topics_marked_read'] . "<br /><br />" . $lang['Click'] . " <a href=\"viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id\">" . $lang['HERE'] . "</a> " . $lang['to_return_forum']; + $message = $lang['Topics_marked_read'] . "<br /><br />" . sprintf($lang['Click_return_forum'], "<a href=\"" . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">", "</a> "); message_die(GENERAL_MESSAGE, $message); } // @@ -337,25 +336,15 @@ $template->assign_vars(array( // // User authorisation levels output // -$s_auth_can = $lang['You'] . " " . ( ($is_auth['auth_read']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['read_posts'] . "<br />"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_post']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['post_topics'] . "<br />"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_reply']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['reply_posts'] . "<br />"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_edit']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['edit_posts'] . "<br />"; -$s_auth_can .= $lang['You'] . " " . ( ($is_auth['auth_delete']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['delete_posts'] . "<br />"; - -/* -$s_auth_read_img = "<img src=\"" . ( ($is_auth['auth_read']) ? $image['auth_can_read'] : $image['auth_cannot_read'] ) . "\" alt=\"" . $lang['You'] . " " . ( ($is_auth['auth_read']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['read_posts'] . "\" />"; -$s_auth_post_img = "<img src=\"" . ( ($is_auth['auth_post']) ? $image['auth_can_post'] : $image['auth_cannot_post'] ) . "\" alt=\"" . $lang['You'] . " " . ( ($is_auth['auth_post']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['post_topics'] . "\" />"; -$s_auth_reply_img = "<img src=\"" . ( ($is_auth['auth_reply']) ? $image['auth_can_reply'] : $image['auth_cannot_reply'] ) . "\" alt=\"" . $lang['You'] . " " . ( ($is_auth['auth_reply']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['reply_posts'] . "\" />"; -$s_auth_edit_img = "<img src=\"" . ( ($is_auth['auth_edit']) ? $image['auth_can_edit'] : $image['auth_cannot_edit'] ) . "\" alt=\"" . $lang['You'] . " " . ( ($is_auth['auth_edit']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['edit_posts'] . "\" />"; -$s_auth_delete_img = "<img src=\"" . ( ($is_auth['auth_delete']) ? $image['auth_can_delete'] : $image['auth_cannot_delete'] ) . "\" alt=\"" . $lang['You'] . " " . ( ($is_auth['auth_delete']) ? $lang['can'] : $lang['cannot'] ) . " " . $lang['delete_posts'] . "\" />"; -*/ +$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . "<br />"; +$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . "<br />"; +$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . "<br />"; +$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . "<br />"; +$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . "<br />"; + if( $is_auth['auth_mod'] ) { - $s_auth_can .= $lang['You'] . " " . $lang['can'] . " <a href=\"" . append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">" . $lang['moderate_forum'] . "</a><br />"; - -// $s_auth_mod_img = "<a href=\"" . append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\"><img src=\"" . $images['auth_mod'] . "\" alt=\"" . $lang['You'] . " " . $lang['can'] . " " . $lang['moderate_forum'] . "\" border=\"0\"/></a>"; - + $s_auth_can .= sprintf($lang['Rules_moderate'], "<a href=\"" . append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">", "</a>"); } else { @@ -455,7 +444,7 @@ if($total_topics) if( ( $replies + 1 ) > $board_config['posts_per_page'] ) { - $goto_page = " (<img src=\"" . $images['icon_minipost'] . "\" alt=\"" . $lang['Goto_page'] . "\" />" . $lang['Goto_page'] . ": "; + $goto_page = " [ <img src=\"" . $images['icon_minipost'] . "\" alt=\"" . $lang['Goto_page'] . "\" />" . $lang['Goto_page'] . ": "; $times = 1; for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) @@ -477,19 +466,19 @@ if($total_topics) } $times++; } - $goto_page .= ")"; + $goto_page .= " ] "; } else { $goto_page = ""; } - if($topic_rowset[$i]['topic_status'] == TOPIC_LOCKED) + if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) { $folder_image = "<img src=\"" . $images['folder_locked'] . "\" alt=\"" . $lang['Topic_locked'] . "\" />"; $newest_post_img = ""; } - else if($topic_rowset[$i]['topic_status'] == TOPIC_MOVED) + else if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED ) { $topic_type = $lang['Topic_Moved'] . " "; $topic_id = $topic_rowset[$i]['topic_moved_id']; @@ -499,12 +488,12 @@ if($total_topics) } else { - if($topic_rowset[$i]['topic_type'] == POST_ANNOUNCE) + if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE ) { $folder = $images['folder_announce']; $folder_new = $images['folder_announce_new']; } - else if($topic_rowset[$i]['topic_type'] == POST_STICKY) + else if( $topic_rowset[$i]['topic_type'] == POST_STICKY ) { $folder = $images['folder_sticky']; $folder_new = $images['folder_sticky_new']; @@ -555,13 +544,14 @@ if($total_topics) $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); - $topic_poster = $topic_rowset[$i]['username']; - $topic_poster_profile_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']); + $topic_poster = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['user_id']) . "\">" : ""; + $topic_poster .= $topic_rowset[$i]['username']; + $topic_poster .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? "</a>" : ""; $last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']); $last_post = $last_post_time . "<br />" . $lang['by'] . " "; - $last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $topic_rowset[$i]['user2'] . " " : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['id2']) . "\">" . $topic_rowset[$i]['user2'] . "</a> "; + $last_post .= ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ($topic_rowset[$i]['post_username'] != "" ) ? $topic_rowset[$i]['post_username'] . " " : $lang['Guest'] . " " ) : "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $topic_rowset[$i]['id2']) . "\">" . $topic_rowset[$i]['user2'] . "</a> "; $last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $topic_rowset[$i]['topic_last_post_id']) . "#" . $topic_rowset[$i]['topic_last_post_id'] . "\"><img src=\"" . $images['icon_latest_reply'] . "\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\" /></a>"; $views = $topic_rowset[$i]['topic_views']; @@ -579,18 +569,14 @@ if($total_topics) "VIEWS" => $views, "LAST_POST" => $last_post, - "U_VIEW_TOPIC" => $view_topic_url, - "U_TOPIC_POSTER_PROFILE" => $topic_poster_profile_url) + "U_VIEW_TOPIC" => $view_topic_url) ); } $template->assign_vars(array( "PAGINATION" => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start), - "ON_PAGE" => ( floor( $start / $board_config['topics_per_page'] ) + 1 ), - "TOTAL_PAGES" => ceil( $topics_count / $board_config['topics_per_page'] ), + "PAGE_NUMBER" => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )), - "L_OF" => $lang['of'], - "L_PAGE" => $lang['Page'], "L_GOTO_PAGE" => $lang['Goto_page'], "S_NO_TOPICS" => FALSE) |
