OSDN Git Service

trpgchat ver1.1.1
[trpgtools-onweb/AjaxChat.git] / trpgchat-ini.php
1 <?php
2 /*
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/
7  *
8  * [注意事項他]
9  * 本チャットスクリプトの使用および配布は、BSDライセンスに基づきます。
10  * BSDライセンスの詳細につきましては、添付のライセンス.txtを参照してください。
11  *
12  * BSDライセンス概要&使用上の注意
13  * 1. このスクリプトはフリーソフトです。以下の条件を満たす限りにおいて、使用・改造・再配布(オリジナルおよび改造版の両方とも)は自由です。
14  * 再配布する場合、上記著作権表示、本条件書きおよび第2項・第3項の責任限定規定を必ず含めてください。
15  * 2. 同梱のアイコンはPetite Prier様(http://snow.if.tv/)の素材です。
16       本スクリプトの使用および再配布時にアイコンをそのまま用いる場合は、配布元の規定も遵守してください。
17  * 3. 本スクリプトは無保証です。自己責任で使用してください。このスクリプトを使用したいかなる損害に対しても、作者は一切の責任を負いません。
18  * 4. 設置および使用方法に関する質問は、配布サイトの掲示板にお願いします。ただし、必ず回答できるとは限りません。
19  * メールによる質問は、ご遠慮ください。
20  */
21
22 // 基本設定
23     // チャット名
24 $title = 'Ajaxチャット for TRPG';
25
26     // 現在画面に表示する行数
27 $max_num= 40;
28
29     // ホームページのURL(返り先)
30 $home = 'http://trpgtools-onweb.sourceforge.jp/';
31
32     // 管理者用パスワード
33 $masterpass = "password";
34
35     // 入室前表示(改行のみタグ不要。他はHTMLタグ有効)
36 $help = '「ダイス」ヘルプ
37 発言欄で[2d6+2*2-3]のように入力してください。
38
39 「ささやき」ヘルプ
40 「参加者」表示の行で、「ささやき」したい相手の名前をクリックしてください。
41 ふきだしアイコンをクリックすると「ささやき」が終了します。
42 パスワードを入力していないと、「ささやき」は使えません。
43
44 HTMLタグは無効です。
45
46 動作確認:IE6.0、LunaScape4.1、Opera9.0、Netscape 7.1、(FireFox2.0)
47 ';
48     // メソッド(通常POST。一部レンタルサーバなど、POSTが使えない環境ではGETにしてください。
49     $method = 'POST';
50
51     // 書きこみ禁止IP
52 $block_ip = array(
53 '66.180.82.','18.241.20.','66.35.255.','128.241.20.',//トレンドマイクロ社ロボットのIPです。ウィルスバスターユーザ二重発言の防止用なので、削除しないでください。
54 '192.168.1.1', // 禁止IPはこちらに追加
55 );
56
57 //ダイス関連
58     // 一度に振れる最大ダイス数(0でダイス不使用;最大数は100です)
59 $dice_max = 10;
60     // ダイスボタン設定
61 $preset_dice = array(
62     '2D6',
63     '1D6',
64     '3D6',
65     '1D8',
66     '1D10',
67     '1D20',
68     '1D100',
69 );
70     // ダイスメッセージ色
71 $dice_color = '7793BF';
72
73
74 //表示メッセージなどの設定
75     // ステータス欄デフォルト入力
76 $status = '';
77     // ステータス表示色
78 $status_color = '777777';
79     // PC欄最大数
80 $pc_num = 5;
81     // システム表示名
82 $system = 'System';
83     // システム文字色
84 $color_system = '7793BF';
85     // 入室時に表示されるメッセージ
86 $online_msg = 'さんが入室しました。';
87     // 退室時に表示されるメッセージ
88 $offline_msg = 'さんが退室しました。';
89     // 名前入力欄への表示
90 $noname = 'お名前';
91
92
93 // 画像関連設定
94     // ささやきマーク
95 $whisper ='./image/comment_r_b.gif';
96     // ささやき中
97 $whisper_off ='./image/key_open.gif';
98     // ささやき解除
99 $whisper_on ='./image/key_normal.gif';
100     // ステータス欄表示
101 $status_icon ='./image/file_pen_b.gif';
102     // PC欄追加
103 $pc_show ='./image/item_move_left.gif';
104     // PC欄削除
105 $pc_hide ='./image/item_move_right.gif';
106     // ホームアイコン
107 $home_icon ='./image/home_b.gif';
108     // ヘルプアイコン
109 $help_icon ='./image/help_b.gif';
110     // リロードアイコン
111 $reload_icon ='./image/reload_b.gif';
112     // 管理画面アイコン
113 $admin_icon ='./image/property_b.gif';
114     // ダイスアイコン
115 $dice_icon ='./image/d6.gif';
116
117 // データ取得間隔
118     // オンライン中
119 $getdata_on = 2;  //(秒)
120         // ROM中
121 $getdata_off = 90; //(秒)
122
123 // ファイル名
124     // 最新ログファイル名
125 $recent_log = './trpgchat.log';
126     // 過去ログ保管ディレクトリ
127 $past_dir = './past/';
128     // 管理用過去ログ保管ディレクトリ
129 $master_past_dir = './master_past/';
130     // 直近過去ログファイル名
131 $past_log = './trpgchat_past.log';
132     // メンバーチェッカーログファイル名
133 $now_member = './member.log';
134     // ログ書き込みスクリプト名
135 $writescript = './write.php';
136     // 過去ログ管理スクリプト
137 $pastlog_maker = './pastlog.php';
138     // ロックファイル
139 $lockfile = 'lock.txt';
140 $lockfile2 = 'lock2.txt';
141
142 // 文字色カラーコード作成
143 $color_code = array("00","55","99","BB","FF");
144
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');
153
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!';
157
158
159 // 共通関数
160 /* ヘッター */
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";
167     if ($js) {
168         $header .= '<meta http-equiv="Content-Script-Type" content="text/javascript" />'."\n";
169     }
170     if ($no_cache) {
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";
174     }
175     if ($window == 'pastlog') {
176         $header .= '<link rel="stylesheet" type="text/css" href="../trpgchat.css">'."\n";
177     } else {
178         $header .= '<link rel="stylesheet" type="text/css" href="trpgchat.css">'."\n";
179     }
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";
186     }
187     $header .= '<title>'.$title.'</title>'."\n";
188     if ($js) {
189         $header .= '<script type="text/javascript" src="./lib/jquery.js"></script>'."\n";
190     }
191     if ($color_chart) {
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";
194     }
195
196     return $header;
197 }
198
199 /* フッター */
200 function html_footer($copyright) {
201     if ($copyright) $footer = '<p class="copyright">'.$copyright.'</p>'."\n";
202     $footer .= '</body>'."\n";
203     $footer .= '</html>'."\n";
204
205     return $footer;
206 }
207
208 /* エラー表示 */
209 function error($msg) {
210     print html_header(false, 'エラー', false, false);
211     print '</head>'."\n";
212     print '<body>'."\n";
213     print '<font color="red">エラー</font><br>'."\n";
214     print $msg."\n";
215     print  html_footer('');
216     exit;
217 }
218
219 /* トリップ生成 */
220 function create_hash($name,$pwd) {
221     //パスワードがなければ中止
222     if (!$pwd) {
223         return false;
224     }
225     $key = substr(substr($pwd,1,2)."dummy",0,2);
226     $key = strtr($key,':;<=>?@[\]^_`','ABCDEFGabcdef');
227     $pwd = substr(crypt($name, $key), -10);
228
229     return $pwd;
230 }
231 ?>