3 * Ajax Chat for TRPG ver.1.3
4 * (c)2007 Cake All rights reserved.
5 * Mail : cake_67@users.sourceforge.jp
6 * Home : http://trpgtools-onweb.sourceforge.jp/
15 if (!strcasecmp(METHOD, 'GET')) {
17 } elseif (!strcasecmp(METHOD, 'POST')) {
24 function colorbox($color_code, $id, $select=''){
25 $color_list = array();
26 foreach ($color_code as $k1 => $v1) {
27 foreach ($color_code as $v2) {
28 foreach ($color_code as $v3) {
29 $color_list[] = $v1.$v2.$v3;
33 array_unique($color_list);
36 foreach ($color_list as $k => $v) {
37 print'<option value="'.$v.'" style="color: #'.$v.'; font-weight:bold;" id="'.$id.'_'.$v.'"';
38 if ($select == $v) { print ' selected';}
39 print ' >#'.$v.'</option>'."\n";
44 function html_header($title, $window = false, $js = true, $no_cache = true) {
45 $header = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
46 $header .= '<html>'."\n";
47 $header .= '<head>'."\n";
48 $header .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'."\n";
49 $header .= '<meta http-equiv="Content-Style-Type" content="text/css" />'."\n";
51 $header .= '<meta http-equiv="Content-Script-Type" content="text/javascript" />'."\n";
54 $header .= '<meta http-equiv="Pragma" content="no-cache">'."\n";
55 $header .= '<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate">'."\n";
56 $header .= '<meta http-equiv="Expires" content="Thu, 01 Feb 2007 00:00:00 GMT">'."\n";
58 if ($window == 'pastlog') {
59 $header .= '<link rel="stylesheet" type="text/css" href="../css/trpgchat.css">'."\n";
61 $header .= '<link rel="stylesheet" type="text/css" href="./css/trpgchat.css">'."\n";
63 if ($window == 'index') {
64 $header .= '<link rel="stylesheet" type="text/css" href="./css/index.css">'."\n";
65 } elseif ($window == 'main') {
66 $header .= '<link rel="stylesheet" type="text/css" href="./css/main.css">'."\n";
67 } elseif ($window == 'pastlog') {
68 $header .= '<link rel="stylesheet" type="text/css" href="../css/main.css">'."\n";
70 $header .= '<title>'.$title.'</title>'."\n";
72 $header .= '<script type="text/javascript" src="./lib/js/jquery.js"></script>'."\n";
79 function html_footer($copyright = 'true') {
80 if ($copyright) $footer = '<p class="copyright">'.COPYRIGHT.'</p>'."\n";
81 $footer .= '</body>'."\n";
82 $footer .= '</html>'."\n";
88 function error($msg) {
89 print html_header('エラー', false, false, false);
92 print '<font color="red">エラー</font><br>'."\n";
94 print html_footer('');
99 function create_hash($name,$pwd) {
104 $key = substr(substr($pwd,1,2)."dummy",0,2);
105 $key = strtr($key,':;<=>?@[\]^_`','ABCDEFGabcdef');
106 $pwd = substr(crypt($name, $key), -10);