aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-11-21 15:56:12 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-11-21 15:56:12 +0000
commitcad29155b83c30b79db08d7edfc7b27f77fe0f42 (patch)
tree469e74bbdef248ae15273ac9ab9cc252db538517
parentdb41a689f8312e16be125a157084ab64e5c4885a (diff)
downloadforums-cad29155b83c30b79db08d7edfc7b27f77fe0f42.tar
forums-cad29155b83c30b79db08d7edfc7b27f77fe0f42.tar.gz
forums-cad29155b83c30b79db08d7edfc7b27f77fe0f42.tar.bz2
forums-cad29155b83c30b79db08d7edfc7b27f77fe0f42.tar.xz
forums-cad29155b83c30b79db08d7edfc7b27f77fe0f42.zip
PM popup and icon are finally in place
git-svn-id: file:///svn/phpbb/trunk@1405 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/page_header.php21
-rw-r--r--phpBB/language/lang_english/lang_main.php4
-rw-r--r--phpBB/privmsg.php43
-rw-r--r--phpBB/templates/subSilver/overall_header.tpl14
-rw-r--r--phpBB/templates/subSilver/privmsgs_popup.tpl22
-rw-r--r--phpBB/templates/subSilver/subSilver.cfg2
6 files changed, 102 insertions, 4 deletions
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index c5aa78032e..3635e71f1f 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -173,10 +173,12 @@ if( $userdata['session_logged_in'] )
}
$s_privmsg_new = true;
+ $icon_pm = $images['pm_new_msg'];
}
else
{
$s_privmsg_new = 0;
+ $icon_pm = $images['pm_no_new_msg'];
}
}
else
@@ -184,6 +186,7 @@ if( $userdata['session_logged_in'] )
$l_privmsgs_text = $lang['No_new_pm'];
$s_privmsg_new = 0;
+ $icon_pm = $images['pm_no_new_msg'];
}
if( $userdata['user_unread_privmsg'] )
@@ -219,6 +222,21 @@ $template->assign_vars(array(
"PRIVATE_MESSAGE_NEW_FLAG" => $s_privmsg_new,
"LAST_VISIT_DATE" => sprintf($lang['You_last_visit'], $s_last_visit),
+ "PRIVMSG_IMG" => $icon_pm,
+ "FORUM_IMG" => $images['forum'],
+ "FORUM_NEW_IMG" => $images['forum_new'],
+ "FORUM_LOCKED_IMG" => $images['forum_locked'],
+ "FOLDER_IMG" => $images['folder'],
+ "FOLDER_NEW_IMG" => $images['folder_new'],
+ "FOLDER_HOT_IMG" => $images['folder_hot'],
+ "FOLDER_HOT_NEW_IMG" => $images['folder_hot_new'],
+ "FOLDER_LOCKED_IMG" => $images['folder_locked'],
+ "FOLDER_LOCKED_NEW_IMG" => $images['folder_locked_new'],
+ "FOLDER_STICKY_IMG" => $images['folder_sticky'],
+ "FOLDER_STICKY_NEW_IMG" => $images['folder_sticky_new'],
+ "FOLDER_ANNOUNCE_IMG" => $images['folder_announce'],
+ "FOLDER_ANNOUNCE_NEW_IMG" => $images['folder_announce_new'],
+
"L_USERNAME" => $lang['Username'],
"L_PASSWORD" => $lang['Password'],
"L_LOGIN" => $lang['Login'],
@@ -260,7 +278,8 @@ $template->assign_vars(array(
"U_INDEX" => append_sid("index.".$phpEx),
"U_REGISTER" => append_sid("profile.".$phpEx."?mode=register"),
"U_PROFILE" => append_sid("profile.".$phpEx."?mode=editprofile"),
- "U_PRIVATEMSGS" => append_sid("privmsg.".$phpEx."?folder=inbox"),
+ "U_PRIVATEMSGS" => append_sid("privmsg.".$phpEx."?folder=inbox"),
+ "U_PRIVATEMSGS_POPUP" => append_sid("privmsg.".$phpEx."?mode=newpm"),
"U_SEARCH" => append_sid("search.".$phpEx),
"U_MEMBERLIST" => append_sid("memberlist.".$phpEx),
"U_MODCP" => append_sid("modcp.".$phpEx),
diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php
index c66e32c653..85a47df807 100644
--- a/phpBB/language/lang_english/lang_main.php
+++ b/phpBB/language/lang_english/lang_main.php
@@ -363,6 +363,9 @@ $lang['No_new_pm'] = "You have no new messages";
$lang['Unread_pms'] = "You have %d unread messages";
$lang['Unread_pm'] = "You have %d unread message";
$lang['No_unread_pm'] = "You have no unread messages";
+$lang['You_new_pm'] = "A new private message is waiting for you in your Inbox";
+$lang['You_new_pms'] = "New private messages are waiting for you in your Inbox";
+$lang['You_no_new_pm'] = "No new private messages are waiting for you";
$lang['Inbox'] = "Inbox";
$lang['Outbox'] = "Outbox";
@@ -420,6 +423,7 @@ $lang['Inbox_size'] = "Your Inbox is %d%% full"; // eg. Your Inbox is 50% full
$lang['Sentbox_size'] = "Your Sentbox is %d%% full";
$lang['Savebox_size'] = "Your Savebox is %d%% full";
+$lang['Click_view_privmsg'] = "Click %sHere%s to visit your Inbox";
//
// Profiles/Registration
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index c108cb9836..1c20d7a91f 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -118,7 +118,46 @@ $savebox_url = ($folder != "savebox" || $mode != "") ? '<a href="' . append_sid(
// ----------
// Start main
//
-if( $mode == "read" )
+if( $mode == "newpm" )
+{
+ $gen_simple_header = TRUE;
+
+ $page_title = $lang['Private_Messaging'];
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
+
+ $template->set_filenames(array(
+ "body" => "privmsgs_popup.tpl")
+ );
+
+ if( $userdata['session_logged_in'] )
+ {
+ if( $userdata['user_new_privmsg'] )
+ {
+ $l_new_message = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['You_new_pm'] : $lang['You_new_pms'];
+ }
+ else
+ {
+ $l_new_message = $lang['You_no_new_pm'];
+ }
+
+ $l_new_message .= "<br /><br />" . sprintf($lang['Click_view_privmsg'], "<a href=\"" . append_sid("privmsg.".$phpEx."?folder=inbox") . "\" onClick=\"jump_to_inbox();return false;\" target=\"_new\">", "</a>");
+ }
+ else
+ {
+ $l_new_message = $lang['Login_check_pm'];
+ }
+
+ $template->assign_vars(array(
+ "L_CLOSE_WINDOW" => $lang['Close_window'],
+ "L_MESSAGE" => $l_new_message)
+ );
+
+ $template->pparse("body");
+
+ include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
+
+}
+else if( $mode == "read" )
{
if( !empty($HTTP_GET_VARS[POST_POST_URL]) )
{
@@ -931,7 +970,7 @@ else if( $submit || $refresh || $mode != "" )
AND privmsgs_from_userid = " . $to_userdata['user_id'];
if( !$result = $db->sql_query($sql) )
{
- message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_MESSAGE, $lang['No_such_user']);
}
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
diff --git a/phpBB/templates/subSilver/overall_header.tpl b/phpBB/templates/subSilver/overall_header.tpl
index 6feb03eab1..754e80d656 100644
--- a/phpBB/templates/subSilver/overall_header.tpl
+++ b/phpBB/templates/subSilver/overall_header.tpl
@@ -4,7 +4,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<meta http-equiv="Content-Type" content="text/html" />
<meta http-equiv="Content-Style-Type" content="text/css" />
{META}
<title>{SITENAME} :: {PAGE_TITLE}</title>
@@ -201,6 +201,18 @@ a.copyright { color: #333333; text-decoration: none;}
a.copyright:hover { color: #000000; text-decoration: underline;}
-->
</style>
+<!-- BEGIN switch_enable_pm_popup -->
+<script language="Javascript" type="text/javascript">
+<!--
+ var new_pm_flag = {PRIVATE_MESSAGE_NEW_FLAG};
+
+ if( new_pm_flag )
+ {
+ window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=200,resizable=yes,WIDTH=400');;
+ }
+//-->
+</script>
+<!-- END switch_enable_pm_popup -->
</head>
<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}">
diff --git a/phpBB/templates/subSilver/privmsgs_popup.tpl b/phpBB/templates/subSilver/privmsgs_popup.tpl
new file mode 100644
index 0000000000..e48205b338
--- /dev/null
+++ b/phpBB/templates/subSilver/privmsgs_popup.tpl
@@ -0,0 +1,22 @@
+
+<script language="javascript" type="text/javascript">
+<!--
+function jump_to_inbox()
+{
+ opener.document.location.href = "{U_PRIVATEMSGS}";
+ window.close();
+}
+//-->
+</script>
+
+ <table width="100%" border="0" cellspacing="0" cellpadding="10">
+ <tr>
+ <td>
+ <table width="100%" border="0" cellspacing="1" cellpadding="4" class="forumline">
+ <tr>
+ <td valign="top" class="row1" align="center"><br /><span class="gen">{L_MESSAGE}</span><br /><br /><span class="genmed"><a href="javascript:window.close();" class="genmed">{L_CLOSE_WINDOW}</a></span><br /><br /></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
diff --git a/phpBB/templates/subSilver/subSilver.cfg b/phpBB/templates/subSilver/subSilver.cfg
index 33b605947f..a4dd58feda 100644
--- a/phpBB/templates/subSilver/subSilver.cfg
+++ b/phpBB/templates/subSilver/subSilver.cfg
@@ -71,6 +71,8 @@ $images['pm_replymsg'] = "templates/subSilver/images/reply.gif";
$images['pm_postmsg'] = "templates/subSilver/images/msg_newpost.gif";
$images['pm_quotemsg'] = "templates/subSilver/images/icon_quote.gif";
$images['pm_editmsg'] = "templates/subSilver/images/icon_edit.gif";
+$images['pm_new_msg'] = "";
+$images['pm_no_new_msg'] = "";
$images['topic_watch'] = "";
$images['topic_un_watch'] = "";