diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 85c4426b03..80a1909e5c 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -200,7 +200,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) } } - $is_admin = ($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ? TRUE : FALSE; + $is_admin = ($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ? TRUE : 0; $auth_user = array(); @@ -242,17 +242,17 @@ function auth($type, $forum_id, $userdata, $f_access = -1) break; case AUTH_REG: - $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : FALSE; + $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Registered_Users']; break; case AUTH_ACL: - $auth_user[$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_ACL, $key, $u_access, $is_admin) : FALSE; + $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']; break; case AUTH_MOD: - $auth_user[$key] = ( $userdata['session_logged_in'] ) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : FALSE; + $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']; break; @@ -262,7 +262,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) break; default: - $auth_user[$key] = FALSE; + $auth_user[$key] = 0; break; } } @@ -281,17 +281,17 @@ function auth($type, $forum_id, $userdata, $f_access = -1) break; case AUTH_REG: - $auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? TRUE : FALSE; + $auth_user[$f_forum_id][$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$f_forum_id][$key . '_type'] = $lang['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) : FALSE; + $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']; 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) : FALSE; + $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']; break; @@ -301,7 +301,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) break; default: - $auth_user[$f_forum_id][$key] = FALSE; + $auth_user[$f_forum_id][$key] = 0; break; } } @@ -313,7 +313,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) // 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) : FALSE; + $auth_user['auth_mod'] = ($userdata['session_logged_in']) ? auth_check_user(AUTH_MOD, 'auth_mod', $u_access, $is_admin) : 0; } else { @@ -321,7 +321,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) : FALSE; + $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; } } diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index c3a50efa78..ee1c65867f 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -64,16 +64,11 @@ $template->set_filenames(array( // if($userdata['session_logged_in']) { - $logged_in_status = $lang['You_are_logged_in'] . " " . $userdata["username"] . "."; - $logged_in_status .= " [" . $lang['Logout'] . "]"; - $u_login_logout = "login.$phpEx?submit=logout"; $l_login_logout = $lang['Logout'] . " : " . $userdata["username"] . ""; } else { - $logged_in_status = $lang['You_are_not_logged_in']; - $u_login_logout = "login.$phpEx"; $l_login_logout = $lang['Login']; } @@ -121,7 +116,7 @@ while($row = $db->sql_fetchrow($result)) $userlist = ""; for($i = 0; $i < $logged_visible_online; $i++) { - $userlist .= ($i == $logged_visible_online - 1 && $logged_visible_online > 1) ? " and " : ""; + $userlist .= ($i == $logged_visible_online - 1 && $logged_visible_online > 1) ? " " . $lang['and'] . " " : ""; $userlist .= $userlist_ary[$i]; $userlist .= ($i < $logged_visible_online - 2) ? ", " : ""; } @@ -151,17 +146,17 @@ if($userdata['session_logged_in']) { $new_messages = $pm_result['new_messages']; - $l_message_new = ($new_messages == 1) ? "message" : "messages"; - $l_privmsgs_text = "You have $new_messages new $l_message_new"; + $l_message_new = ($new_messages == 1) ? $lang['message'] : $lang['messages']; + $l_privmsgs_text = $lang['You_have'] . " $new_messages " . $lang['new'] . " $l_message_new"; } else { - $l_privmsgs_text = "You have no new messages"; + $l_privmsgs_text = $lang['No_new_pm']; } } else { - $l_privmsgs_text = "To check your private messages you must login"; + $l_privmsgs_text = $lang['Login_check_pm']; } // @@ -172,9 +167,8 @@ else $template->assign_vars(array( "SITENAME" => $board_config['sitename'], "PAGE_TITLE" => $page_title, - "LOGIN_STATUS" => $logged_in_status, "META_INFO" => $meta_tags, - "TOTAL_USERS_ONLINE" => $lang['There'] . " $l_is_are $logged_visible_online " . $lang['Registered'] . " $l_r_user_s, $logged_hidden_online " . $lang['Hidden'] . " $l_h_user_s and $guests_online " . $lang['Guest'] . " $l_g_user_s " . $lang['online'], + "TOTAL_USERS_ONLINE" => $lang['There'] . " $l_is_are $logged_visible_online " . $lang['Registered'] . " $l_r_user_s, $logged_hidden_online " . $lang['Hidden'] . " $l_h_user_s ". $lang['and'] . " $guests_online " . $lang['Guest'] . " $l_g_user_s " . $lang['online'], "LOGGED_IN_USER_LIST" => $userlist, "L_USERNAME" => $lang['Username'], @@ -199,6 +193,7 @@ $template->assign_vars(array( "L_MODERATOR" => $lang['Moderator'], "L_NONEWPOSTS" => $lang['No_new_posts'], "L_NEWPOSTS" => $lang['New_posts'], + "L_TOPIC_IS_LOCKED" => $lang['Topic_is_locked'], "L_POSTED" => $lang['Posted'], "L_JOINED" => $lang['Joined'], "L_AUTO_LOGIN" => $lang['Log_me_in'], diff --git a/phpBB/includes/page_tail.php b/phpBB/includes/page_tail.php index f5a22e4203..607b322b0b 100644 --- a/phpBB/includes/page_tail.php +++ b/phpBB/includes/page_tail.php @@ -27,7 +27,7 @@ // if($userdata['user_level'] == ADMIN) { - $admin_link = "Administration Panel"; + $admin_link = "" . $lang['Admin_panel'] . ""; } $current_time = time(); @@ -51,14 +51,18 @@ $endtime = $mtime; $totaltime = ($endtime - $starttime); $gzip_text = ($board_config['gzip_compress']) ? "GZIP compression enabled" : "GZIP compression disabled"; +$debug_mode = (DEBUG) ? " : Debug Mode" : ""; -printf("
phpBB Created this page in %f seconds : " . $db->num_queries . " queries executed : $gzip_text
", $totaltime); +printf("
phpBB Created this page in %f seconds : " . $db->num_queries . " queries executed : $gzip_text".$debug_mode."
", $totaltime); // // Close our DB connection. // $db->sql_close(); +//for($i=0;$iquery_array);$i++) +// echo $db->query_array[$i] . "
"; + // // Compress buffered output if required // and send to browser diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 43b5848795..0a9e700c33 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -7,7 +7,6 @@ * email : support@phpbb.com * * $Id$ - * $Id$ * * ***************************************************************************/ @@ -88,7 +87,10 @@ $lang['Yes'] = "Yes"; $lang['No'] = "No"; $lang['Private_messaging'] = "Send a Private Message"; -$lang['Click_index'] = "Click HERE to return to the index"; + +$lang['and'] = "and"; // used within a sentence in various places + +$lang['Admin_panel'] = "Go to Administration Panel"; $lang['You'] = "You"; // This is followed by the auth results for a given function (see below) $lang['can'] = "can"; @@ -200,7 +202,8 @@ $lang['Delete_post'] = "Delete this post"; $lang['Edited_by'] = "Last edited by"; // followed by -> [username] on ... $lang['on'] = "on"; $lang['edited'] = "edited"; // followed by -> [num] times in total -$lang['times_in_total'] = "time/s in total"; +$lang['time_in_total'] = "time in total"; +$lang['times_in_total'] = "times in total"; $lang['Lock_topic'] = "Lock this topic"; $lang['Unlock_topic'] = "Unlock this topic"; @@ -262,6 +265,13 @@ $lang['to_return_topic'] = "to return to the topic"; // // Private Messaging // +$lang['You_have'] = "You have"; // followed by "x new message/s" +$lang['new'] = "new"; // see above +$lang['message'] = "message"; // see above +$lang['messages'] = "messages"; // see above +$lang['No_new_pm'] = "You have no new messages"; +$lang['Login_check_pm'] = "Login to check your private messages"; + $lang['Inbox'] = "Inbox"; $lang['Sent'] = "Sent"; $lang['Outbox'] = "Outbox"; diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index f4bc503ba9..e78b4f733c 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -175,7 +175,7 @@ if($mode == "read") $savebox_url = " " . $lang['Saved'] . ""; $post_new_mesg_url = ""; - $post_reply_mesg_url = ($folder == "inbox") ? "" : ""; + $post_reply_mesg_url = ($folder == "inbox") ? "" : ""; $s_hidden_fields = ""; @@ -239,7 +239,7 @@ if($mode == "read") $aim_img = ($privmsg['user_aim']) ? "" : ""; - $msn_img = ($privmsg['user_msnm']) ? "" : ""; + $msn_img = ($privmsg['user_msnm']) ? "" : ""; $yim_img = ($privmsg['user_yim']) ? "" : ""; @@ -435,7 +435,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit") } $privmsg = $db->sql_fetchrow($pm_reply_status); - $subject = $lang['Re'] . ":" . stripslashes($privmsg['privmsgs_subject']); + $subject = ( (strstr("Re:", $privmsg['privmsgs_subject'])) ? $lang['Re'] . ":" : "" ) . stripslashes($privmsg['privmsgs_subject']); $to_username = stripslashes($privmsg['username']); $to_userid = $privmsg['user_id']; @@ -1063,7 +1063,7 @@ $outbox_url .= ($folder != "outbox") ? " "; $savebox_url .= ($folder != "savebox") ? "" . $lang['Saved'] . "" : "" . $lang['Saved'] . ""; -$post_new_mesg_url = ""; +$post_new_mesg_url = ""; // // General SQL to obtain messages diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3752b2d218..0d4991950e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -105,9 +105,9 @@ $join_sql_table = (!isset($post_id)) ? "" : "" . POSTS_TABLE . " p, " . POSTS_TA $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 p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_votecreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC"; +$order_sql = (!isset($post_id)) ? "" : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, f.forum_name, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments 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_name, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_votecreate, f.auth_vote, f.auth_attachments" . $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, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_votecreate, f.auth_vote, f.auth_attachments" . $count_sql . " FROM $join_sql_table " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f WHERE $join_sql AND f.forum_id = t.forum_id @@ -150,7 +150,7 @@ init_userprefs($userdata); // $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row[0]); -if(!$is_auth['auth_view'] || !$is_auth['auth_view']) +if(!$is_auth['auth_view'] || !$is_auth['auth_read']) { // // The user is not authed to read this forum ... @@ -426,21 +426,16 @@ for($i = 0; $i < $total_posts; $i++) // if($postrow[$i]['post_edit_count']) { - $message = $message . "

" . $lang['Edited_by'] . " " . $poster . " " . $lang['on'] . " " . create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['default_timezone']) . ", " . $lang['edited'] . " " . $postrow[$i]['post_edit_count'] . " " . $lang['times_in_total'] . ""; + $l_edit_total = ($postrow[$i]['post_edit_count'] == 1) ? $lang['time_in_total'] : $lang['times_in_total']; + + $message = $message . "

" . $lang['Edited_by'] . " " . $poster . " " . $lang['on'] . " " . create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['default_timezone']) . ", " . $lang['edited'] . " " . $postrow[$i]['post_edit_count'] . " $l_edit_total"; } // // Again this will be handled by the templating // code at some point // - if(!($i % 2)) - { - $color = "#" . $theme['td_color1']; - } - else - { - $color = "#" . $theme['td_color2']; - } + $color = (!($i % 2)) ? "#" . $theme['td_color1'] : "#" . $theme['td_color2']; $template->assign_block_vars("postrow", array( "POSTER_NAME" => $poster,