From cad29155b83c30b79db08d7edfc7b27f77fe0f42 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Wed, 21 Nov 2001 15:56:12 +0000 Subject: PM popup and icon are finally in place git-svn-id: file:///svn/phpbb/trunk@1405 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/page_header.php | 21 +++++++++++++- phpBB/language/lang_english/lang_main.php | 4 +++ phpBB/privmsg.php | 43 ++++++++++++++++++++++++++-- phpBB/templates/subSilver/overall_header.tpl | 14 ++++++++- phpBB/templates/subSilver/privmsgs_popup.tpl | 22 ++++++++++++++ phpBB/templates/subSilver/subSilver.cfg | 2 ++ 6 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 phpBB/templates/subSilver/privmsgs_popup.tpl 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 != "") ? '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 .= "

" . sprintf($lang['Click_view_privmsg'], "
", ""); + } + 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 @@ - + {META} {SITENAME} :: {PAGE_TITLE} @@ -201,6 +201,18 @@ a.copyright { color: #333333; text-decoration: none;} a.copyright:hover { color: #000000; text-decoration: underline;} --> + + + 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 @@ + + + + + + + +
+ + + + +

{L_MESSAGE}

{L_CLOSE_WINDOW}

+
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'] = ""; -- cgit v1.2.1