OSDN Git Service

trpgchat ver2.6
authorcake_67 <cake_67@46fa8b77-3530-0410-9d82-d95c44d28aba>
Wed, 7 Oct 2009 12:22:39 +0000 (12:22 +0000)
committercake_67 <cake_67@46fa8b77-3530-0410-9d82-d95c44d28aba>
Wed, 7 Oct 2009 12:22:39 +0000 (12:22 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/trpgtools-onweb/src/trunk/AjaxChatForTRPG@48 46fa8b77-3530-0410-9d82-d95c44d28aba

130 files changed:
admin.php
auth.php
card.php [new file with mode: 0644]
card_deck_change.php [new file with mode: 0644]
card_return_nomember.php [new file with mode: 0644]
card_update.php [new file with mode: 0644]
card_write.php [new file with mode: 0644]
cookie_load.php
cookie_save.php
css/card.css [new file with mode: 0644]
css/index.css
css/main.css
css/trpgchat.css
edit_config.php
image/NowLoading.gif [new file with mode: 0644]
image/card/bg.gif [new file with mode: 0644]
image/card/tarot/Waite/large/0.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/1.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/10.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/11.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/12.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/13.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/14.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/15.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/16.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/17.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/18.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/19.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/2.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/20.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/21.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/3.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/4.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/5.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/6.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/7.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/8.jpg [new file with mode: 0644]
image/card/tarot/Waite/large/9.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/0.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/1.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/10.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/11.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/12.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/13.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/14.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/15.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/16.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/17.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/18.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/19.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/2.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/20.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/21.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/3.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/4.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/5.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/6.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/7.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/8.jpg [new file with mode: 0644]
image/card/tarot/Waite/small/9.jpg [new file with mode: 0644]
image/card/tarot/hex_indigo.jpg [new file with mode: 0644]
image/read_card.gif [new file with mode: 0644]
image/trump.gif [new file with mode: 0644]
image/volume_config_b.png [new file with mode: 0644]
image/volume_normal_b.gif [new file with mode: 0644]
image/volume_off_b.png [new file with mode: 0644]
index.php
info-mobile.php
lib/Jsphon/Decoder.php [new file with mode: 0644]
lib/Jsphon/Decoder/Tokenizer.php [new file with mode: 0644]
lib/Jsphon/Encoder.php [new file with mode: 0644]
lib/Jsphon/Error.php [new file with mode: 0644]
lib/Jsphon/Exception.php [new file with mode: 0644]
lib/admin.php
lib/card.php [new file with mode: 0644]
lib/config.php
lib/consumer_rule.php
lib/ini/trpgchat-ini-consumer.php
lib/ini/trpgchat-ini-help.php
lib/js/card-js.php [new file with mode: 0644]
lib/js/card.js [new file with mode: 0644]
lib/js/consumer-rule.js
lib/js/index-js.php
lib/js/index.js
lib/js/jquery.blockUI.js [new file with mode: 0644]
lib/js/main-js.php
lib/js/main.js
lib/js/obf.js
lib/js/pastlog.js
lib/js/trpg.js
lib/js/trpgchat-js.php
lib/js/trpgchat.js
lib/log.php
lib/member_check.php
lib/mobile.php
lib/pastlog.php
lib/setup.php
lib/trpg.php
lib/trpgchat.php
lib/write.php
main.php
mindex.php
mwrite.php
pastlog_create.php
pastlog_del.php
pastlog_edit_dir.php
pastlog_edit_file.php
pastlog_index.php
pastlog_main.php
pastlog_output.php
setup.php
setup/.htaccess
setup/orig/config-data-card.php [new file with mode: 0644]
setup/orig/config-data-icon.php
setup/orig/config-data-important.php
setup/orig/config-data-main.php
setup/orig/config-data-trpg.php
setup/orig/deck_status.json [new file with mode: 0644]
setup/orig/deckset.json [new file with mode: 0644]
setup/orig/lock3.txt [new file with mode: 0644]
setup/orig/trpgchat-ini.php
setup/trpgchat-ini.php
sound_effect/index.html [new file with mode: 0644]
sound_effect/none.wav [new file with mode: 0644]
trpgchat-ini-2.php
version.php
write.php
write_config.php
ドキュメント/README.html
ドキュメント/更新履歴.txt

index 983e854..c83f485 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
@@ -76,6 +76,9 @@ if ($_GET['msg']) print '<p class="msg">'.$_GET['msg'].'</p>';
 <form action="./edit_config.php" method="<?php print METHOD; ?>">
 <input type="hidden" name="mode" value="携帯">
 <input type="submit" value="携帯設定"></form>
+<form action="./edit_config.php" method="<?php print METHOD; ?>">
+<input type="hidden" name="mode" value="カード機能関連">
+<input type="submit" value="カード機能関連設定"></form>
 </div>
 <hr>
 </td></tr>
index 836a72e..2afb5ef 100644 (file)
--- a/auth.php
+++ b/auth.php
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
diff --git a/card.php b/card.php
new file mode 100644 (file)
index 0000000..297071a
--- /dev/null
+++ b/card.php
@@ -0,0 +1,139 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+
+/*******************
+ *  カード機能:表示
+ *******************/
+
+// 設定ファイルの読み込み
+require_once './trpgchat-ini.php';
+require_once './lib/trpgchat.php';
+require_once './lib/card.php';
+require_once './lib/member_check.php';
+
+// 設定セット
+set_config(read_config());
+
+// 使用設定
+if (!USE_CARD) {
+    error('使用できません');
+}
+
+// アクセスブロック
+access_block();
+
+// HTML出力
+print html_header(CHAT_TITLE.'カード機能', 'card', true, true);
+
+// JavaScript読み込み
+require_once './lib/js/trpgchat-js.php';
+require_once './lib/js/card-js.php';
+
+ ?>
+</head>
+<body id="body">
+
+<?php
+// カード詳細
+$header = '<span class="cardTitle">カード詳細</span>';
+$body = '<div class="cardDetailImage"></div><div class="cardText"></div>';
+$footer = '<form name="cardDetailConsole"onsubmit="return false;" action="">
+<input id="selectCardId" type="hidden" value="">
+<input id="selectFrom" type="hidden" value="">
+<input id="selectField" type="hidden" value="">
+<input id="oneDraw" type="submit" value="このカードを引く" onclick="selectCardDraw();"><br>
+<select name="member" id="selectMember">
+<option value="deckCardSet" id="deckCardSetSelect" selected>現在のカード</option>
+<option value="plName" id="plNameSelect">自分</option>
+</select>の
+<input id="oneCastField" type="submit" value="場に出す" onclick="selectCardCast(\'Field\');">
+<input id="oneCastSecret" type="submit" value="手札に渡す/山に戻す" onclick="selectCardCast(\'Secret\');"><br>
+</form>';
+write_console('35px', '45px', '200px', 'none', 'cardDetail', $header, $body, '', $footer, false);
+?>
+
+
+<div id="deckType">
+<div class="nodisplay"><form action="./#" method="GET" onsubmit="return false;"></div>
+<div id="selectCard">
+<?php
+$card_ini_list = read_card_ini();
+
+if ($card_ini_list) {
+    print '<select name="deckSelect" id="deckSelect">'."\n";
+    print '<option name="">カード変更</option>'."\n";
+    foreach($card_ini_list as $v) {
+        print '<option value="'.$v['config']['filename'].'">'.$v['config']['name']."</option>\n";
+    }
+    print '<option value="noCard">片付ける</option>'."\n";
+    print '</select>'."\n";
+    $onclick = 'changeDeck();';
+    show_icon(CARD_READ_ICON, '', '', '', "新", '', $onclick);
+} else {
+    print '使用できるカードの設定がありません。';
+}
+?>
+</div>
+<div id="nowDeckOpelation">
+<ul class="name" id="deckName">
+<li class="command"><input name="drawNum" id="deckDrawNum" type="text" value="1" size="2" istyle="4">枚 <input name="submit" class="cardDraw" id="deckDraw" onclick="var cardNum=getCardDrowNum('#deckDrawNum');if(!cardNum){return false;}updateCardStatus('draw', 'deckCardSet', 'Secret',  'plName', 'Secret', cardNum, '', true);" type="submit" value="引く"><input name="submit" id="deckCast" onclick="var cardNum=getCardDrowNum('#deckDrawNum');if(!cardNum){return false;}updateCardStatus('cast', 'deckCardSet', 'Secret', 'deckCardSet', 'Field', cardNum, '', 1);" type="submit" value="出す">
+</li></ul>
+<div class="nodisplay"></form></div>
+</div>
+</div>
+
+<form name="cardSubmit" onsubmit="return false;" action="">
+<div id="deckPlace">
+<ul class="player" id="deckCardSet">
+<li class="name" id="deckCardSet">現在のカード:<span class="nameValue" id="name"></span> <span class="name" id="deckSetName"></span><span style="display:none;" id="deckConfig"></span></li>
+<li class="position">
+<div class="Secret" id="deckSecret">山:<span class="contents"></span></div>
+<div class="Field" id="deckField">場:<span class="contents"></span></div>
+<li class="command">
+<a href="#" onclick="returnCard('#deckField .contents', 'deckCardSet');return false;">場札を山に戻す</a> <a href="#" onclick="returnCard('all', '');return false;">全てのカードを山に戻す</a>
+</ul>
+</div>
+
+<div id="myPlace">
+<ul class="player" id="plName">
+<li class="name" id="playerName"></li>
+<li class="position">
+<div class="Secret" id="mySecret">手:<span class="contents"></span></div></li>
+<div class="Field" id="myField">場:<span class="contents"></span></div></li>
+<li class="command">
+<a href="#" onclick="returnCard('#mySecret .contents', 'plName');return false;">手札を山に戻す</a> <a href="#" onclick="returnCard('#myField .contents', 'plName');return false;">場札を山に戻す</a>
+</li>
+</ul>
+</div>
+
+<div id="oplPlace">
+</div>
+
+<div id="noMemberPlace">
+<ul class="player" id="noMember">
+<li class="name" id="noMemberName">退室者のカード(<span id="noMemberCardsNum">0</span>)</li>
+<li class="command"><a href="#" onclick="returnCard('nomember', 'noMember');return false;">山に戻す</a>
+</li></ul>
+</div>
+
+</div>
+
+<div id="cardSpace" class="nodisplay">
+</div>
+<div id="cardDetail" class="nodisplay">
+</div>
+
+</form>
+<noscript>
+<p><img src="image/blog_jscript.gif" alt="Javascript" width="80" height="15">本チャットは、JavaScript が有効な環境でのみ使用可能です。</p>
+</noscript>
+
+<?php
+// フッター
+print html_footer('');
+ ?>
\ No newline at end of file
diff --git a/card_deck_change.php b/card_deck_change.php
new file mode 100644 (file)
index 0000000..b445aa4
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+/*******************
+ *  カード機能:デック交換
+ *******************/
+
+// デバッグ用設定
+ini_set('log_errors', false);
+ini_set('error_log', "./php_error.log");
+
+// 設定ファイルの読み込み
+require_once './trpgchat-ini.php';
+require_once './lib/trpgchat.php';
+require_once './lib/member_check.php';
+require_once './lib/card.php';
+
+// 受信データの成形
+if (!$request = request()) {
+    error('リクエストを受信できません', true);
+}
+
+// 設定セット
+set_config(read_config());
+
+// 書き込みブロック
+write_block();
+
+// アクセスブロック
+access_block();
+
+// デック交換者チェック
+$plname = htmlspecialchars($request['n']);
+if (!$plname) {
+    error('チャットに参加してください', true);
+}
+if (OBFUSCATION) {
+    $plname = obf_xor($plname);
+}
+$now_member = get_member_log();
+$member_flag = false;
+foreach($now_member as $v) {
+    if ($plname == $v[0]) {
+        $member_flag = true;
+        break;
+    }
+}
+if (!$member_flag) {
+    error('カード変更は参加者のみ可能です', true);
+}
+
+$write_msg = array();
+// 新デック設定がある場合、設定を読み込みつつ内容チェック
+if (!$request['newdeck']) {
+    error('カードを指定して下さい', true);
+} elseif ($request['newdeck'] != 'noCard') {
+    $deck_ini = parse_ini_file(CARD_DIR.$request['newdeck'], true);
+
+    if (!$deck_ini) {
+        error($request['newdeck'].' カードの設定がありません', true);
+    }
+
+    // カード設定
+    if (!$deck_ini['config']) {
+        error($request['newdeck'].' 設定ファイルが不正です', true);
+    }
+
+    // 新しいデック作成
+    $deck_config = set_array2json($deck_ini);
+
+    // カード状態セット
+    $GLOBALS['AJAX_CHAT_TRPG']['deck']['status'] = array();
+    foreach($deck_ini as $k => $v) {
+        if ($v && $k != 'config') {
+            card_status("deckCardSet", $k);
+        }
+    }
+    $write_msg[]['msg'] = '現在のカードを'.$deck_ini['config']['name'].'に変えました。';
+
+// デック削除
+} else {
+    $deck_ini = array();
+    $deck_ini[] = 'なし';
+    $deck_config = set_array2json($deck_ini);
+    $GLOBALS['AJAX_CHAT_TRPG']['deck']['status'] = array();
+    $write_msg[]['msg'] = '現在のカードを片付けました。';
+}
+
+// ファイルロック
+$lfp = fopen(LOCK3,"w");
+stream_set_write_buffer($lfp, 0);
+flock($lfp,LOCK_EX);
+
+// 現在のデックを削除
+if (file_exists(NOW_DECK)) {
+    unlink(NOW_DECK);
+    unlink(NOW_DECK_STATUS);
+    // デックお片づけをチャットに書き込み
+}
+// デック書き込み
+if ($deck_config) {
+    $fp = @fopen(NOW_DECK, "w") or error("カードファイルを開けません。", true);
+    if ($deck_config) {
+        fwrite($fp, $deck_config);
+    }
+    fclose($fp);
+}
+if (file_exists(NOW_DECK)) {
+    chmod(NOW_DECK, 0666);
+}
+
+// 現在のカード配置書き込み
+$deck_status = $GLOBALS['AJAX_CHAT_TRPG']['deck']['status'];
+$fp = @fopen(NOW_DECK_STATUS, "w") or error("カードファイルを開けません。", true);
+fwrite($fp, set_array2json($deck_status));
+fclose($fp);
+if (file_exists(NOW_DECK_STATUS)) {
+    chmod(NOW_DECK_STATUS, 0666);
+}
+
+// 新デック展開をチャットに書き込み
+echo set_array2json($write_msg);
+
+// ロック解除
+fflush($lfp);
+fclose($lfp);
+
+exit;
+
+?>
\ No newline at end of file
diff --git a/card_return_nomember.php b/card_return_nomember.php
new file mode 100644 (file)
index 0000000..490861f
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+/*******************
+ *  カード機能:カード更新(退室者のカードを戻す)
+ *******************/
+
+// デバッグ用設定
+ini_set('log_errors', false);
+ini_set('error_log', "./php_error.log");
+
+// 設定ファイルの読み込み
+require_once './trpgchat-ini.php';
+require_once './lib/trpgchat.php';
+require_once './lib/member_check.php';
+require_once './lib/card.php';
+
+// 受信データの成形
+if (!$request = request()) {
+    error('リクエストを受信できません', true);
+}
+
+// 設定セット
+set_config(read_config());
+
+// 書き込みブロック
+write_block();
+
+// アクセスブロック
+access_block();
+
+// 実行者チェック
+$plname = htmlspecialchars($request['n']);
+if (!$plname) {
+    error('チャットに参加してください', true);
+}
+
+// 難読化
+if (OBFUSCATION) {
+    $deckOwner = obf_xor('deckCardSet');
+    $plname = obf_xor($plname);
+} else {
+    $deckOwner = 'deckCardSet';
+}
+
+// メンバーチェック
+$now_member = get_member_log();
+$members = array();
+$member_flag = false;
+foreach($now_member as $v) {
+    $members[] = $v[0];
+    if ($plname == $v[0]) {
+        $member_flag = true;
+        break;
+    }
+}
+if (!$member_flag) {
+    error('カード変更は参加者のみ可能です', true);
+}
+
+// カード移動
+// ファイルロック
+$lfp = fopen(LOCK3,"w");
+stream_set_write_buffer($lfp, 0);
+flock($lfp,LOCK_EX);
+
+// 現在のカード状態
+$deck_status_json = file_get_contents(NOW_DECK_STATUS);
+$deck_status = set_json2array($deck_status_json);
+
+if (!$deck_status) {
+    error('現在のカード状態設定がありません', true);
+}
+
+// カード操作
+foreach ($deck_status as $k => $v) {
+    if ($k != $deckOwner && $k != $plname
+        && !in_array($k, $members)) {
+        if ($deck_status[$k]['Secret']['card']) {
+            $deck_status[$deckOwner]['Secret']['card'] = array_merge($deck_status[$deckOwner]['Secret']['card'], $deck_status[$k]['Secret']['card']);
+            unset($deck_status[$k]['Secret']['card']);
+        }
+        if ($deck_status[$k]['Field']['card']) {
+            $deck_status[$deckOwner]['Secret']['card'] = array_merge($deck_status[$deckOwner]['Secret']['card'], $deck_status[$k]['Field']['card']);
+            unset($deck_status[$k]['Field']['card']);
+        }
+    }
+}
+
+// カード操作結果の書き込み
+$fp = @fopen(NOW_DECK_STATUS, "w") or error("カードファイルを開けません。", true);
+fwrite($fp, set_array2json($deck_status));
+fclose($fp);
+
+// ロック解除
+fflush($lfp);
+fclose($lfp);
+
+$write_msg[0]['msg'] = "退室者のカードを山に戻しました。";
+echo set_array2json($write_msg);
+
+exit;
diff --git a/card_update.php b/card_update.php
new file mode 100644 (file)
index 0000000..a868091
--- /dev/null
@@ -0,0 +1,197 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+/*******************
+ *  カード機能:カード更新(引く、捨てる)
+ *******************/
+
+// デバッグ用設定
+ini_set('log_errors', false);
+ini_set('error_log', "./php_error.log");
+
+// 設定ファイルの読み込み
+require_once './trpgchat-ini.php';
+require_once './lib/trpgchat.php';
+require_once './lib/member_check.php';
+require_once './lib/card.php';
+
+// 受信データの成形
+if (!$request = request()) {
+    error('リクエストを受信できません', true);
+}
+
+// 設定セット
+set_config(read_config());
+
+// 書き込みブロック
+write_block();
+
+// アクセスブロック
+access_block();
+
+// 実行者チェック
+$plname = htmlspecialchars($request['n']);
+if (!$plname) {
+    error('チャットに参加してください', true);
+}
+
+if (!$request['cn']) {
+    $request['cn'] = 1;
+}
+
+// 難読化
+if (OBFUSCATION) {
+    $from = obf_xor($request['f']);
+    $to = obf_xor($request['t']);
+    $deckOwner = obf_xor('deckCardSet');
+} else {
+    $from = $request['f'];
+    $to = $request['t'];
+    $deckOwner = 'deckCardSet';
+}
+
+$fieldFrom =$request['ff'];
+$fieldTo = $request['ft'];
+$action = $request['a'];
+
+if (!($to && $from && $fieldFrom && $fieldTo && $action)) {
+    error('パラメータ不足です。', true);
+}
+if (!$to || !$from
+    || ($fieldFrom != 'Secret' && $fieldFrom != 'Field')
+    || ($fieldTo != 'Secret' && $fieldTo != 'Field')
+    || ($action != 'r' && ($request['cn'] < 1))
+    || ($action != 'd' && $action != 'c' && $action != 'r')) {
+    error('パラメータが不正です。', true);
+}
+
+// カード移動
+// ファイルロック
+$lfp = fopen(LOCK3,"w");
+stream_set_write_buffer($lfp, 0);
+flock($lfp,LOCK_EX);
+
+// 現在のカード状態
+$deck_json = file_get_contents(NOW_DECK);
+$deck = set_json2array($deck_json);
+$deck_status_json = file_get_contents(NOW_DECK_STATUS);
+$deck_status = set_json2array($deck_status_json);
+
+if (!$deck || !$deck_status) {
+    error('現在のカード状態設定がありません', true);
+}
+
+// 移動元のカード
+if (count((array)$deck_status[$from][$fieldFrom]['card']) < 1) {
+    error($request['f'].'の'.$fieldFrom.'札がありません。', true);
+}
+// 移動先のカード
+$to_card_set = $deck_status[$to][$fromTo]['card'];
+
+// カード操作
+$write_msg = array();
+$target_keys = array();
+// 指定場所の札を全て山に戻す
+if ($action == 'r') {
+    $deck_status[$deckOwner]['Secret']['card'] = array_merge($deck_status[$deckOwner]['Secret']['card'], $deck_status[$from][$fieldFrom]['card']);
+    unset($deck_status[$from][$fieldFrom]['card']);
+
+    list($write_msg[0]['msg'], $action, $is_secret) = writeMoveCard($request['f'], $fieldFrom, $request['t'], $fieldTo, '', $request['tm']);
+// ランダムで移動
+} elseif (!$request['id']) {
+    list($write_msg[0]['msg'], $action, $is_secret) = writeMoveCard($request['f'], $fieldFrom, $request['t'], $fieldTo, $request['cn'], $request['tm']);
+    $write_msg[1] = setCardMoveDetailForWriteToChat($action, $is_secret);
+
+    // カード移動
+    for ($i=0;$i<$request['cn'];$i++) {
+        if (!$deck_status[$from][$fieldFrom]['card']) {
+            break;
+        }
+
+        $target_index = array_rand($deck_status[$from][$fieldFrom]['card'], 1);
+        $target_card = array_splice($deck_status[$from][$fieldFrom]['card'], $target_index, 1);
+
+        list($target_card_id, $card_head) = moveCardByTargetId(&$deck_status, $target_card, $from, $to, $fieldFrom, $fieldTo, $request['ih']);
+
+        $card_name = $deck[$target_card_id]['name_long'];
+        if ($card_head) {
+            $card_name = '(逆位置)'. $card_name;
+        }
+
+        if ($write_msg[1]) {
+            if ($i) {
+                $write_msg[1]['msg'] .= "、";
+            }
+            $write_msg[1]['msg'] .= $card_name;
+        }
+
+        if (count($deck_status[$from][$fieldFrom]['card']) < 1) {
+            break;
+        }
+    }
+// カードを指定して移動
+} else {
+    if (OBFUSCATION) {
+        $target_card_id = obf_xor($request['id']);
+    } else {
+        $target_card_id = $request['id'];
+    }
+
+    $flag_move = false;
+    foreach ($deck_status[$from][$fieldFrom]['card'] as $target_index => $v) {
+        if ($v['id'] == $target_card_id) {
+            list($write_msg[0]['msg'], $action, $is_secret) = writeMoveCard($request['f'], $fieldFrom, $request['t'], $fieldTo, 1, $request['tm']);
+            $write_msg[1] = setCardMoveDetailForWriteToChat($action, $is_secret);
+
+            $target_card = array_splice($deck_status[$from][$fieldFrom]['card'], $target_index, 1);
+
+            list($target_card_id, $card_head) = moveCardByTargetId(&$deck_status, $target_card, $from, $to, $fieldFrom, $fieldTo, $request['ih']);
+
+            $card_name = $deck[$target_card_id]['name_long'];
+            if ($card_head) {
+                $card_name = '(逆位置)'. $card_name;
+            }
+
+        if ($write_msg[1]) {
+            if ($i) {
+                $write_msg[1]['msg'] .= "、";
+            }
+            $write_msg[1]['msg'] .= $card_name;
+        }
+
+            $flag_move = true;
+            break;
+        }
+    }
+    if (!$flag_move) {
+        error('指定のカードがありません', true);
+    }
+}
+
+if ($write_msg[1]['isSecret']) {
+    if ($request['t'] == $request['n']) {
+        $write_msg[1]['secretTo'] = $request['f'];
+    } elseif ($request['f'] == $request['n']) {
+        $write_msg[1]['secretTo'] = $request['t'];
+    }
+}
+
+// カード操作結果の書き込み
+$fp = @fopen(NOW_DECK_STATUS, "w") or error("カードファイルを開けません。", true);
+fwrite($fp, set_array2json($deck_status));
+fclose($fp);
+
+// ロック解除
+fflush($lfp);
+fclose($lfp);
+
+// 操作結果をチャットに書き込み
+if ($write_msg) {
+    echo set_array2json($write_msg);
+}
+
+exit;
diff --git a/card_write.php b/card_write.php
new file mode 100644 (file)
index 0000000..8325503
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+
+/* カード用発言書込み */
+
+// デバッグ用設定
+ini_set('log_errors', false);
+ini_set('error_log', "./php_error.log");
+
+// 設定ファイルの読み込み
+require_once './trpgchat-ini.php';
+require_once './lib/trpgchat.php';
+//require_once './lib/write.php';
+require_once './lib/member_check.php';
+
+// 設定セット
+set_config(read_config());
+
+// ユーザの情報
+if (REC_UA) {
+    $host = gethostbyaddr($_SERVER['REMOTE_ADDR']);
+    $ua = getenv("HTTP_USER_AGENT");
+}
+
+// 書き込みブロック
+write_block();
+
+// アクセスブロック
+access_block();
+
+// リクエスト受信
+if (!$request = $_GET) {
+    error('データを受信できません');
+}
+
+// secretTo設定
+if ($request['w2']) {
+    if (OBFUSCATION) {
+        $target_member = obf_xor($request['w2']);
+    } else {
+        $target_member = $request['w2'];
+    }
+
+    // 参加者チェック
+    $member_data = get_member_log();
+    if ($member_data) {
+        foreach ($member_data as $v) {
+            $mname = $v[0];
+            $mhash = $v[1];
+
+            // 在室かつパスワードありで、相手にも「ささやき」カード発言
+            if ($mname == $target_member && $mhash) {
+                $flag = true;
+                if (OBFUSCATION) {
+                    $mname = de_obf_xor($mname);
+                }
+                $request['n'] = $request['w'];
+                $request['w'] = $mname;
+                $request['h'] = $mhash;
+//                $request['p'] = $mhash;
+
+
+                break;
+            }
+        }
+    }
+}
+$request['e'] = time();
+unset($request['w2']);
+
+// 本文をwrite.phpへパス
+$self_url = get_self_url();
+$params = http_build_query($request);
+$url = str_replace('card_write.php', 'write.php', $self_url).'/?';
+header('Location: '. $url.$params);
+
+exit;
+
+?>
index 056b973..00e1daa 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /* クッキーファイル読み込み */
index 021566d..f4373a7 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /* クッキーファイル保存 */
@@ -12,7 +12,7 @@
 session_cache_limiter('public');
 
 // デバッグ用設定
-ini_set('log_errors', true);
+ini_set('log_errors', false);
 ini_set('error_log', "./php_error.log");
 
 // 設定ファイルの読み込み
diff --git a/css/card.css b/css/card.css
new file mode 100644 (file)
index 0000000..459a27e
--- /dev/null
@@ -0,0 +1,164 @@
+/* カード画面の設定 */\r
+@charset "Shift_JIS";\r
+\r
+/* メイン */\r
+html {\r
+       margin: 0;\r
+}\r
+body {\r
+       margin: 5px;\r
+       padding: 0;\r
+}\r
+\r
+/* タグ別 */\r
+li {\r
+       list-style-type: none;\r
+}\r
+\r
+/* 個別 */\r
+#body {\r
+       color: #ffffff;\r
+       background-color: #009933;\r
+}\r
+#deckType {\r
+       position: static;\r
+       margin: 0;\r
+       padding: 7px 0;\r
+}\r
+#deckType #selectCard {\r
+       padding: 0 7px;\r
+       text-align: right;\r
+       float: right;\r
+}\r
+#deckType hr {\r
+       margin: 0.5em 0;\r
+}\r
+#deckType .name {\r
+       font-weight: bold;\r
+}\r
+#cardSpace {\r
+       position: absolute;\r
+}\r
+\r
+.player {\r
+       margin: 0 7px;\r
+       clear: both;\r
+       border-top: #33cc33 groove 3px;\r
+}\r
+li.name {\r
+       padding: 0 3px;\r
+       font-weight: bold;\r
+       background-color: #0a6000;\r
+}\r
+.Secret {\r
+       position: relative;\r
+       clear: both;\r
+       height: 45px;\r
+}\r
+.Field {\r
+       position: relative;\r
+       clear: both;\r
+       height: 45px;\r
+}\r
+.contents {\r
+       position: static;\r
+}\r
+\r
+.card {\r
+       position: absolute;\r
+       float: left;\r
+       top: 0;\r
+       left: 23px;\r
+       width: 30px;\r
+       height: 40px;\r
+       overflow: hidden;\r
+       border: #000000 solid 1px;\r
+       background-color: #FFFFFF;\r
+       color: #000000;\r
+       margin: 0 0 1px 0;\r
+       padding: 0;\r
+       font-size: 10px;\r
+}\r
+\r
+.secretCard {\r
+       background-image: url(../image/card/bg.gif);\r
+}\r
+.openCard {\r
+       background-image: none;\r
+       background-position: bottom right;\r
+       background-repeat: no-repeat;\r
+       cursor: pointer;\r
+}\r
+\r
+.cardValue {\r
+       position: relative;\r
+       overflow: hidden;\r
+       padding: 0;\r
+       margin: 0;\r
+       font-size: 8px;\r
+}\r
+.cardLeftValue {\r
+       position: absolute;\r
+       top: 0;\r
+       left: 0;\r
+       width: 10px;\r
+       height: 100%;\r
+}\r
+\r
+#cardDetail {\r
+       position: absolute;\r
+       z-index: 100000;\r
+       overflow: hidden;\r
+       border: #000000 solid 1px;\r
+       background-color: #FFFFFF;\r
+       background-image: none;\r
+       color: #000000;\r
+       width: 200px;\r
+       margin: 0;\r
+       padding: 5px;\r
+}\r
+#cardDetail #header {\r
+       margin: 0;\r
+       padding: 0;\r
+       font-size: 14px;\r
+       font-weight: bold;\r
+       overflow: auto;\r
+       cursor: pointer;\r
+}\r
+#cardDetail #body {\r
+       margin: 0;\r
+       padding: 0;\r
+       background-color: transparent;\r
+}\r
+#cardDetail #body .cardDetailImage {\r
+       float: left;\r
+       margin: 0;\r
+       padding: 0;\r
+       overflow: hidden;\r
+}\r
+#cardDetail #body .cardText {\r
+       font-size: 12px;\r
+       float: left;\r
+       overflow: auto;\r
+       margin: 0;\r
+       padding: 0;\r
+       vertical-align: top;\r
+}\r
+#cardDetail #footer {\r
+       clear: both;\r
+}\r
+\r
+#deckDrawNum {\r
+       text-align: right;\r
+}\r
+\r
+.command {\r
+       font-size: 12px;\r
+}\r
+.command a:link,\r
+.command a:visited {\r
+       color: #FFFFFF;\r
+}\r
+.command a:hover {\r
+       color: #FFFFCC;\r
+}\r
index 0a3c610..231616e 100644 (file)
@@ -1,10 +1,11 @@
-/* \94­\8c¾\98g\82Ì\90Ý\92è */\r
+/* \83R\83A\89æ\96Ê\82Ì\90Ý\92è */\r
 @charset "Shift_JIS";\r
 \r
 /* \83\81\83C\83\93 */\r
 html {\r
        font-weight: normal;\r
        margin: 5px;\r
+       padding: 0;\r
 }\r
 \r
 body {\r
@@ -28,7 +29,7 @@ body {
        padding-bottom: 0px;\r
 }\r
 \r
-.online, .nodisplay,   {\r
+.nodisplay {\r
        display: none;\r
 }\r
 \r
index 0b84a00..1c70f16 100644 (file)
@@ -1,4 +1,4 @@
-/* \83`\83\83\83b\83g\89ï\98b\97\93\82Ì\90Ý\92è */\r
+/* \83`\83\83\83b\83g\89ï\98b\89æ\96Ê\82Ì\90Ý\92è */\r
 @charset "Shift_JIS";\r
 \r
 /* \83\81\83C\83\93 */\r
@@ -11,6 +11,12 @@ body {
        padding-left: 7px;\r
 }\r
 \r
+input.radio,\r
+input.checkbox {\r
+       margin: 0;\r
+       padding: 0;\r
+}\r
+\r
 /* \8cÂ\95Ê */\r
 .chatwindow {\r
        font-size: 12px;\r
@@ -41,3 +47,31 @@ body {
        font-weight:bold;\r
        text-decoration: none;\r
 }\r
+td#lineConfig {\r
+       width: 115px;\r
+       height: 20px;\r
+       text-align: right;\r
+}\r
+\r
+td#soundEffect {\r
+       width: 17px;\r
+       margin: 0;\r
+       padding: 0;\r
+}\r
+td#soundEffect li {\r
+       list-style-type: none;\r
+       display: block;\r
+       float: left;\r
+       margin: 0;\r
+       padding: 0;\r
+}\r
+td#soundEffect #seSelect {\r
+       display: none;\r
+}\r
+#se {\r
+       position: absolute;\r
+       top:-9999px;\r
+}\r
+.seIcon {\r
+       display:none;\r
+}\r
index e38f157..b648c88 100644 (file)
@@ -21,8 +21,6 @@ input,
 textarea,\r
 select {\r
        font-size: 12px;\r
-       border-width: 1px;\r
-       border-style: solid;\r
        margin: 0px;\r
        padding: 1px;\r
        vertical-align: middle ;\r
@@ -30,14 +28,18 @@ select {
 \r
 input.text,\r
 input.password,\r
+input.bottun,\r
 textarea {\r
+       border-width: 1px;\r
+       border-style: solid;\r
        overflow: auto;\r
 }\r
 \r
 input.radio,\r
 input.checkbox {\r
        margin-right: 5px;\r
-       margin-top: 0px;\r
+       margin-top: 0;\r
+       border-style: none;\r
 }\r
 \r
 input.submit,\r
@@ -84,8 +86,8 @@ h6 {
 .btn {\r
        border-width: 1px;\r
        border-style: solid;\r
-       margin: 2px;\r
-       padding: 0px;\r
+       margin: 1px;\r
+       padding: 1px;\r
        vertical-align: middle;\r
        cursor: pointer;\r
 }\r
index abc18ef..35f71ff 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
diff --git a/image/NowLoading.gif b/image/NowLoading.gif
new file mode 100644 (file)
index 0000000..f618e74
Binary files /dev/null and b/image/NowLoading.gif differ
diff --git a/image/card/bg.gif b/image/card/bg.gif
new file mode 100644 (file)
index 0000000..864207e
Binary files /dev/null and b/image/card/bg.gif differ
diff --git a/image/card/tarot/Waite/large/0.jpg b/image/card/tarot/Waite/large/0.jpg
new file mode 100644 (file)
index 0000000..8f8cc32
Binary files /dev/null and b/image/card/tarot/Waite/large/0.jpg differ
diff --git a/image/card/tarot/Waite/large/1.jpg b/image/card/tarot/Waite/large/1.jpg
new file mode 100644 (file)
index 0000000..9e54e17
Binary files /dev/null and b/image/card/tarot/Waite/large/1.jpg differ
diff --git a/image/card/tarot/Waite/large/10.jpg b/image/card/tarot/Waite/large/10.jpg
new file mode 100644 (file)
index 0000000..b827315
Binary files /dev/null and b/image/card/tarot/Waite/large/10.jpg differ
diff --git a/image/card/tarot/Waite/large/11.jpg b/image/card/tarot/Waite/large/11.jpg
new file mode 100644 (file)
index 0000000..8e96867
Binary files /dev/null and b/image/card/tarot/Waite/large/11.jpg differ
diff --git a/image/card/tarot/Waite/large/12.jpg b/image/card/tarot/Waite/large/12.jpg
new file mode 100644 (file)
index 0000000..18e7224
Binary files /dev/null and b/image/card/tarot/Waite/large/12.jpg differ
diff --git a/image/card/tarot/Waite/large/13.jpg b/image/card/tarot/Waite/large/13.jpg
new file mode 100644 (file)
index 0000000..da55afa
Binary files /dev/null and b/image/card/tarot/Waite/large/13.jpg differ
diff --git a/image/card/tarot/Waite/large/14.jpg b/image/card/tarot/Waite/large/14.jpg
new file mode 100644 (file)
index 0000000..50f1733
Binary files /dev/null and b/image/card/tarot/Waite/large/14.jpg differ
diff --git a/image/card/tarot/Waite/large/15.jpg b/image/card/tarot/Waite/large/15.jpg
new file mode 100644 (file)
index 0000000..e7770dd
Binary files /dev/null and b/image/card/tarot/Waite/large/15.jpg differ
diff --git a/image/card/tarot/Waite/large/16.jpg b/image/card/tarot/Waite/large/16.jpg
new file mode 100644 (file)
index 0000000..e6a7bf4
Binary files /dev/null and b/image/card/tarot/Waite/large/16.jpg differ
diff --git a/image/card/tarot/Waite/large/17.jpg b/image/card/tarot/Waite/large/17.jpg
new file mode 100644 (file)
index 0000000..4a87466
Binary files /dev/null and b/image/card/tarot/Waite/large/17.jpg differ
diff --git a/image/card/tarot/Waite/large/18.jpg b/image/card/tarot/Waite/large/18.jpg
new file mode 100644 (file)
index 0000000..3da4319
Binary files /dev/null and b/image/card/tarot/Waite/large/18.jpg differ
diff --git a/image/card/tarot/Waite/large/19.jpg b/image/card/tarot/Waite/large/19.jpg
new file mode 100644 (file)
index 0000000..96bdbf3
Binary files /dev/null and b/image/card/tarot/Waite/large/19.jpg differ
diff --git a/image/card/tarot/Waite/large/2.jpg b/image/card/tarot/Waite/large/2.jpg
new file mode 100644 (file)
index 0000000..89de4ce
Binary files /dev/null and b/image/card/tarot/Waite/large/2.jpg differ
diff --git a/image/card/tarot/Waite/large/20.jpg b/image/card/tarot/Waite/large/20.jpg
new file mode 100644 (file)
index 0000000..9c7b4e7
Binary files /dev/null and b/image/card/tarot/Waite/large/20.jpg differ
diff --git a/image/card/tarot/Waite/large/21.jpg b/image/card/tarot/Waite/large/21.jpg
new file mode 100644 (file)
index 0000000..1dfa610
Binary files /dev/null and b/image/card/tarot/Waite/large/21.jpg differ
diff --git a/image/card/tarot/Waite/large/3.jpg b/image/card/tarot/Waite/large/3.jpg
new file mode 100644 (file)
index 0000000..064fd5f
Binary files /dev/null and b/image/card/tarot/Waite/large/3.jpg differ
diff --git a/image/card/tarot/Waite/large/4.jpg b/image/card/tarot/Waite/large/4.jpg
new file mode 100644 (file)
index 0000000..cdee892
Binary files /dev/null and b/image/card/tarot/Waite/large/4.jpg differ
diff --git a/image/card/tarot/Waite/large/5.jpg b/image/card/tarot/Waite/large/5.jpg
new file mode 100644 (file)
index 0000000..88fa066
Binary files /dev/null and b/image/card/tarot/Waite/large/5.jpg differ
diff --git a/image/card/tarot/Waite/large/6.jpg b/image/card/tarot/Waite/large/6.jpg
new file mode 100644 (file)
index 0000000..fa7ae15
Binary files /dev/null and b/image/card/tarot/Waite/large/6.jpg differ
diff --git a/image/card/tarot/Waite/large/7.jpg b/image/card/tarot/Waite/large/7.jpg
new file mode 100644 (file)
index 0000000..c33b66a
Binary files /dev/null and b/image/card/tarot/Waite/large/7.jpg differ
diff --git a/image/card/tarot/Waite/large/8.jpg b/image/card/tarot/Waite/large/8.jpg
new file mode 100644 (file)
index 0000000..3be8617
Binary files /dev/null and b/image/card/tarot/Waite/large/8.jpg differ
diff --git a/image/card/tarot/Waite/large/9.jpg b/image/card/tarot/Waite/large/9.jpg
new file mode 100644 (file)
index 0000000..d5403b1
Binary files /dev/null and b/image/card/tarot/Waite/large/9.jpg differ
diff --git a/image/card/tarot/Waite/small/0.jpg b/image/card/tarot/Waite/small/0.jpg
new file mode 100644 (file)
index 0000000..fc3738c
Binary files /dev/null and b/image/card/tarot/Waite/small/0.jpg differ
diff --git a/image/card/tarot/Waite/small/1.jpg b/image/card/tarot/Waite/small/1.jpg
new file mode 100644 (file)
index 0000000..124bf84
Binary files /dev/null and b/image/card/tarot/Waite/small/1.jpg differ
diff --git a/image/card/tarot/Waite/small/10.jpg b/image/card/tarot/Waite/small/10.jpg
new file mode 100644 (file)
index 0000000..a6b93f1
Binary files /dev/null and b/image/card/tarot/Waite/small/10.jpg differ
diff --git a/image/card/tarot/Waite/small/11.jpg b/image/card/tarot/Waite/small/11.jpg
new file mode 100644 (file)
index 0000000..8cbf251
Binary files /dev/null and b/image/card/tarot/Waite/small/11.jpg differ
diff --git a/image/card/tarot/Waite/small/12.jpg b/image/card/tarot/Waite/small/12.jpg
new file mode 100644 (file)
index 0000000..65df8d0
Binary files /dev/null and b/image/card/tarot/Waite/small/12.jpg differ
diff --git a/image/card/tarot/Waite/small/13.jpg b/image/card/tarot/Waite/small/13.jpg
new file mode 100644 (file)
index 0000000..e073a37
Binary files /dev/null and b/image/card/tarot/Waite/small/13.jpg differ
diff --git a/image/card/tarot/Waite/small/14.jpg b/image/card/tarot/Waite/small/14.jpg
new file mode 100644 (file)
index 0000000..4ef9b61
Binary files /dev/null and b/image/card/tarot/Waite/small/14.jpg differ
diff --git a/image/card/tarot/Waite/small/15.jpg b/image/card/tarot/Waite/small/15.jpg
new file mode 100644 (file)
index 0000000..ea0d7e5
Binary files /dev/null and b/image/card/tarot/Waite/small/15.jpg differ
diff --git a/image/card/tarot/Waite/small/16.jpg b/image/card/tarot/Waite/small/16.jpg
new file mode 100644 (file)
index 0000000..e072372
Binary files /dev/null and b/image/card/tarot/Waite/small/16.jpg differ
diff --git a/image/card/tarot/Waite/small/17.jpg b/image/card/tarot/Waite/small/17.jpg
new file mode 100644 (file)
index 0000000..0ac7846
Binary files /dev/null and b/image/card/tarot/Waite/small/17.jpg differ
diff --git a/image/card/tarot/Waite/small/18.jpg b/image/card/tarot/Waite/small/18.jpg
new file mode 100644 (file)
index 0000000..93ec76a
Binary files /dev/null and b/image/card/tarot/Waite/small/18.jpg differ
diff --git a/image/card/tarot/Waite/small/19.jpg b/image/card/tarot/Waite/small/19.jpg
new file mode 100644 (file)
index 0000000..1c4a806
Binary files /dev/null and b/image/card/tarot/Waite/small/19.jpg differ
diff --git a/image/card/tarot/Waite/small/2.jpg b/image/card/tarot/Waite/small/2.jpg
new file mode 100644 (file)
index 0000000..0ea99b2
Binary files /dev/null and b/image/card/tarot/Waite/small/2.jpg differ
diff --git a/image/card/tarot/Waite/small/20.jpg b/image/card/tarot/Waite/small/20.jpg
new file mode 100644 (file)
index 0000000..87ad518
Binary files /dev/null and b/image/card/tarot/Waite/small/20.jpg differ
diff --git a/image/card/tarot/Waite/small/21.jpg b/image/card/tarot/Waite/small/21.jpg
new file mode 100644 (file)
index 0000000..b5d95e6
Binary files /dev/null and b/image/card/tarot/Waite/small/21.jpg differ
diff --git a/image/card/tarot/Waite/small/3.jpg b/image/card/tarot/Waite/small/3.jpg
new file mode 100644 (file)
index 0000000..bfd82de
Binary files /dev/null and b/image/card/tarot/Waite/small/3.jpg differ
diff --git a/image/card/tarot/Waite/small/4.jpg b/image/card/tarot/Waite/small/4.jpg
new file mode 100644 (file)
index 0000000..f4135cd
Binary files /dev/null and b/image/card/tarot/Waite/small/4.jpg differ
diff --git a/image/card/tarot/Waite/small/5.jpg b/image/card/tarot/Waite/small/5.jpg
new file mode 100644 (file)
index 0000000..fba6a57
Binary files /dev/null and b/image/card/tarot/Waite/small/5.jpg differ
diff --git a/image/card/tarot/Waite/small/6.jpg b/image/card/tarot/Waite/small/6.jpg
new file mode 100644 (file)
index 0000000..83ea297
Binary files /dev/null and b/image/card/tarot/Waite/small/6.jpg differ
diff --git a/image/card/tarot/Waite/small/7.jpg b/image/card/tarot/Waite/small/7.jpg
new file mode 100644 (file)
index 0000000..e40d7da
Binary files /dev/null and b/image/card/tarot/Waite/small/7.jpg differ
diff --git a/image/card/tarot/Waite/small/8.jpg b/image/card/tarot/Waite/small/8.jpg
new file mode 100644 (file)
index 0000000..e73036f
Binary files /dev/null and b/image/card/tarot/Waite/small/8.jpg differ
diff --git a/image/card/tarot/Waite/small/9.jpg b/image/card/tarot/Waite/small/9.jpg
new file mode 100644 (file)
index 0000000..a79c2ff
Binary files /dev/null and b/image/card/tarot/Waite/small/9.jpg differ
diff --git a/image/card/tarot/hex_indigo.jpg b/image/card/tarot/hex_indigo.jpg
new file mode 100644 (file)
index 0000000..b5972a6
Binary files /dev/null and b/image/card/tarot/hex_indigo.jpg differ
diff --git a/image/read_card.gif b/image/read_card.gif
new file mode 100644 (file)
index 0000000..35fe99f
Binary files /dev/null and b/image/read_card.gif differ
diff --git a/image/trump.gif b/image/trump.gif
new file mode 100644 (file)
index 0000000..a76e0ca
Binary files /dev/null and b/image/trump.gif differ
diff --git a/image/volume_config_b.png b/image/volume_config_b.png
new file mode 100644 (file)
index 0000000..2be046d
Binary files /dev/null and b/image/volume_config_b.png differ
diff --git a/image/volume_normal_b.gif b/image/volume_normal_b.gif
new file mode 100644 (file)
index 0000000..7be3aab
Binary files /dev/null and b/image/volume_normal_b.gif differ
diff --git a/image/volume_off_b.png b/image/volume_off_b.png
new file mode 100644 (file)
index 0000000..9704942
Binary files /dev/null and b/image/volume_off_b.png differ
index e859095..ee658a2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // かんたんセットアップ対応
@@ -54,8 +54,8 @@ require_once './lib/js/index-js.php';
 <tr>
 <td>
 <form name="online1" onsubmit="return false;" action="">
-<input type="hidden" name="name_on" value="" size="10" id="name_on">
-<input type="hidden" name="pwd_on" size="4" id="pwd_on">
+<input type="hidden" name="name_on" value="" id="name_on">
+<input type="hidden" name="pwd_on" id="pwd_on">
 <input type="hidden" name="my_hash" value="" id="my_hash">
 </td>
 
@@ -125,8 +125,8 @@ if (DICE_MAX && $GLOBALS['AJAX_CHAT_TRPG']['PRESET_DICE'][0]) {
         show_icon(CONSUMER_RULES_OPEN_ICON, CONSUMER_RULES_CLOSE_ICON, "", "consumer_rule_icon", "†", "市販ルールの簡易使用欄をON/OFFします", 'toggleColumn(\'consumer_rule\');');
     }
     print "</td>\n";
-        print '<td class="nodisplay"></form></td>'."\n";
 }
+print '<td class="nodisplay"></form></td>'."\n";
 //=======ここまで:オンラインTRPG欄
 
 // タグボタン
@@ -149,13 +149,26 @@ if (ALLOW_TAG) {
 <?php
 show_icon(RELOAD_ICON, "", "", "", "R", "チャット画面をリフレッシュ!", "window.mainframe.clearLog();");
 
-$toggle_config = 'toggleColumn(\'tools0\');toggleColumn(\'tools1\');toggleColumn(\'tools2\');toggleColumn(\'tools3\');';
+$toggle_config = '';
+if (FREEMAP_URL) {
+    $toggle_config .= 'toggleColumn(\'tools0\');';
+}
+if (!(DELETE_LAST_PASTLOG && !PUBLIC_PASTLOG)) {
+    $toggle_config .= 'toggleColumn(\'tools1\');toggleColumn(\'tools2\');';
+}
+if (COOKEI_EXPIRE && COOKIE) {
+    $toggle_config .= 'toggleColumn(\'tools3\');';
+}
 if (USE_MOBILE) {
     $toggle_config .= 'toggleColumn(\'tools4\');';
 }
+if (CARD_ICON) {
+    $toggle_config .= 'toggleColumn(\'tools5\');';
+}
 show_icon(TOOLS_ICON, "", "", "", "TOOL", "過去ログ表示・クッキー保存アイコンなどの表示をON/OFFします", $toggle_config);
 
 print "</td>";
+
 // FreeMap連動
 if (FREEMAP_URL) {
     print '<td id="tools0" style="display:none;">';
@@ -163,6 +176,22 @@ if (FREEMAP_URL) {
     print '</td>';
 }
 
+// カード機能
+if (USE_CARD) {
+    $onlick = "openNewWindow('card.php', 'card', true, 400, 500, true);";
+    print '<td id="tools5" style="display:none;">';
+    print show_icon(CARD_ICON, "", "", "card_icon", "card", "カード機能を使う", $onlick);
+    print '</td>';
+}
+
+// FreeMap連動
+if (FREEMAP_URL) {
+    $onlick = "openNewWindow('".FREEMAP_URL."', 'map', false, '', '', true);";
+    print '<td id="tools0" style="display:none;">';
+    print show_icon(FREEMAP_ICON, "", "", "freemap", "MAP", "マップとコマを使う", $onlick);
+    print '</td>';
+}
+
 // 過去ログ表示
 if (!(DELETE_LAST_PASTLOG && !PUBLIC_PASTLOG)) {
     print '<td id="tools1" style="display:none;">';
@@ -192,7 +221,7 @@ $onclick_help = 'toggleColumn(\'help_win\');';
 show_icon(HELP_ICON, '', '', 'help_win_icon', '?', 'ヘルプをON/OFFします', $onclick_help);
 ?>
 </td>
-<td align="right" id="logoutBt"><input type="button" value="退室" name="logout" class="btn logout" id="logout" /></td>
+<td align="right" id="logoutBt"><input type="button" value="退室" name="logout" class="logout" id="logout" /></td>
 </table>
 
 <?php
@@ -298,7 +327,7 @@ if (PC_NUM >= 1) {
         print '<table border="0" cellspacing="3" cellpadding="0" id="pc_'.$i.'" class="add_pc"; style="display:none;">'."\n";
         print '<tr>'."\n";
         print '<td class="nodisplay"><form onsubmit="return false;" id="'.$i.'"></td>'."\n";
-        print '<td><input type="submit" value="発言" class="btn" id="submit" style="display:inline" name="submit" onclick="comment(this.form)"></td>'."\n";
+        print '<td><input type="submit" value="発言" class="" id="submit" style="display:inline" name="submit" onclick="comment(this.form)"></td>'."\n";
         print '<td align="left" nowrap><input type="text" name="pc_name" value="'.$cookies[$pc_name_key].'" size="6" class="pc_name inputmain" id="pc_name_'.$i.'" style="font-weight:bold; color:#'.$cookies[$pc_color_key].'" onblur="selectedColumnId(this, true)"></td>'."\n";
 
 if (USER_WHISPER) {
index 7b2bf71..04da416 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
diff --git a/lib/Jsphon/Decoder.php b/lib/Jsphon/Decoder.php
new file mode 100644 (file)
index 0000000..9e60dc3
--- /dev/null
@@ -0,0 +1,377 @@
+<?php
+//
+// +--------------------------------------------------------------------+
+// | PHP version 4 and 5                                                |
+// +--------------------------------------------------------------------+
+// | Copyright (c) 2006 Hawk                                            |
+// +--------------------------------------------------------------------+
+// | This source file is subject to version 3.00 of the PHP License,    |
+// | that is available at http://www.php.net/license/3_0.txt.           |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to        |
+// | license@php.net so we can mail you a copy immediately.             |
+// +--------------------------------------------------------------------+
+// | Authors: Hawk <scholar@hawklab.jp>                                 |
+// +--------------------------------------------------------------------+
+//
+//
+
+require_once(dirname(__FILE__) .'/Decoder/Tokenizer.php');
+
+/**
+ * Converts JSON-formatted string to appropriate PHP variable
+ * 
+ * example:
+ * <code>
+ * //create a new instance of Jsphon_Decoder
+ * $json =& new Jsphon_Decoder();
+ * 
+ * //convert JSON-formatted string to PHP variable
+ * $value = '["foo","bar",{"hoge":[1,2]}]';
+ * $var = $json->decode($value);
+ * 
+ * print_r($var);
+ * //array('foo', 'bar', array('hoge' => array(1,2)))
+ * </code>
+ * 
+ * @author Hawk
+ */
+class Jsphon_Decoder
+{
+    var $_mbstring;
+
+    var $_decodeOverUCS2;
+
+    var $_internalError;
+
+    var $_transTable = array(
+        '\b' => "\x08",
+        '\t' => "\x09",
+        '\n' => "\x0A",
+        '\f' => "\x0C",
+        '\r' => "\x0D",
+        '\"' => "\x22",
+        '\/' => "\x2F",
+         '\\\\' => "\x5C"
+        );
+
+    var $_allUESreg = '/\\\u([a-fA-F0-9]{4})/';
+
+    var $_utf16surUESreg = '/\\\u(D[89AB][A-F0-9]{2})\\\u(D[C-F][A-F0-9]{2})/i';
+
+    /**
+     * construct a new Jsphon_Decoder instance.
+     * 
+     * @param  bool   $decodeOverUCS2   If true, decodeString() converts the whole
+     *                                  Unicode escape sequences (\uXXXX) including surrogate pairs
+     *                                  to corresponding characters in UTF-8.
+     */
+    function Jsphon_Decoder($decodeOverUCS2=false)
+    {
+        $this->_decodeOverUCS2 = $decodeOverUCS2;
+        $this->_mbstring = extension_loaded('mbstring');
+    }
+
+    /**
+     * decodes a JSON string into appropriate variable
+     * 
+     * @param  String    $json
+     * @return mixed
+     */
+    function decode($json)
+    {
+        $tknz = new Jsphon_Decoder_Tokenizer($json,
+                                             array(&$this, 'handleInternalError'));
+        $this->_internalError = false;
+
+        $result = null;
+        if($tknz->nextToken()) {
+            $result = $this->_decodeJSValue($tknz);
+        }
+        
+        $this->_internalError = false;
+        return $result;
+    }
+
+    /**
+     * 
+     * @param  Object $tknz
+     * @return mixed
+     */
+    function _decodeJSValue(&$tknz)
+    {
+        switch($tknz->getToken()) {
+          case JSPHON_TOKEN_DATUM:
+            if(is_string($r = $tknz->getTokenValue())) {
+                $r = $this->decodeString($r);
+            }
+            return $r;
+            
+          case JSPHON_TOKEN_LBRACKET:
+            return $this->_decodeArray($tknz);
+
+          case JSPHON_TOKEN_LBRACE:
+            return $this->_decodeObject($tknz);
+
+          default:
+            $this->_error("syntax error: Expecting '{', '[' or DAUM.");
+            return null;
+        }
+    }
+
+    /**
+     * Decodes a JSON array format:
+     * [element, element2,...,elementN]
+     * 
+     * @param  Object $tknz
+     * @return array
+     */
+    function _decodeArray(&$tknz)
+    {
+        $ret = array();
+        if(!($token = $tknz->nextToken())) {
+            return null;
+            
+        } elseif($token == JSPHON_TOKEN_RBRACKET) {
+            return $ret;
+        }
+
+        //if false, break
+        while(  ($value = $this->_decodeJSValue($tknz) or true)
+            and !$this->_internalError
+            and ($ret[] = $value or true)
+            and $token = $tknz->nextToken()
+            and $token == JSPHON_TOKEN_COMMA
+            and $token = $tknz->nextToken()
+            );
+
+        if($this->_internalError) {
+            return null;
+            
+        } elseif($token == JSPHON_TOKEN_RBRACKET) {
+            return $ret;
+        } else {
+            $this->_error("Missing ',' or ']' in array encoding.");
+            return null;
+        }
+    }
+
+    /**
+     * Decodes an object of the form:
+     *  { "attribute: value, "attribute2" : value,...}
+     * 
+     * _decodeObject() always converts a JSON-object to an associative array,
+     * because you can't access empty property in PHP5.
+     * <code>
+     * // { "":"foo" }
+     * $obj->{""} = "foo"; //Fatal error: Cannot access empty property
+     * </code>
+     * 
+     * @param  Object $tknz
+     * @return array
+     */
+    function _decodeObject(&$tknz)
+    {
+        $ret = array();
+        if(!($token = $tknz->nextToken())) {
+            return null;
+            
+        } elseif($token == JSPHON_TOKEN_RBRACE) {
+            return $ret;
+        }
+
+        //if false, break
+        while(  ($key = $this->_decodeJSValue($tknz) or true)
+            and !$this->_internalError
+            and $this->_checkObjectKey($key)
+            and $token = $tknz->nextToken()
+            and $this->_checkKeyValueSep($token)
+            and $token = $tknz->nextToken()
+            and ($value = $this->_decodeJSValue($tknz) or true)
+            and !$this->_internalError
+            and ($ret[$key] = $value or true)
+            and $token = $tknz->nextToken()
+            and $token == JSPHON_TOKEN_COMMA
+            and $token = $tknz->nextToken()
+            );
+
+        if($this->_internalError) {
+            return null;
+            
+        } elseif($token == JSPHON_TOKEN_RBRACE) {
+            return $ret;
+        } else {
+            $this->_error("Missing ',' or '}' in object encoding.");
+            return null;
+        }
+    }
+
+    function _checkObjectKey($key)
+    {
+        if(!is_string($key)) {
+            $this->_error("Object's key must be a string, but is ". gettype($key));
+            return false;
+        }
+        return true;
+    }
+
+    function _checkKeyValueSep($token)
+    {
+        if($token != JSPHON_TOKEN_COLON) {
+            $this->_error("Missing ':' in object encoding.");
+            return false;
+        }
+        return true;
+    }
+    
+
+    /**
+     * 
+     * 
+     * @param  String    $encoded
+     * @return String
+     */
+    function decodeString($encoded)
+    {
+        $ret = strtr($encoded, $this->_transTable);
+        
+        if($this->_decodeOverUCS2) {
+            return $this->_decodeUESOverUCS2($ret);
+        } else {
+            //_decodeUESWithoutMbstring() fastar than _decodeUES()...
+            return $this->_decodeUESWithoutMbstring($ret);
+        }
+        
+        /*
+        if(!$this->_mbstring) {
+            return $this->_decodeUESWithoutMbstring($ret);
+        } elseif($this->_decodeOverUCS2) {
+            return $this->_decodeUESOverUCS2($ret);
+        } else {
+            return $this->_decodeUES($ret);
+        }
+        */
+    }
+
+    function _decodeUES($str)
+    {
+        $transTable = array();
+
+        if(!preg_match_all($this->_allUESreg, $str, $matches)) {
+            return $str;
+        }
+
+        $codepoints = $matches[1];
+        foreach($matches[0] as $i => $escSeq) {
+            if(isset($transTable[$escSeq])) {
+                continue;
+            }
+            $codepoint = hexdec($codepoints[$i]);
+            $transTable[$escSeq] = (0xD800 <= $codepoint && $codepoint <= 0xDFFF) ? ""
+            : mb_convert_encoding(pack('n', $codepoint), 'UTF-8', 'UCS-2');
+        }
+        return strtr($str, $transTable);
+    }
+    
+    function _decodeUESOverUCS2($str)
+    {
+        $transTable = array();
+
+        if(!preg_match_all($this->_allUESreg, $str, $u16)) {
+            return $str;
+        }
+        
+        if(preg_match_all($this->_utf16surUESreg, $str, $u16sur)) {
+            $sur1st = $u16sur[1];
+            $sur2nd = $u16sur[2];
+            
+            foreach($u16sur[0] as $i => $escSeq) {
+                if(isset($transTable[$escSeq])) {
+                    continue;
+                }
+                $transTable[$escSeq] = mb_convert_encoding(
+                    pack('n2', hexdec($sur1st[$i]), hexdec($sur2nd[$i])), 'UTF-8', 'UTF-16BE');
+            }
+        }
+
+        $codepoints = $u16[1];
+        foreach($u16[0] as $i => $escSeq) {
+            if(isset($transTable[$escSeq])) {
+                continue;
+            }
+            $codepoint = hexdec($codepoints[$i]);
+            $transTable[$escSeq] = (0xD800 <= $codepoint && $codepoint <= 0xDFFF) ? ""
+            : mb_convert_encoding(pack('n', $codepoint), 'UTF-8', 'UCS-2');
+        }
+        return strtr($str, $transTable);
+    }
+
+    function _decodeUESWithoutMbstring($str)
+    {
+        $transTable = array();
+
+        if(!preg_match_all($this->_allUESreg, $str, $matches)) {
+            return $str;
+        }
+
+        $codepoints = $matches[1];
+        foreach($matches[0] as $i => $escSeq) {
+            if(isset($transTable[$escSeq])) {
+                continue;
+            }
+            
+            $utf8char = "";
+
+            $cp = hexdec($codepoints[$i]);
+            switch(true) {
+              case ($cp < 0x80):
+                $utf8char = chr($cp);
+                break;
+                
+              case (0xD800 <= $cp && $cp <= 0xDFFF):
+                break;
+
+              case ($cp < 0x800):
+                $utf8char = chr($cp >> 6 & 0x1F | 0xC0) . chr($cp & 0x3F | 0x80);
+                break;
+                
+              case ($cp < 0x10000):
+                $utf8char = chr($cp >> 12 & 0xF | 0xE0) .
+                chr($cp >> 6 & 0x3F | 0x80) . chr($cp & 0x3F | 0x80);
+                break;
+
+              default:
+            }
+            $transTable[$escSeq] = $utf8char;
+        }
+        return strtr($str, $transTable);
+    }
+    
+
+    /**
+     * a simple wrapper for PEAR_ErrorStack::push.
+     * 
+     * @param  String    $message
+     * @param  array     $param
+     * @param  string    $level
+     * @param  int       $code
+     * @return String
+     */
+    function _error($message,
+                    $param= array(),
+                    $level='error',
+                    $code=JSPHON_ERROR_DECODE_SYNTAX)
+    {
+        $e = Jsphon_Error::push(
+            $code, $level, $param, $message, false, debug_backtrace());
+        $this->_internalError = true;
+        return $e;
+    }
+    
+    function handleInternalError($err)
+    {
+        $this->_internalError = true;
+    }
+}
+
+?>
diff --git a/lib/Jsphon/Decoder/Tokenizer.php b/lib/Jsphon/Decoder/Tokenizer.php
new file mode 100644 (file)
index 0000000..f422692
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+//
+// +--------------------------------------------------------------------+
+// | PHP version 4 and 5                                                |
+// +--------------------------------------------------------------------+
+// | Copyright (c) 2006 Hawk                                            |
+// +--------------------------------------------------------------------+
+// | This source file is subject to version 3.00 of the PHP License,    |
+// | that is available at http://www.php.net/license/3_0.txt.           |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to        |
+// | license@php.net so we can mail you a copy immediately.             |
+// +--------------------------------------------------------------------+
+// | Authors: Hawk <scholar@hawklab.jp>                                 |
+// +--------------------------------------------------------------------+
+//
+//
+
+define('JSPHON_TOKEN_EOF',      1);
+define('JSPHON_TOKEN_DATUM',    2);
+define('JSPHON_TOKEN_LBRACE',   3);
+define('JSPHON_TOKEN_LBRACKET', 4);
+define('JSPHON_TOKEN_RBRACE',   5);
+define('JSPHON_TOKEN_RBRACKET', 6);
+define('JSPHON_TOKEN_COMMA',    7);
+define('JSPHON_TOKEN_COLON',    8);
+
+/**
+ * Jsphon_Decoder_Tokenizer
+ * 
+ * @author Hawk
+ */
+class Jsphon_Decoder_Tokenizer
+{
+    var $_source;
+
+    var $_token;
+
+    var $_tokenValue;
+
+    var $_tokenTable = array(
+        '{' => JSPHON_TOKEN_LBRACE,
+        '}' => JSPHON_TOKEN_RBRACE,
+        '[' => JSPHON_TOKEN_LBRACKET,
+        ']' => JSPHON_TOKEN_RBRACKET,
+        ',' => JSPHON_TOKEN_COMMA,
+        ':' => JSPHON_TOKEN_COLON
+        );
+
+    var $_tokenValueTable = array(
+        'true'  => true,
+        'false' => false,
+        'null'  => null
+        );
+
+    var $_errorCallback;
+
+    /**
+     * constructs a new Jsphon_Decoder_Tokenizer instance.
+     * 
+     * @param  String    $source
+     */
+    function Jsphon_Decoder_Tokenizer($source, $internalErrorCallback=null)
+    {
+        $this->_source = $source;
+        $this->_errorCallback = $internalErrorCallback;
+    }
+
+    /**
+     * Retrieves the next token from the source stream.
+     * 
+     * @return int or false
+     */
+    function nextToken()
+    {
+        $src = ltrim($this->_source);
+
+        $this->_tokenValue = null;
+        $this->_token = JSPHON_TOKEN_EOF;
+
+        switch(true)
+        {
+          case $src === '':
+            break;
+            
+          case ($c = $src{0}) !== "" and isset($this->_tokenTable[$c]):
+            $this->_token = $this->_tokenTable[$c];
+            $src = substr($src, 1);
+            break;
+
+          case $c == '"' and preg_match('/^"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"/', $src, $m):
+            $this->_token = JSPHON_TOKEN_DATUM;
+            $this->_tokenValue = $m[1];
+            $src = substr($src, strlen($m[0]));
+            break;
+
+          case preg_match('/^(true|false|null)\b/', $src, $m):
+            $this->_token = JSPHON_TOKEN_DATUM;
+            $this->_tokenValue = $this->_tokenValueTable[$m[1]];
+            $src = substr($src, ($m[1]{0} == 'f' ? 5 : 4));
+            break;
+
+          case preg_match('/^-?(?:[1-9]\d+|\d)(?:\.\d+)?(?:[eE][-+]?\d+)?/', $src, $m):
+            $this->_token = JSPHON_TOKEN_DATUM;
+            $intV   = (int)$m[0];
+            $floatV = (float)$m[0];
+            $this->_tokenValue = ($intV == $floatV) ? $intV : $floatV;
+            $src = substr($src, strlen($m[0]));
+            break;
+
+          default:
+            $err = Jsphon_Error::push(
+                JSPHON_ERROR_DECODE_SYNTAX,
+                'error',
+                array(),
+                'Illegal Token',
+                false,
+                debug_backtrace());
+
+            if(is_callable($this->_errorCallback)) {
+                call_user_func($this->_errorCallback, $err);
+            }
+            return false;
+
+        }
+
+        $this->_source = $src;
+        return $this->_token;
+    }
+
+    function getToken()
+    {
+        return $this->_token;
+    }
+
+    function getTokenValue()
+    {
+        return $this->_tokenValue;
+    }
+
+}
+
+?>
diff --git a/lib/Jsphon/Encoder.php b/lib/Jsphon/Encoder.php
new file mode 100644 (file)
index 0000000..7cf9689
--- /dev/null
@@ -0,0 +1,250 @@
+<?php
+//
+// +--------------------------------------------------------------------+
+// | PHP version 4 and 5                                                |
+// +--------------------------------------------------------------------+
+// | Copyright (c) 2006 Hawk                                            |
+// +--------------------------------------------------------------------+
+// | This source file is subject to version 3.00 of the PHP License,    |
+// | that is available at http://www.php.net/license/3_0.txt.           |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to        |
+// | license@php.net so we can mail you a copy immediately.             |
+// +--------------------------------------------------------------------+
+// | Authors: Hawk <scholar@hawklab.jp>                                 |
+// +--------------------------------------------------------------------+
+//
+//
+
+/**
+ * Converts to JSON format.
+ * 
+ * example:
+ * <code>
+ * //create a new instance of Jsphon_Encoder
+ * $json =& new Jsphon_Encoder();
+ * 
+ * //convert a complex value to JSON notation, and send it to the browser
+ * $value = array('foo', 'bar', array('hoge' => array(1,2)));
+ * $output = $json->encode($value);
+ * 
+ * print_r($output);
+ * //prints: ["foo","bar",{"hoge":[1,2]}]
+ * </code>
+ * 
+ * @author Hawk
+ */
+class Jsphon_Encoder
+{
+    var $_mbstring;
+    
+    var $_escapeNonASCII;
+    
+    var $_escapeOverUCS2;
+    
+    var $_transTable;
+    
+    var $_utf8UCS2reg;
+    
+    var $_utf8overUCS2reg;
+    
+    /**
+     * constructs a new Jsphon_Encoder instance.
+     * 
+     * @param bool $escapeNonASCII  If true, encode() converts non-ASCII characters 
+     *                              to Unicode escape sequence (\uXXXX).
+     * @param bool $escapeOverUCS2  If true, encode() converts all the non-ASCII characters 
+     *                              that is encodable in UTF-16 to Unicode escape sequence.
+     *                              This parameter affects the encoder's behavior 
+     *                              only if $escapeNonASCII is set to true and 
+     *                              the multibyte string extension is available.
+     * 
+     */
+    function Jsphon_Encoder($escapeNonASCII=true, $escapeOverUCS2=false)
+    {
+        $this->_escapeNonASCII = $escapeNonASCII;
+        $this->_escapeOverUCS2 = $escapeOverUCS2;
+        $this->_mbstring = extension_loaded('mbstring');
+
+        $this->_transTable = array(
+            "\x08" => '\b',
+            "\x09" => '\t',
+            "\x0A" => '\n',
+            "\x0C" => '\f',
+            "\x0D" => '\r',
+            "\x22" => '\"',
+            "\x2F" => '\/',
+            "\x5C" => '\\\\'
+        );
+        
+        $utf8ucs2 = '[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}';
+        $utf16sur = '[\xF0-\xF3][\x80-\xBF]{3}|\xF4[\x80-\x8F][\x80-\xBF]{2}';
+        $this->_utf8UCS2reg = "/{$utf8ucs2}/";
+        $this->_utf8overUCS2reg = "/{$utf8ucs2}|{$utf16sur}/";
+    }
+    
+    /**
+     * encodes an arbitrary variables into JSON format.
+     * 
+     * If $_escapeNonASCII is set to true, 
+     * encode() removes all non-ASCII characters to make sure that 
+     * returning value dosen't contain any non-ASCII characters.
+     * 
+     * @param mixed $value
+     * @return string
+     */
+    function encode($value)
+    {
+        $json = $this->_encode($value);
+        if($this->_escapeNonASCII) {
+            $json = preg_replace('/[\x80-\xFF]/', '', $json);
+        }
+        return $json;
+    }
+    
+    function _encode($value)
+    {
+        if($value === null) {
+            return 'null';
+            
+        } elseif(is_bool($value)) {
+            return $value ? 'true' : 'false';
+            
+        } elseif(is_int($value)) {
+            return (int)$value;
+            
+        } elseif(is_float($value)) {
+            return (float)$value;
+            
+        } elseif(is_string($value)) {
+            return '"'. $this->_encodeString($value) .'"';
+
+        } elseif(is_array($value)) {
+            if(($len = count($value)) > 0 &&
+               array_keys($value) !== range(0, $len - 1)) {
+                return $this->_encodeObject($value);
+            } else {
+                return '['. join(',', array_map(array(&$this, '_encode'), $value)) .']';
+            }
+
+        } elseif(is_object($value)) {
+            return $this->_encodeObject($value);
+            
+        }
+        
+        return 'null';
+    }
+    
+    function _encodeObject($arr)
+    {
+        $result = array();
+        foreach($arr as $name => $value) {
+            $result[] = $this->_encode((string)$name) .':'. $this->_encode($value);
+        }
+        return '{'. join(',', $result) ."}";
+    }
+    
+    function _encodeString($str)
+    {
+        $str = strtr($str, $this->_transTable);
+        
+        if(!$this->_escapeNonASCII) {
+            return $str;
+        }
+        
+        if(!$this->_mbstring) {
+            return $this->_escapeNonASCIIWithoutMbstring($str);
+        }
+        
+        if($this->_escapeOverUCS2) {
+            return $this->_escapeNonASCIIOverUCS2($str);
+        } else {
+            return $this->_escapeNonASCII($str);
+        }
+    }
+    
+    function _escapeNonASCII($str) 
+    {
+        $transTable = array();
+
+        if(!preg_match_all($this->_utf8UCS2reg, $str, $matches)) {
+            return $str;
+        }
+        
+        foreach($matches[0] as $utf8char) {
+            if(isset($transTable[$utf8char])) {
+                continue;
+            }
+            $transTable[$utf8char] = $this->_formatSeq(
+                mb_convert_encoding($utf8char, 'UTF-16', 'UTF-8'));
+        }
+        return strtr($str, $transTable);
+    }
+
+    function _escapeNonASCIIOverUCS2($str) 
+    {
+        $transTable = array();
+
+        if(!preg_match_all($this->_utf8overUCS2reg, $str, $matches)) {
+            return $str;
+        }
+        
+        foreach($matches[0] as $utf8char) {
+            if(isset($transTable[$utf8char])) {
+                continue;
+            }
+            $utf16char = mb_convert_encoding($utf8char, 'UTF-16', 'UTF-8');
+            
+            if(($l = strlen($utf16char)) == 2) {
+                $transTable[$utf8char] = $this->_formatSeq($utf16char);
+            } elseif($l == 4) {
+                $transTable[$utf8char] = 
+                    $this->_formatSeq(substr($utf16char, 0, 2)) . $this->_formatSeq(substr($utf16char, 2));
+            }
+            
+        }
+        return strtr($str, $transTable);
+    }
+
+    function _escapeNonASCIIWithoutMbstring($str) 
+    {
+        $transTable = array();
+
+        if(!preg_match_all($this->_utf8UCS2reg, $str, $matches)) {
+            return $str;
+        }
+        
+        foreach($matches[0] as $utf8char) {
+            if(isset($transTable[$utf8char])) {
+                continue;
+            }
+            
+            switch(strlen($utf8char)) {
+            case 2:
+                $code = (
+                 ((ord($utf8char{0}) & 0x1F) << 6) |
+                  (ord($utf8char{1}) & 0x3F)
+                );
+                break;
+
+            case 3:
+                $code = (
+                 ((ord($utf8char{0}) & 0x0F) << 12) |
+                 ((ord($utf8char{1}) & 0x3F) << 6 ) |
+                  (ord($utf8char{2}) & 0x3F)
+                );
+                break;
+            default:
+            }
+            $transTable[$utf8char] = '\u'. substr('0000'. dechex($code), -4);
+        }
+        return strtr($str, $transTable);
+    }
+
+    function _formatSeq($u16)
+    {
+        return '\u'. substr('0000'. bin2hex($u16), -4);
+    }
+}
+
+?>
diff --git a/lib/Jsphon/Error.php b/lib/Jsphon/Error.php
new file mode 100644 (file)
index 0000000..b2a5413
--- /dev/null
@@ -0,0 +1,190 @@
+<?php
+//
+// +--------------------------------------------------------------------+
+// | PHP version 4 and 5                                                |
+// +--------------------------------------------------------------------+
+// | Copyright (c) 2006 Hawk                                            |
+// +--------------------------------------------------------------------+
+// | This source file is subject to version 3.00 of the PHP License,    |
+// | that is available at http://www.php.net/license/3_0.txt.           |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to        |
+// | license@php.net so we can mail you a copy immediately.             |
+// +--------------------------------------------------------------------+
+// | Authors: Hawk <scholar@hawklab.jp>                                 |
+// +--------------------------------------------------------------------+
+//
+//
+
+/**
+ * Jsphon_Error
+ * 
+ * @author Hawk
+ */
+class Jsphon_Error
+{
+    var $_isPHP5;
+
+    var $_existsPEAR;
+
+    var $_throwException = true;
+
+    var $_exceptionCreator;
+
+    /**
+     * Constructor
+     * 
+     * @access private
+     */
+    function Jsphon_Error()
+    {
+        $this->_isPHP5     = version_compare(phpversion(), '5', '>=');
+        $this->_existsPEAR = (@include_once "PEAR/ErrorStack.php");
+        
+        if($this->_isPHP5) {
+            if($this->_existsPEAR) {
+                require_once(dirname(__FILE__) .'/Exception.php');
+                $method = '_createJsphonException';
+            } else {
+                $method = '_createException';
+            }
+            $this->_exceptionCreator = array(__CLASS__, $method);
+        }
+    }
+
+    /**
+     * 
+     * 
+     * @since 06/09/05 13:21
+     * @return Jsphon_Error
+     */
+    function &singleton()
+    {
+        static $instance = null;
+        if($instance === null) {
+            $instance = new Jsphon_Error();
+        }
+        return $instance;
+    }
+
+    /**
+     * 
+     * @static
+     * @param  int      $code
+     * @param  string   $level
+     * @param  array    $params
+     * @param  string   $msg
+     * @param  mixed    $repackage
+     * @param  array    $backtrace
+     * @return array
+     */
+    function push($code, $level = 'error', $params = array(), $msg = false,
+                  $repackage = false, $backtrace = false)
+    {
+        if (!$backtrace) {
+            $backtrace = debug_backtrace();
+        }
+
+        $self  =& Jsphon_Error::singleton();
+
+        if(!$self->_isPHP5 || !$self->_throwException) {
+            return $self->_push(
+                $code, $level, $params, $msg, $repackage, $backtrace);
+        }
+
+        $pushOnly = true;
+        $err = $self->_push(
+                $code, $level, $params, $msg, $repackage, $backtrace, $pushOnly);
+
+        array_shift($backtrace);
+        throw (call_user_func($self->_exceptionCreator, $msg, $code, $backtrace));
+        return ;
+    }
+
+    /**
+     * 
+     * 
+     * @access private
+     * @static
+     * @param  int      $code
+     * @param  string   $level
+     * @param  array    $params
+     * @param  string   $msg
+     * @param  mixed    $repackage
+     * @param  array    $backtrace
+     * @param  bool     $pushOnly
+     * @return array or null unless PEAR_ErrorStack exists.
+     */
+    function _push($code, $level='error', $params=array(), $msg=false,
+                              $repackage=false, $backtrace=false, $pushOnly=false)
+    {
+        if(!$this->_existsPEAR) {
+            return;
+        }
+
+        $stack =& PEAR_ErrorStack::singleton('Jsphon');
+        if($pushOnly) {
+            $stack->pushCallback(array(__CLASS__, 'pushOnly'));
+        }
+        
+        $err = $stack->push($code, $level, $params, $msg, $repackage, $backtrace);
+
+        if($pushOnly) {
+            $stack->popCallback();
+        }
+        return $err;
+    }
+
+    /**
+     * 
+     * @since 06/09/05 13:34
+     * @param  String    $bool
+     * @param  String    $exceptionClass
+     * @return String
+     */
+    function setThrowException($bool)
+    {
+        $this->_throwException = $bool;
+    }
+
+    /**
+     * error handler which do nothing
+     * 
+     * @since 06/09/05 13:52
+     * @param  array    $err
+     * @return int
+     */
+    function pushOnly($err)
+    {
+        return PEAR_ERRORSTACK_PUSH;
+    }
+
+    /**
+     * 
+     * @static
+     * @param  String    $msg
+     * @param  int       $code
+     * @param  array    $trace
+     * @return Exception
+     */
+    function _createJsphonException($msg, $code, $trace)
+    {
+        return new Jsphon_Exception($msg, $code, $trace);
+    }
+
+    /**
+     * 
+     * @static
+     * @param  String    $msg
+     * @param  int       $code
+     * @param  array    $trace
+     * @return Exception
+     */
+    function _createException($msg, $code, $trace)
+    {
+        return new Exception($msg, $code);
+    }
+}
+
+
+?>
diff --git a/lib/Jsphon/Exception.php b/lib/Jsphon/Exception.php
new file mode 100644 (file)
index 0000000..3fc5f85
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+//
+// +--------------------------------------------------------------------+
+// | PHP version 4 and 5                                                |
+// +--------------------------------------------------------------------+
+// | Copyright (c) 2006 Hawk                                            |
+// +--------------------------------------------------------------------+
+// | This source file is subject to version 3.00 of the PHP License,    |
+// | that is available at http://www.php.net/license/3_0.txt.           |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to        |
+// | license@php.net so we can mail you a copy immediately.             |
+// +--------------------------------------------------------------------+
+// | Authors: Hawk <scholar@hawklab.jp>                                 |
+// +--------------------------------------------------------------------+
+//
+//
+
+require_once('PEAR/Exception.php');
+
+/**
+ * Jsphon_Exception
+ * 
+ * @author Hawk
+ */
+class Jsphon_Exception extends PEAR_Exception
+{
+    private $_outerTrace;
+    
+    /**
+     * Constructor
+     * 
+     */
+    public function __construct($msg, $code, $outerTrace)
+    {
+        $this->_outerTrace = $outerTrace;
+        parent::__construct($msg, $code);
+    }
+    
+    /**
+     * 
+     * 
+     * @override
+     * @return array
+     */
+    public function getTraceSafe()
+    {
+        if(count($this->_outerTrace) > 0) {
+            return $this->_outerTrace;
+        }
+        return parent::getTraceSafe();
+    }
+
+}
+
+?>
index db52c5c..3ec1bca 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
diff --git a/lib/card.php b/lib/card.php
new file mode 100644 (file)
index 0000000..9669e1a
--- /dev/null
@@ -0,0 +1,214 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+
+/*****************
+ *  PHPライブラリ:カード機能用
+ *****************/
+
+// 外部ライブラリの読み込み
+require_once './lib/Jsphon/Encoder.php';
+require_once './lib/Jsphon/Decoder.php';
+
+/*
+ * ログ基本整形
+ */
+function read_card_ini()
+{
+    $card_inifile_list = get_dir_contents_list(CARD_DIR, 'ASC', true);
+
+    // 設定ファイル読み込み
+    $card_ini = array();
+    if ($card_inifile_list) {
+        // サブディレクトリ読み込みは現状なし
+        foreach($card_inifile_list['files'] as $v) {
+            $card_ini[] = parse_ini_file(CARD_DIR.$v, true);
+        }
+
+        // order設定順にソート
+        foreach ($card_ini as $k => $v) {
+            $order[$k]  = $v['config']['order'];
+        }
+        array_multisort($order, SORT_ASC, $card_ini);
+    }
+    return $card_ini;
+}
+
+/* 
+ * 配列をJSONへパース
+ */
+function set_array2json($data)
+{
+    if (!is_array($data)) {
+        $data = array();
+    }
+
+    $json = new Jsphon_Encoder(false);
+    $purse = $json->encode($data);
+
+    return $purse;
+}
+
+/* 
+ * JSONを配列へパース
+ */
+function set_json2array($data)
+{
+    if (!$data) {
+        $data = array();
+    }
+
+    $json = new Jsphon_Decoder(false);
+    $arr = $json->decode($data);
+
+    return $arr;
+}
+
+/* 
+ * カード配置セット
+ */
+function card_status($plname, $card_id, $status='Secret', $is_open=false, $is_head=false, $force='')
+{
+    // 前処理
+    $plname = addslashes($plname);
+
+    // 難読化
+    if (OBFUSCATION) {
+        $plname = obf_xor($plname);
+        $card_id = obf_xor($card_id);
+    }
+
+    // カードを配置
+    $GLOBALS['AJAX_CHAT_TRPG']['deck']['status'][$plname][$status]['card'][] = array(
+        'id' => $card_id,
+        'open' => $is_open,
+        'head' => $head,
+    );
+}
+
+// カード移動
+function setMoveCard($target, $a)
+{
+    // カードを出す場合
+    if ($a == 'd') {
+        $target['open'] = false;
+    // カードを出す場合
+    } elseif ($a == 'c') {
+        $target['open'] = true;
+    }
+
+    return $target;
+}
+
+// カード移動書き込み補助
+function writeMoveCard($fromName, $fromPlace, $toName, $toPlace, $num, $toMe) {
+    $msg = '';
+    $from = setCardName($fromName, $fromPlace);
+    $to = setCardName($toName, $toPlace);
+    $msg .= $from.'から';
+    $msg .= $to.'に';
+    if ($num) {
+        $msg .= $num.'枚';
+    }
+    if ($toPlace == 'Field') {
+            $msg .= '出しました。';
+            $action = '出した';
+            $is_secret = false;
+    } else {
+        if ($toName == 'deckCardSet') {
+            $msg .= '戻しました。';
+            $action = '戻した';
+        } else {
+            if ($toMe) {
+                $msg .= '引きました。';
+                $action = '引いた';
+            } else {
+                $msg .= '渡しました。';
+                $action = '渡した';
+            }
+        }
+        if ($fromPlace == 'Secret') {
+            $is_secret = true;
+        } else {
+            $is_secret = false;
+        }
+    }
+    return array($msg, $action, $is_secret);
+}
+function setCardName($name, $place) {
+    if ($name == 'deckCardSet') {
+        if ($place == 'Secret') {
+            return '山札';
+        } else {
+            return '場札';
+        }
+    } else {
+        if ($place == 'Secret') {
+            return $name.'さんの手札';
+        } elseif ($place == 'Field')  {
+            return $name.'さんの場札';
+        }
+    }
+    return false;
+}
+function setCardMoveDetailForWriteToChat($action, $is_secret) {
+    $write_msg = array();
+    $write_msg['msg'] = $action.'カード:';
+    if ($is_secret) {
+            $write_msg['isSecret'] = $action.'カード:';
+    }
+
+    return $write_msg;
+}
+
+// 指定カードの移動
+function moveCardByTargetId(&$deck_status, $target_card, $from, $to, $fieldFrom, $fieldTo, $head) {
+    if (OBFUSCATION) {
+        $target_card_id = de_obf_xor($target_card[0]['id']);
+    } else {
+        $target_card_id = $target_card[0]['id'];
+    }
+
+    // カード公開
+    // 山・手は非公開
+    if ($fieldTo == 'Secret') {
+        $target_card[0]['open'] = false;
+    // 場は公開
+    } else {
+        $target_card[0]['open'] = true;
+    }
+
+    // 正逆を指定
+    if (isset($head)) {
+        // 正逆ランダムでカードを出す
+        if ($head == 'rand') {
+            mt_srand((double) microtime() * 1000000);
+            $target_card[0]['head'] = (bool)(mt_rand(1, 6) % 2);
+            if ($target_card[0]['head']) {
+                $card_head = true;
+            }
+        // 指定あり:正
+        } elseif ($head) {
+            $target_card[0]['head'] = $head;
+            $card_head  = true;
+        // 指定あり:逆
+        } else {
+            $target_card[0]['head'] = NULL;
+        }
+    } else {
+        $target_card[0]['head'] = NULL;
+    }
+
+    if (!is_array($deck_status[$to][$fieldTo]['card'])) {
+        $deck_status[$to][$fieldTo]['card'] = array();
+    }
+    array_push($deck_status[$to][$fieldTo]['card'], $target_card[0]);
+
+    return array($target_card_id, $card_head);
+}
+
+?>
\ No newline at end of file
index 2b549b1..e06c567 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
@@ -18,6 +18,8 @@ function config_mode($mode){
         $lines = read_config_one(CONFIG_MAIN);
     } elseif ($mode == 'TRPG機能関連') {
         $lines = read_config_one(CONFIG_TRPG);
+    } elseif ($mode == 'カード機能関連') {
+        $lines = read_config_one(CONFIG_CARD);
     } elseif ($mode == 'タグ') {
         $lines = read_config_one(CONFIG_TAG);
     } elseif ($mode == '全体の配色') {
index 786116e..bcd49d9 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 require_once './lib/ini/trpgchat-ini-consumer.php';
 
index 44feea4..710b8c0 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
index 6ba8953..e1f5849 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
@@ -80,6 +80,6 @@ $GLOBALS['AJAX_CHAT_TRPG']['ACCORDION_HELP'][4]['body'] = "「参加者」表示
 
         // 動作確認
 $GLOBALS['AJAX_CHAT_TRPG']['ACCORDION_HELP'][5]['title'] = "その他";
-$GLOBALS['AJAX_CHAT_TRPG']['ACCORDION_HELP'][5]['body'] = "動作確認:IE6、IE7、FireFox2、FireFox3、Opera9";
+$GLOBALS['AJAX_CHAT_TRPG']['ACCORDION_HELP'][5]['body'] = "";
 
 ?>
\ No newline at end of file
diff --git a/lib/js/card-js.php b/lib/js/card-js.php
new file mode 100644 (file)
index 0000000..55db1bb
--- /dev/null
@@ -0,0 +1,77 @@
+<?php
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+
+/*****************
+ *  JaveScriptライブラリ:共通
+ *****************/
+
+?>
+<script type="text/javascript">
+<!--
+
+//変数の設定
+var getdata_on = <?php print GETDATA_ON;?>*1000;
+var getdata_off = <?php print GETDATA_OFF;?>*1000;
+var deleteLastPastLog = '<?php print DELETE_LAST_PASTLOG;?>';
+var deckFile = '<?php print NOW_DECK;?>';
+var deckStatus = '<?php print NOW_DECK_STATUS;?>';
+var color_system = '#<?php print COLOR_SYSTEM;?>';
+var obfuscateLog = '<?php print OBFUSCATION; ?>';
+var hide_icon = '<?php print HIDE_ICON; ?>';
+var cardBgColor = '<?php print CARD_BGCOLOR; ?>';
+var cardTextColor = '<?php print CARD_TEXTCOLOR; ?>';
+
+// 起動時の処理
+$(function(){
+    // 入室チェック
+    loginData = checkLogin();
+    if (!loginData[0]) {
+        alert("カード機能の使用にはチャットログインが必要です。");
+        close();
+        return false;
+    }
+
+    loginName = loginData[0];
+    loginHash = loginData[1];
+    pwd = loginData[2];
+
+    // ブラウザ判断
+    isIE();
+
+    // 場を表示
+    $('#deckType').css('display', 'block');
+    $('#plhash').val(loginHash);
+    replaceTagAppend('ul#plName>li#playerName', 'span', 'nameValue', 'name', loginName, '', '', '', '');
+    $('ul#plName>li#playerName').attr('id', loginName);
+
+    // 現在のデック設定を表示
+    dispCardField(false);
+    dispDeck(false);
+    dispDeckStatus(false, false);
+
+    // カード詳細
+    $("#cardDetail").draggable({
+        cursor:'move',
+        helper:'original'
+    });
+    $("#cardDetail").draggable('enable');
+    $("#cardDetail").accordion({
+        event: 'dblclick',
+        alwaysOpen: false,
+        autoHeight: true,
+        header: 'div#header'
+    });
+
+    // 自動更新
+    deckTimer = setInterval('dispCardField(true)', getdata_on);
+    deckTimer = setInterval('dispDeck(true)', getdata_on);
+    deckTimer = setInterval('dispDeckStatus(true, true)', getdata_on);
+});
+
+-->
+</script>
\ No newline at end of file
diff --git a/lib/js/card.js b/lib/js/card.js
new file mode 100644 (file)
index 0000000..874358f
--- /dev/null
@@ -0,0 +1,1063 @@
+/*
+ Ajax Chat for TRPG ver.2.6
+ (c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
+ */
+/*****************
+ *  JaveScriptライブラリ:カード機能用
+ *****************/
+
+var cardWritescript = './write.php';
+var cardWritescript2 = './card_write.php';
+var cardUpdateScript = './card_update.php';
+var dateD = (new Date()).getTime();
+
+// 入室チェック
+function checkLogin() {
+    var error = false;
+    var openWindow = window.opener;
+    if (!openWindow) {
+        error = true;
+    } else {
+        var name = openWindow.document.getElementById("name_on").value;
+        if (!name) {
+            error = true;
+        }
+    }
+    if (error) {
+        return false;
+    }
+    var pwd = openWindow.document.getElementById('pwd_on').value;
+    var hash = openWindow.document.getElementById('my_hash').value;
+    return new Array(name, hash, pwd);
+}
+
+// カード卓更新
+// カード卓に参加者を表示
+function dispCardField(ifModifiedField) {
+    var flg = false;
+
+    // 他PL表示
+    $.ajax({
+        type: "get",
+        url: now_member,
+        ifModified: ifModifiedField,
+        dataType: "text",
+        // 受信完了イベント
+        success: function(data) {
+            var nowMembers = new Array();
+
+            var memberData = data.split("\n");
+            $.each(memberData, function(i){
+                var memberDataDetail = memberData[i].split("<>");
+                if (obfuscateLog == '1') {
+                    var oplName = deObfLog(memberDataDetail[0]);
+                } else {
+                    var oplName = memberDataDetail[0];
+                }
+
+                // 他PL表示
+                if (oplName && oplName != loginName) {
+                    var oplId = "#"+oplName;
+                    nowMembers.push(oplName);
+                    // 追加
+                    if ($(oplId).text()=='') {
+                        flg = true;
+                        // カード卓
+                        var oplTagValue = '<li class="name" id="playerName">'+oplName+'</li>'
+                                            +'<li class="position">'
+                                            +'<div class="Secret" id="'+oplName+'Secret">手:<span class="contents"></span></div>'
+                                            +'</li>'
+                                            +'<div class="Field" id="'+oplName+'Field">場:<span class="contents"></span></div>'
+                                            +'</li>'
+                                            +'<li class="command">'
+                                            +'<a href="#" onclick="updateCardStatus(\'draw\', \''+oplName+'\', \'Secret\', \'plName\', \'Secret\', 1, null, null);return false;">手札から1枚引く</a>'
+
+                                            +'</li>';
+                        addTagAppend('#oplPlace', 'ul', 'player', oplName, oplTagValue, '', '', '', '');
+                        // カード操作
+                        var oplTagValue2 = '<option value="'+oplName+'" id="'+oplName+'Select">'+oplName+'</option>';
+                        addTagAppend('#selectMember', '', '', '', oplTagValue2, '', '', '', '');
+                    }
+                }
+            });
+
+            // ログアウト者を削除
+            var dispMembers = $(".player").get();
+            var delMemberIds = new Array();
+            var delMemberSelect = new Array();
+            for(i=0;i<dispMembers.length;i++) {
+                var id = $(".player").get(i).id;
+                if ((id != 'deckCardSet' && id != 'plName' && id != 'noMember')
+                    && jQuery.inArray(id, nowMembers)=="-1") {
+                    delMemberIds.push("#"+id);
+                    delMemberSelect.push("#"+id+'Select');
+                }
+            }
+
+            if (delMemberIds[0]) {
+                for(i=0;i<delMemberIds.length;i++) {
+                    flg = true;
+                    // カード卓
+                    $(delMemberIds[i]).remove();
+                    // カード操作
+                    $(delMemberSelect[i]).remove();
+                }
+            }
+            // メンバーが変化していれば更新
+            if (flg && ifModifiedField) {
+                dispDeckStatus(false, true);
+            }
+        }
+    });
+}
+
+// 現在のデック設定を読み込んで表示
+function dispDeck(cacheStatus) {
+    // デック設定読み込み
+    var log = deckFile+'?e='+dateD;
+
+    // キャッシュ削除
+    if (!cacheStatus) {
+        $.ajax({
+            type: "get",
+            url: log,
+            ifModified: false,
+            cache: false,
+            dataType: "json",
+            success: function(data){
+                dispDeck(true);
+            }
+        });
+        return false;
+    }
+
+    // デック設定読み込み
+    var log = deckFile+'?e='+dateD;
+    $.ajax({
+        type: "get",
+        url: log,
+        ifModified: true,
+        cache: true,
+        dataType: "json",
+        // デック更新
+        success: function(data){
+            $("#deckConfig").text("");
+            $("#deckSetName").text("");
+            $("#cardSpace").text("");
+
+            // データがなければ終了
+            if (data=="undefined" || !data) {
+                return false;
+            }
+            if (data=="なし" || data["config"]["name"]=="undefined") {
+                $('#deckSetName').text("なし");
+                $('.command').hide();
+                return false;
+            }
+
+            // デック名
+            $('#deckSetName').text(data["config"]["name"]);
+            $('.command').show();
+            // 他デック設定
+            // デックファイル名
+            replaceTagAppend("#deckConfig", "span", "deckConfig", "DeckFileName", data["config"]["filename"], '', "", "", "")
+            // デック背面画像ファイル名
+            deckBgImageFilename = data["config"]["bg_image"];
+            // 背面画像
+            if (deckBgImageFilename) {
+                var deckBgImage = loadImageObj(deckBgImageFilename);
+            }
+            // 正逆設定
+            deckHead = data["config"]["is_head"];
+
+            // デックセット
+            // 伏せカード
+            addTagAppend('#cardSpace', 'div', 'card secretCard', "secretCard", '', '', '', '', '');
+            if (deckBgImage && deckBgImage.src!="undefined") {
+                $("#secretCard").css("background-image", "url("+deckBgImage.src+")");
+            }
+            // オープンカード
+            var cardBgImage = new Array();
+            $.each(data, function(i){
+                // カード設定
+                if (i=="config") {
+                    if (data["config"]["bg_color"]) {
+                        card_bg_color = "#"+data["config"]["bg_color"];
+                    } else {
+                        card_bg_color = '#'+cardBgColor;
+                    }
+                    if (data["config"]["text_color"]) {
+                        card_text_color = "#"+data["config"]["text_color"];
+                    } else {
+                        card_text_color = '#'+cardTextColor;
+                    }
+                    $('.openCard').css("background-color", card_bg_color);
+                    $('.openCard').css("color", card_text_color);
+                    $('#cardDetail').css("background-color", card_bg_color);
+                    $('#cardDetail').css("color", card_text_color);
+                    $('.cardText').css("color", card_text_color);
+                // デック表示
+                } else {
+                    if (!data[i]["name_short"]) {
+                        return false;
+                    }
+                    // 正逆
+                    if (data[i]["head"]) {
+                        data[i]["name_short"] = "(逆)" + data[i]["name_short"]; 
+                    }
+
+
+                    // 詳細表示
+                    var cardDetailId = 'cardDetail'+i;
+
+                    var title = data[i]["name_long"];
+                    if (data[i]["image_b"]) {
+                        var img = loadImageObj(data[i]["image_b"]);
+                    } else {
+                        var img = '';
+                    }
+                    var body = '';
+                    if (data["config"]["text_prefix"]) {
+                        body += data["config"]["text_prefix"];
+                    }
+                    if (data[i]["text"]) {
+                        body += data[i]["text"];
+                    }
+                    if (data["config"]["text_postfix"]) {
+                        body += data["config"]["text_postfix"];
+                    }
+
+                    var cardDetailTag = '<div class="title">'+title+'</div>';
+                    if (img || body) {
+                        if (img) {
+                            cardDetailTag += '<div class="cardDetailImage">';
+                            cardDetailTag += '<img src="'+img.src+'">';
+                            cardDetailTag += '</div>';
+                        }
+                        if (body) {
+                            cardDetailTag += '<div class="cardText">'+body+'</div>';
+                        }
+                    }
+                    addTagAppend('#cardSpace', 'div', 'cardDetailData', cardDetailId, cardDetailTag, '', '', '', '');
+
+                    // カード出力
+                    var tagValue = '';
+
+                    // カード左表示
+                    tagValue += '<div class="cardLeftValue">';
+                    if (data[i]["text_color"]) {
+                        tagValue += '<font color="#'+data[i]["text_color"]+'">';
+                    }
+                    tagValue += data[i]["name_short"];
+                    if (data[i]["text_color"]) {
+                        tagValue += '</font>';
+                    }
+                    tagValue += '</div>'+"\n";
+
+                    // カード作成
+                    addTagAppend('#cardSpace', 'div', 'card openCard', i, tagValue, 'showCard(this)', 'hideCard(this)', 'cardClick(this);', '');
+                    var cardId = "#"+i;
+
+                    // カード主画像
+                    if (data[i]["image_s"]) {
+                        cardBgImage[i] = loadImageObj(data[i]["image_s"]);
+                        if (cardBgImage[i].src) {
+                            $(cardId).css("background-image", 'url("'+cardBgImage[i].src+'")');
+                        }
+                    }
+                    $(cardId).css("background-color", card_bg_color);
+                    $(cardId).css("color", card_text_color);
+
+                }
+            });
+        },
+        error: function(){
+        }
+    });
+}
+
+// 現在のカード配置を読み込んで表示
+function dispDeckStatus(ifModifiedStatus, end) {
+    var log = deckStatus+'?e='+dateD;
+
+    // デック状態読み込み
+    $.ajax({
+        type: "get",
+        url: log,
+        ifModified: ifModifiedStatus,
+//        cache: true,
+        dataType: "json",
+        // カード配置更新
+        success: function(data){
+            // 卓をアミカケ
+            showNowLoading();
+
+            $(".contents").text('');
+            // データがなければ終了
+            if (data=="undefined" || !data) {
+                return false;
+            }
+
+            // カード配置
+            var nowMember = new Array();
+            var noMemberCardNum = 0;
+            var totalCardNum = 0;
+            $.each(data, function(owner){
+                var cardSet = data[owner];
+                // 難読化
+                if (obfuscateLog == '1') {
+                    var ownerName = deObfLog(owner);
+                } else {
+                    var ownerName = owner;
+                }
+                var ownerId = "#"+ownerName;
+
+                if (owner && data[owner]) {
+                    var isField = false;
+                    var isOwner = false;
+                    var isNoMember = false;
+                    // 山
+                    if (ownerName == 'deckCardSet') {
+                        var isField = true;
+                        ownerName = 'deck';
+                    // 閲覧者のカード表示
+                    } else if (ownerName == loginName) {
+                        var isOwner = true;
+                        ownerName = 'my';
+                    // 参加者のカードではない
+                    } else if (!$(ownerId).text()) {
+                        var isNoMember = true;
+                    }
+
+                    // 手札と場札
+                    $.each(cardSet, function(status){
+                        var card = cardSet[status]["card"];
+                        if (status && card) {
+                            // カード表示場所
+                            var targetPlace = 'div#'+ownerName+status+'>.contents';
+                            for (var i=0;i<card.length;i++) {
+                                totalCardNum++;
+                                if (card[i]) {
+                                    // カード表示
+                                    // カード表示はオープンか
+                                    var isOpen = false;
+                                    if (isOwner || (status == "Field" && card[i]["open"])) {
+                                        var isOpen = true;
+                                    }
+
+                                    // 参加者以外のカード
+                                    if (isNoMember) {
+                                        noMemberCardNum++
+                                    } else {
+
+                                        // 伏せカード
+                                        if (!isOpen) {
+                                            var targetCard = $("#secretCard").clone(true);
+                                            $(targetPlace).append(targetCard);
+
+                                            targetCard.attr("id", 'secretCard'+totalCardNum);
+                                            var targetCardId = '#secretCard'+totalCardNum;
+                                        // オープンカード
+                                        } else {
+                                            // 難読化
+                                            if (obfuscateLog == '1') {
+                                                var cardId = deObfLog(card[i]["id"]);
+                                            } else {
+                                                var cardId = card[i]["id"];
+                                            }
+
+                                            var targetCardId = cardId;
+
+                                            var targetCardId = "#"+targetCardId;
+                                            if ($(targetCardId).text()) {
+                                                var targetCard = $(targetCardId).clone(true);
+                                                if (deckHead) {
+                                                    if (card[i]["head"] && card[i]["head"]!="false") {
+                                                        targetCard.children().prepend("(逆)");
+                                                    }
+                                                }
+                                            }
+                                            $(targetPlace).append(targetCard);
+                                            if (targetCard != undefined) {
+                                                var targetCardId = "#"+targetCard.attr('Id');
+                                            }
+                                        }
+
+                                        // カード調整
+                                        if (isOpen) {
+                                            var pitch = 14;
+                                        } else {
+                                            var pitch = 4;
+                                        }
+                                        cardShift(targetCardId, pitch*i);
+                                        $(targetCardId).css("z-index", Number(10)+i);
+                                    }
+                                }
+                            }
+                        }
+                       });
+               }
+            });
+
+            // カード表示の調整
+            // IE用
+            if (isIE) {
+                $(".card").css("width", "32px");
+                $(".card").css("height", "42px");
+            }
+            // 非参加者のカード表示
+            $('#noMemberCardsNum').text(noMemberCardNum);
+
+            if (end) {
+                hideOverLay();
+            }
+        }
+    });
+}
+
+// カードを毎に表示調整
+function cardShift(cardId, pitch) {
+    var leftPos = $(cardId).css("left");
+    if (leftPos != undefined) {
+        leftPos = $(cardId).css("left").substring(0, leftPos.length-2);
+    leftPos = Number(leftPos)+Number(pitch);
+    $(cardId).css("left", leftPos+"px");
+    return leftPos;
+    } else {
+        return null;
+    }
+}
+
+// カード表示(マウスオーバ)
+function showCard(Obj) {
+    prevZIndex = Obj.style.zIndex;
+    Obj.style.zIndex = 9999;
+}
+function hideCard(Obj) {
+    Obj.style.zIndex = prevZIndex;
+}
+
+// カードをクリック
+function cardClick(Obj) {
+    // カード情報
+    var id = "#"+Obj.id;
+    var card = $(id);
+    var field = card.parent().parent().attr("class");
+    var owner = card.parent().parent().parent().parent().children().attr("id");
+
+    // カード詳細情報セット
+    var cardDetailEl = '#cardDetail'+Obj.id;
+    var cardTitleEl = cardDetailEl+' > .title';
+    var cardImgEl = cardDetailEl+' > .cardDetailImage > img';
+    var cardBodyEl = cardDetailEl+' > .cardText';
+
+    $("#cardDetail > #header > .cardTitle").html($(cardTitleEl).text());
+    if ($(cardImgEl).attr("src") && $(cardImgEl).attr("src") != undefined) {
+        var Img = $(cardImgEl).clone();
+        $('#cardDetail > #body > .cardDetailImage').html(Img);
+        $('#cardDetail > #body > .cardDetailImage').css("width", "80px");
+        $('#cardDetail > #body > .cardText').css("width", "100px");
+    } else {
+        $('#cardDetail > #body > .cardDetailImage').html("");
+        $('#cardDetail > #body > .cardDetailImage').css("width", "0");
+        $('#cardDetail > #body > .cardText').css("width", "190px");
+    }
+    $("#cardDetail > #body > .cardText").html($(cardBodyEl).html());
+    $("#cardDetail > #footer > form > #selectCardId").val(Obj.id);
+    $("#cardDetail > #footer > form > #selectFrom").val(owner);
+    $("#cardDetail > #footer > form > #selectField").val(field);
+
+    // カード操作ボタン表示
+    if (owner == loginName && field == 'Secret') {
+        $("#oneDraw").hide();
+    } else {
+        $("#oneDraw").show();
+    }
+
+    // カード詳細情報表示
+    var x = parseInt($(Obj).offset().left);
+    $("#cardDetail").css("left", x-35);
+    var y = parseInt($(Obj).offset().top);
+    $("#cardDetail").css("top", y+42);
+    $("#cardDetail").show();
+}
+
+// カードを引く枚数指定
+function getCardDrowNum(Id) {
+    var cardNum = $(Id).attr("value");
+    if (!checkCardNum(cardNum)) {
+        return false;
+    }
+    return cardNum;
+}
+
+// カード枚数指定チェック
+function checkCardNum(cardNum) {
+    if (!cardNum) {
+        alert('枚数を指定して下さい');
+        return false;
+    }
+    cardNum = parseInt(cardNum, 10);
+    if (isNaN(cardNum)) {
+        alert('枚数は半角数字で指定して下さい');
+        return false;
+    }
+    return true
+}
+
+// カードを引く・出す
+function updateCardStatus(action, from, fieldFrom, to, fieldTo, cardNum, castCardId, castCardHead) {
+    if (!loginName) {
+        alert('ログインして下さい');
+        return false;
+    }
+
+    if (!checkCardNum(cardNum)) {
+        return false;
+    }
+
+    if (!from || !fieldFrom || !to || !fieldTo) {
+        return false;
+    }
+
+    if (from == to && fieldFrom == fieldTo) {
+        alert('同じ場所です');
+        return false;
+    }
+
+    var fromCards = "#"+phpHtmlspecialchars(from)+" ."+fieldFrom+" .contents>div";
+
+    if (castCardId) {
+        var castCardId2 = "#"+castCardId;
+        if (!$(castCardId2).text()) {
+            alert('カードがありません');
+            return false;
+        }
+    } else {
+        var fromCardNum = $(fromCards).size();
+        if (!fromCardNum || fromCardNum==0) {
+            alert('カードがありません');
+            return false;
+        }
+    }
+
+    if (from=="deckCardSet") {
+        var fromName = "現在のカード";
+    } else if (from=="plName") {
+        var fromName = loginName;
+        from = loginName;
+    } else {
+        var fromName = from;
+    }
+    if (fieldFrom=="Secret") {
+        if (from=="deckCardSet") {
+            fromName += "の山札";
+        } else {
+            fromName += "さんの手札";
+        }
+    } else {
+        if (from!="deckCardSet") {
+            fromName += "さん";
+        }
+        fromName += "の場札";
+    }
+
+    var returnFlag = false;
+    if (to=="deckCardSet") {
+        var toName = "現在のカード";
+    } else if (to=="plName") {
+        var toName = loginName;
+        to = loginName;
+    } else {
+        var toName = to;
+    }
+    if (fieldTo=="Secret") {
+        if (to=="deckCardSet") {
+            toName += "の山札";
+            returnFlag = true;
+        } else {
+            toName += "さんの手札";
+        }
+    } else {
+        if (to!="deckCardSet") {
+            toName += "さん";
+        }
+        toName += "の場札";
+    }
+
+    var confirmMsg = fromName+"から"+toName+"へ";
+    if (!castCardId) {
+        confirmMsg += cardNum+"枚";
+    } else {
+        confirmMsg += $(castCardId2).text()+"を";
+    }
+    if (action=='draw') {
+        confirmMsg += "引きます";
+        var playerActionSystem = "d";
+    } else if (action=='cast') {
+        if (returnFlag) {
+            confirmMsg += "戻します。\n戻すと"+toName+"はシャッフルされます";
+        } else if (fieldTo=="Secret" && fieldFrom=="Secret") {
+            confirmMsg += "渡します";
+        } else  {
+            confirmMsg += "出します";
+        }
+        var playerActionSystem = "c";
+    } else {
+        alert('そのカード移動はできません');
+        return false;
+    }
+
+    var updateCardStatusConfirm = confirm(confirmMsg+"。\nよろしいですか?");
+    if (!updateCardStatusConfirm) {
+        return false;
+    }
+
+    if (fromCardNum < cardNum) {
+        var shortCardMsg = fromCardNum+"枚しか";
+        if (action=='draw') {
+            shortCardMsg += "引けません";
+        } else if (action=='cast') {
+        shortCardMsg += "出せません";
+        } else {
+            return false;
+        }
+        var shortCardConfirm = confirm(shortCardMsg+"。\nよろしいですか?");
+        if (!shortCardConfirm) {
+            return false;
+        }
+    }
+
+    // 正逆指定
+    var cardIsTail = false;
+    if (deckHead && castCardHead) {
+        if (castCardId) {
+            var castCardHeadset = confirm("”正位置”で出します。\nよろしいですか?\n  OK:正位置で出す キャンセル:逆位置で出す");
+            if (castCardHeadset) {
+                var cardIsTail = false;
+            } else {
+                var cardIsTail = true;
+            }
+        } else if (action=='cast') {
+            var cardIsTail = "rand";
+        }
+    }
+
+    // カード更新
+    var params = setCardStatus(from, fieldFrom, to, fieldTo, cardNum, castCardId, playerActionSystem, cardIsTail);
+    // カード配置書き込み
+    writeCardStatus(params);
+
+}
+
+// カードを指定して移動
+// 指定カードIDを取得
+function getSelectCardId() {
+    // カード指定
+    var selectCardId = $("#selectCardId").attr("value");
+    if (!selectCardId || selectCardId == undefined) {
+        alert('カードが正しく選択できていません');
+        return false;
+    }
+    return selectCardId;
+}
+
+// カードを1枚指定して引く
+function selectCardDraw() {
+    var selectCardId = getSelectCardId();
+    if (!selectCardId) {
+        return false;
+    }
+    var SelectCardJId = "#"+selectCardId;
+
+    // 指定カードが自分の手札ではないか
+    var isMySecretCards = ".player .Secret .contents>div"+SelectCardJId;
+    if ($(isMySecretCards).size()) {
+        alert('あなたの手札です');
+        return false;
+    }
+
+    var action = 'draw';
+    var from = $("#selectFrom").attr("value");
+    var to = 'plName';
+    var fieldFrom = $("#selectField").attr("value");
+    var fieldTo = 'Secret';
+    var castCardId = selectCardId;
+    updateCardStatus(action, from, fieldFrom, to, fieldTo, 1, castCardId, false);
+    $("#cardDetail").hide();
+}
+
+// カードを1枚指定して出す
+function selectCardCast(field) {
+    var selectCardId = getSelectCardId();
+    if (!selectCardId) {
+        return false;
+    }
+    var SelectCardJId = "#"+selectCardId;
+
+    var action = 'cast';
+    var from = $("#selectFrom").attr("value");
+    var to = $('select#selectMember option:selected').val();
+    var fieldFrom = $("#selectField").attr("value");
+    var fieldTo = field;
+    var castCardId = selectCardId;
+
+    // 移動権限チェック
+    if (fieldFrom=='Secret' && from!=loginName) {
+        alert('移動できません');
+        $("#cardDetail").hide();
+        return false;
+    }
+    if (deckHead && fieldTo=='Field') {
+        var cardIsTail = true;
+    } else {
+        var cardIsTail = false;
+    }
+    updateCardStatus(action, from, fieldFrom, to, fieldTo, 1, castCardId, cardIsTail);
+    $("#cardDetail").hide();
+}
+
+// 指定フィールドのカードを全て山に戻す
+function returnCard(field, fromId) {
+    if (!loginName) {
+        alert('ログインして下さい');
+        return false;
+    }
+
+    // カード全回収
+    if (field=="all") {
+        var FieldDeckFileName = $('#DeckFileName').text();
+        changeDeck(FieldDeckFileName, '全てのカードを山に戻しました。');
+        return false;
+    // 退室者のカードを回収
+    } else if (field=="nomember") {
+        returnNoMemberCard();
+        return false;
+    }
+
+    if (!field || !fromId) {
+        return false;
+    }
+
+    var fieldObj = $(field);
+    if (!fieldObj) {
+        return false;
+    }
+    var fromCardNum = $(fieldObj).children().size();
+    if (!fromCardNum || fromCardNum==0) {
+        alert('カードがありません');
+        return false;
+    }
+    var fieldFrom = $(fieldObj).parent().attr("class");
+
+    fromId = "#"+fromId;
+    var fromName = $(fromId).children().attr("id");
+    if (fromName=='deckCardSet') {
+        var returnCardName = '場札';
+    } else if (fromName==loginName) {
+        var returnCardName = loginName+'の手札';
+    } else {
+        return false;
+    }
+    var fromId = "#"+fieldObj.parent().attr("id");
+
+    var to = "deckSecret";
+    var toName = '山';
+    var toId = "#"+to;
+
+    var confirmMsg = returnCardName+"を"+toName+"へ";
+        confirmMsg += "戻します\n";
+        confirmMsg += "戻すと"+toName+"はシャッフルされます";
+
+    var returnCardConfirm = confirm(confirmMsg+"。\nよろしいですか?");
+    if (!returnCardConfirm) {
+        return false;
+    }
+
+    // カード更新
+    var params = setCardStatus(fromName, fieldFrom, "deckCardSet", "Secret", "", "", "r", "");
+
+    // カード配置書き込み
+    writeCardStatus(params);
+}
+
+// カード更新用データ整形
+function setCardStatus(from, fieldFrom, to, fieldTo, cardNum, castCardId, playerActionSystem, cardIsTail)
+{
+    //データ成形
+    var params =
+        '?n='+convert(loginName)//操作者名
+        +'&f='+convert(from)//カード移動元
+        +'&ff='+fieldFrom//手札か場札か
+        +'&t='+convert(to)//カード移動先
+        +'&ft='+fieldTo//手札か場札か
+        +'&cn='+cardNum;//数
+        if (castCardId) {
+            params +='&id='+castCardId//カードID指定
+        }
+        params +='&a='+playerActionSystem//行動
+        if (to==loginName && fieldTo=='Secret') {
+            params +='&tm='+1//「引く」
+        } else {
+            params +='&tm='+0
+        }
+
+        if (cardIsTail) {
+            params +='&ih='+cardIsTail;//正逆有無
+        }
+
+    return params;
+}
+
+// 書き込み
+function writeCardStatus(params)
+{
+    // 参加確認
+    var joinFlg = false;
+
+    $.ajax({
+        type: "get",
+        url: now_member,
+        ifModified: false,
+//        cache: true,
+        dataType: "text",
+        // 受信完了イベント
+        success: function(data) {
+            var memberList = data.split("\n");
+            $.each(memberList, function(i){
+                var memberData = memberList[i].split("<>");
+                if (obfuscateLog == '1') {
+                    memberData[0] = deObfLog(memberData[0]);
+                }
+                if (memberData[0]==phpHtmlspecialchars(loginName)) {
+                    joinFlg = true;
+                }
+            });
+            if (!joinFlg) {
+                alert('参加者リストにお名前がないので、カードを操作できません。\n長時間発言がないと、参加者リストから削除されます。\nチャットで発言すると、参加者リストに復帰します。');
+            } else {
+                showNowLoading();
+                // 書き込み
+                $.ajax({
+                    type: "GET",
+                    url: cardUpdateScript+params,
+                    cache: false,
+                    dataType: "json",
+                    // 受信完了イベント
+                    success: function(data) {
+                        setCardManageToChat(data);
+                    },
+                    error:function() {
+                        alert('カード操作に失敗しました');
+                    }
+                });
+            }
+        },
+        error:function() {
+            alert('失敗しました');
+            return false;
+        }
+    });
+
+}
+
+// デック変更
+function changeDeck(selectedDeck, writeChatMsg) {
+    if (!selectedDeck) {
+        var selectedDeckType = $('select#deckSelect option:selected').val();
+    } else {
+        var selectedDeckType = selectedDeck;
+    }
+    if (!selectedDeckType || selectedDeckType==undefined || selectedDeckType=='カード変更') {
+        alert('カードを選択してください');
+        return false;
+    }
+    var changeDeckConfirm = confirm("現在配られているカードは全て回収されます。\nよろしいですか?");
+    if (changeDeckConfirm) {
+        // カード読み込み
+        var script = './card_deck_change.php';
+        var url = script
+            +'/?newdeck='+selectedDeckType
+            +'&n='+convert(loginName);
+        $.ajax({
+            type: "get",
+            url: url,
+            cache: false,
+            dataType: "json",
+            success: function(data){
+                if (writeChatMsg) {
+                    data[0]['msg'] = writeChatMsg;
+                }
+                   setCardManageToChat(data);
+                dispCardField(false);
+            },
+            error: function(data){
+                alert('カード変更に失敗しました');
+            }
+        });
+    }
+}
+
+// 退室者のカード回収
+function returnNoMemberCard(g) {
+    var changeDeckConfirm = confirm("退室者のカードを、全て山に戻してシャッフルします。\nよろしいですか?");
+    if (changeDeckConfirm) {
+        // カード読み込み
+        var script = './card_return_nomember.php';
+        var url = script
+            +'/?n='+convert(loginName);
+        $.ajax({
+            type: "get",
+            url: url,
+            cache: false,
+            dataType: "json",
+            success: function(data){
+                if (data) {
+                    setCardManageToChat(data);
+                }
+            },
+            error: function(data){
+                alert('カード回収に失敗しました');
+            }
+        });
+    }
+}
+
+// カード操作をチャットに書き込む
+// 最大2行まで
+function setCardManageToChat(data) {
+    if (!data[0]['msg']) {
+        return false;
+    }
+    var params = setCardManageToChatParam(data[0]);
+    $.ajax({
+        type: "GET",
+        url: cardWritescript+params,
+        cache: false,
+        success: function(dat) {
+            // 受信完了イベント
+            if (data[1]!=undefined) {
+                var params2 = setCardManageToChatParam(data[1]);
+                if (data[1]['secretTo'] && data[1]['secretTo']!=undefined) {
+                    var url = cardWritescript2+params2;
+                } else {
+                    var url = cardWritescript+params2;
+                }
+                $.ajax({
+                    type: "GET",
+                    url: url,
+                    cache: false,
+                    success: function(dat) {
+                    }
+                });
+            } else {
+                window.mainframe.getLog(false);
+            }
+        }
+    });
+}
+// カード操作書き込み用データ成形
+function setCardManageToChatParam(data) {
+    var params =
+        '?n='+convert(loginName)//名前
+       +'&m='+convert(data['msg']); //本文
+    if (data['isSecret']!=undefined) {
+        if (pwd!=undefined) {
+            params += '&w='+convert(loginName)//whisperto
+                   +  '&h='+loginHash;//whisperto_hash
+        }
+        if (data['secretTo']!=undefined) {
+            params += '&w2='+convert(data['secretTo'])//whisperto2
+        }
+    }
+    if (pwd!=undefined) {
+        params += '&p='+convert(pwd);//PWD
+    }
+    params += '&y=card'
+       +'&e='+(new Date()).getTime();//cacheの更新
+    return params;
+}
+
+// タグ名(括りあり)classとID、valueを指定して指定タグ内の最初の要素として追加
+function addTagPrepend(targetId, tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD) {
+    var content = setTag(tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD);
+    $(targetId).prepend(content);
+}
+
+// タグ名(括りあり)classとID、valueを指定して、指定タグ内に表示(置換)
+function replaceTagAppend(targetId, tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD) {
+    var content = setTag(tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD);
+    $(targetId).html(content);
+}
+
+// タグ名(括りあり)classとID、valueを指定して、指定タグ内の最後の要素として追加
+function addTagAppend(targetId, tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD) {
+    var content = setTag(tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD);
+    $(targetId).append(content);
+}
+// タグ名(括りあり)classとID、valueを指定してタグ形成
+function setTag(tag, tagClass, tagId, tagValue, onMouseOver, onMouseOut, click, DD) {
+    if (!tag) {
+        return tagValue;
+    }
+    var tagContent = '<'+tag;
+    if (tagClass) {
+        tagContent += ' class=\"'+tagClass+'\"';
+    }
+    if (tagId) {
+        tagContent += ' id=\"'+tagId+'\"';
+    }
+    if (onMouseOver) {
+        tagContent += ' onMouseover=\"'+onMouseOver+'\"';
+    }
+    if (onMouseOut) {
+        tagContent += ' onMouseout=\"'+onMouseOut+'\"';
+    }
+    if (click) {
+        tagContent += ' onclick=\"'+click+'\"';
+    }
+    tagContent += '>';
+    if (tagValue) {
+        tagContent += tagValue;
+    }
+    tagContent += '</'+tag+'>';
+    return tagContent;
+}
+
+// ランダムでboolean型を返す
+function randomBool() {
+    var rand = Math.floor(Math.random() * 2);
+    return Boolean(rand);
+
+}
+
+// 卓上にアミカケ&操作停止
+// カードデータ読み込み中、アミカケ表示
+function showNowLoading() {
+    var msg = '';
+    if (nowLoadingIcon) {
+        msg += '<img src="'+nowLoadingIcon+'">';
+    }
+    msg += '...Now Loading...';
+
+    var left = ($(window).width() - 200) /2 + 'px';
+    $.blockUI({
+        message: msg,
+        css: { 
+            border: 'none',
+            padding: '0',
+            left: left,
+            width: '200px',
+            '-webkit-border-radius': '5px',
+            '-moz-border-radius': '5px',
+            opacity: '1'
+        }
+    });
+}
+// アミカケ解除
+function hideOverLay() {
+    $.unblockUI();
+}
+
index c4827b4..bb62635 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
  
 /*****************
index 759d8a7..cc76f06 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 /*****************
  *  JaveScriptライブラリ:index.php用
@@ -43,31 +43,6 @@ $(function(){
         if (!doLogin(name, pwd)) {
             return false;
         }
-
-        //フォームチェンジ
-        $("#online1").show();
-        $("#online2").show();
-        $("#offline").hide();
-        $("#pc_0").show();
-        $("#name_on").val(name);
-        if (!$("#pc_name_0").val()) {
-            $("#pc_name_0").val(name);
-        }
-        $("#pwd_on").val(pwd);
-        $("#my_hash").val("<?php echo create_hash($data['n'],$data['p']); ?>");
-        $("#pc_input_0").focus();
-        if (userWhisper) {
-            $(".whisper_to").each(function(idx, Obj){
-                Obj.disabled = true;
-                Obj.value ="全員";
-            });
-            $(".whisper_to_hash").each(function(idx, Obj){
-                Obj.value ="";
-            });
-        }
-
-        // 更新
-        window.mainframe.login();
     });
 
 
@@ -91,7 +66,6 @@ $(function(){
         $(".show_status").each(function(){
             this.checked = false;
         });
-//        $("#whisper").click();
         $("#name_on").val("");
         $("#pwd_on").val("");
         $("#my_hash").val("");
@@ -136,6 +110,19 @@ function get_cookie_content() {
     COOKIE += "&linespace="+window.mainframe.document.getElementById("linespace").value;
     COOKIE += "&hr="+window.mainframe.document.getElementById("hr").value;
 
+<?php if (USE_SE): ?>
+    // 効果音設定
+    if (window.mainframe.document.getElementById("seSetting").checked) {
+        COOKIE += "&se=1";
+    }
+    if (window.mainframe.document.getElementById("systemSeSetting").checked) {
+        COOKIE += "&sse=1";
+    }
+    if (window.mainframe.document.getElementById("userSetting").checked) {
+        COOKIE += "&use=1";
+    }
+<?php endif; ?>
+
     return COOKIE;
 }
 
index 2a07df9..3aae300 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 /*****************
  *  JaveScriptライブラリ:index.php用
@@ -10,7 +10,6 @@
 // 変数
 columnId = 'pc_input_0';
 formObjId = '0';
-var writescript = './write.php';
 var cookieSaveScript = './cookie_save.php';
 var cookieLoadScript = './cookie_load.php';
 
@@ -62,7 +61,7 @@ function comment(Obj) {
         if ($("#pwd_on").attr("value")) {
             var pwd = convert($("#pwd_on").attr("value"));
         }
-        if(pwd) {
+        if (pwd) {
             var params =
             params+'&p='+pwd;//PWD
         }
@@ -86,23 +85,92 @@ function writeComment(params)
     $.ajax({
         type: "GET",
         url: writescript+params,
-        success: function() {
-    // 受信完了イベント
-            window.mainframe.getLog();
+        success: function(data) {
+            // 受信完了イベント
+            window.mainframe.getLog(true);
         }
     });
 }
 
-// 在室確認
-function isMember(name){
-    var member = $(window.mainframe.document.getElementById("indi")).text();
-
-    var name_array = member.split('<>');
-    for (i=0;i<name_array.length;i++) {
-        if (name_array[i] == name) {
-            return true;
+// 在室を確認して指定の処理を実行
+function isMember(name, action, params, pwd) {
+    var flg = false;
+    $.ajax({
+        type: "get",
+        url: now_member,
+        ifModified: false,
+        cache: false,
+        dataType: "text",
+        success: function(data) {
+            var name_array = new Array();
+            var memberData = data.split("\n");
+            $.each(memberData, function(i){
+                var memberDataDetail = memberData[i].split("<>");
+                if (obfuscateLog == '1') {
+                    var plName = deObfLog(memberDataDetail[0]);
+                } else {
+                    var plName = memberDataDetail[0];
+                }
+
+                if (name==plName) {
+                    flg = true;
+                }
+            });
+
+            if (flg) {
+                if (action=="logout") {
+                $("#logout").click();
+                return true;
+                }
+                if (action=="login") {
+                    alert('そのお名前でログインはできません。');
+                    return false;
+                }
+            }
+
+            if (action=="login") {
+                writeComment(params);
+                //フォームチェンジ
+                $("#online1").show();
+                $("#online2").show();
+                $("#offline").hide();
+                $("#pc_0").show();
+                $("#name_on").val(name);
+                if (!$("#pc_name_0").val()) {
+                    $("#pc_name_0").val(name);
+                }
+                $("#pwd_on").val(pwd);
+                $("#pc_input_0").focus();
+                if (userWhisper) {
+                    $(".whisper_to").each(function(idx, Obj){
+                        Obj.disabled = true;
+                        Obj.value ="全員";
+                    });
+                    $(".whisper_to_hash").each(function(idx, Obj){
+                        Obj.value ="";
+                    });
+                }
+
+                // 更新
+                window.mainframe.login();
+
+            }
+        },
+        error: function(data) {
+            alert('参加者情報取得に失敗しました');
+            return false;
         }
-    }
+    });
+}
+
+// ウインドウサイズ変更でフォームサイズ変更
+function changeSize() {
+    var winWidth = getWinWidth();
+    var winHeight = getWinHeight() - 80;
+    $(".input_comment").css({width: winWidth-275});
+    $(".status").css({width: winWidth-313});
+    $("#mainframe").css({height: winHeight-40});
+    $("#offline_win").css({left: winWidth-280});
 }
 
 
@@ -173,8 +241,8 @@ function insertFontTag(columnId) {
 // 入室中にリロード・ページ遷移で自動退室
 function UnLoad() {
     var name = $("#name_on").attr("value");
-    if (name && isMember(name)==true) {
-        $("#logout").click();
+    if (name) {
+        isMember(name, 'logout', '', '');
     }
 }
 
@@ -230,12 +298,28 @@ function doLogin(name, pwd) {
         alert("お名前を入力してください。");
         return false;
     }
-    //現在の入室者と同じ名前ではログインできない
-    if (isMember(name)==true) {
-        alert("現在の参加者と同じ名前ではログインできません。");
+
+    // 一部記号はNG
+    if (name.search(/[\'\"#\$\%&<>\/\\\`\=]/i) != -1) {
+        alert("一部の半角記号をお名前に使う事はできません。削除するか全角にしてみてください。");
+        return false;
+    }
+
+    //特定の名前ではログインできない
+    var ngNames = new Array(noname, systemName, '現在のカード', 'deckCardSet', 'deck', 'my', 'plName');
+    var ngName = false;
+    for(i=0; i<ngNames.length; i++){
+        if (name==ngNames[i]){
+            var ngName = true;
+            break;
+        }
+    }
+    if (ngName) {
+        alert("そのお名前ではログインできません");
         return false;
     }
 
+    // パラメータセット
     //データ成形
     var params =
         '?n='+convert(name)//名前
@@ -246,9 +330,9 @@ function doLogin(name, pwd) {
     var params =
         params+'&y=in'
         +'&e='+(new Date()).getTime();//cacheの更新
-     writeComment(params);
 
-    return true;
+    // 現在の入室者と同じ名前かどうかチェックしてログイン
+    isMember(name, 'login', params, pwd);
 }
 
 // ログアウト
@@ -445,3 +529,35 @@ function openUrl(url, target) {
     }
     window.open(url, target);
 }
+
+// 別窓で開く
+function openNewWindow(location, target, noBar, width, height, scroll) {
+    if (!location) {
+        return false; 
+    }
+    if (!target) {
+        target = _blank;
+    }
+    if (!width || width <= 0) {
+        width = 600;
+    }
+    if (!height || height <= 0) {
+        height = document.body.clientHeight - 80;
+    }
+    if (noBar) {
+        showBar = 'toolbar=no,location=no,directorybottuns=no,menubar=no';
+    } else {
+        showBar = 'toolbar=yes,location=yes,directorybottuns=yes,menubar=yes';
+    }
+    if (scroll) {
+        setScroll = 'scrollbars=yes';
+    } else {
+        setScroll = 'scrollbars=no';
+    }
+    var options = 'width='+width
+                 +',height='+height
+                 +','+showBar
+                 +','+setScroll
+                 +',status=yes,resizable=yes';
+    return window.open(location, target, options);
+}
diff --git a/lib/js/jquery.blockUI.js b/lib/js/jquery.blockUI.js
new file mode 100644 (file)
index 0000000..a015a55
--- /dev/null
@@ -0,0 +1,418 @@
+/*\r
+ * jQuery blockUI plugin\r
+ * Version 2.23 (21-JUN-2009)\r
+ * @requires jQuery v1.2.3 or later\r
+ *\r
+ * Examples at: http://malsup.com/jquery/block/\r
+ * Copyright (c) 2007-2008 M. Alsup\r
+ * Dual licensed under the MIT and GPL licenses:\r
+ * http://www.opensource.org/licenses/mit-license.php\r
+ * http://www.gnu.org/licenses/gpl.html\r
+ *\r
+ * Thanks to Amir-Hossein Sobhi for some excellent contributions!\r
+ */\r
+\r
+;(function($) {\r
+\r
+if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {\r
+    alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery);\r
+    return;\r
+}\r
+\r
+$.fn._fadeIn = $.fn.fadeIn;\r
+\r
+// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle\r
+// retarded userAgent strings on Vista)\r
+var mode = document.documentMode || 0;\r
+var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8);\r
+var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode;\r
+\r
+// global $ methods for blocking/unblocking the entire page\r
+$.blockUI   = function(opts) { install(window, opts); };\r
+$.unblockUI = function(opts) { remove(window, opts); };\r
+\r
+// convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)\r
+$.growlUI = function(title, message, timeout, onClose) {\r
+       var $m = $('<div class="growlUI"></div>');\r
+       if (title) $m.append('<h1>'+title+'</h1>');\r
+       if (message) $m.append('<h2>'+message+'</h2>');\r
+       if (timeout == undefined) timeout = 3000;\r
+    $.blockUI({\r
+               message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,\r
+               timeout: timeout, showOverlay: false,\r
+               onUnblock: onClose, \r
+               css: $.blockUI.defaults.growlCSS\r
+    });\r
+};\r
+\r
+// plugin method for blocking element content\r
+$.fn.block = function(opts) {\r
+    return this.unblock({ fadeOut: 0 }).each(function() {\r
+        if ($.css(this,'position') == 'static')\r
+            this.style.position = 'relative';\r
+        if ($.browser.msie)\r
+            this.style.zoom = 1; // force 'hasLayout'\r
+        install(this, opts);\r
+    });\r
+};\r
+\r
+// plugin method for unblocking element content\r
+$.fn.unblock = function(opts) {\r
+    return this.each(function() {\r
+        remove(this, opts);\r
+    });\r
+};\r
+\r
+$.blockUI.version = 2.23; // 2nd generation blocking at no extra cost!\r
+\r
+// override these in your code to change the default behavior and style\r
+$.blockUI.defaults = {\r
+    // message displayed when blocking (use null for no message)\r
+    message:  '<h1>Please wait...</h1>',\r
+\r
+    // styles for the message when blocking; if you wish to disable\r
+    // these and use an external stylesheet then do this in your code:\r
+    // $.blockUI.defaults.css = {};\r
+    css: {\r
+        padding:        0,\r
+        margin:         0,\r
+        width:          '30%',\r
+        top:            '40%',\r
+        left:           '35%',\r
+        textAlign:      'center',\r
+        color:          '#000',\r
+        border:         '3px solid #aaa',\r
+        backgroundColor:'#fff',\r
+        cursor:         'wait'\r
+    },\r
+\r
+    // styles for the overlay\r
+    overlayCSS:  {\r
+        backgroundColor: '#000',\r
+        opacity:          0.6,\r
+        cursor:          'wait'\r
+    },\r
+\r
+       // styles applied when using $.growlUI\r
+       growlCSS: {\r
+               width:    '350px',\r
+               top:      '10px',\r
+               left:     '',\r
+               right:    '10px',\r
+           border:   'none',\r
+           padding:  '5px',\r
+           opacity:   0.6,\r
+               cursor:    null,\r
+           color:    '#fff',\r
+           backgroundColor: '#000',\r
+           '-webkit-border-radius': '10px',\r
+           '-moz-border-radius':    '10px'\r
+       },\r
+       \r
+       // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w\r
+       // (hat tip to Jorge H. N. de Vasconcelos)\r
+       iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',\r
+\r
+       // force usage of iframe in non-IE browsers (handy for blocking applets)\r
+       forceIframe: false,\r
+\r
+    // z-index for the blocking overlay\r
+    baseZ: 1000,\r
+\r
+    // set these to true to have the message automatically centered\r
+    centerX: true, // <-- only effects element blocking (page block controlled via css above)\r
+    centerY: true,\r
+\r
+    // allow body element to be stetched in ie6; this makes blocking look better\r
+    // on "short" pages.  disable if you wish to prevent changes to the body height\r
+    allowBodyStretch: true,\r
+\r
+       // enable if you want key and mouse events to be disabled for content that is blocked\r
+       bindEvents: true,\r
+\r
+    // be default blockUI will supress tab navigation from leaving blocking content\r
+    // (if bindEvents is true)\r
+    constrainTabKey: true,\r
+\r
+    // fadeIn time in millis; set to 0 to disable fadeIn on block\r
+    fadeIn:  200,\r
+\r
+    // fadeOut time in millis; set to 0 to disable fadeOut on unblock\r
+    fadeOut:  400,\r
+\r
+       // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock\r
+       timeout: 0,\r
+\r
+       // disable if you don't want to show the overlay\r
+       showOverlay: true,\r
+\r
+    // if true, focus will be placed in the first available input field when\r
+    // page blocking\r
+    focusInput: true,\r
+\r
+    // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)\r
+    applyPlatformOpacityRules: true,\r
+\r
+    // callback method invoked when unblocking has completed; the callback is\r
+    // passed the element that has been unblocked (which is the window object for page\r
+    // blocks) and the options that were passed to the unblock call:\r
+    //     onUnblock(element, options)\r
+    onUnblock: null,\r
+\r
+    // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493\r
+    quirksmodeOffsetHack: 4\r
+};\r
+\r
+// private data and functions follow...\r
+\r
+var pageBlock = null;\r
+var pageBlockEls = [];\r
+\r
+function install(el, opts) {\r
+    var full = (el == window);\r
+    var msg = opts && opts.message !== undefined ? opts.message : undefined;\r
+    opts = $.extend({}, $.blockUI.defaults, opts || {});\r
+    opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});\r
+    var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});\r
+    msg = msg === undefined ? opts.message : msg;\r
+\r
+    // remove the current block (if there is one)\r
+    if (full && pageBlock)\r
+        remove(window, {fadeOut:0});\r
+\r
+    // if an existing element is being used as the blocking content then we capture\r
+    // its current place in the DOM (and current display style) so we can restore\r
+    // it when we unblock\r
+    if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {\r
+        var node = msg.jquery ? msg[0] : msg;\r
+        var data = {};\r
+        $(el).data('blockUI.history', data);\r
+        data.el = node;\r
+        data.parent = node.parentNode;\r
+        data.display = node.style.display;\r
+        data.position = node.style.position;\r
+               if (data.parent)\r
+                       data.parent.removeChild(node);\r
+    }\r
+\r
+    var z = opts.baseZ;\r
+\r
+    // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;\r
+    // layer1 is the iframe layer which is used to supress bleed through of underlying content\r
+    // layer2 is the overlay layer which has opacity and a wait cursor (by default)\r
+    // layer3 is the message content that is displayed while blocking\r
+\r
+    var lyr1 = ($.browser.msie || opts.forceIframe) \r
+       ? $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>')\r
+        : $('<div class="blockUI" style="display:none"></div>');\r
+    var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');\r
+    var lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';display:none;position:fixed"></div>')\r
+                    : $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>');\r
+\r
+    // if we have a message, style it\r
+    if (msg)\r
+        lyr3.css(css);\r
+\r
+    // style the overlay\r
+    if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))\r
+        lyr2.css(opts.overlayCSS);\r
+    lyr2.css('position', full ? 'fixed' : 'absolute');\r
+\r
+    // make iframe layer transparent in IE\r
+    if ($.browser.msie || opts.forceIframe)\r
+        lyr1.css('opacity',0.0);\r
+\r
+    $([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);\r
+\r
+    // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)\r
+    var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0);\r
+    if (ie6 || expr) {\r
+        // give body 100% height\r
+        if (full && opts.allowBodyStretch && $.boxModel)\r
+            $('html,body').css('height','100%');\r
+\r
+        // fix ie6 issue when blocked element has a border width\r
+        if ((ie6 || !$.boxModel) && !full) {\r
+            var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');\r
+            var fixT = t ? '(0 - '+t+')' : 0;\r
+            var fixL = l ? '(0 - '+l+')' : 0;\r
+        }\r
+\r
+        // simulate fixed position\r
+        $.each([lyr1,lyr2,lyr3], function(i,o) {\r
+            var s = o[0].style;\r
+            s.position = 'absolute';\r
+            if (i < 2) {\r
+                full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')\r
+                     : s.setExpression('height','this.parentNode.offsetHeight + "px"');\r
+                full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')\r
+                     : s.setExpression('width','this.parentNode.offsetWidth + "px"');\r
+                if (fixL) s.setExpression('left', fixL);\r
+                if (fixT) s.setExpression('top', fixT);\r
+            }\r
+            else if (opts.centerY) {\r
+                if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');\r
+                s.marginTop = 0;\r
+            }\r
+                       else if (!opts.centerY && full) {\r
+                               var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;\r
+                               var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';\r
+                s.setExpression('top',expression);\r
+                       }\r
+        });\r
+    }\r
+\r
+    // show the message\r
+       if (msg) {\r
+               lyr3.append(msg);\r
+               if (msg.jquery || msg.nodeType)\r
+                       $(msg).show();\r
+       }\r
+\r
+       if (($.browser.msie || opts.forceIframe) && opts.showOverlay)\r
+               lyr1.show(); // opacity is zero\r
+       if (opts.fadeIn) {\r
+               if (opts.showOverlay)\r
+                       lyr2._fadeIn(opts.fadeIn);\r
+               if (msg)\r
+                       lyr3.fadeIn(opts.fadeIn);\r
+       }\r
+       else {\r
+               if (opts.showOverlay)\r
+                       lyr2.show();\r
+               if (msg)\r
+                       lyr3.show();\r
+       }\r
+\r
+    // bind key and mouse events\r
+    bind(1, el, opts);\r
+\r
+    if (full) {\r
+        pageBlock = lyr3[0];\r
+        pageBlockEls = $(':input:enabled:visible',pageBlock);\r
+        if (opts.focusInput)\r
+            setTimeout(focus, 20);\r
+    }\r
+    else\r
+        center(lyr3[0], opts.centerX, opts.centerY);\r
+\r
+       if (opts.timeout) {\r
+               // auto-unblock\r
+               var to = setTimeout(function() {\r
+                       full ? $.unblockUI(opts) : $(el).unblock(opts);\r
+               }, opts.timeout);\r
+               $(el).data('blockUI.timeout', to);\r
+       }\r
+};\r
+\r
+// remove the block\r
+function remove(el, opts) {\r
+    var full = el == window;\r
+       var $el = $(el);\r
+    var data = $el.data('blockUI.history');\r
+       var to = $el.data('blockUI.timeout');\r
+       if (to) {\r
+               clearTimeout(to);\r
+               $el.removeData('blockUI.timeout');\r
+       }\r
+    opts = $.extend({}, $.blockUI.defaults, opts || {});\r
+    bind(0, el, opts); // unbind events\r
+    var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el);\r
+\r
+    if (full)\r
+        pageBlock = pageBlockEls = null;\r
+\r
+    if (opts.fadeOut) {\r
+        els.fadeOut(opts.fadeOut);\r
+        setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);\r
+    }\r
+    else\r
+        reset(els, data, opts, el);\r
+};\r
+\r
+// move blocking element back into the DOM where it started\r
+function reset(els,data,opts,el) {\r
+    els.each(function(i,o) {\r
+        // remove via DOM calls so we don't lose event handlers\r
+        if (this.parentNode)\r
+            this.parentNode.removeChild(this);\r
+    });\r
+\r
+    if (data && data.el) {\r
+        data.el.style.display = data.display;\r
+        data.el.style.position = data.position;\r
+               if (data.parent)\r
+                       data.parent.appendChild(data.el);\r
+        $(data.el).removeData('blockUI.history');\r
+    }\r
+\r
+    if (typeof opts.onUnblock == 'function')\r
+        opts.onUnblock(el,opts);\r
+};\r
+\r
+// bind/unbind the handler\r
+function bind(b, el, opts) {\r
+    var full = el == window, $el = $(el);\r
+\r
+    // don't bother unbinding if there is nothing to unbind\r
+    if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))\r
+        return;\r
+    if (!full)\r
+        $el.data('blockUI.isBlocked', b);\r
+\r
+       // don't bind events when overlay is not in use or if bindEvents is false\r
+    if (!opts.bindEvents || (b && !opts.showOverlay)) \r
+               return;\r
+\r
+    // bind anchors and inputs for mouse and key events\r
+    var events = 'mousedown mouseup keydown keypress';\r
+    b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);\r
+\r
+// former impl...\r
+//    var $e = $('a,:input');\r
+//    b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);\r
+};\r
+\r
+// event handler to suppress keyboard/mouse events when blocking\r
+function handler(e) {\r
+    // allow tab navigation (conditionally)\r
+    if (e.keyCode && e.keyCode == 9) {\r
+        if (pageBlock && e.data.constrainTabKey) {\r
+            var els = pageBlockEls;\r
+            var fwd = !e.shiftKey && e.target == els[els.length-1];\r
+            var back = e.shiftKey && e.target == els[0];\r
+            if (fwd || back) {\r
+                setTimeout(function(){focus(back)},10);\r
+                return false;\r
+            }\r
+        }\r
+    }\r
+    // allow events within the message content\r
+    if ($(e.target).parents('div.blockMsg').length > 0)\r
+        return true;\r
+\r
+    // allow events for content that is not being blocked\r
+    return $(e.target).parents().children().filter('div.blockUI').length == 0;\r
+};\r
+\r
+function focus(back) {\r
+    if (!pageBlockEls)\r
+        return;\r
+    var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];\r
+    if (e)\r
+        e.focus();\r
+};\r
+\r
+function center(el, x, y) {\r
+    var p = el.parentNode, s = el.style;\r
+    var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');\r
+    var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');\r
+    if (x) s.left = l > 0 ? (l+'px') : '0';\r
+    if (y) s.top  = t > 0 ? (t+'px') : '0';\r
+};\r
+\r
+function sz(el, p) {\r
+    return parseInt($.css(el,p))||0;\r
+};\r
+\r
+})(jQuery);\r
index b734104..e463a96 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 /*****************
  *  JaveScriptライブラリ:チャット画面
@@ -24,24 +24,38 @@ var showDatetimeYear = '<?php print SHOW_DATETIME_YEAR; ?>';
 var showDatetimeSecond = '<?php print SHOW_DATETIME_SECOND; ?>';
 var showMobileIcon = '<?php print SHOW_MOBILE_COM;?>';
 var statusColor = '<?php print STATUS_COLOR; ?>';
-var systemColor = '<?php print COLOR_SYSTEM; ?>';
 var logfile = '<?php print RECENT_LOG;?>';
 var mobileMark = '<?php show_mobile_icon(MOBILE_ICON, '', '', '', 'M', '', ''); ?>';
+<?php if (USE_SE): ?>
+var userSeSrc = '<?php print SE_USER; ?>';
+var systemSeSrc = '<?php print SE_SYSTEM; ?>';
+var userSeObj = new Image();
+var systemSeObj = new Image();
+userSeObj.src = userSeSrc;
+systemSeObj.src = systemSeSrc;
+<?php else: ?>
+var useSe = false;
+<?php endif; ?>
 
 // ログイン・ログオフ
 function login() {
-    Timer = setInterval('getLog()', getdata_on);
+<?php if (UNPUBLIC_LAST_PASTLOG): ?>
+    getLog(false);
+<?php endif; ?>
 <?php 
 if (OFFWINDOW_MSG || (UNPUBLIC_LAST_PASTLOG && NO_LAST_PASTLOG_MSG)) {
-    print '    window.parent.document.getElementById("offline_win").style.display = "none";'."\n";
+    print '    window.parent.document.getElementById("offline_win").style.display = "none";';
 }
 ?>
+
     fontSizeChange("0");
     lineSpaceChange("0");
+
+    Timer = setInterval('getLog(true)', getdata_on);
 }
 function logout() {
     clearInterval(Timer);
-    Timer = setInterval('getLog()', getdata_off);
+    Timer = setInterval('getLog(true)', getdata_off);
 <?php 
 if (OFFWINDOW_MSG || (UNPUBLIC_LAST_PASTLOG && NO_LAST_PASTLOG_MSG)) {
     print '    window.parent.document.getElementById("offline_win").style.display = "";';
@@ -52,19 +66,19 @@ if (OFFWINDOW_MSG || (UNPUBLIC_LAST_PASTLOG && NO_LAST_PASTLOG_MSG)) {
 // 起動時の処理
 $(function()
 {
+<?php if (!UNPUBLIC_LAST_PASTLOG): ?>
+    //現在ログの取得
+    getLog(true);
+    Timer = setInterval('getLog(true)', getdata_off);
+    showMember(true);
+<?php else: ?>
+    $("#main_console").after('<?php print NO_LAST_PASTLOG_MSG; ?>');
+    showMember(false);
+<?php endif; ?>
+
     // ウィンドウサイズに合わせる
     changeSize();
 
-    //現在ログの取得
-    Timer = setInterval('getLog()', getdata_off);
-    if (!publicLastPastlog) {
-        clearLog();
-    } else {
-        clearInterval(Timer);
-        $("#main_console").after('<?php print NO_LAST_PASTLOG_MSG; ?>');
-    }
-    showMember();
-
     // 行間ライン変更
     $('#line_hr').click(function(ev) {
         var select = $('select#hr option:selected').next().val();
@@ -78,6 +92,18 @@ $(function()
         lineSpaceHrChange($(':selected').val());
     });
 
+    // 発言音表示
+    if (useSe) {
+        $("#seConfig").hide();
+        $("#seSelect").hide();
+        if ($("#seSetting").attr("checked")) {
+            $("#seOn").show();
+            $("#seOff").hide();
+        } else {
+            $("#seOn").hide();
+            $("#seOff").show();
+        }
+    }
 });
 
 //-->
index 4948f98..64385ef 100644 (file)
@@ -1,14 +1,15 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
 */
 /*****************
  *  JaveScriptライブラリ:ログ表示
  *****************/
