因應V3的發布,先來發一篇支援V3的聊天室吧~
而功能正如名稱,是聊天室…(廢話)
簡介如下:
作者:涅魂
版本:1.6
功能:
1.純文字文件紀錄
2.可使用發文顏色
3.支援快速代碼
4.支援隊伍頻道、工會頻道
5.(預設)10分鐘無人發言自動刪除聊天紀錄
6.(預設)5秒內不能連續發言
7.支援密語頻道
8.文字過濾功能
9.修正程式對部分簡體中文產生的錯誤
10.支援UTF8格式
11.密語顯示發送者名稱
12.新增表情符號
13.新增表情符號列表
14.新增動作代碼列表
15.新增表情符號、動作代碼開關設定
16.顯示聊天內容程式碼修正
17.出現錯誤訊息時不顯示聊天內容(節省資源)
18.補強顯示時的身分驗證
19.修改過濾文字與表情符號的處理方式
20.加入聊天室設定功能,用以設定使用者端能控制的聊天室發文與顯示的功能
21.加入聊天室頻道功能
22.刪除定時刪除聊天室文本(預設chat_log.txt)功能,改為將過期的內容刪除的功能(預設5分鐘)
23.修改表情符號的顯示方式為跳窗模式
24.修改聊天室refresh的方式,從meta標籤改為javascript的計時器
25.將chat_config.php從chat.php分離出來
新增檔案:
chat.php
chat_config.php
chat.htm
chat_log.txt
修改檔案:
wog_index.htm
wog.js
class/wog_act_chara.php
快速代碼使用範例:
假設欲新增一快速指令
指令代碼:/glance
替換內容:&name 朝 &aim 看了一眼
則$act_table設定方式如下
- 代碼: 選擇全部
$act_table =array("/kick"=>" &name 踢了 &aim 一腳"[color=red],"/glance"=>"&name 朝 &aim 看了一眼"[/color]);
注意事項:
本聊天室在非Internet Explorer 的其他瀏覽器下無法保證能正常運作
開始安裝
下載檔案:(請照您所下載的WOG編碼格式下載相對應的chat程式)
‧chat_1_6_utf8.exeUTF8格式-exe執行檔
‧chat_1_6_big5.exeBIG5格式-exe執行檔
檔案大小:108 KB
檔案版本:Ver. 1.6
檔案內容:chat.php, chat_config.php, chat.htm
‧chat_face.exe
檔案大小:73 KB
檔案版本:1.0
檔案內容:[chat_face]資料夾
請將解出來的檔案放在[wog]資料夾之中
Open File wog/wog_index.htm
Find
- 代碼: 選擇全部
<frame src="wog_foot.htm" name="foot" id="foot" frameborder="0" scrolling="Auto" noresize marginwidth="0" marginheight="0">
Replace
- 代碼: 選擇全部
[color=red] <frameset cols="*,600" border="0" resize="no" >[/color]
<frame src="wog_foot.htm" name="foot" id="foot" frameborder="0" scrolling="Auto" noresize marginwidth="0" marginheight="0">
[color=red]<frameset rows="*,26" border="0" resize="no" >
<frame src="chat.php" name="chat" id="chat" frameborder="0" scrolling="Auto" noresize marginwidth="0" marginheight="0">
<frame src="chat.htm" name="chat_input" id="chat_input" frameborder="0" scrolling="No" noresize marginwidth="0" marginheight="0">
</frameset>[/color]
Open File wog/wog.js
Find
- 代碼: 選擇全部
function window_open(a,b,c)
Before , Add
- 代碼: 選擇全部
[color=red]function chat_view()
{
var view=parent.chat.document;
view.close();
view.write('<html>');
view.write('<head>');
view.write('<meta http-equiv="Content-Type" content="text/html; charset=big5">');
view.write('<meta http-equiv=Cache-Control content="no-cache">');
view.write('<META HTTP-EQUIV="Refresh" CONTENT=20 src="chat.php"> ');
view.write('<style type=text/css>');
view.write('td {font-family : verdana,Arial,Helvetica ;font-size : 10pt; text-align : center;}');
view.write('</style>');
view.write('</head>');
view.write('<body bgcolor="#000000" text="#EFEFEF" link="#EFEFEF" vlink="#EFEFEF" alink="#EFEFEF" >');
}
function chat_set_view()
{
var view=parent.wog_view.document;
message_cls();
view.write('');
view.write('<form name="frm">');
view.write(temp_table1);
view.write('<tr><td bgcolor="#4B689E" align="center" colspan="4">聊天室設定</td></tr>');
view.write('<cols width="30%" align="center"><cols width="70%">');
view.write('<tr><td>一般設定</td><td>');
view.write('<input type="checkbox" name="face_use" checked> 發言使用表情符號<br>');
view.write('<input type="checkbox" name="fastcode_use" checked> 發言使用動作代碼<br>');
view.write('</td></tr>');
view.write('<tr><td>頻道開關</td><td colspan="3">');
view.write('一般頻道 <input type="radio" name="channel1" value="0">關閉 <input type="radio" name="channel1" value="1" checked>開啟<br>');
view.write('工會頻道 <input type="radio" name="channel2" value="0">關閉 <input type="radio" name="channel2" value="1" checked>開啟<br>');
view.write('隊伍頻道 <input type="radio" name="channel3" value="0">關閉 <input type="radio" name="channel3" value="1" checked>開啟<br>');
view.write('密語頻道 <input type="radio" name="channel4" value="0">關閉 <input type="radio" name="channel4" value="1" checked>開啟<br>');
view.write('</td></tr>');
view.write('<tr><td colspan="4"><input type="button" value="設定完成" onclick="parent.chat_set()"></td></tr>');
view.write(temp_table2);
view.write('</form>');
var chat_arr=Gookie('wog_chat_cookie');
if(chat_arr != null)
{
var f=parent.wog_view.frm;
chat_arr=chat_arr.split(',');
f.face_use.checked=chat_arr[0]=='1'?true:false;
f.fastcode_use.checked=chat_arr[1]=='1'?true:false;
f.channel1[(chat_arr[2]=='0'?0:1)].checked=true;
f.channel2[(chat_arr[3]=='0'?0:1)].checked=true;
f.channel3[(chat_arr[4]=='0'?0:1)].checked=true;
f.channel4[(chat_arr[5]=='0'?0:1)].checked=true;
}
}
function chat_set()
{
var f=parent.wog_view.frm;
var chat_arr=[];
chat_arr.push(f.face_use.checked==true?'1':'0');
chat_arr.push(f.fastcode_use.checked==true?'1':'0');
chat_arr.push(f.channel1[1].checked==true?'1':'0');
chat_arr.push(f.channel2[1].checked==true?'1':'0');
chat_arr.push(f.channel3[1].checked==true?'1':'0');
chat_arr.push(f.channel4[1].checked==true?'1':'0');
chat_arr=chat_arr.toString(',');
Sookie('wog_chat_cookie',chat_arr);
job_end(3);
}
var chat_timer="";[/color]
Open File wog/class/wog_act_chara.php
In chara_save() Function
Find
- 代碼: 選擇全部
$this->show_chara($user_id,$bbs_id,1);
After , Add
- 代碼: 選擇全部
[color=red]echo "<script language='Javascript'>parent.chat_input.document.frm.disabled=false;parent.chat_input.document.frm.style.display='';parent.chat.location.href='./chat.php';</script>";[/color]
In login() Function
Find
- 代碼: 選擇全部
$this->show_chara($p[p_id],$bbs_id,1);
After , Add
- 代碼: 選擇全部
[color=red]echo "<script language='Javascript'>parent.chat_input.document.frm.disabled=false;parent.chat_input.document.frm.style.display='';parent.chat.location.href='./chat.php';</script>";[/color]
Close/Save All Files