[外掛](3.0)聊天室 Ver 1.6

版主: 涅魂, 簫哥


涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

[外掛](3.0)聊天室 Ver 1.6

文章涅魂 » 2006-05-21 8:18 pm

----------最新版本請由此進----------

因應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


最後由 涅魂 於 2009-09-10 1:44 am 編輯,總共編輯了 26 次。

¥飛天阿鳥¥
 
文章: 322
註冊時間: 2004-11-07 3:04 pm
來自: 水色的某一處     團體:變態團團員     團隊:烤鳥隊長

Re: [外掛](3.0)聊天室

文章¥飛天阿鳥¥ » 2006-05-21 8:36 pm

安裝完後..............無法顯示網頁 :roll:

我今天安裝外掛都失敗ˋˊ~~我今天怎麼這麼倒楣 :cry:




涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

文章涅魂 » 2006-05-21 8:49 pm

找到問題了,的確是我的疏失… :roll:

聊天室中用來輸入聊天內容的chat.htm之前忘記放上…

現在已經加上去了,請再看一次安裝文章吧 :o



¥飛天阿鳥¥
 
文章: 322
註冊時間: 2004-11-07 3:04 pm
來自: 水色的某一處     團體:變態團團員     團隊:烤鳥隊長

文章¥飛天阿鳥¥ » 2006-05-21 8:56 pm

成功.......謝謝小涅~~



leobbs
 
文章: 161
註冊時間: 2006-01-30 2:19 am

文章leobbs » 2006-05-21 9:24 pm

感謝分享-好帥喔^^



simon2007
 
文章: 95
註冊時間: 2006-05-01 12:18 pm
來自: hk

文章simon2007 » 2006-05-21 9:26 pm

多發佈一個2.08的聊天室和教學,得嗎



想不通
 
文章: 185
註冊時間: 2005-11-06 2:37 pm

文章想不通 » 2006-05-21 9:42 pm

能增加過濾字嗎???
就是罵髒話的時侯 對話欄對有紅色驚告字及禁言
' 特別字句將不能發出 系統將你禁言xx秒 '


我的wog有空就玩玩吧


涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

文章涅魂 » 2006-05-21 10:09 pm

simon2007 寫:多發佈一個2.08的聊天室和教學,得嗎

修改內容在V2.8中都有,所以這個直接用在V2.8上應該是沒問題的

請試看看吧 :o




涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

文章涅魂 » 2006-05-21 10:19 pm

想不通 寫:能增加過濾字嗎???
就是罵髒話的時侯 對話欄對有紅色驚告字及禁言
' 特別字句將不能發出 系統將你禁言xx秒 '

禁言是沒辦法,用到資料庫有違這個外掛的原則,用純文字來儲存又覺得有點沒效率… :roll:

不過系統過濾文字的話是可行的~

In wog/chat.php

Find
代碼: 選擇全部
$sendtime=5;         //發言時間限制

After , Add
代碼: 選擇全部
[color=red]$ban_char = "測試|無聊|哈哈哈|喔喔";   //系統過濾文字(regular expression)[/color]

Find
代碼: 選擇全部
if(time() < $_POST['sendtime']+$sendtime)
{
   echo '<font color=red><b>系統訊息</b></font>:'.$sendtime.'秒內無法再次發言<br>';
}elseif(!empty($_POST['message']))

Replace
代碼: 選擇全部
if(time() < $_POST['sendtime']+$sendtime)
{
   echo '<font color=red><b>系統訊息</b></font>:'.$sendtime.'秒內無法再次發言<br>';
}[color=red]elseif(eregi($ban_char,$_POST['message']))
{
   echo '<font color=red><b>系統訊息</b></font>:對話內容中含有系統過濾字體<br>';
}[/color]elseif(!empty($_POST['message']))

這樣就可以囉~



simon2007
 
文章: 95
註冊時間: 2006-05-01 12:18 pm
來自: hk

文章simon2007 » 2006-05-21 10:38 pm

涅魂 寫:
simon2007 寫:多發佈一個2.08的聊天室和教學,得嗎

修改內容在V2.8中都有,所以這個直接用在V2.8上應該是沒問題的

請試看看吧 :o

真的嗎?那我試試看



simon2007
 
文章: 95
註冊時間: 2006-05-01 12:18 pm
來自: hk

文章simon2007 » 2006-05-21 10:46 pm

不行,右下角出現Warning: main(./forum_support/config/config.php): failed to open stream: No such file or directory in c:\appserv\www\wog\chat.php on line 5

Fatal error: main(): Failed opening required './forum_support/config/config.php' (include_path='.;c:\php4\pear') in c:\appserv\www\wog\chat.php on line 5



頭像
~木林森~
 
文章: 446
註冊時間: 2005-01-20 12:28 pm
來自: 澎湖的某一處

文章~木林森~ » 2006-05-21 11:03 pm

這個看一下錯誤訊息就能了解了
路徑改一下就好了
編輯chat.php
尋找
代碼: 選擇全部
require_once("./forum_support/config/config.php");
require_once("./forum_support/config/db_mysql.php");

換成
代碼: 選擇全部
require_once("./../vbb_support/config/config.php");
require_once("./../vbb_support/config/db_mysql.php");

應該就可以了


龜速吸收PHP知識中...
"新"[團結就是力量論壇]登場!歡迎大家加入
WOG Only v2.08 + else Mod (簡單的架設結合許多優秀外掛的WOG)

simon2007
 
文章: 95
註冊時間: 2006-05-01 12:18 pm
來自: hk

文章simon2007 » 2006-05-21 11:07 pm

改完之後右下角又出現
There seems to have been a slight problem with the database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

Database error in WOG : Invalid SQL: SELECT p_id,p_name,p_g_id,t_id FROM wog_player WHERE p_id=6 mysql error: Unknown column 't_id' in 'field list' mysql error number: 1054 Date: Sunday 21st of May 2006 11:05:49 PM Script: http://kffahonaa.zapto.org Referer: http://kffahonaa.zapto.org/wog/chat.htm IP Address: 221.127.73.130



頭像
~木林森~
 
文章: 446
註冊時間: 2005-01-20 12:28 pm
來自: 澎湖的某一處

文章~木林森~ » 2006-05-21 11:44 pm

這個就要看你要新增隊伍系統
還是把聊天室的隊伍部分給刪除囉


龜速吸收PHP知識中...
"新"[團結就是力量論壇]登場!歡迎大家加入
WOG Only v2.08 + else Mod (簡單的架設結合許多優秀外掛的WOG)

笑傲乾坤
 
文章: 89
註冊時間: 2006-01-08 1:21 pm

文章笑傲乾坤 » 2006-05-22 11:41 am

請問...為什麼我安裝後,聊天的地方出現找不到網頁??
安裝後我也有再檢查兩三次,確認安裝步驟沒有錯...
訊息顯示
代碼: 選擇全部
Not Found
The requested URL /wog3_big5/chat.php was not found on this server.


--------------------------------------------------------------------------------

Apache/1.3.31 Server at localhost Port 80




下一頁

回到 外掛區

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 2 位訪客

cron