[實驗]彈出視窗顯示

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

[實驗]彈出視窗顯示

文章 oO]-[Oo »

實驗目的:
將處理彈出視窗通知的程式碼, 從 privmsg.php 移出, 以加速處理速度及減輕 privmsg.php 的負荷.

實驗結果:
我自己分不出來@@".. 不過理論上是會比較快.

實驗難度: 中\r

[ --- Action: Open includes/page_header.php --- ]

[ --- Action: Find and Delete --- ]

代碼: 選擇全部

	"PRIVATE_MESSAGE_NEW_FLAG" => $s_privmsg_new, 
[ --- Action: Find --- ]

代碼: 選擇全部

	"U_PRIVATEMSGS_POPUP" => append_sid("privmsg.".$phpEx."?mode=newpm"), 
[ --- Action: Replace --- ]

代碼: 選擇全部

	"U_PRIVATEMSGS_POPUP" => append_sid("popup_notice.".$phpEx), // popup_notice
[ --- Action: Close includes/page_header.php --- ]

[ --- Action: Open templates/subSilver/overall_header.tpl --- ]

[ --- Action: Find and Delete --- ]

代碼: 選擇全部

	var new_pm_flag = {PRIVATE_MESSAGE_NEW_FLAG};
[ --- Action: Find --- ]

代碼: 選擇全部

	if( new_pm_flag )
	{
		....................................
	}
[ --- Action: Replace --- ]

代碼: 選擇全部

	....................................
[ --- Action: Close templates/subSilver/overall_header.tpl --- ]

[ --- 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);

?>
[ --- Action: Save popup_notice.php --- ]
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
谷雨
星球公民
星球公民
文章: 45
註冊時間: 2002-01-13 05:55
來自: 失落的天堂
聯繫:

文章 谷雨 »

有個問題,這樣做可以即時彈出嗎?

有時後大家都在線上,如果不 RELOAD 也不會彈出視窗,
這樣就少了即時的效率問題。

雖然這是個小小效果,但好像蠻重要的。
當你走到左邊,發現右邊才是你要的天堂時
  一切是痛苦的.........

http://books.4partners.com/
oO]-[Oo
南宮博士
南宮博士
文章: 512
註冊時間: 2001-11-11 18:09
來自: TAIWAN
聯繫:

文章 oO]-[Oo »

突然看到這篇沒回@@"
嗯.. 我沒改到主架構, 所以跟原本的功能是一樣的..
不過phpBB本身並不是真正即時的喔..
OOHOO said:
有事Mail給我, 不要P我, 因為根本沒辦法P.
主題已鎖定

回到「外掛問題討論」