OSDN Git Service

PHP Notice対応
[trpgtools-onweb/AjaxChat.git] / index.php
1 <?php
2 /*
3  Ajax Chat for TRPG ver.2.6.2
4  (c)2007-2009 Cake All Rights Reserved.
5  Mail : cake_67@users.sourceforge.jp
6  Home : http://trpgtools-onweb.sourceforge.jp/
7  */
8
9 // かんたんセットアップ対応
10 require_once './lib/trpgchat.php';
11 require_once './trpgchat-ini-2.php';
12 if (!file_exists('./trpgchat-ini.php')) {
13     if (!file_exists('./setup.php')) {
14         error('setup.phpがありません。ディレクトリを確認してください。', false, false, true);
15     }
16     $self_url = get_self_url();
17     $url =str_replace('index.php', 'setup.php', $self_url);
18     header('Location: '.$url);
19     exit;
20 }
21 if (file_exists('./setup.php')) {
22     error('setup.phpを移動するか、または名前を変えてください。', false, false, true);
23 }
24
25 // 設定ファイルの読み込み
26 require_once './trpgchat-ini.php';
27 require_once './lib/ini/trpgchat-ini-help.php';
28
29 // 設定セット
30 set_config(read_config());
31
32 // アクセスブロック
33 access_block();
34
35 // 携帯は携帯INDEXへ
36 // 後日実装
37
38 // HTML出力
39 print html_header(CHAT_TITLE, 'index', true, true);
40
41 // COOKIE読み込み
42 $cookies = read_cookie();
43
44 // JavaScript読み込み
45 require_once './lib/js/trpgchat-js.php';
46 require_once './lib/js/index-js.php';
47
48 ?>
49 </head>
50 <body onblur="inputBlur()" onresize="changeSize()" onunload="UnLoad()">
51
52 <input id="isInputFocus" type="checkbox" class="nodisplay">
53
54 <?php
55 // 操作欄
56 if (UPPER_USER_PANEL) {
57     include './index_inc_userpanel.php';
58 }
59  ?>
60
61 <div>
62 <?php
63 // コンソール
64 // ヘルプ
65 write_console('55px', '-400px', '350px', 'none', 'help_win', 'ヘルプ', HELP_MSG.$GLOBALS['AJAX_CHAT_TRPG']['STATIC_HELP'], $GLOBALS['AJAX_CHAT_TRPG']['ACCORDION_HELP'], '', false);
66 // 入室前表示
67 if (OFFWINDOW_MSG || (UNPUBLIC_LAST_PASTLOG && NO_LAST_PASTLOG_MSG)) {
68     $off_msg = OFFWINDOW_MSG;
69     if (UNPUBLIC_LAST_PASTLOG) $off_msg .= NO_LAST_PASTLOG_MSG;
70     write_console('30px', '-330px', '250px', '', 'offline_win', '', nl2br($off_msg), array(), '', false);
71 }
72 // クッキーをファイルから読む
73 if (COOKEI_EXPIRE && COOKIE) {
74     $body = '<div class="nodisplay">'.
75             '<form id="cookieFrame" action="./cookie_load.php" method="POST" enctype="multipart/form-data" onsubmit="if(!isFile(\'#cookieFileName\')){return false;};">'.
76             '</div>'.
77             '<input type="file" name="cookieFileName" id="cookieFileName">'.
78             '<input type="hidden" name="MAX_FILE_SIZE" value="300000" />'.
79             '<input type="submit" value="読み込む"> '.
80             '<input type="reset" value="やめる" onclick="hideTarget(\'load_cookie\')">'.
81             '<div class="nodisplay"></form></div>';
82     write_console('35px', '0px', '200px', 'none', 'load_cookie', '設定をファイルから読み込む', $body, '', '', false);
83
84 }
85
86 ?>
87 </div>
88 <iframe src="./main.php" width="100%" frameborder="1" border="1" allowtransparency="true" scrolling="auto" name="mainframe" class="mainframe" style="height:500px;" id="mainframe"></iframe>
89
90 <noscript>
91 <p><img src="image/blog_jscript.gif" alt="Javascript" width="80" height="15">本チャットは、JavaScript が有効な環境でのみ使用可能です</p>
92 </noscript>
93
94 <?php
95
96 // 操作欄
97 if (!UPPER_USER_PANEL) {
98     include './index_inc_userpanel.php';
99 }
100
101 // フッター
102 print html_footer(true, true);
103
104 exit;
105  ?>