3 Ajax Chat for TRPG ver.2.6
4 (c)2007-2009 Cake All Rights Reserved.
5 Mail : cake_67@users.sourceforge.jp
6 Home : http://trpgtools-onweb.sourceforge.jp/
10 * PHPライブラリ:ログのPHP読み込み用
16 function format_log($line, $hash='', $d=true, $is_mobile=false)
18 $unit = explode("<>", $line);
24 $color = MAIN_TEXTCOLOR;
28 $date_format = 'm/d H:i';
29 if (SHOW_DATETIME_YEAR && !$is_mobile) {
30 $date_format = 'Y/'.$date_format;
32 if (SHOW_DATETIME_SECOND && !$is_mobile) {
35 $datetime = date($date_format, $unit[5]);
38 $host = (MASTERPASS && $hash == MASTERPASS) ? '<!--' : NULL ;
39 $host .= (MASTERPASS && $hash == MASTERPASS && $unit[6]) ? $unit[6].'<>' : NULL ;
40 $host .= (MASTERPASS && $hash == MASTERPASS) ? $unit[7].' -->' : NULL ;
41 $whisper_from_pass = $unit[8];
42 $whisper_to_name = $unit[9];
43 $whisper_to_pass = $unit[10];
46 if ($unit[9] || $unit[10]) {
48 if ($hash == MASTERPASS) {
50 } elseif ($hash == $unit[8]) {
52 } elseif ($hash == $unit[10]) {
58 if ($unit[11] == '1' && $unit[12]) {
61 $isMobile = $unit[13];
63 return array($num, $name, $pc, $color, $com, $datetime, $host, $whisper_from_pass, $whisper_to_name, $whisper_to_pass, $w, $status, $isMobile);
69 function decode_obf_log($pc, $com, $name, $whisper_to_name, $status)
71 $pc = de_obf_xor($pc);
72 $com = de_obf_xor($com);
73 $name = de_obf_xor($name);
74 if ($whisper_to_name) $whisper_to_name = de_obf_xor($whisper_to_name);
75 if ($status) $status = de_obf_xor($status);
77 return array($pc, $com, $name, $whisper_to_name, $status);