aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-12-16 18:58:05 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-12-16 18:58:05 +0000
commitb14ca3c338584d9383bce0782cf758b240ea14a5 (patch)
treeaeb572d363be83385e07ac9f2f8dc731de99095e
parent687b659888897d045fa82ecf4fb61a716c989b46 (diff)
downloadforums-b14ca3c338584d9383bce0782cf758b240ea14a5.tar
forums-b14ca3c338584d9383bce0782cf758b240ea14a5.tar.gz
forums-b14ca3c338584d9383bce0782cf758b240ea14a5.tar.bz2
forums-b14ca3c338584d9383bce0782cf758b240ea14a5.tar.xz
forums-b14ca3c338584d9383bce0782cf758b240ea14a5.zip
Changed way moderator lang is output on viewforum and index
git-svn-id: file:///svn/phpbb/trunk@1611 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/auth.php67
-rw-r--r--phpBB/includes/page_header.php1
-rw-r--r--phpBB/index.php14
-rw-r--r--phpBB/language/lang_english/lang_main.php13
-rw-r--r--phpBB/templates/subSilver/index_body.tpl2
-rw-r--r--phpBB/viewforum.php1
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 = "&nbsp;";
}
+ if( $mods > 0 )
+ {
+ $l_moderators = ( $mods == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
+ }
+ else
+ {
+ $l_moderators = "&nbsp;";
+ }
+
$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'] = "<b>anonymous users</b>";
-$lang['Registered_Users'] = "<b>registered users</b>";
-$lang['Users_granted_access'] = "<b>users granted special access</b>";
-$lang['Moderators'] = "<b>moderators</b>";
-$lang['Administrators'] = "<b>administrators</b>";
+$lang['Auth_Anonymous_Users'] = "<b>anonymous users</b>";
+$lang['Auth_Registered_Users'] = "<b>registered users</b>";
+$lang['Auth_Users_granted_access'] = "<b>users granted special access</b>";
+$lang['Auth_Moderators'] = "<b>moderators</b>";
+$lang['Auth_Administrators'] = "<b>administrators</b>";
$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 @@
<td class="row1" align="center" valign="middle" height="50">{catrow.forumrow.FOLDER}</td>
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
- </span><span class="gensmall">{L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
+ </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
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'],