將處理彈出視窗通知的程式碼, 從 privmsg.php 移出, 以加速處理速度及減輕 privmsg.php 的負荷.
實驗結果:
我自己分不出來@@".. 不過理論上是會比較快.
實驗難度: 中\r
[ --- Action: Open includes/page_header.php --- ]
[ --- Action: Find and Delete --- ]
代碼: 選擇全部
"PRIVATE_MESSAGE_NEW_FLAG" => $s_privmsg_new,
代碼: 選擇全部
"U_PRIVATEMSGS_POPUP" => append_sid("privmsg.".$phpEx."?mode=newpm"),
代碼: 選擇全部
"U_PRIVATEMSGS_POPUP" => append_sid("popup_notice.".$phpEx), // popup_notice
[ --- Action: Open templates/subSilver/overall_header.tpl --- ]
[ --- Action: Find and Delete --- ]
代碼: 選擇全部
var new_pm_flag = {PRIVATE_MESSAGE_NEW_FLAG};
代碼: 選擇全部
if( new_pm_flag )
{
....................................
}
代碼: 選擇全部
....................................
[ --- Action: Create popup_notice.php --- ]
代碼: 選擇全部
<?php
/***************************************************************************
* popup_notice.php
* -------------------
* begin : Saturday, Jun 9, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: popup_notice.php,v 1.00 2002/01/24 20:16:09 OOHOO Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Is PM disabled?
//
if( !empty($board_config['privmsg_disable']) )
{
message_die(GENERAL_MESSAGE, 'PM_disabled');
}
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PRIVMSGS, $session_length);
init_userprefs($userdata);
//
// End session management
//
$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);
?>

