Fixed errors, non-sid-appended urls, lang switchovers, etc.

git-svn-id: file:///svn/phpbb/trunk@707 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-07-20 15:16:03 +00:00
parent 862f5d6700
commit c285a885ae
6 changed files with 48 additions and 44 deletions

View file

@ -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;
}
}

View file

@ -64,16 +64,11 @@ $template->set_filenames(array(
//
if($userdata['session_logged_in'])
{
$logged_in_status = $lang['You_are_logged_in'] . " <b>" . $userdata["username"] . "</b>.";
$logged_in_status .= " [<a href=\"" . append_sid("login.$phpEx?submit=logout") . "\">" . $lang['Logout'] . "</a>]";
$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'],

View file

@ -27,7 +27,7 @@
//
if($userdata['user_level'] == ADMIN)
{
$admin_link = "<a href=\"admin/index.$phpEx\">Administration Panel</a>";
$admin_link = "<a href=\"" . append_sid("admin/index.$phpEx") . "\">" . $lang['Admin_panel'] . "</a>";
}
$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("<center><font size=-2>phpBB Created this page in %f seconds : " . $db->num_queries . " queries executed : $gzip_text</font></center>", $totaltime);
printf("<center><font size=-2>phpBB Created this page in %f seconds : " . $db->num_queries . " queries executed : $gzip_text".$debug_mode."</font></center>", $totaltime);
//
// Close our DB connection.
//
$db->sql_close();
//for($i=0;$i<count($db->query_array);$i++)
// echo $db->query_array[$i] . "<BR>";
//
// Compress buffered output if required
// and send to browser

View file

@ -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 <a href=\"index.$phpEx\">HERE</a> 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'] = "<b>can</b>";
@ -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";

View file

@ -175,7 +175,7 @@ if($mode == "read")
$savebox_url = "<img src=\"images/msg_savebox.gif\" border=\"0\">&nbsp;<a href=\"" . append_sid("privmsg.$phpEx?folder=savebox") . "\"><b>" . $lang['Saved'] . "</b></a>";
$post_new_mesg_url = "<a href=\"privmsg.$phpEx?mode=post\"><img src=\"templates/PSO/images/post.gif\" border=\"1\"></a>";
$post_reply_mesg_url = ($folder == "inbox") ? "<a href=\"privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsgs_id\"><img src=\"templates/PSO/images/reply.gif\" border=\"1\"></a>" : "";
$post_reply_mesg_url = ($folder == "inbox") ? "<a href=\"" . append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsgs_id") . "\"><img src=\"templates/PSO/images/reply.gif\" border=\"1\"></a>" : "";
$s_hidden_fields = "<input type=\"hidden\" name=\"mark[]\" value=\"$privmsgs_id\">";
@ -239,7 +239,7 @@ if($mode == "read")
$aim_img = ($privmsg['user_aim']) ? "<a href=\"aim:goim?screenname=" . $privmsg['user_aim'] . "&message=Hello+Are+you+there?\"><img src=\"" . $images['icon_aim'] . "\" border=\"0\"></a>" : "";
$msn_img = ($privmsg['user_msnm']) ? "<a href=\"profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id\"><img src=\"" . $images['icon_msnm'] . "\" border=\"0\"></a>" : "";
$msn_img = ($privmsg['user_msnm']) ? "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id") . "\"><img src=\"" . $images['icon_msnm'] . "\" border=\"0\"></a>" : "";
$yim_img = ($privmsg['user_yim']) ? "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=" . $privmsg['user_yim'] . "&.src=pg\"><img src=\"" . $images['icon_yim'] . "\" border=\"0\"></a>" : "";
@ -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") ? "<a href=\"" . append_sid("privmsg.$phpEx
$savebox_url = "<img src=\"images/msg_savebox.gif\" border=\"0\">&nbsp;";
$savebox_url .= ($folder != "savebox") ? "<a href=\"" . append_sid("privmsg.$phpEx?folder=savebox") . "\"><b>" . $lang['Saved'] . "</b></a>" : "<b>" . $lang['Saved'] . "</b>";
$post_new_mesg_url = "<a href=\"privmsg.$phpEx?mode=post\"><img src=\"templates/PSO/images/post.gif\" border=\"1\"></a>";
$post_new_mesg_url = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"templates/PSO/images/post.gif\" border=\"1\"></a>";
//
// General SQL to obtain messages

View file

@ -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 . "<br /><br /><font size=\"-2\">" . $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'] . "</font>";
$l_edit_total = ($postrow[$i]['post_edit_count'] == 1) ? $lang['time_in_total'] : $lang['times_in_total'];
$message = $message . "<br /><br /><font size=\"-2\">" . $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</font>";
}
//
// 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,