From b14ca3c338584d9383bce0782cf758b240ea14a5 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 16 Dec 2001 18:58:05 +0000 Subject: Changed way moderator lang is output on viewforum and index git-svn-id: file:///svn/phpbb/trunk@1611 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth.php | 67 +++++++++++++------------------ phpBB/includes/page_header.php | 1 - phpBB/index.php | 14 ++++++- phpBB/language/lang_english/lang_main.php | 13 +++--- phpBB/templates/subSilver/index_body.tpl | 2 +- phpBB/viewforum.php | 1 + 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 85164884ec..7acab748f0 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -56,7 +56,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { global $db, $lang; - switch($type) + switch( $type ) { case AUTH_ALL: $a_sql = "a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate"; @@ -124,7 +124,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) // If f_access has been passed, or auth is needed to return an array of forums // then we need to pull the auth information on the given forum (or all forums) // - if($f_access == -1) + if( $f_access == -1 ) { $forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "WHERE a.forum_id = $forum_id" : ""; @@ -139,7 +139,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) } else { - if(!$db->sql_numrows($af_result)) + if( !$db->sql_numrows($af_result) ) { message_die(GENERAL_ERROR, "No forum access control lists exist!", "", __LINE__, __FILE__, $sql); } @@ -157,37 +157,24 @@ function auth($type, $forum_id, $userdata, $f_access = -1) // $auth_user = array(); - if($userdata['session_logged_in']) + if( $userdata['session_logged_in'] ) { $forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "AND a.forum_id = $forum_id" : ""; -/* $sql = "SELECT au.forum_id, $a_sql, au.auth_mod, g.group_single_user - FROM " . AUTH_ACCESS_TABLE . " au, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE. " g - WHERE ug.user_id = " . $userdata['user_id'] . " - AND g.group_id = ug.group_id - AND ( - ( au.user_id = ug.user_id - AND g.group_id = 0 ) - OR - ( au.group_id = ug.group_id - AND g.group_id <> 0 ) - ) - $forum_match_sql";*/ - $sql = "SELECT a.forum_id, $a_sql, a.auth_mod, g.group_single_user - FROM " . AUTH_ACCESS_TABLE . " a, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g + $sql = "SELECT a.forum_id, $a_sql, a.auth_mod + FROM " . AUTH_ACCESS_TABLE . " a, " . USER_GROUP_TABLE . " ug WHERE ug.user_id = ".$userdata['user_id']. " AND ug.user_pending = 0 - AND g.group_id = ug.group_id AND a.group_id = ug.group_id $forum_match_sql"; $a_result = $db->sql_query($sql); - if(!$a_result) + if( !$a_result ) { message_die(GENERAL_ERROR, "Failed obtaining forum access control lists", "", __LINE__, __FILE__, $sql); } $num_u_access = $db->sql_numrows($a_result); - if($num_u_access) + if( $num_u_access ) { if($forum_id != AUTH_LIST_ALL) { @@ -195,7 +182,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) } else { - while($u_row = $db->sql_fetchrow($a_result)) + while( $u_row = $db->sql_fetchrow($a_result) ) { $u_access[$u_row['forum_id']][] = $u_row; } @@ -203,7 +190,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) } } - $is_admin = ($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ? TRUE : 0; + $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); @@ -233,35 +220,35 @@ function auth($type, $forum_id, $userdata, $f_access = -1) // be assigned). If the row does represent a single user then forget any previous group results // and instead set the auth to whatever the OR'd contents of the access levels are. // - if($forum_id != AUTH_LIST_ALL) + if( $forum_id != AUTH_LIST_ALL ) { $value = $f_access[$key]; - switch($value) + switch( $value ) { case AUTH_ALL: $auth_user[$key] = TRUE; - $auth_user[$key . '_type'] = $lang['Anonymous_users']; + $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; - $auth_user[$key . '_type'] = $lang['Registered_Users']; + $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ACL: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_ACL, $key, $u_access, $is_admin) : 0; - $auth_user[$key . '_type'] = $lang['Users_granted_access']; + $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0; - $auth_user[$key . '_type'] = $lang['Moderators']; + $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$key] = $is_admin; - $auth_user[$key . '_type'] = $lang['Administrators']; + $auth_user[$key . '_type'] = $lang['Auth_Administrators']; break; default: @@ -276,31 +263,31 @@ function auth($type, $forum_id, $userdata, $f_access = -1) $value = $f_access[$k][$key]; $f_forum_id = $f_access[$k]['forum_id']; - switch($value) + switch( $value ) { case AUTH_ALL: $auth_user[$f_forum_id][$key] = TRUE; - $auth_user[$f_forum_id][$key . '_type'] = $lang['Anonymous_users']; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: $auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; - $auth_user[$f_forum_id][$key . '_type'] = $lang['Registered_Users']; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ACL: $auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_ACL, $key, $u_access[$f_forum_id], $is_admin) : 0; - $auth_user[$f_forum_id][$key . '_type'] = $lang['Users_granted_access']; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: $auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0; - $auth_user[$f_forum_id][$key . '_type'] = $lang['Moderators']; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Moderators']; break; case AUTH_ADMIN: $auth_user[$f_forum_id][$key] = $is_admin; - $auth_user[$f_forum_id][$key . '_type'] = $lang['Administrators']; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Auth_Administrators']; break; default: @@ -314,9 +301,9 @@ function auth($type, $forum_id, $userdata, $f_access = -1) // // Is user a moderator? // - if($forum_id != AUTH_LIST_ALL) + if( $forum_id != AUTH_LIST_ALL ) { - $auth_user['auth_mod'] = ($userdata['session_logged_in']) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0; + $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0; } else { @@ -324,7 +311,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { $f_forum_id = $f_access[$k]['forum_id']; - $auth_user[$f_forum_id]['auth_mod'] = ($userdata['session_logged_in']) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0; + $auth_user[$f_forum_id]['auth_mod'] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access[$f_forum_id], $is_admin) : 0; } } @@ -335,7 +322,7 @@ function auth_check_user($type, $key, $u_access, $is_admin) { $auth_user = 0; - if(count($u_access)) + if( count($u_access) ) { for($j = 0; $j < count($u_access); $j++) { diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index 8061991843..dd5efb3f24 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -269,7 +269,6 @@ $template->assign_vars(array( "L_VIEWS" => $lang['Views'], "L_POSTS" => $lang['Posts'], "L_LASTPOST" => $lang['Last_Post'], - "L_MODERATOR" => $lang['Moderator'], "L_NO_NEW_POSTS" => $lang['No_new_posts'], "L_NEW_POSTS" => $lang['New_posts'], "L_NO_NEW_POSTS_HOT" => $lang['No_new_posts_hot'], diff --git a/phpBB/index.php b/phpBB/index.php index 0df3c67e54..1a611f054a 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -251,6 +251,7 @@ if($total_categories = $db->sql_numrows($q_categories)) "FORUM_NEW_IMG" => $images['forum_new'], "FORUM_LOCKED_IMG" => $images['forum_locked'], + "L_MODERATOR" => $lang['Moderators'], "L_FORUM_LOCKED" => $lang['Forum_is_locked'], "L_MARK_FORUMS_READ" => $lang['Mark_all_forums'], @@ -379,11 +380,20 @@ if($total_categories = $db->sql_numrows($q_categories)) } } - if($moderators_links == "") + if( $moderators_links == "" ) { $moderators_links = " "; } + if( $mods > 0 ) + { + $l_moderators = ( $mods == 1 ) ? $lang['Moderator'] : $lang['Moderators']; + } + else + { + $l_moderators = " "; + } + $row_color = ( !($count % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($count % 2) ) ? $theme['td_class1'] : $theme['td_class2']; @@ -398,6 +408,8 @@ if($total_categories = $db->sql_numrows($q_categories)) "LAST_POST" => $last_post, "MODERATORS" => $moderators_links, + "L_MODERATOR" => $l_moderators, + "U_VIEWFORUM" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id")) ); diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php index 04038c65fa..b0e7dc7047 100644 --- a/phpBB/language/lang_english/lang_main.php +++ b/phpBB/language/lang_english/lang_main.php @@ -144,7 +144,8 @@ $lang['Memberlist'] = "Memberlist"; $lang['FAQ'] = "FAQ"; $lang['Usergroups'] = "Usergroups"; $lang['Last_Post'] = "Last Post"; -$lang['Moderator'] = "Moderator/s"; +$lang['Moderator'] = "Moderator"; +$lang['Moderators'] = "Moderators"; // @@ -749,11 +750,11 @@ $lang['Sorry_auth_delete'] = "Sorry but only %s can delete posts in this forum"; $lang['Sorry_auth_vote'] = "Sorry but only %s can vote in polls in this forum"; // These replace the %s in the above strings -$lang['Anonymous_Users'] = "anonymous users"; -$lang['Registered_Users'] = "registered users"; -$lang['Users_granted_access'] = "users granted special access"; -$lang['Moderators'] = "moderators"; -$lang['Administrators'] = "administrators"; +$lang['Auth_Anonymous_Users'] = "anonymous users"; +$lang['Auth_Registered_Users'] = "registered users"; +$lang['Auth_Users_granted_access'] = "users granted special access"; +$lang['Auth_Moderators'] = "moderators"; +$lang['Auth_Administrators'] = "administrators"; $lang['Not_Moderator'] = "You are not a moderator of this forum"; $lang['Not_Authorised'] = "Not Authorised"; diff --git a/phpBB/templates/subSilver/index_body.tpl b/phpBB/templates/subSilver/index_body.tpl index f5d4006843..792a403482 100644 --- a/phpBB/templates/subSilver/index_body.tpl +++ b/phpBB/templates/subSilver/index_body.tpl @@ -30,7 +30,7 @@ {catrow.forumrow.FOLDER} {catrow.forumrow.FORUM_NAME}
{catrow.forumrow.FORUM_DESC}
-
{L_MODERATOR} {catrow.forumrow.MODERATORS} + {catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS} {catrow.forumrow.TOPICS} {catrow.forumrow.POSTS} {catrow.forumrow.LAST_POST} diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 12afa21e3a..bb16be83fc 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -371,6 +371,7 @@ $template->assign_vars(array( "FOLDER_ANNOUNCE_IMG" => $images['folder_announce'], "FOLDER_ANNOUNCE_NEW_IMG" => $images['folder_announce_new'], + "L_MODERATOR" => ( $total_mods == 1 ) ? $lang['Moderator'] : $lang['Moderators'], "L_MARK_TOPICS_READ" => $lang['Mark_all_topics'], "L_POST_NEW_TOPIC" => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'], -- cgit v1.2.1