+
 // ログ取得
-function getLog(){
+function getLog(isUpdate){
     var log = logfile+'?e='+dateD;
     $.ajax({
         type: "get",
@@ -40,22 +41,38 @@ function getLog(){
         }
         var text_rev = text.reverse();
 
+        var seFlg = false;
+            // 発言音
+            if (useSe && isUpdate && !seFlg) {
+                var seSetting = $("#seSetting").attr("checked");
+                if (seSetting) {
+                    var systemSeSetting = $("#systemSeSetting").attr("checked");
+                    var userSetting = $("#userSetting").attr("checked");
+                                               if (systemSeSrc && systemSeSetting && unit[2] == systemName) {
+                        document.getElementById('se').src = systemSeObj.src;
+                        seFlg = true;
+                    } else if (userSeSrc && userSetting && unit[2] != systemName && unit[1] != window.parent.document.getElementById("name_on").value) {
+                        document.getElementById('se').src = userSeObj.src;
+                        seFlg = true;
+                    }
+                }
+            }
         for(var i=0;i<text_rev.length; i++){
         //出力
             $("#main_console").after(text_rev[i]);
             // ログを「流す」
-            if (deleteLastPastLog != '0' && document.getElementById("chatwindow").childNodes.length > maxNum) {
+            if (deleteLastPastLog && document.getElementById("chatwindow").childNodes.length > maxNum) {
                 document.getElementById("chatwindow").removeChild(document.getElementById("chatwindow").lastChild);
             }
         }
     }
     });
     // 在室表示
-    showMember();
+    showMember(true);
 }
 
 // 在室表示
-function showMember() {
+function showMember(isLogin) {
     $.ajax({
         type: "get",
         ifModified: true,
@@ -79,13 +96,17 @@ function showMember() {
                     mpwd = deObfLog(mpwd);
                 }
 
-                var text2 = text2+'<span id="'+mname+'" class="member" onclick="inputWhisper(\''+mname+'\',\''+mpwd+'\');">'+mname+'</span>'+'<>';
+                if (isLogin || !unpublicLoginMember) {
+                    var text2 = text2+'<span id="'+mname+'" class="member" onclick="inputWhisper(\''+mname+'\',\''+mpwd+'\');">'+mname+'</span>'+'<>';
+                } else {
+                    var text2 = text2+'<span class="member">****</span>'+'<>';
+                }
                 // my_hashに自分のハッシュ登録
-                if (!$(window.parent.document.getElementById("my_hash")).attr("value") && $(window.parent.document.getElementById("pwd_on")).attr("value") && $(window.parent.document.getElementById("name_on")).attr("value")==mname) {
+                if (window.parent.document.getElementById("name_on").value && window.parent.document.getElementById("pwd_on").value && phpHtmlspecialchars(window.parent.document.getElementById("name_on").value, '')==mname) {
                     window.parent.document.getElementById("my_hash").value = mpwd;
                 }
             }
-    // 出力
+            // 出力
             if (text2) {
                 $("#indi").html(text2);
             }
@@ -138,6 +159,7 @@ function setLogData(unit) {
     //データの成形
     var name = unit[1];
     var pc = unit[2];
+    pcType = pc;
     var color = unit[3];
     var com = unit[4];
     var d = new Date();
@@ -190,7 +212,7 @@ function setLogData(unit) {
         }
         row += last_id_tag+'<span style="font-weight:bold; color:'+color+';" id="'+deObfLog(unit[0])+'" title="'+name+'">'+pcname+'</span>:';
         if (whisper=='to' || whisper=='from') {
-            row += '<span style="color:'+color_system+';">(';
+            row += '<span style="color:'+systemColor+';">(';
             if (whisper=='to') row += whisperFrom+'さんへ';
             if (whisper=='from') row += pc+'さんから';
             row += 'のささやき) </span>';
@@ -226,9 +248,9 @@ function setLogData(unit) {
 // チャット画面文字サイズ変更
 function fontSizeChange(size) {
     // 現在の文字サイズ
-    var nowFontSize = parseInt(document.getElementById("fontsize").value);
+    var nowFontSize = parseInt(document.getElementById("fontsize").value, 10);
     // 変更後の文字サイズ
-    var changedFontSize = nowFontSize + parseInt(size);
+    var changedFontSize = nowFontSize + parseInt(size, 10);
     if (changedFontSize < 8 || changedFontSize > 24) {
         alert("これ以上変更できません");
         return false;
@@ -241,7 +263,7 @@ function fontSizeChange(size) {
 // チャット画面行間隔変更
 function lineSpaceChange(size) {
     // 現在の行間隔
-    var nowSpace = parseInt(document.getElementById("linespace").value);
+    var nowSpace = parseInt(document.getElementById("linespace").value, 10);
     // 変更後の行間隔
     var changedSpace = nowSpace+size/2;
     if (changedSpace < 0 || changedSpace > 48) {
@@ -260,7 +282,7 @@ function inputWhisper(name, whisperTo) {
     if (!userWhisper) {
         return false;
     }
-       var flag = whisperTo ? true : false;
+    var flag = whisperTo ? true : false;
     if (flag==false){
         alert(name+"さんは入室パスワード未入力のため、「ささやき」はできません。");
     } else if (!window.parent.document.getElementById("pwd_on").value){
@@ -280,3 +302,46 @@ function lineSpaceHrChange(SelectObj) {
 function lineSpaneHrSelectChange(val) {
     $("select#hr").val(val);
 }
+
+// 発言音設定
+function seOn() {
+    $("#seSetting").attr("checked", true);
+    $("#seOn").hide();
+    $("#seOff").hide();
+    seConfigShow();
+}
+function seOff() {
+    $("#seSetting").attr("checked", false);
+    $("#seOn").hide();
+    $("#seOff").show();
+    $("#seConfig").hide();
+}
+function seConfigShow() {
+    $("#seConfig").show();
+    $("#seSelect").show();
+}
+function seConfigHide() {
+    if (!$("#systemSeSetting").attr("checked") && !$("#userSetting").attr("checked")) {
+        $("#seSetting").attr("checked", false);
+    }
+
+    $("#seConfig").hide();
+    $("#seSelect").hide();
+
+    if ($("#seSetting").attr("checked")) {
+        $("#seOn").show();
+        $("#seOff").hide();
+    } else {
+        $("#seOn").hide();
+        $("#seOff").show();
+    }
+}
+
+// ウインドウサイズ変更でフォームサイズ変更
+function changeSize() {
+    var winWidth = getWinWidth();
+    var winHeight = getWinHeight() - 80;
+    if (useSe) {
+        $("#seSelect").css({left: winWidth-250});
+    }
+}
index 5e6e1bc..06b9e6a 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
 */
 // 設定
 ke = '0x54';
index 7e106ba..5468bb6 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
 */
 /*****************
  *  JaveScriptライブラリ:過去ログ
index 3e0cac6..6e45949 100644 (file)
@@ -1,8 +1,8 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 /*****************
  *  JaveScriptライブラリ:TRPG用
@@ -61,3 +61,19 @@ function setNull(str) {
     return str;
 }
 
+/* 指定ファイルを先読み */
+function preReadFile(filePlace, filename) {
+    $.ajax({
+        type: "get",
+        ifModified: true,
+        url: filePlace,
+        cache: false,
+        success: function(data){
+            return data;
+        },
+        error: function(data){
+            alert(filename+'取得に失敗しました');
+            return false;
+        }
+    });
+}
index 81adcbc..a30733c 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
 var getdata_on = <?php print GETDATA_ON;?>*1000;
 var getdata_off = <?php print GETDATA_OFF;?>*1000;
 var now_member = '<?php print NOW_MEMBER;?>';
-var color_system = '#<?php print COLOR_SYSTEM;?>';
-var publicLastPastlog = '<?php if (UNPUBLIC_LAST_PASTLOG) { print "1"; } else { print ""; } ?>';
+var systemName = '<?php print SYSTEM; ?>';
+var systemColor = '#<?php print COLOR_SYSTEM;?>';
+var unpublicLoginMember = '<?php print UNPUBLIC_LOGIN_MEMBER; ?>';
 var userWhisper = '<?php print USER_WHISPER; ?>';
 var obfuscateLog = '<?php print OBFUSCATION; ?>';
+var nowLoadingIcon = '<?php print NOW_LOADING_ICON; ?>';
+<?php if (USE_SE): ?>
+var useSe = '<?php print USE_SE; ?>';
+<?php endif; ?>
 
 // ホーム
 function returnHome() {
index 27768d7..62cbed5 100644 (file)
@@ -1,13 +1,25 @@
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
  *  JaveScriptライブラリ:共通
  *****************/
+// 変数
+var writescript = './write.php';
+
+// IE判断
+function isIE() {
+    var userAgent = navigator.userAgent;
+    if (userAgent.search('MSIE')!='-1') {
+        isIE = true;
+    } else {
+        isIE = false;
+    }
+}
 
 // エンコード
 function convert(C) {
@@ -15,6 +27,31 @@ function convert(C) {
     return C;
 }
 
+// PHPのhtmlspecialchars
+function phpHtmlspecialchars(str) {
+    if (!str) {
+        return str;
+    }
+    str = str.replace(/&/g,"&amp;");
+    str = str.replace(/</g,"&lt;");
+    str = str.replace(/>/g,"&gt;");
+    str = str.replace(/"/g,"\"");
+    str = str.replace(/'/g,"\'");
+    return str;
+}
+
+// PHPのaddslashes
+function phpAddslashes(str) {
+    if (!str) {
+        return str;
+    }
+    str = str.replace(/"/g,'\\"');
+    str = str.replace(/'/g,"\\'");
+//    str = str.replace(/\/g,"\\");
+    return str;
+
+}
+
 // 表示ON/OFF
 function showTarget(target) {
     var id = '#'+target;
@@ -47,12 +84,33 @@ function toggleColumn(target) {
 }
 
 // ウインドウサイズ変更でフォームサイズ変更
-function changeSize() {
-    var winWidth = document.body.clientWidth;
-    var winHeight = document.body.clientHeight - 80;
-    $(".input_comment").css({width: winWidth-275});
-    $(".status").css({width: winWidth-313});
-    $("#mainframe").css({height: winHeight-40});
-    $("#offline_win").css({left: winWidth-280});
+// ウィンドウサイズ取得のブラウザ補正
+function getWinWidth() {
+    if (window.innerWidth) {
+        return window.innerWidth;
+    } else if (document.documentElement && document.documentElement.clientWidth) {
+        return document.documentElement.clientWidth;
+    } else if ( document.body && document.body.clientWidth) {
+        return document.body.clientWidth;
+    }
+}
+function getWinHeight() {
+    if (window.innerHeight) {
+        return window.innerHeight;
+    } else if (document.documentElement && document.documentElement.clientHeight) {
+        return document.documentElement.clientHeight;
+    } else if ( document.body && document.body.clientHeight) {
+        return document.body.clientHeight;
+    }
 }
 
+// 画像読み込み
+function loadImageObj(fileName) {
+    var imgObj = new Image();
+    if (fileName!="undefined" && fileName) {
+        imgObj.src = fileName;
+    } else {
+        imgObj.src = '';
+    }
+    return imgObj;
+}
index 579358a..c3d2380 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
index ece239c..5c52484 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /* 現在の参加者データ取得 */
index 14a239f..10ff557 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
index a289638..b277a22 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
index aa38f9f..d9d680a 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
@@ -15,6 +15,7 @@ $GLOBALS['AJAX_CHAT_TRPG']['ORIG_CONFIGFILES_NAME'] = array(
     'config-data-important.php',
     'config-data-tag.php',
     'config-data-trpg.php',
+    'config-data-card.php',
     'config-data-base-color.php',
     'config-data-main-color.php',
     'config-data-main.php',
@@ -72,7 +73,12 @@ function set_ini($data) {
     if (!is_readable(SETUP_DIR.'trpgchat-ini.php')) {
         error(SETUP_DIR."ディレクトリ内にtrpgchat-ini.phpがありません", true);
     }
+
     $contents = output_file_string(SETUP_DIR.'trpgchat-ini.php');
+
+    if (!$contents) {
+        error(SETUP_DIR."trpgchat-ini.phpの読み込みに失敗しました", true);
+    }
     $output = sprintf($contents,
                 $data['masterpass'],
                 $data['admin_hash'],
@@ -81,6 +87,7 @@ function set_ini($data) {
                 $data['imp'],
                 $data['tag'],
                 $data['trpg'],
+                $data['card'],
                 $data['bc'],
                 $data['mc'],
                 $data['main'],
@@ -92,8 +99,14 @@ function set_ini($data) {
                 $data['mpdir'],
                 $data['mem'],
                 $data['l1'],
-                $data['l2']
+                $data['l2'],
+                $data['l3'],
+                $data['cdir'],
+                $data['nd'],
+                $data['nds']
             );
+    if (!$output) error('trpgchat-ini.phpの内容設定に失敗しました。', false, true, true);
+
     write_string_to_file('./trpgchat-ini.php', $output);
     if (!file_exists("./trpgchat-ini.php")) error('セットアップに失敗しました。ディレクトリの書き込み権限を確認してください', false, true, true);
     return true;
@@ -155,19 +168,23 @@ function set_logs($data) {
     set_permission_666($data['l1'], $data['666']);
     touch($data['l2']);
     set_permission_666($data['l2'], $data['666']);
+    touch($data['l3']);
+    set_permission_666($data['l3'], $data['666']);
 
     // 在室メンバー
     touch($data['mem']);
     set_permission_666($data['mem'], $data['666']);
 
     // 過去ログ
-    if (!$data['mlog']) act_log($data['rlog'], $data['666'], $data['mode'], $data['previous_chat_dir'], $data['clog'], $data['obf']);
-    if (!$data['mlog']) act_log($data['plog'], $data['666'], $data['mode'], $data['previous_chat_dir'], $data['clog'], $data['obf']);
-
-    // HTML過去ログディレクトリ
-    if (!$data['mlog']) act_mkdir($data);
+    if (!$data['mlog']) {
+        act_log($data['rlog'], $data['666'], $data['mode'], $data['previous_chat_dir'], $data['clog'], $data['obf']);
+        act_log($data['plog'], $data['666'], $data['mode'], $data['previous_chat_dir'], $data['clog'], $data['obf']);
+        act_log($data['nd'], $data['666'], $data['mode'], $data['previous_chat_dir'], $data['clog'], $data['obf']);
+        act_log($data['nds'], $data['666'], $data['mode'], $data['previous_chat_dir'], $data['clog'], $data['obf']);
+        act_mkdir($data);
+    }
 
-    if (is_writable($data['rlog']) && is_writable($data['plog']) && is_writable($data['pdir']) && is_writable($data['mpdir']) && is_writable($data['l1']) && is_writable($data['l2'])) {
+    if (is_writable($data['rlog']) && is_writable($data['plog']) && is_writable($data['pdir']) && is_writable($data['mpdir']) && is_writable($data['l1']) && is_writable($data['l2']) && is_writable($data['l3'])) {
         return true;
     } else {
         return false;
@@ -205,7 +222,9 @@ function act_log($file, $permission, $mode, $prev_dir = '', $copy = '', $obf = '
         touch($file);
     } elseif ($mode == 'verup_do' && $prev_dir) {
         if (!$obf) {
-            copy($prev_dir.$file, $file);
+            if (!copy($prev_dir.$file, $file)) {
+                touch($file);
+            }
         } else {
             touch($file);
         }
@@ -319,9 +338,8 @@ function easy_setup_config_ext1($mode) {
     print <<<HD
 直近の過去ログファイルを、普通には読めないように変換して保管します。<br>
 <strong>・暗号化ではありません。</strong><br>
-・.htaccessが使えるならば、上の設定のみで直近の過去ログへのアクセスを禁止することをお勧めします。<br>
-・この機能を用いると、負荷が高くなります。また、トラブルが起こった時にログの復元がしずらくなります。<br>
-・難読化している場合、今後のバージョンアップ時にHTML化していない過去ログは、引き継げない場合がありえます。ご了承ください。<br>
+・この機能を用いると、負荷が多少高くなります。また、トラブルが起こった時にログの復元がしずらくなります。<br>
+・難読化している場合、今後のバージョンアップ時にHTML化していない過去ログは、引き継げない場合があります。ご了承ください。<br>
 HD;
     if($mode == 'v') print "・また、この設定を選ぶと、<strong>直近の過去ログを引き継ぎません</strong><br>";
     print "</td></tr>\n";
index 4e6f7d1..a47a0f8 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*
index 1b01dbb..2e3b58d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
@@ -29,7 +29,7 @@ function read_config_one($configfile) {
 /* 全設定ファイル */
 /* 全設定ファイル読み込み */
 function read_config() {
-    return array_merge(read_config_one(CONFIG_IMPORTANT), read_config_one(CONFIG_TAG), read_config_one(CONFIG_TRPG), read_config_one(CONFIG_BASE_COLOR), read_config_one(CONFIG_MAIN_COLOR), read_config_one(CONFIG_MAIN), read_config_one(CONFIG_ICON), read_config_one(CONFIG_MOBILE));
+    return array_merge(read_config_one(CONFIG_IMPORTANT), read_config_one(CONFIG_TAG), read_config_one(CONFIG_TRPG), read_config_one(CONFIG_CARD), read_config_one(CONFIG_BASE_COLOR), read_config_one(CONFIG_MAIN_COLOR), read_config_one(CONFIG_MAIN), read_config_one(CONFIG_ICON), read_config_one(CONFIG_MOBILE));
 }
 
 /* 設定を変数にセット */
@@ -75,7 +75,7 @@ function set_config($lines, $editmode = false){
 /*
  * 指定ディレクトリ内のファイル・ディレクトリ一覧
  */
-function get_dir_contents_list($dir, $sort = 'DESC') {
+function get_dir_contents_list($dir, $sort = 'DESC', $set_sort=true) {
     $file_list = array();
     $dir_list = array();
 
@@ -90,12 +90,14 @@ function get_dir_contents_list($dir, $sort = 'DESC') {
     closedir($dp);
 
     // ソート
-    if($sort == 'ASC') {
-        sort($file_list);
-        sort($dir_list);
-    } else {
-        rsort($file_list);
-        rsort($dir_list);
+    if ($set_sort) {
+        if($sort == 'ASC') {
+            sort($file_list);
+            sort($dir_list);
+        } else {
+            rsort($file_list);
+            rsort($dir_list);
+        }
     }
 
     return array('dirs' => $dir_list, 'files' => $file_list);
@@ -140,7 +142,7 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
     if ($window != 'pastlog') {
         $header .= '<link rel="stylesheet" type="text/css" href="./css/trpgchat.css">'."\n";
     }
-    if ($window == 'index') {
+    if ($window == 'index' || $window == 'card') {
         $header .= '<link rel="stylesheet" type="text/css" href="./css/index.css">'."\n";
     } elseif ($window == 'main' || $window == 'admin') {
         $header .= '<link rel="stylesheet" type="text/css" href="./css/main.css">'."\n";
@@ -148,8 +150,14 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
     if ($window == 'admin' || $window == 'edit_config') {
         $header .= '<link rel="stylesheet" type="text/css" href="./css/admin.css">'."\n";
     }
+    if ($window == 'card') {
+        $header .= '<link rel="stylesheet" type="text/css" href="./css/card.css">'."\n";
+    }
 
     // 管理機能からの設定
+    if ($window == 'main') {
+        $header .= '<link rel="stylesheet" type="text/css" href="./css/main_css.php">'."\n";
+    }
     $header .= '<style type="text/css">'."\n";
     $header .= '<!--'."\n";
     if ($window == 'pastlog') {
@@ -219,7 +227,7 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
         $header .= 'img.btn {'."\n";
         $header .= '    color: #'.INPUT_BORDER_COLOR_EDIT.";\n";
         $header .= '}'."\n";
-        $header .= 'input, textarea, select {'."\n";
+        $header .= 'input.text, input.password, textarea, select {'."\n";
         $header .= '    color: #'.INPUT_TEXTCOLOR_EDIT.';'."\n";
         $header .= '    background-color: #'.INPUT_BGCOLOR_EDIT.";\n";
         if (INPUT_BORDER_CSS_EDIT) {
@@ -237,6 +245,8 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
             $header .= "    border-width: 1px;\n";
         }
         $header .= '}'."\n";
+    } elseif ($window == 'card') {
+        $header .= '}'."\n";
     } else {
         $header .= '    color: #'.BASE_TEXTCOLOR.';'."\n";
         if (BASE_BGCSS) {
@@ -261,7 +271,7 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
         $header .= 'img.btn {'."\n";
         $header .= '    color: #'.INPUT_BORDER_COLOR.";\n";
         $header .= '}'."\n";
-        $header .= 'input, textarea, select {'."\n";
+        $header .= 'input.text, input.password, textarea, select {'."\n";
         $header .= '    color: #'.INPUT_TEXTCOLOR.';'."\n";
         $header .= '    background-color: #'.INPUT_BGCOLOR.";\n";
         if (INPUT_BORDER_CSS) {
@@ -287,7 +297,7 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
         }
         $header .= '}'."\n";
         
-        if($window == 'admin') {
+        if ($window == 'admin') {
             $header .= 'table {'."\n";
                 if (INPUT_BORDER_CSS) {
                 $header .= '    border: '.INPUT_BORDER_CSS.";\n";
@@ -300,28 +310,51 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
         }
     }
 
+if ($window == 'card') {
+    $header .= '.secretCard {'."\n";
+    $header .= '    background-image: url('.CARD_BGIMAGE.');'."\n";
+    $header .= '}'."\n";
+    $header .= '.card  {'."\n";
+    $header .= "    background-color: #".CARD_BGCOLOR.";\n";
+    $header .= "    color: #".CARD_TEXTCOLOR.";\n";
+    $header .= '}'."\n";
+    $header .= '.openCard  {'."\n";
+    $header .= "    background-color: #".CARD_BGCOLOR.";\n";
+    $header .= "    color: #".CARD_TEXTCOLOR.";\n";
+    $header .= '}'."\n";
+    $header .= '#cardDetail  {'."\n";
+    $header .= "    background-color: #".CARD_BGCOLOR.";\n";
+    $header .= "    color: #".CARD_TEXTCOLOR.";\n";
+    $header .= '}'."\n";
+}
     // 全体共通CSS
     $header .= '.status {'."\n";
     $header .= '    color: #'.STATUS_COLOR.";\n";
     $header .= "}\n";
+    $header .= 'input.radio, input.checkbox {'."\n";
+    $header .= '    border-style: none;'."\n";
+    $header .= '}'."\n";
 
     // コンソール色設定
     $console_css = '
        font-size: 12px;
        margin: 3px;
-       padding: 3px;
+       padding: 0;
        border-width: 1px;
        border-style: solid;
        position: absolute;
        z-index: 1000;
     ';
     $console_header_css = '
+       padding: 3px;
         font-size:14px;
     ';
     $console_body_css = '
+       padding: 3px;
        padding-top: 3px;
     ';
     $console_footer_css = '
+       padding: 3px;
     ';
 
     $header .= '.console{'."\n";
@@ -392,6 +425,13 @@ function html_header($title, $window = false, $js = true, $no_cache = true) {
             $header .= '<script type="text/javascript" src="./lib/js/pastlog.js"></script>'."\n";
         } elseif ($window == 'main') {
             $header .= '<script type="text/javascript" src="./lib/js/main.js"></script>'."\n";
+        } elseif ($window == 'card') {
+            $header .= '<script type="text/javascript" src="./lib/js/card.js"></script>'."\n";
+            $header .= '<script type="text/javascript" src="./lib/js/ui.core.js"></script>'."\n";
+            $header .= '<script type="text/javascript" src="./lib/js/ui.draggable.min.js"></script>'."\n";
+//            $header .= '<script type="text/javascript" src="./lib/js/ui.droppable.min.js"></script>'."\n";
+            $header .= '<script type="text/javascript" src="./lib/js/ui.accordion.min.js"></script>'."\n";
+            $header .= '<script type="text/javascript" src="./lib/js/jquery.blockUI.js"></script>'."\n";
         }
     }
 
@@ -411,7 +451,14 @@ function html_footer($copyright = true, $adminlogin = false) {
         $footer .= '管理画面:<input type="password" name="admin_pwd" size="8" class="inputpwd" value=""><input name="action" type="hidden" value="admin.php"> <input type="image" class="btn sub" src="'.ADMIN_ICON.'"></form>'."\n";
     }
     $footer .= '</td><td align="right" nowrap style="width:350px; border-style:none;">'."\n";
-    if ($copyright) $footer .= '<p class="copyright">'.COPYRIGHT.'</p>'."\n";
+    if ($copyright) {
+        $copyright_msg = COPYRIGHT;
+        if (USER_COPYRIGHT) {
+            $copyright_msg .= " ".USER_COPYRIGHT;
+        }
+        $copyright_msg .= " Thanks!";
+        $footer .= '<p class="copyright">'.$copyright_msg.'</p>'."\n";
+    }
     $footer .= '</td></tr></table>'."\n";
     $footer .= '</body>'."\n";
     $footer .= '</html>'."\n";
@@ -560,7 +607,7 @@ function write_console($top, $left, $width, $display, $id, $header, $msg_st, $ms
     print '</div>'."\n";
 
     if ($footer || $copyright) {
-        print '<div id="footer>';
+        print '<div id="footer">';
         if ($footer) print $footer;
         if ($copyright) print '<p class="copyright">'.COPYRIGHT.'</p>';
         print '</div>'."\n";
index 7a125b0..5a25e9b 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
index ffb5f78..8ac145e 100644 (file)
--- a/main.php
+++ b/main.php
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
@@ -13,6 +13,7 @@ require_once './lib/member_check.php';
 
 // 設定セット
 set_config(read_config());
+$ua = getenv("HTTP_USER_AGENT");
 
 // アクセスブロック
 access_block();
@@ -37,7 +38,48 @@ require_once './lib/js/main-js.php';
 <table style="border-style:none; width:100%;" id="main_console">
 <tr><td>
 参加者: <span id="indi"></span>
-</td><td style="width:120px; text-align:right; height:20px;" nowrap>
+</td>
+<?php if (USE_SE): ?>
+<td id="soundEffect">
+<ul>
+<?php if (strstr($ua, "MSIE ")):  ?>
+<bgsound id="se" src="./sound_effect/none.wav" loop="1">
+<?php else: ?>
+<embed id="se" src="./sound_effect/none.wav" loop="1">
+<?php endif; ?>
+<li style="display:none;">
+<input id="seSetting" type="checkbox"<?php if ($cookies['se']): ?> checked="checked"<?php endif ?>>
+</li>
+<li id="seBottun">
+<?php 
+show_icon(SE_ON, "", "seIcon", "seOn", "♪", "発言音ON/クリックでOFFにします", "seOff();");
+show_icon(SE_OFF, "", "seIcon", "seOff", "×♪", "発言音OFF/クリックでONにします", "seOn();");
+show_icon(SE_CONFIG, "", "seIcon", "seConfig", "+♪", "発言音設定/クリックで設定が隠れます", "seConfigHide();");
+?>
+</li>
+<li>
+<?php 
+$seConfig = '<dl>';
+$seConfig .= '<dt><input id="userSetting" type="checkbox"';
+if ($cookies['use']) {
+    $seConfig .= ' checked="checked"';
+}
+$seConfig .= ">発言</dt>";
+$seConfig .= '<dd>自分以外の発言に音を鳴らす</dd>';
+$seConfig .= '<dt><input id="systemSeSetting" type="checkbox"';
+if ($cookies['sse']) {
+    $seConfig .= ' checked="checked"';
+}
+$seConfig .= ">入退室など</dt>";
+$seConfig .= '<dd>システムメッセージ(入退室など)に音を鳴らす</dd>';
+$seConfig .= '</dl>';
+
+write_console('20px', '150px', '190px', 'none', 'seSelect', '発言音設定', $seConfig, '', '', false);
+
+ ?>
+</td>
+<?php endif; ?>
+<td id="lineConfig" nowrap>
 <?php
 show_icon(FONT_SIZE_UP, "", "", "", "拡大", "文字を大きくします", "fontSizeChange('2');");
 show_icon(FONT_SIZE_DOWN, "", "", "", "縮小", "文字を小さくします", "fontSizeChange('-2');");
index 8de3a40..578c564 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // かんたんセットアップ対応
index 45243e4..0547f93 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /* 携帯用発言書込み */
index fe23343..2491b6d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
index a49b30e..6aa6bed 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
index 2b31726..be20002 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
index 016d2dc..e93b19d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
index fcbcc8c..c8fcebc 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
index 52d58a1..a5dd950 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
index 03851c6..e42670f 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // SSL&IE対策
index a649a6a..3dabf23 100644 (file)
--- a/setup.php
+++ b/setup.php
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 /*****************
  *  かんたんセットアップ
@@ -79,6 +79,8 @@ if (!$mode) {
     print input_area('text', 'tag', './config-data-tag.php');
     print output_table("TRPG関連の設定ファイル");
     print input_area('text', 'trpg', './config-data-trpg.php');
+    print output_table("カード関連の設定ファイル");
+    print input_area('text', 'card', './config-data-card.php');
     print output_table("全体の配色設定ファイル");
     print input_area('text', 'bc', './config-data-base-color.php');
     print output_table("チャット画面の配色設定ファイル");
@@ -101,8 +103,14 @@ if (!$mode) {
     print input_area('text', 'mem', './member.log');
     print output_table("ロックファイル");
     print input_area('text', 'l1', './lock.txt');
-    print "\n";
     print input_area('text', 'l2', './lock2.txt');
+    print input_area('text', 'l3', './lock3.txt');
+    print output_table("カード設定ディレクトリ");
+    print input_area('text', 'cdir', './lib/card/');
+    print output_table("現在のカード状態ファイル");
+    print input_area('text', 'nd', './deckset.json');
+    print input_area('text', 'nds', './deck_status.json');
+    print "\n";
 
     print "</td></tr>\n";
     print '<tr><td style="text-align:center;" colspan="2">';
@@ -176,6 +184,21 @@ if (!$mode) {
         if (!defined('CONFIG_MOBILE')) {
             define('CONFIG_MOBILE', './config-data-mobile.php');
         }
+        if (!defined('CONFIG_CARD')) {
+            define('CONFIG_CARD', './config-data-card.php');
+        }
+        if (!defined('LOCK3')) {
+            define('LOCK3', './lock3.txt');
+        }
+        if (!defined('CARD_DIR')) {
+            define('CARD_DIR', './lib/card/');
+        }
+        if (!defined('NOW_DECK')) {
+            define('NOW_DECK', './deckset.json');
+        }
+        if (!defined('NOW_DECK_STATUS')) {
+            define('NOW_DECK_STATUS', './deck_status.json');
+        }
 
         require_once $prev_ini;
         $data = array(
@@ -185,6 +208,7 @@ if (!$mode) {
             'imp' => CONFIG_IMPORTANT,
             'tag' => CONFIG_TAG,
             'trpg' => CONFIG_TRPG,
+            'card' => CONFIG_CARD,
             'bc' => CONFIG_BASE_COLOR,
             'mc' => CONFIG_MAIN_COLOR,
             'main' => CONFIG_MAIN,
@@ -197,6 +221,10 @@ if (!$mode) {
             'mem' => NOW_MEMBER,
             'l1' => LOCK,
             'l2' => LOCK2,
+            'l3' => LOCK3,
+            'cdir' => CARD_DIR,
+            'nd' => NOW_DECK,
+            'nds' => NOW_DECK_STATUS,
         );
 
         if ($data['masterpass'] != $request['masterpass']) error("パスワードが合致しません", true);
@@ -214,6 +242,7 @@ if (!$mode) {
         CONFIG_IMPORTANT,
         CONFIG_TAG,
         CONFIG_TRPG,
+        CONFIG_CARD,
         CONFIG_BASE_COLOR,
         CONFIG_MAIN_COLOR,
         CONFIG_MAIN,
index add026f..0559527 100644 (file)
@@ -5,4 +5,10 @@ SetEnvIf Referer "^%s" ref_ok
 Order Deny,Allow
 Deny from all
 allow from env=ref_ok
-</Files>
\ No newline at end of file
+</Files>
+
+<Files ~ "\.json$">
+Order Deny,Allow
+Deny from all
+allow from env=ref_ok
+</Files>
diff --git a/setup/orig/config-data-card.php b/setup/orig/config-data-card.php
new file mode 100644 (file)
index 0000000..61310cd
--- /dev/null
@@ -0,0 +1,6 @@
+カード
+カード機能を使う<><>USE_CARD<>0<>2<><>1
+デフォルトカード設定
+カード裏面画像<><>CARD_BGIMAGE<>0<>0<>card_bgimage<>./image/card/bg.gif
+カードの色<><>CARD_BGCOLOR<>0<>0<>card_bgcolor<>FFFFFF
+カードの文字色<><>CARD_TEXTCOLOR<>0<>0<>card_bgcolor<>000000
index 7f77108..bd11a0c 100644 (file)
@@ -36,3 +36,11 @@ HTMLログダウンロード<><>PASTLOG_DL_ICON<>0<>0<>image<>./image/save_b.gif
 一定値以上(以下)の出目をカウントする機能のアイコン<><>PICKUP_ICON<>0<>0<>image<>./image/pickupDice.gif
 FreeMap連動<><>FREEMAP_ICON<>0<>0<>image<>./image/editUnit.gif
 携帯アイコン<><>MOBILE_ICON<>0<>0<>image<>./image/mobile.gif
+カード機能アイコン<><>CARD_ICON<>0<>0<>image<>./image/trump.gif
+カード設定呼び出しアイコン<><>CARD_READ_ICON<>0<>0<>image<>./image/read_card.gif
+NowLoadingマーク<><>NOW_LOADING_ICON<>0<>0<>image<>./image/NowLoading.gif
+カード機能アイコン<><>CARD_ICON<>0<>0<>image<>./image/trump.gif
+カード設定呼び出しアイコン<><>CARD_READ_ICON<>0<>0<>image<>./image/read_card.gif
+効果音設定アイコン<><>SE_CONFIG<>0<>0<>image<>./image/volume_config_b.png
+効果音ONアイコン<><>SE_ON<>0<>0<>image<>./image/volume_normal_b.gif
+効果音OFFアイコン<><>SE_OFF<>0<>0<>image<>./image/volume_off_b.png
index 8fd381a..c9530d6 100644 (file)
@@ -7,7 +7,8 @@
 過去ログ表示・保管の設定
 チャット表示行数<>開いた時点で表示する最大行数です。これより以前の発言は「直近の過去ログ」として別画面で表示します。<>MAX_NUM<>0<>0<><>40
 発言者のホスト情報をログに記録する<><>REC_UA<>0<>2<><>1
-参加者にのみ表示する <>直近の過去ログは、参加中のメンバーが参加者名とパスワードを入力すれば表示可能です<br>参加者名は全員に表示されます。<>UNPUBLIC_LAST_PASTLOG<>0<>2<><>
+参加者にのみ表示する<>直近の過去ログは、参加中のメンバーが参加者名とパスワードを入力すれば表示可能です<br>この設定のみならば、参加者名は全員に表示されます。<>UNPUBLIC_LAST_PASTLOG<>0<>2<><>
+ログイン中のメンバー名も参加者のみに表示する<>参加者名もログインしないと非表示(****で表示)します。<br>会話も「参加者にのみ表示する」設定の場合のみ有効。<>UNPUBLIC_LOGIN_MEMBER<>0<>2<><>
 直近の過去ログを表示しない場合、入室前に表示するメッセージ<>HTMLタグは有効です(空欄可) 改行は自動変換します<>NO_LAST_PASTLOG_MSG<>0<>1<><>このチャットの会話は、参加者のみに表示されます
 直近の過去ログを「流す」<>「チャット表示行数」以上は表示せず消します。<br>参加者でも閲覧できません(HTML化過去ログはOK)<>DELETE_LAST_PASTLOG<>0<>2<><>
 HTML化した過去ログを公開する<>「直近の過去ログを流す」「直近の過去ログを公開する」の設定とは無関係です。<br>「直近の過去ログ」は表示しないがHTML化した過去ログは公開する・・・と言う設定も可能です。<>PUBLIC_PASTLOG<>0<>2<><>1
index ed36dc6..56ba53a 100644 (file)
@@ -8,3 +8,9 @@
 発言時間を秒まで表示する<><>SHOW_DATETIME_SECOND<>0<>2<><>1
 オンライン前表示<>改行のみタグ不要です。HTMLタグは有効です<br>(空欄可)<>OFFWINDOW_MSG<>0<>1<>1<>Ajan Chat for TRPGは、TRPG用機能満載の、動作軽快なWEBチャットです。<br /><div align=right><a href=http://trpgtools-onweb.sourceforge.jp/modules/mydownloads/ target=_self>ダウンロードはこちらから</a></div>
 ヘルプ自由入力<>改行のみタグ不要です。HTMLタグは有効です(空欄可)<>HELP_MSG<>0<>1<>1<>
+効果音設定
+効果音機能を使う<>発言・入退室があった場合、音を鳴らす<>USE_SE<>0<>2<><>0
+発言効果音<>通常の参加者の発言で鳴る効果音<>SE_USER<>0<>0<><>
+システム発言効果音<>システム発言(入退室など)で鳴る効果音<>SE_SYSTEM<>0<>0<><>
+コピーライトリンク表示
+コピーライト使用リンク表示<>アイコン画像/音源使用などで「リンク表示」が必要な場合、ここに記してください。フッターに表示されます。<br>HTMLタグで記入してください<>USER_COPYRIGHT<>0<>1<>1<>
index 2640547..98ccf8f 100644 (file)
@@ -1,4 +1,4 @@
-TPRG関連機能汎用設定
+ダイス
 ダイス最大個数<>一度に振れるダイス数の最大数を入力してください。<br>0でダイス不使用。最大数は1000個です(多すぎるとサーバに負担をかける事があります)<>DICE_MAX<>0<>0<><>100
 プリセットダイス<>一般的に「よく使うダイス」を、簡単に選択&入力可能 にします<>PRESET_DICE<>1<>0<><>2D6</>3D6</>1D6</>1D8</>1D10</>2D10</>1D20</>1D100
 ダイスショートカット<>ユーザごとに「よく使うダイス」を設定可能にします<>SHORTCUT_DICE<>0<>2<><>1
diff --git a/setup/orig/deck_status.json b/setup/orig/deck_status.json
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/setup/orig/deckset.json b/setup/orig/deckset.json
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/setup/orig/lock3.txt b/setup/orig/lock3.txt
new file mode 100644 (file)
index 0000000..e69de29
index cf2a505..b6a8dae 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
@@ -28,9 +28,8 @@ define('COOKIE', 'AjaxChat'); // 空:クッキーを使用しない
 // この機能を用いると、負荷が高くなります。また、トラブルが起こった時にログの復元がしずらくなります。
 // また、完全な暗号化ではありません。「読みずらく」しているだけです。
 //  難読化している場合、今後のバージョンアップ時にHTML化していない過去ログは、引き継げない場合がありえます。ご了承ください。
-//  また、携帯ではバグが起こりやすくなります。
 //  この設定を途中で変更すると、HTML化していない過去ログが読めなくなります。
-define('OBFUSCATION', false);
+define('OBFUSCATION', '0');
 
 /* ここまで、重要な設定 */
 
@@ -41,6 +40,8 @@ define('CONFIG_IMPORTANT', './config-data-important.php');
 define('CONFIG_TAG', './config-data-tag.php');
     // 設定ファイル:TRPG
 define('CONFIG_TRPG', './config-data-trpg.php');
+    // 設定ファイル:カード機能
+define('CONFIG_CARD', './config-data-card.php');
     // 設定ファイル:全体の配色
 define('CONFIG_BASE_COLOR', './config-data-base-color.php');
     // 設定ファイル:チャット画面の配色
@@ -64,7 +65,13 @@ define('NOW_MEMBER', './member.log');
     // ロックファイル
 define('LOCK', './lock.txt');
 define('LOCK2', './lock2.txt');
+define('LOCK3', './lock3.txt');
+    // カード設定保管ディレクトリ
+define('CARD_DIR', './lib/card/');
+    // 現在のデックファイル名
+define('NOW_DECK', './deckset.json');
+    // 現在のデック(カード)所持状態ファイル名
+define('NOW_DECK_STATUS', './deck_status.json');
 
 require_once './trpgchat-ini-2.php';
 
-?>
\ No newline at end of file
index 5c5d337..56331ce 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /*****************
@@ -24,11 +24,8 @@ define('COOKIE', '%s'); // 空:クッキーを使用しない
 // 直近の過去ログを難読化する
 // 直近の過去ログファイルを普通には読めないように変換して保管します。
 // *注意*
-// .htaccessが使えるならば、.htaccessのみで直近の過去ログへのダイレクトアクセスを禁止することをお勧めします。
-// この機能を用いると、負荷が高くなります。また、トラブルが起こった時にログの復元がしずらくなります。
-// また、完全な暗号化ではありません。「読みずらく」しているだけです。
-//  難読化している場合、今後のバージョンアップ時にHTML化していない過去ログは、引き継げない場合がありえます。ご了承ください。
-//  この設定を途中で変更すると、HTML化していない過去ログが読めなくなります。
+// 完全な暗号化ではありません。「読みずらく」しているだけです。
+//  難読化設定を切り替えた場合、HTML化していない過去ログが文字化けます。ご注意ください。
 define('OBFUSCATION', '%s');
 
 /* ここまで、重要な設定 */
@@ -40,6 +37,8 @@ define('CONFIG_IMPORTANT', '%s');
 define('CONFIG_TAG', '%s');
     // 設定ファイル:TRPG
 define('CONFIG_TRPG', '%s');
+    // 設定ファイル:カード機能
+define('CONFIG_CARD', '%s');
     // 設定ファイル:全体の配色
 define('CONFIG_BASE_COLOR', '%s');
     // 設定ファイル:チャット画面の配色
@@ -63,7 +62,13 @@ define('NOW_MEMBER', '%s');
     // ロックファイル
 define('LOCK', '%s');
 define('LOCK2', '%s');
+define('LOCK3', '%s');
+    // カード機能設定保管ディレクトリ
+define('CARD_DIR', '%s');
+    // 現在のデックファイル名
+define('NOW_DECK', '%s');
+    // 現在のデック(カード)所持状態ファイル名
+define('NOW_DECK_STATUS', '%s');
 
 require_once './trpgchat-ini-2.php';
 
-?>
\ No newline at end of file
diff --git a/sound_effect/index.html b/sound_effect/index.html
new file mode 100644 (file)
index 0000000..e7692e6
--- /dev/null
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\r
+<title>TRPGのためのAjaxチャット</title>\r
+</head>\r
+<body>\r
+\r
+TRPGのためのAjaxChat配布サイトは<a href="http://trpgtools-onweb.sourceforge.jp/">こちら。</a>\r
+\r
+</body>\r
+</html>\r
diff --git a/sound_effect/none.wav b/sound_effect/none.wav
new file mode 100644 (file)
index 0000000..9d792e2
Binary files /dev/null and b/sound_effect/none.wav differ
index fcc1815..e45c540 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
 */
 
 /*****************
@@ -69,7 +69,7 @@ define('DEMO_CHAT', false);
  * 著作権とバージョン表示
  */
 require_once './version.php';
-define('COPYRIGHT', '<a href="http://trpgtools-onweb.sourceforge.jp/" target="_blank">Ajax Chat for TRPG</a> ver.'.TRPGCHAT_VERSION.' Copyright(c) Cake 2007-2009 All Rights Reserved.<br> * icons:<a href="http://snow.if.tv/" target="_blank">Petite Prier</a> Thanks!');
+define('COPYRIGHT', '<a href="http://trpgtools-onweb.sourceforge.jp/" target="_blank">Ajax Chat for TRPG</a> ver.'.TRPGCHAT_VERSION.' Copyright(c) Cake 2007-2009 All Rights Reserved.<br> * icons:<a href="http://snow.if.tv/" target="_blank">Petite Prier</a> <a href="http://preloaders.net/" target="_blank">preloaders.net</a>');
 define('MOBILE_COPYRIGHT', 'AjaxChatforTRPGv'.TRPGCHAT_VERSION.'@Mobile');
 
 ?>
\ No newline at end of file
index c017db5..5d37a28 100644 (file)
@@ -1,3 +1,3 @@
 <?php
-define('TRPGCHAT_VERSION', '2.5');
+define('TRPGCHAT_VERSION', '2.6');
 ?>
\ No newline at end of file
index a9b8524..7146e64 100644 (file)
--- a/write.php
+++ b/write.php
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 /* 発言書込み */
@@ -116,10 +116,15 @@ if($stopflag==0) {
         $data['m'] = $data['n'].OFFLINE_MSG;
         $data['l'] = COLOR_SYSTEM;
         $data['s'] = 0;
+        // カード操作
+    } elseif ($data['y'] == 'card') {
+        $pcname = SYSTEM;
+        $data['m'] = $data['n'].'さんが'.$data['m'];
+        $data['l'] = COLOR_SYSTEM;
+        $data['s'] = 0;
     } else {
         $pcname = $data['c'];
     }
-
     if ($data['n'] && $data['p']) {
         $pwd = create_hash($data['n'],$data['p']);
     }
index a95954a..6695486 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
- * Ajax Chat for TRPG ver.2.5
* (c)2007-2009 Cake All rights reserved.
Mail : cake_67@users.sourceforge.jp
Home : http://trpgtools-onweb.sourceforge.jp/
+ Ajax Chat for TRPG ver.2.6
(c)2007-2009 Cake All Rights Reserved.
+ Mail : cake_67@users.sourceforge.jp
+ Home : http://trpgtools-onweb.sourceforge.jp/
  */
 
 // 設定ファイルの読み込み
@@ -39,6 +39,8 @@ if ($request['mode'] =='重要な') {
     $target = CONFIG_MAIN;
 } elseif ($request['mode'] == 'TRPG機能関連') {
     $target = CONFIG_TRPG;
+} elseif ($request['mode'] == 'カード機能関連') {
+    $target = CONFIG_CARD;
 } elseif ($request['mode'] == 'タグ') {
     $target = CONFIG_TAG;
 } elseif ($request['mode'] == '全体の配色') {
index 82a35ba..8c17e39 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
 <html lang="ja">\r
 <head>\r
-       <meta http-equiv="content-type" content="text/html; charset=Shift_JIS">\r
-       <title>Ajax Chat for TRPG\82É\82Â\82¢\82Ä</title>\r
+<meta http-equiv="content-type" content="text/html; charset=Shift_JIS">\r
+<title>Ajax Chat for TRPG\82É\82Â\82¢\82Ä</title>\r
 </head>\r
 \r
 <body>\r
@@ -11,7 +11,7 @@
 \r
 <hr>\r
 <pre>\r
-Ajax Chat for TRPG ver.2.5\r
+Ajax Chat for TRPG ver.2.6\r
 (c)2007-2009 Cake All Rights Reserved.\r
 Mail : cake_67@users.sourceforge.jp\r
 Home : http://trpgtools-onweb.sourceforge.jp/\r
@@ -41,9 +41,15 @@ BSD
     (Cake\8dì\90¬\82Ì\83A\83C\83R\83\93\81F\r
        d1.gif, d4.gif, d6.gif,\r
        sw.gif, mobile.gif, \r
+       card/bg.gif, card/event\88È\89º\82Ì\91S\82Ä\81Acard/tarot\88È\89º\82Ì\91S\82Ä\81Acard/trump\88È\89º\82Ì\91S\82Ä\r
      \88È\8fã\82É\82Â\82¢\82Ä\82Í\81A\92\98\8dì\8c \82ð\95ú\8aü\82µ\82Ü\82·\81B\r
-     \8eg\97p\81E\89ü\91¢\81E\8dÄ\94z\95z\91S\82Ä\8e©\97R\82Å\82·)\r
+     \8eg\97p\81E\89ü\91¢\81E\8dÄ\94z\95z\81A\91S\82Ä\8e©\97R\82Å\82·)\r
 </pre></li>\r
+<li>\93¯\8d«\82Ì\83f\83t\83H\83\8b\83g\83^\83\8d\83b\83g\89æ\91\9c\82Í\81A\88È\89º\83E\83F\83C\83g\94Å\82Ì\83p\83u\83\8a\83b\83N\83h\83\81\83C\83\93\89æ\91\9c\82ð\8eg\97p\82µ\82Ä\82¢\82Ü\82·\81B<br>\r
+      http://en.wikipedia.org/wiki/Major_arcana<br>\r
+    \83^\83\8d\83b\83g\83J\81[\83h\82Ì\94z\97ñ\82â\90à\96¾\82Í\81A\83E\83F\83C\83g\94Å\82ð\83x\81[\83X\82É\88ê\94Ê\93I\82È\89ð\8eß\82Æ\82³\82ê\82Ä\82¢\82é\93à\97e\82É\8f\80\82\82Ä\82¢\82Ü\82·\81B<br>\r
+    \8fÚ\8d×\82â\89ð\8eß\82ª\95K\82¸\82µ\82à\90³\82µ\82¢\82à\82Ì\82Å\82 \82é\82Æ\82Í\8cÀ\82è\82Ü\82¹\82ñ\81B\82²\97¹\8f³\89º\82³\82¢\81B\r
+</li>\r
 <li>\96{\83X\83N\83\8a\83v\83g\82Í\96³\95Û\8fØ\82Å\82·\81B\8e©\8cÈ\90Ó\94C\82Å\8eg\97p\82µ\82Ä\82­\82¾\82³\82¢\81B\82±\82Ì\83X\83N\83\8a\83v\83g\82ð\8eg\97p\82µ\82½\82¢\82©\82È\82é\91¹\8aQ\82É\91Î\82µ\82Ä\82à\81A\8dì\8eÒ\82Í\88ê\90Ø\82Ì\90Ó\94C\82ð\95\89\82¢\82Ü\82¹\82ñ\81B</li>\r
 <li>\90Ý\92u\82¨\82æ\82Ñ\8eg\97p\95û\96@\82É\8aÖ\82·\82é\8e¿\96â\82Í\81A\94z\95z\83T\83C\83g\82Ì\8cf\8e¦\94Â\82É\82¨\8aè\82¢\82µ\82Ü\82·\81B\82½\82¾\82µ\81A\95K\82¸\89ñ\93\9a\82Å\82«\82é\82Æ\82Í\8cÀ\82è\82Ü\82¹\82ñ\81B<br>\r
 \83\81\81[\83\8b\82É\82æ\82é\8e¿\96â\82Í\81A\82²\89\93\97\82­\82¾\82³\82¢\81B</li>\r
@@ -60,19 +66,20 @@ BSD
   \84¥ image [644]\r
   \84¥ lib [644]\r
   \84¥ setup [644]\r
-  \84¤ *.php [644] (\96¼\91O\82ª.php\82Å\8fI\82í\82é\83t\83@\83C\83\8b\91S\82Ä)\r
+  \84¥ sound_effect [644]\r
+  \84¤ *.* [644] (\82»\82Ì\91¼\81A\93¯\8d«\82Ì\83t\83@\83C\83\8b\91S\82Ä)\r
 </pre>\r
-\8aî\96{\93I\82É\81A<b><u>\92\86\90g\82ð\82»\82Ì\82Ü\82Ü\83R\83s\81|\82Ì\82Ý</u></b>\82Å\82n\82j\82Å\82·\81B<br>\r
+\8aî\96{\93I\82É\81A<b><u>\89ð\93\80\82µ\82½\92\86\90g\82ð\82»\82Ì\82Ü\82Ü\83R\83s\81|\82Ì\82Ý</u></b>\82Å\82n\82j\82Å\82·\81B<br>\r
 <br>\r
 \81\96\81@\82¨\8eg\82¢\82Ì\83T\81[\83o\82É\82æ\82Á\82Ä\82Í\81A\90Ý\92u\82µ\82½\83f\83B\83\8c\83N\83g\83\8a\82Ì\83p\81[\83~\83b\83V\83\87\83\93\82ð[777]\82Ü\82½\82Í[707]\82É\82·\82é\95K\97v\82ª\82 \82è\82Ü\82·\81B<br>\r
 \r
 <h3>\82Q\81D\81u\82©\82ñ\82½\82ñ\83Z\83b\83g\83A\83b\83v\81v</h3>\r
-IE\82È\82Ç\82Ì\83u\83\89\83E\83U\82©\82ç\81A\90Ý\92u\82µ\82½\83f\83B\83\8c\83N\83g\83\8a\82Ìindex.php\82É\83A\83N\83Z\83X\82µ\82Ä\82­\82¾\82³\82¢\81B<br>\r
+IE\82È\82Ç\82Ì\83u\83\89\83E\83U\82©\82ç\81A\90Ý\92u\82µ\82½\83f\83B\83\8c\83N\83g\83\8a\82É\83A\83N\83Z\83X\82µ\82Ä\82­\82¾\82³\82¢\81B<br>\r
 <br>\r
 \90V\82µ\82­\83C\83\93\83X\83g\81[\83\8b\82·\82é\8fê\8d\87\82Í\81A\81u\90V\8bK\83C\83\93\83X\83g\81[\83\8b\81v\82ð\91I\82ñ\82Å\81u\8e\9f\82Ö\81v\82ð\89\9f\82µ\82Ä\82­\82¾\82³\82¢\81B<br>\r
 <br>\r
 \8d¡\8eg\82Á\82Ä\82¢\82éAjax Chat for TRPG\82Ì\90Ý\92è\82ð\88ø\82«\8cp\82¬\82½\82¢\8fê\8d\87\82Í\81A\81u\83o\81[\83W\83\87\83\93\83A\83b\83v\81v\82ð\91I\82ñ\82Å\82­\82¾\82³\82¢\81B<br>\r
-\81@\81\96\81@\83o\81[\83W\83\87\83\93\83A\83b\83v\82Í\81A\88ø\82«\8cp\82¬\82½\82¢\83`\83\83\83b\83g\82ªver2.0\88È\8d~\82Å\82 \82é\95K\97v\82ª\82 \82è\82Ü\82·\81Bver1.*\82Ö\8eÀ\8e{\82µ\82½\8fê\8d\87\82Ì\93®\8dì\82Í\95Û\8fá\82µ\82Ü\82¹\82ñ\81B<br>\r
+\81@\81\96\81@\83o\81[\83W\83\87\83\93\83A\83b\83v\82Í\81A\88ø\82«\8cp\82¬\82½\82¢\83`\83\83\83b\83g\82ªver2.0\88È\8d~\82Å\82 \82é\95K\97v\82ª\82 \82è\82Ü\82·\81Bver1.*\82Å\8eÀ\8e{\82µ\82½\8fê\8d\87\82Ì\93®\8dì\82Í\95Û\8fá\82µ\82Ü\82¹\82ñ\81B<br>\r
 <br>\r
 \82 \82Æ\82Í\81A\89æ\96Ê\82Ì\8ew\8e¦\82É\8f]\82Á\82Ä\90Ý\92è\82µ\82Ä\82­\82¾\82³\82¢\81B<br>\r
 <br>\r
@@ -103,7 +110,6 @@ IE
 \81@FireFox3.0<br>\r
 \81@IE7.0<br>\r
 \r
-\r
 <h4>\93®\8dì\8eÀ\90Ñ(ver2.4\8e\9e\93_)</h4>\r
 Windows<br>\r
 \81@IE6.0<br>\r
index a07c2e1..c299a75 100644 (file)
@@ -1,3 +1,13 @@
+2009/07/08\r
+ver2.6\r
+\81E\81u\83J\81[\83h\8b@\94\\81v\93±\93ü\82µ\82Ü\82µ\82½\81B\83I\83\8a\83W\83i\83\8b\82Ì\83J\81[\83h\82ð\8dì\82Á\82Ä\8eg\82¦\82Ü\82·\81I\81c\81c\92A\82µ\81A\83J\81[\83h\82Ì\92\98\8dì\8c \82É\82Í\8fd\81X\82²\97¯\88Ó\82­\82¾\82³\82¢\81B\r
+\81E\81u\94­\8c¾\82ð\89¹\82Å\82¨\92m\82ç\82¹\81v\8b@\94\\92Ç\89Á\82µ\82Ü\82µ\82½\81B\83f\83t\83H\83\8b\83g\90Ý\92è\82ÍOFF\82Å\82·\81B\82Ü\82½\81A\89¹\8c¹\82Í\8ae\8e©\82Å\82²\97p\88Ó\89º\82³\82¢\81B\8eg\97p\82·\82é\8fê\8d\87\81A\8aÇ\97\9d\89æ\96Ê\81u\91S\94Ê\90Ý\92è\81v\82©\82ç\90Ý\92è\92Ç\89Á\81E\89¹\8c¹\92Ç\89Á\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\81E\89¹\8c¹/\83A\83C\83R\83\93\89æ\91\9c\82È\82Ç\81A\94z\95z\83T\83C\83g\82Ì\91f\8dÞ\82ð\8eg\82¤\8fê\8d\87\82Ì\81u\83\8a\83\93\83N\83E\83F\83A\81v\95\\8e¦\91Î\89\9e\81B\8aÇ\97\9d\89æ\96Ê\82©\82ç\81A\83t\83b\83^\81[\82É\95\8fÍ\92Ç\89Á\89Â\94\\82Æ\82µ\82Ü\82µ\82½\81B\r
+\81E\81u\89ï\98b\82ð\8eQ\89Á\8eÒ\82Ì\82Ý\82É\95\\8e¦\81v\83\82\81[\83h\82Å\81A\8eQ\89Á\8eÒ\88Ó\8aO\82É\82Í\8eQ\89Á\8eÒ\96¼\82à\93½\96¼\95\\8e¦\82·\82é\90Ý\92è\82ð\92Ç\89Á\82µ\82Ü\82µ\82½\81B\r
+\81ETRPG\8b@\94\\82ð\83I\83t\82É\82µ\82½\8fê\8d\87\81A\94­\8c¾\97\93\83G\83\93\83^\81[\82Å\8f\91\82«\8d\9e\82Ý\82ª\82Å\82«\82È\82­\82È\82é\83o\83O\82ð\8fC\90³\82µ\82Ü\82µ\82½\81B\r
+\81E\8cë\8dì\93®\96h\8e~\82Ì\82½\82ß\81A\83\8d\83O\83C\83\93\96¼\82Ì\90§\8cÀ\82ð\91\9d\82â\82µ\82Ü\82µ\82½\81B\88ê\95\94\94¼\8ap\8bL\8d\86\82â\81A\93Á\92è\82Ì\96¼\8fÌ\82ª\8eg\82¦\82È\82­\82È\82è\82Ü\82·\81B\r
+\81EIE\82Å\83`\83F\83b\83N\83{\83b\83N\83X\82Ì\8eü\82è\82É\98g\90ü\82ª\93ü\82é\95\\8e¦\82ð\8fC\90³\82µ\82Ü\82µ\82½\81B\r
+\r
 2009/04/29\r
 ver2.5\r
 \81EIE\82Å\81u\89ß\8b\8e\96é\95\\8e¦\81v\82È\82Ç\88ê\95\94\83A\83C\83R\83\93\82ª\93®\8dì\82µ\82È\82­\82È\82Á\82Ä\82¢\82½\82Ì\82ð\8fC\90³\82µ\82Ü\82µ\82½\81B\r