3 * Ajax Chat for TRPG ver.1.1
4 * (c)2007 Cake All righ1ts reserved.
5 * Mail : cake_67@users.sourceforge.jp
6 * Home : http://trpgtools-onweb.sourceforge.jp/
9 * 本チャットスクリプトの使用および配布は、BSDライセンスに基づきます。
10 * BSDライセンスの詳細につきましては、添付のライセンス.txtを参照してください。
13 * 1. このスクリプトはフリーソフトです。以下の条件を満たす限りにおいて、使用・改造・再配布(オリジナルおよび改造版の両方とも)は自由です。
14 * 再配布する場合、上記著作権表示、本条件書きおよび第2項・第3項の責任限定規定を必ず含めてください。
15 * 2. 同梱のアイコンはPetite Prier様(http://snow.if.tv/)の素材です。
16 本スクリプトの使用および再配布時にアイコンをそのまま用いる場合は、配布元の規定も遵守してください。
17 * 3. 本スクリプトは無保証です。自己責任で使用してください。このスクリプトを使用したいかなる損害に対しても、作者は一切の責任を負いません。
18 * 4. 設置および使用方法に関する質問は、配布サイトの掲示板にお願いします。ただし、必ず回答できるとは限りません。
24 $title = 'Ajaxチャット for TRPG';
30 $home = 'http://trpgtools-onweb.sourceforge.jp/';
33 $masterpass = "password";
35 // 入室前表示(改行のみタグ不要。他はHTMLタグ有効)
37 発言欄で[2d6+2*2-3]のように入力してください。
40 「参加者」表示の行で、「ささやき」したい相手の名前をクリックしてください。
41 ふきだしアイコンをクリックすると「ささやき」が終了します。
42 パスワードを入力していないと、「ささやき」は使えません。
46 動作確認:IE6.0、LunaScape4.1、Opera9.0、Netscape 7.1、(FireFox2.0)
48 // メソッド(通常POST。一部レンタルサーバなど、POSTが使えない環境ではGETにしてください。
53 '66.180.82.','18.241.20.','66.35.255.','128.241.20.',//トレンドマイクロ社ロボットのIPです。ウィルスバスターユーザ二重発言の防止用なので、削除しないでください。
54 '192.168.1.1', // 禁止IPはこちらに追加
58 // 一度に振れる最大ダイス数(0でダイス不使用;最大数は100です)
71 $dice_color = '7793BF';
78 $status_color = '777777';
84 $color_system = '7793BF';
86 $online_msg = 'さんが入室しました。';
88 $offline_msg = 'さんが退室しました。';
95 $whisper ='./image/comment_r_b.gif';
97 $whisper_off ='./image/key_open.gif';
99 $whisper_on ='./image/key_normal.gif';
101 $status_icon ='./image/file_pen_b.gif';
103 $pc_show ='./image/item_move_left.gif';
105 $pc_hide ='./image/item_move_right.gif';
107 $home_icon ='./image/home_b.gif';
109 $help_icon ='./image/help_b.gif';
111 $reload_icon ='./image/reload_b.gif';
113 $admin_icon ='./image/property_b.gif';
115 $dice_icon ='./image/d6.gif';
119 $getdata_on = 2; //(秒)
121 $getdata_off = 90; //(秒)
125 $recent_log = './trpgchat.log';
127 $past_dir = './past/';
129 $master_past_dir = './master_past/';
131 $past_log = './trpgchat_past.log';
133 $now_member = './member.log';
135 $writescript = './write.php';
137 $pastlog_maker = './pastlog.php';
139 $lockfile = 'lock.txt';
140 $lockfile2 = 'lock2.txt';
143 $color_code = array("00","55","99","BB","FF");
145 // 詳細設定:通常は変更しないでください
146 mb_language('Japanese');
147 mb_http_input('auto');
148 mb_http_output('utf8');
149 ini_set('mbstring.encoding_translation','On');
150 ini_set('mbstring.output_buffering','On');
151 ini_set('mbstring.output_hanler','mb_output_handler');
152 ini_set('session.use_cookies', '0');
154 // 著作権とバージョン表示(改変しないでください)
155 $copyright = '<a href="http://trpgtools-onweb.sourceforge.jp/" target="_blank">Ajax Chat for TRPG</a> ver.1.1.1 Copyright(c) Cake 2007 All Rights Reserved.<br>
156 * icons:<a href="http://snow.if.tv/" target="_blank">Petite Prier</a> Thanks!';
161 function html_header($window, $title, $js, $no_cache, $color_chart = false) {
162 $header = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
163 $header .= '<html>'."\n";
164 $header .= '<head>'."\n";
165 $header .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'."\n";
166 $header .= '<meta http-equiv="Content-Style-Type" content="text/css" />'."\n";
168 $header .= '<meta http-equiv="Content-Script-Type" content="text/javascript" />'."\n";
171 $header .= '<meta http-equiv="Pragma" content="no-cache">'."\n";
172 $header .= '<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">'."\n";
173 $header .= '<meta http-equiv="Expires" content="Thu, 01 Feb 2007 00:00:00 GMT">'."\n";
175 if ($window == 'pastlog') {
176 $header .= '<link rel="stylesheet" type="text/css" href="../trpgchat.css">'."\n";
178 $header .= '<link rel="stylesheet" type="text/css" href="trpgchat.css">'."\n";
180 if ($window == 'index') {
181 $header .= '<link rel="stylesheet" type="text/css" href="index.css">'."\n";
182 } elseif ($window == 'main') {
183 $header .= '<link rel="stylesheet" type="text/css" href="main.css">'."\n";
184 } elseif ($window == 'pastlog') {
185 $header .= '<link rel="stylesheet" type="text/css" href="../main.css">'."\n";
187 $header .= '<title>'.$title.'</title>'."\n";
189 $header .= '<script type="text/javascript" src="./lib/jquery.js"></script>'."\n";
192 $header .= '<script type="text/javascript" src="./lib/farbtastic/farbtastic.js"></script>'."\n";
193 $header .= '<script type="text/javascript" src="./lib/farbtastic/farbtastic.css"></script>'."\n";
200 function html_footer($copyright) {
201 if ($copyright) $footer = '<p class="copyright">'.$copyright.'</p>'."\n";
202 $footer .= '</body>'."\n";
203 $footer .= '</html>'."\n";
209 function error($msg) {
210 print html_header(false, 'エラー', false, false);
211 print '</head>'."\n";
213 print '<font color="red">エラー</font><br>'."\n";
215 print html_footer('');
220 function create_hash($name,$pwd) {
225 $key = substr(substr($pwd,1,2)."dummy",0,2);
226 $key = strtr($key,':;<=>?@[\]^_`','ABCDEFGabcdef');
227 $pwd = substr(crypt($name, $key), -10);