diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-05-31 15:39:59 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-05-31 15:39:59 +0000 |
| commit | 3ed50ce0b7665fcd6a2a80d1f5bc6630089382d5 (patch) | |
| tree | 1c46f1913b8646556f29788196397c21b7a4988d /phpBB/viewtopic.php | |
| parent | eb9734b237eec0c6513b97f85b051dfd6599d0d3 (diff) | |
| download | forums-3ed50ce0b7665fcd6a2a80d1f5bc6630089382d5.tar forums-3ed50ce0b7665fcd6a2a80d1f5bc6630089382d5.tar.gz forums-3ed50ce0b7665fcd6a2a80d1f5bc6630089382d5.tar.bz2 forums-3ed50ce0b7665fcd6a2a80d1f5bc6630089382d5.tar.xz forums-3ed50ce0b7665fcd6a2a80d1f5bc6630089382d5.zip | |
Changes to allow all auth types to be returned
git-svn-id: file:///svn/phpbb/trunk@388 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
| -rw-r--r-- | phpBB/viewtopic.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d275f5f5fb..56edebdacb 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -136,9 +136,9 @@ else $join_sql_table = (!isset($post_id)) ? "" : "".POSTS_TABLE." p, ".POSTS_TABLE." p2,"; $join_sql = (!isset($post_id)) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id"; $count_sql = (!isset($post_id)) ? "" : ", COUNT(p2.post_id) AS prev_posts"; - $order_sql = (!isset($post_id)) ? "" : "GROUP BY fm.user_id, p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_type, f.forum_name, f.forum_id, u.username, u.user_id ORDER BY p.post_id ASC"; + $order_sql = (!isset($post_id)) ? "" : "GROUP BY fm.user_id, p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, u.username, u.user_id, fa.auth_read ORDER BY p.post_id ASC"; - $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_type, f.forum_name, f.forum_id, u.username, u.user_id, fa.auth_read".$count_sql." + $sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, u.username, u.user_id, fa.*".$count_sql." FROM $join_sql_table ".TOPICS_TABLE." t, ".FORUMS_TABLE." f, ".FORUM_MODS_TABLE." fm, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." fa WHERE $join_sql AND f.forum_id = t.forum_id @@ -213,7 +213,7 @@ init_userprefs($userdata); // // Start auth check // -$is_auth = auth(READ, $forum_id, $userdata, $forum_row[0]['auth_read']); +$is_auth = auth(ALL, $forum_id, $userdata, $forum_row[0]); if(!$is_auth) { @@ -515,11 +515,22 @@ else $pages = "1 $l_page"; } +$s_auth_can = ""; +$s_auth_can .= "You " . (($is_auth['auth_read']) ? "<b>can</b>" : "<b>cannot</b>" ) . " read posts in this forum<br>"; +$s_auth_can .= "You " . (($is_auth['auth_post']) ? "<b>can</b>" : "<b>cannot</b>") . " add new topics to this forum<br>"; +$s_auth_can .= "You " . (($is_auth['auth_reply']) ? "<b>can</b>" : "<b>cannot</b>") . " reply to posts in this forum<br>"; +$s_auth_can .= "You " . (($is_auth['auth_edit']) ? "<b>can</b>" : "<b>cannot</b>") . " edit your posts in this forum<br>"; +$s_auth_can .= "You " . (($is_auth['auth_delete']) ? "<b>can</b>" : "<b>cannot</b>") . " delete your posts in this forum<br>"; +$s_auth_can .= ($is_auth['auth_mod']) ? "You are a moderator of this forum<br>" : ""; +$s_auth_can .= ($is_auth['auth_admin']) ? "You are a board admin<br>" : ""; + $template->assign_vars(array( "PAGINATION" => generate_pagination("viewtopic.$phpEx?".POST_TOPIC_URL."=$topic_id", $total_replies, $board_config['posts_per_page'], $start), "ON_PAGE" => (floor($start/$board_config['posts_per_page'])+1), "TOTAL_PAGES" => ceil(($total_replies)/$board_config['posts_per_page']), + "S_AUTH_LIST" => $s_auth_can, + "L_OF" => $lang['of'], "L_PAGE" => $lang['Page'], "L_GOTO_PAGE" => $lang['Goto_page']) |
