├── .gitattributes ├── .gitignore ├── README.md └── drrr ├── .htaccess ├── ajax.php ├── css ├── animation_off.png ├── animation_on.png ├── blue.png ├── box.png ├── gray.png ├── green.png ├── icon_admin.png ├── icon_gg.png ├── icon_kanra.png ├── icon_setton.png ├── icon_tanaka.png ├── icon_zaika.png ├── icon_zawa.png ├── kanra.png ├── logo.png ├── member_off.png ├── member_on.png ├── orange.png ├── pink.png ├── red.png ├── setting.png ├── setton.png ├── sound_off.png ├── sound_on.png ├── style.css ├── tail.png ├── tanaka.png └── zaika.png ├── dura.php ├── favicon.ico ├── fonts ├── Ubuntu Font License 1.0.txt ├── UbuntuMono-B-webfont.eot ├── UbuntuMono-B-webfont.svg ├── UbuntuMono-B-webfont.ttf ├── UbuntuMono-B-webfont.woff ├── UbuntuMono-BI-webfont.eot ├── UbuntuMono-BI-webfont.svg ├── UbuntuMono-BI-webfont.ttf ├── UbuntuMono-BI-webfont.woff ├── UbuntuMono-R-webfont.eot ├── UbuntuMono-R-webfont.svg ├── UbuntuMono-R-webfont.ttf ├── UbuntuMono-R-webfont.woff ├── UbuntuMono-RI-webfont.eot ├── UbuntuMono-RI-webfont.svg ├── UbuntuMono-RI-webfont.ttf ├── UbuntuMono-RI-webfont.woff ├── demo.html └── stylesheet.css ├── img ├── banner-200x200.png ├── banner-200x40-1.png ├── banner-200x40-2.png └── banner-80x15.png ├── index.php ├── js ├── jquery-ui.min.js ├── jquery.chat.js ├── jquery.corner.js ├── jquery.min.js ├── jquery.sound.js ├── language │ ├── en-US.js │ ├── ja-JP.js │ ├── ko-KR.js │ ├── ru-RU.js │ ├── zh-CN.js │ └── zh-TW.js ├── sound.mp3 └── translator.js ├── offline ├── banner.png └── index.html ├── readme ├── .htaccess ├── License.txt ├── readme-en.html ├── readme-ja.html ├── update1.0.1-to-1.0.2.txt └── update1.0.2-to-1.0.3.txt ├── setting.php └── trust_path ├── .htaccess ├── abstract └── controller.php ├── class ├── icon.php ├── room_session.php ├── ticket.php ├── user.php ├── xml.php └── xml_handler.php ├── controller ├── admin.php ├── admin_announce.php ├── create_room.php ├── default.php ├── logout.php ├── lounge.php └── room.php ├── language ├── en-US.php ├── ja-JP.php ├── ko-KR.php ├── list.php ├── ru-RU.php ├── zh-CN.php └── zh-TW.php ├── model ├── room.php └── room_handler.php ├── resource └── image.docx └── template ├── admin.default.php ├── admin_announce.default.php ├── create_room.default.php ├── default.default.php ├── footer.html ├── header.html ├── lounge.default.php ├── room.default.php ├── theme.php └── trans.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | drrr-like-chat 2 | ============== 3 | 4 | 无头骑士异闻录 聊天室 5 | 6 | 7 | 以下是原作者的说明 本项目由@FireAwayH要努力 修改 8 | 9 | Revise: Crow 10 | Revise URL: http://particularly.me/ 11 | 2012.11 12 | 13 | 版本修改说明: 14 | 功能上没动,反而我去掉了一些东西,其中有一点是保留了房主提示。 15 | 修改了默认的一些数字参数,例如人数房数。 16 | 大体上是在做美工。移动设备分辨率自适应。总体分为大,中,小屏幕。 17 | CN访问谷歌的问题JS库里需要的文件已搬到本地,不然加载飞慢且掉线。 18 | 但是房主功能被我擦掉了(你可以在原中文版里找到并按照你的方式修改进去)。 19 | 我试了下,但是没做到关闭浏览器窗口等于logout动作,因此非正常关闭窗口依旧需要等待断线。 20 | 如果你修改了退出动作,教我吧! 21 | 22 | 必须修改: 23 | 1.根目录setting.php文件,第12行http://localhost修改为您的地址,勿在结尾斜杠,否则地址多出1/。 24 | 25 | 其它修改: 26 | 1.trust_path/language/zh-CN.php文件第50和51行为标题。(语言文件) 27 | 2.trust_path/template/theme.php文件第6和7行为关键字与描述,第8行为ico文件URL。 28 | 29 | 其它: 30 | 声音文件位于js/sound.mp3 31 | 管理员地址位于登入页面左下角,它为10px大小的.隐藏存在,或者http://localhost/index.php?controller=admin 32 | 33 | setting.php文件的一些描述: 34 | define('DURA_USER_MIN', 3); 房间最小人数 35 | define('DURA_USER_MAX', 15); 房间最大人数 36 | define('DURA_ROOM_LIMIT', 10); 最大房间数 37 | define('DURA_SITE_USER_CAPACITY', 150); 最大总人数 38 | 等。 39 | 40 | 不能创建房间的 trust_path下新建一个名为xml的文件夹 权限777 (bae sae可以省略权限)即可 41 | 42 | 生活愉快~ 43 | 44 | Crow 45 | 2012.11.01 46 | -------------------------------------------------------------------------------- /drrr/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine on 2 | RewriteCond %{REQUEST_FILENAME} !-d 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteRule ^([a-z0-9_]+)/*$ index.php?controller=$1&%{QUERY_STRING} [L] 5 | RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/*$ index.php?controller=$1&action=$2&%{QUERY_STRING} [L] 6 | -------------------------------------------------------------------------------- /drrr/ajax.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | if ( file_exists('setting.php') ) 15 | { 16 | require 'setting.php'; 17 | } 18 | else 19 | { 20 | require 'setting.dist.php'; 21 | } 22 | 23 | require 'dura.php'; 24 | 25 | Dura::setup(); 26 | 27 | if ( !isset($_SESSION['room']['id']) ) 28 | { 29 | // Session not exists. 30 | header('Content-Type: application/xml; charset=UTF-8'); 31 | die('1'); 32 | } 33 | 34 | $id = $_SESSION['room']['id']; 35 | 36 | $roomHandler = new Dura_Model_RoomHandler; 37 | $roomModel = $roomHandler->load($id); 38 | 39 | if ( !$roomModel ) 40 | { 41 | // Room not found. 42 | header('Content-Type: application/xml; charset=UTF-8'); 43 | die('2'); 44 | } 45 | 46 | $file = $roomHandler->getFilePath($id); 47 | 48 | $content = md5(file_get_contents($file)); 49 | 50 | session_write_close(); 51 | 52 | if ( !isset($_GET['fast']) ) 53 | { 54 | for ( $i = 0; $i < DURA_SLEEP_LOOP; $i++ ) 55 | { 56 | if ( $content != md5(file_get_contents($file)) ) 57 | { 58 | break; 59 | } 60 | 61 | sleep(DURA_SLEEP_TIME); 62 | 63 | if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false ) // TODO 64 | { 65 | break; 66 | } 67 | } 68 | } 69 | 70 | $roomModel = $roomHandler->load($id); 71 | 72 | $userId = $_SESSION['user']->getId(); 73 | $isLogin = false; 74 | 75 | foreach ( $roomModel->users as $user ) 76 | { 77 | if ( $userId == (string) $user->id ) 78 | { 79 | $isLogin = true; 80 | } 81 | } 82 | 83 | if ( !$isLogin ) 84 | { 85 | session_name(DURA_SESSION_NAME); 86 | session_start(); 87 | unset($_SESSION['room']); 88 | // Room timeout. 89 | header('Content-Type: application/xml; charset=UTF-8'); 90 | die('3'); 91 | } 92 | 93 | $roomModel->addChild('error', 0); 94 | 95 | foreach ( $roomModel->talks as $talk ) 96 | { 97 | if ( (string) $talk->uid == 0 ) 98 | { 99 | $name = (string) $talk->name; 100 | $message = (string) $talk->message; 101 | 102 | $talk->message = t($message, $name); 103 | } 104 | } 105 | 106 | header('Content-Type: application/xml; charset=UTF-8'); 107 | die($roomModel->asXML()); 108 | 109 | ?> 110 | -------------------------------------------------------------------------------- /drrr/css/animation_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/animation_off.png -------------------------------------------------------------------------------- /drrr/css/animation_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/animation_on.png -------------------------------------------------------------------------------- /drrr/css/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/blue.png -------------------------------------------------------------------------------- /drrr/css/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/box.png -------------------------------------------------------------------------------- /drrr/css/gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/gray.png -------------------------------------------------------------------------------- /drrr/css/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/green.png -------------------------------------------------------------------------------- /drrr/css/icon_admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_admin.png -------------------------------------------------------------------------------- /drrr/css/icon_gg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_gg.png -------------------------------------------------------------------------------- /drrr/css/icon_kanra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_kanra.png -------------------------------------------------------------------------------- /drrr/css/icon_setton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_setton.png -------------------------------------------------------------------------------- /drrr/css/icon_tanaka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_tanaka.png -------------------------------------------------------------------------------- /drrr/css/icon_zaika.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_zaika.png -------------------------------------------------------------------------------- /drrr/css/icon_zawa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/icon_zawa.png -------------------------------------------------------------------------------- /drrr/css/kanra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/kanra.png -------------------------------------------------------------------------------- /drrr/css/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/logo.png -------------------------------------------------------------------------------- /drrr/css/member_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/member_off.png -------------------------------------------------------------------------------- /drrr/css/member_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/member_on.png -------------------------------------------------------------------------------- /drrr/css/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/orange.png -------------------------------------------------------------------------------- /drrr/css/pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/pink.png -------------------------------------------------------------------------------- /drrr/css/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/red.png -------------------------------------------------------------------------------- /drrr/css/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/setting.png -------------------------------------------------------------------------------- /drrr/css/setton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/setton.png -------------------------------------------------------------------------------- /drrr/css/sound_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/sound_off.png -------------------------------------------------------------------------------- /drrr/css/sound_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/sound_on.png -------------------------------------------------------------------------------- /drrr/css/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Durarara like chat Copyright 2010 Suin. get this chat? 3 | Suin: http://suin.asia/ 4 | Durarara like chat: http://code.google.com/p/drrr-like-chat/ 5 | Revise: Crow 6 | Revise URL: http://particularly.me/ 7 | */ 8 | BACKGROUND: url(http://lovejiani.com/beta/css/logo.png) no-repeat center top; WIDTH: 850px; TOP: 10px; HEIGHT: 350px 9 | 10 | * { 11 | margin: 0; 12 | padding-bottom: 0; 13 | padding-left: 0; 14 | padding-right: 0; 15 | padding-top: 0; 16 | } 17 | 18 | body { 19 | background:#0a0a0a; 20 | color:#fff; 21 | font-size:16px; 22 | font-family:'Microsoft Yahei'; 23 | } 24 | 25 | input,textarea { 26 | font-family:'Microsoft Yahei'; 27 | } 28 | 29 | .clear { 30 | clear:both; 31 | } 32 | 33 | .right { 34 | float:left; 35 | } 36 | 37 | .transparent { 38 | opacity:0.8; 39 | } 40 | 41 | div#body { 42 | position:absolute; 43 | height:312px; 44 | width:100%; 45 | top:100px; 46 | margin-top:-70px; 47 | } 48 | 49 | div.header { 50 | color:#fff; 51 | } 52 | 53 | div.header h2 { 54 | text-align:center; 55 | font-size:20px; 56 | margin-bottom:20px; 57 | } 58 | 59 | .button { 60 | color:#444; 61 | display:inline-block; 62 | font:normal 12px arial, sans-serif; 63 | height:24px; 64 | margin-left:5px; 65 | margin-top:-5px; 66 | text-decoration:none; 67 | } 68 | 69 | .button input { 70 | background-color:#000; 71 | border-radius:18px; 72 | -webkit-border-radius:18px; 73 | -moz-border-radius:18px; 74 | border:3px solid #FFF; 75 | outline:none; 76 | width:160px; 77 | font-weight:700; 78 | font-size:20px; 79 | color:#FFF; 80 | overflow:hidden; 81 | resize:none; 82 | -webkit-transition:.4s; 83 | -moz-transition:.4s; 84 | -o-transition:.4s; 85 | transition:.4s; 86 | font-family:'Microsoft YaHei'; 87 | } 88 | 89 | .button:active { 90 | background-position:bottom right; 91 | color:#000; 92 | outline:none; 93 | } 94 | 95 | .button:active input { 96 | background-color:#FFF; 97 | cursor:pointer; 98 | color:#575757; 99 | } 100 | 101 | .button:active input { 102 | background-color:#FFF; 103 | cursor:pointer; 104 | color:#575757; 105 | } 106 | 107 | .buttonc { 108 | color:#444; 109 | display:inline-block; 110 | font:normal 12px arial, sans-serif; 111 | height:24px; 112 | margin-left:5px; 113 | margin-top:-5px; 114 | text-decoration:none; 115 | } 116 | 117 | .buttonc input { 118 | background-color:#000; 119 | border-radius:18px; 120 | -webkit-border-radius:18px; 121 | -moz-border-radius:18px; 122 | border:3px solid #FFF; 123 | outline:none; 124 | width:200px; 125 | font-weight:700; 126 | font-size:20px; 127 | color:#FFF; 128 | overflow:hidden; 129 | resize:none; 130 | -webkit-transition:.4s; 131 | -moz-transition:.4s; 132 | -o-transition:.4s; 133 | transition:.4s; 134 | font-family:'Microsoft YaHei'; 135 | margin-left:4px; 136 | } 137 | 138 | .buttonc:active { 139 | background-position:bottom right; 140 | color:#000; 141 | outline:none; 142 | } 143 | 144 | .buttonc:active input { 145 | background-color:#FFF; 146 | cursor:pointer; 147 | color:#575757; 148 | } 149 | 150 | #login .field .button input { 151 | background-color:#000; 152 | border-radius:18px; 153 | -webkit-border-radius:18px; 154 | -moz-border-radius:18px; 155 | border:3px solid #FFF; 156 | outline:none; 157 | width:200px; 158 | font-weight:700; 159 | font-size:20px; 160 | color:#FFF; 161 | overflow:hidden; 162 | resize:none; 163 | -webkit-transition:.4s; 164 | -moz-transition:.4s; 165 | -o-transition:.4s; 166 | transition:.4s; 167 | font-family:UbuntuMonoBold,'Microsoft YaHei'; 168 | padding:1px 0; 169 | } 170 | 171 | #login .field .button input:active { 172 | background-position:bottom right; 173 | background-color:#FFF; 174 | cursor:pointer; 175 | color:#575757; 176 | outline:none; 177 | } 178 | 179 | div.message_box { 180 | position:fixed; 181 | width:100%; 182 | top:0; 183 | left:0; 184 | background:#fff; 185 | color:#0a0a0a; 186 | z-index:99999; 187 | border-bottom:1px solid #1D1D1D; 188 | padding:5px 0 0; 189 | } 190 | 191 | div.message_box h2 { 192 | font-size:12px; 193 | margin-top:29px; 194 | float:right; 195 | right:12px; 196 | list-style:none; 197 | position:fixed; 198 | z-index:99999; 199 | } 200 | 201 | div.message_box_inner { 202 | position:relative; 203 | width:510px; 204 | left:50%; 205 | margin-left:-255px; 206 | } 207 | 208 | ul.menu { 209 | float:right; 210 | right:0; 211 | list-style:none; 212 | color:#FFF; 213 | font-size:12px; 214 | margin-top:-17px; 215 | } 216 | 217 | ul.menu li { 218 | display:block; 219 | cursor:pointer; 220 | } 221 | 222 | ul.menu li input { 223 | font-size:12px; 224 | height:15px; 225 | line-height:12px; 226 | cursor:pointer; 227 | color:#FFF; 228 | border:1px #C80000 solid; 229 | background-color:#C80000; 230 | -webkit-transition:.3s; 231 | -moz-transition:.3s; 232 | -o-transition:.3s; 233 | transition:.3s; 234 | margin-right:1px; 235 | border-radius:2px; 236 | -webkit-border-radius:2px; 237 | -moz-border-radius:2px; 238 | padding:1px; 239 | } 240 | 241 | ul.menu li input:hover { 242 | border:1px #9D9D9D solid; 243 | background-color:#9D9D9D; 244 | } 245 | 246 | ul.menu li input:active { 247 | color:#5A5A5A; 248 | border:1px #E7E7E7 solid; 249 | background-color:#E7E7E7; 250 | } 251 | 252 | ul.menu li.setting,ul.menu li.sound,ul.menu li.member,ul.menu li.animation { 253 | width:15px; 254 | display:none; 255 | } 256 | 257 | ul.menu li.setting { 258 | background:transparent url(setting.png) left top no-repeat; 259 | } 260 | 261 | ul.menu li.sound_on { 262 | background:transparent url(sound_on.png) left top no-repeat; 263 | } 264 | 265 | ul.menu li.sound_off { 266 | background:transparent url(sound_off.png) left top no-repeat; 267 | } 268 | 269 | ul.menu li.member_on { 270 | background:transparent url(member_on.png) left top no-repeat; 271 | } 272 | 273 | ul.menu li.member_off { 274 | background:transparent url(member_off.png) left top no-repeat; 275 | } 276 | 277 | ul.menu li.animation_on { 278 | background:transparent url(animation_on.png) left top no-repeat; 279 | } 280 | 281 | ul.menu li.animation_off { 282 | background:transparent url(animation_off.png) left top no-repeat; 283 | } 284 | 285 | #setting_pannel { 286 | clear:both; 287 | padding:20px 0; 288 | } 289 | 290 | #setting_pannel ul#user_list { 291 | list-style:none; 292 | } 293 | 294 | #setting_pannel ul#user_list li { 295 | min-height:20px; 296 | width:80px; 297 | padding-top:50px; 298 | text-align:center; 299 | display:block; 300 | float:left; 301 | line-height:20px; 302 | border:2px solid transparent; 303 | margin:10px; 304 | } 305 | 306 | #message { 307 | text-align:center; 308 | margin-top:19px; 309 | margin-bottom:1px; 310 | } 311 | 312 | #message textarea { 313 | background-color:#FFF; 314 | border-radius:18px; 315 | -webkit-border-radius:18px; 316 | -moz-border-radius:18px; 317 | box-shadow:0 0 5px #5E5E5E; 318 | -webkit-box-shadow:0 0 5px #5E5E5E; 319 | -moz-box-shadow:0 0 5px #5E5E5E; 320 | border:3px solid #5E5E5E; 321 | outline:none; 322 | width:490px; 323 | font-family:'Microsoft Yahei'; 324 | font-weight:700; 325 | font-size:18px; 326 | color:#2D2D2D; 327 | overflow:hidden; 328 | resize:none; 329 | -webkit-transition:.4s; 330 | -moz-transition:.4s; 331 | -o-transition:.4s; 332 | transition:.4s; 333 | padding:6px 5px 14px 7px; 334 | } 335 | 336 | #message textarea:hover { 337 | box-shadow:0 0 6px #575757; 338 | -webkit-box-shadow:0 0 6px #575757; 339 | -moz-box-shadow:0 0 6px #575757; 340 | border:3px solid #575757; 341 | } 342 | 343 | #message div.submit input { 344 | background-color:#FFF; 345 | border-radius:15px; 346 | -webkit-border-radius:15px; 347 | -moz-border-radius:15px; 348 | border:3px solid #5E5E5E; 349 | outline:none; 350 | width:210px; 351 | font-family:UbuntuMonoBold,'Microsoft Yahei'; 352 | font-weight:700; 353 | font-size:20px; 354 | color:#5E5E5E; 355 | background:0; 356 | -webkit-transition:.35s; 357 | -moz-transition:.35s; 358 | -o-transition:.35s; 359 | transition:.35s; 360 | margin:5px 0 7px; 361 | padding:2px 0 2px; 362 | background:-webkit-linear-gradient(white 50%,#EAEAEA 50.1%,#DEDEDE); 363 | } 364 | 365 | #message div.submit input:hover { 366 | cursor:pointer; 367 | box-shadow:0 0 3px #5E5E5E; 368 | -webkit-box-shadow:0 0 3px #5E5E5E; 369 | -moz-box-shadow:0 0 3px #5E5E5E; 370 | color:#575757; 371 | } 372 | 373 | #message div.submit input:active { 374 | cursor:pointer; 375 | box-shadow:0 0 6px #5E5E5E; 376 | -webkit-box-shadow:0 0 6px #5E5E5E; 377 | -moz-box-shadow:0 0 6px #5E5E5E; 378 | color:#575757; 379 | } 380 | 381 | #talks { 382 | margin-top:167px; 383 | padding-bottom:1px; 384 | position:absolute; 385 | width:623px; 386 | left:50%; 387 | margin-left:-369px; 388 | } 389 | 390 | #talks div.system { 391 | letter-spacing:3px; 392 | clear:left; 393 | margin:10px 0 10px 26px; 394 | } 395 | 396 | #talks dl.talk { 397 | clear:both; 398 | min-height:80px; 399 | } 400 | 401 | #talks dl.talk dt { 402 | min-height:20px; 403 | width:90px; 404 | padding-top:75px; 405 | padding-bottom:7px; 406 | text-align:center; 407 | display:block; 408 | line-height:20px; 409 | float:left; 410 | font-size:14px; 411 | } 412 | 413 | #talks dl.talk dd { 414 | display:inline-block; 415 | max-width:523px; 416 | padding-left:10px; 417 | } 418 | 419 | #talks dl.talk dd div.bubble p.body { 420 | float:left; 421 | clear:left; 422 | border-radius:13px; 423 | border:4px #fff solid; 424 | -moz-border-radius:13px; 425 | -webkit-border-radius:13px; 426 | background:#000; 427 | font:1em 'Microsoft Yahei'; 428 | letter-spacing:3px; 429 | color:#FFF; 430 | -position:relative; 431 | padding:16px 20px; 432 | } 433 | 434 | #talks dl.setton dt { 435 | background:transparent url(icon_setton.png) no-repeat center top; 436 | } 437 | 438 | #talks dl.setton dd div.bubble p.body { 439 | background:transparent url(gray.png) repeat-x left center; 440 | } 441 | 442 | #talks dl.tanaka dt { 443 | background:transparent url(icon_tanaka.png) no-repeat center top; 444 | } 445 | 446 | #talks dl.tanaka dd div.bubble p.body { 447 | background:transparent url(blue.png) repeat-x left center; 448 | } 449 | 450 | #talks dl.kanra dt { 451 | background:transparent url(icon_kanra.png) no-repeat center top; 452 | } 453 | 454 | #talks dl.zaika dt { 455 | background:transparent url(icon_zaika.png) no-repeat center top; 456 | } 457 | 458 | #talks dl.zawa dd div.bubble p.body { 459 | background:transparent url(green.png) repeat-x left center; 460 | } 461 | 462 | #talks dl.zawa dt { 463 | background:transparent url(icon_zawa.png) no-repeat center top; 464 | } 465 | 466 | #talks dl.zaika dd div.bubble p.body { 467 | background:transparent url(red.png) repeat-x left center; 468 | } 469 | 470 | #talks dl.gg dt { 471 | background:transparent url(icon_gg.png) no-repeat center top; 472 | } 473 | 474 | #talks dl.gg dd div.bubble p.body { 475 | background:transparent url(pink.png) repeat-x left center; 476 | } 477 | 478 | #talks dl.admin dt { 479 | background:transparent url(icon_admin.png) no-repeat center top; 480 | } 481 | 482 | #login .language,#logingo .language { 483 | text-align:right; 484 | } 485 | 486 | #login .field,#logingo .field { 487 | text-align:center; 488 | width:280px; 489 | } 490 | 491 | #login .field .textbox,#logingo .field .textbox { 492 | width:169px; 493 | height:23px; 494 | font-size:20px; 495 | letter-spacing:1px; 496 | text-align:center; 497 | border:1px solid #fff; 498 | border-radius:7px; 499 | -webkit-border-radius:7px; 500 | -moz-border-radius:7px; 501 | font-family:UbuntuMonoBold,'Microsoft YaHei'; 502 | margin:40px 0 25px 3px; 503 | padding:1px; 504 | } 505 | 506 | .t_name, .t_pass { 507 | text-transform: uppercase; 508 | font-weight: bold; 509 | font-size: 14px; 510 | padding: 0; 511 | margin: 0; 512 | } 513 | 514 | #login .footer,#logingo .footer { 515 | text-align:center; 516 | clear:both; 517 | color:#8a8a8a; 518 | font-size:13px; 519 | margin:40px 0 20px; 520 | } 521 | 522 | #login .copyright,#logingo .copyright { 523 | text-align:center; 524 | clear:both; 525 | color:#8a8a8a; 526 | font-size:10px; 527 | margin:40px 0 20px; 528 | } 529 | 530 | .notice { 531 | text-align:left; 532 | font-size:11px; 533 | 534 | } 535 | 536 | ul.icons { 537 | list-style-type:none; 538 | float:center; 539 | width:312px; 540 | margin-top:26px; 541 | } 542 | 543 | ul.icons li { 544 | display:block; 545 | float:left; 546 | width:64px; 547 | text-align:center; 548 | margin:2px 7px; 549 | } 550 | 551 | #create_room { 552 | float:right; 553 | margin-bottom:10px; 554 | } 555 | 556 | ul#profile { 557 | float:left; 558 | width:612px; 559 | list-style-type:none; 560 | background:#0a0a0a; 561 | border-radius:13px; 562 | border:4px gray solid; 563 | -moz-border-radius:13px; 564 | -webkit-border-radius:13px; 565 | margin:20px 0; 566 | } 567 | 568 | ul#profile li { 569 | display:block; 570 | float:left; 571 | vertical-align:middle; 572 | height:60px; 573 | margin:15px 0; 574 | } 575 | 576 | ul#profile li.icon { 577 | width:60px; 578 | margin-left:15px; 579 | } 580 | 581 | ul#profile li.name { 582 | min-width:50px; 583 | color:#fff; 584 | font-size:16px; 585 | text-align:left; 586 | line-height:60px; 587 | padding:5px 0 0 25px; 588 | } 589 | 590 | ul#profile li.logout { 591 | float:right; 592 | line-height:60px; 593 | margin:20px 10px; 594 | } 595 | 596 | ul.rooms { 597 | list-style-type:none; 598 | clear:both; 599 | margin-bottom:10px; 600 | } 601 | 602 | ul.rooms li { 603 | list-style-type:none; 604 | display:block; 605 | text-align:center; 606 | float:left; 607 | padding:8px 0; 608 | } 609 | 610 | ul.rooms li.name { 611 | width:180px; 612 | text-align:left; 613 | } 614 | 615 | ul.rooms li.creater { 616 | width:170px; 617 | } 618 | 619 | ul.rooms li.member { 620 | width:65px; 621 | margin-top:1px; 622 | } 623 | 624 | ul.rooms li.login { 625 | text-align:left; 626 | } 627 | 628 | ul#members { 629 | list-style-type:none; 630 | text-align:left; 631 | clear:both; 632 | } 633 | 634 | ul#members li { 635 | display:inline; 636 | } 637 | 638 | .error { 639 | text-align:center; 640 | margin-bottom:10px; 641 | } 642 | 643 | #pro { 644 | position:absolute; 645 | width:620px; 646 | left:50%; 647 | margin-left:-310px; 648 | } 649 | 650 | #cra { 651 | position:absolute; 652 | width:260px; 653 | left:50%; 654 | margin-left:-130px; 655 | height:130px; 656 | top:50%; 657 | margin-top:-65px; 658 | } 659 | 660 | .input { 661 | color:#fff; 662 | background-color:#0a0a0a; 663 | border:0; 664 | font-size:12px; 665 | padding-right:1px; 666 | padding-bottom:1px; 667 | -webkit-transition:.25s; 668 | -moz-transition:.25s; 669 | -o-transition:.25s; 670 | transition:.25s; 671 | } 672 | 673 | .input:active { 674 | color:gray; 675 | } 676 | 677 | .x { 678 | width:248px; 679 | font-size:16px; 680 | letter-spacing:1px; 681 | border:1px solid #fff; 682 | border-radius:4px; 683 | -webkit-border-radius:4px; 684 | -moz-border-radius:4px; 685 | padding:3px; 686 | } 687 | 688 | .x0 { 689 | font-size:16px; 690 | letter-spacing:1px; 691 | border:0; 692 | border-radius:4px; 693 | -webkit-border-radius:4px; 694 | -moz-border-radius:4px; 695 | margin-left:-55px; 696 | padding:3px; 697 | } 698 | 699 | #logingo { 700 | position:absolute; 701 | height:160px; 702 | top:50%; 703 | margin-top:-115px; 704 | width:280px; 705 | left:50%; 706 | margin-left:-140px; 707 | } 708 | 709 | ul.icons li img { 710 | -webkit-filter:grayscale(.85); 711 | -webkit-transition:99999s; 712 | -moz-transition:99999s; 713 | -o-transition:99999s; 714 | transition:99999s; 715 | } 716 | 717 | ul.icons li img:active { 718 | -webkit-filter:grayscale(0); 719 | -webkit-transition:0; 720 | -moz-transition:0; 721 | -o-transition:0; 722 | transition:0; 723 | } 724 | 725 | .admind { 726 | position:fixed; 727 | bottom:0px; 728 | left:0px; 729 | font-size:6px; 730 | text-decoration:none; 731 | color:#0A0A0A; 732 | } 733 | 734 | input,button,select,textarea { 735 | outline:none; 736 | font-family:UbuntuMonoBold,'Microsoft YaHei'; 737 | } 738 | 739 | @font-face { 740 | font-family:UbuntuMonoBold; 741 | src:url(../fonts/UbuntuMono-B-webfont.eot?#iefix) format(embedded-opentype), url(../fonts/UbuntuMono-B-webfont.woff) format(woff), url(../fonts/UbuntuMono-B-webfont.ttf) format(truetype), url(../fonts/UbuntuMono-B-webfont.svg#UbuntuMonoBold) format(svg); 742 | font-weight:400; 743 | font-style:normal; 744 | } 745 | 746 | .hide,label input { 747 | display:none; 748 | } 749 | 750 | #setting_pannel ul#user_list li.select,#talks dl.talk dt.select { 751 | border:2px solid #f60; 752 | } 753 | 754 | #talks dl.kanra dd div.bubble p.body,#talks dl.admin dd div.bubble p.body { 755 | background:transparent url(orange.png) repeat-x left center; 756 | } 757 | 758 | @media (max-width:720px) { 759 | ul#profile { 760 | margin:10px 0; 761 | } 762 | 763 | #pro { 764 | padding-bottom:7px; 765 | } 766 | 767 | ul.rooms li.member { 768 | margin-top:0px; 769 | } 770 | 771 | div.header h2 { 772 | margin-bottom:15px; 773 | } 774 | 775 | #message textarea { 776 | width:420px; 777 | } 778 | 779 | #talks { 780 | width:560px; 781 | margin-left:-324px; 782 | } 783 | 784 | #talks dl.talk dd { 785 | max-width:453px; 786 | padding-left:0px; 787 | } 788 | 789 | div.message_box_inner { 790 | width: 440px; 791 | margin-left:-220px; 792 | } 793 | } 794 | 795 | @media (max-width:570px) { 796 | ul#profile { 797 | width:306px; 798 | margin:5px 0; 799 | } 800 | 801 | #pro { 802 | width:310px; 803 | margin-left:-157px; 804 | padding-bottom:4px; 805 | } 806 | 807 | ul.rooms li.name { 808 | width:120px; 809 | text-align:left; 810 | } 811 | 812 | ul.rooms li.creater { 813 | width:75px; 814 | } 815 | 816 | ul.rooms li.member { 817 | width:50px; 818 | margin-top:0px; 819 | } 820 | 821 | body { 822 | font-size:12px; 823 | } 824 | 825 | .button input { 826 | width:60px; 827 | font-size:12px; 828 | border:2px solid white; 829 | } 830 | 831 | #create_room { 832 | margin-bottom:3px; 833 | } 834 | 835 | ul.rooms li { 836 | padding:3px 0; 837 | } 838 | 839 | div.header h2 { 840 | margin-bottom:10px; 841 | } 842 | 843 | #message textarea { 844 | width:250px; 845 | } 846 | 847 | #talks { 848 | width:320px; 849 | margin-left:-160px; 850 | } 851 | 852 | #talks dl.talk dd { 853 | max-width:220px; 854 | padding-left:0px; 855 | } 856 | 857 | div.message_box_inner { 858 | width: 270px; 859 | margin-left:-135px; 860 | } 861 | 862 | #talks { 863 | margin-top:157px; 864 | } 865 | 866 | #message { 867 | margin-top:10px; 868 | } 869 | } 870 | 871 | .t_toggle a { 872 | color: #555; 873 | text-decoration: none; 874 | } 875 | 876 | 877 | 878 | /* webkit scroller */ 879 | ::-webkit-scrollbar-thumb:vertical{height:10px;background-color:#ccc;} 880 | ::-webkit-scrollbar{width:10px;height:5px;background:#FFF;margin-right:15px;} 881 | -------------------------------------------------------------------------------- /drrr/css/tail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/tail.png -------------------------------------------------------------------------------- /drrr/css/tanaka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/tanaka.png -------------------------------------------------------------------------------- /drrr/css/zaika.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/css/zaika.png -------------------------------------------------------------------------------- /drrr/dura.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura 15 | { 16 | public static $controller; 17 | public static $action; 18 | 19 | public static $Controller; 20 | public static $Action; 21 | 22 | public static $roomId; 23 | 24 | public static $catalog = array(); 25 | public static $language = null; 26 | 27 | public static function setup() 28 | { 29 | if ( defined('DURA_LOADED') ) return; 30 | 31 | define('DURA_VERSION', '1.0.3'); 32 | 33 | spl_autoload_register(array(__CLASS__, 'autoload')); 34 | 35 | session_name(DURA_SESSION_NAME); 36 | session_start(); 37 | 38 | self::user()->loadSession(); 39 | 40 | mb_internal_encoding('UTF-8'); 41 | 42 | $langFile = DURA_TRUST_PATH.'/language/'.self::user()->getLanguage().'.php'; 43 | self::$language = self::user()->getLanguage(); 44 | 45 | if ( !file_exists($langFile) ) 46 | { 47 | $langFile = DURA_TRUST_PATH.'/language/'.DURA_LANGUAGE.'.php'; 48 | self::$language = DURA_LANGUAGE; 49 | } 50 | 51 | self::$catalog = require $langFile; 52 | 53 | define('DURA_LOADED', true); 54 | } 55 | 56 | public static function execute() 57 | { 58 | $controller = self::get('controller', 'default'); 59 | $action = self::get('action', 'default'); 60 | 61 | self::$Controller = self::putintoClassParts($controller); 62 | self::$Action = self::putintoClassParts($action); 63 | 64 | self::$controller = self::putintoPathParts(self::$Controller); 65 | self::$action = self::putintoPathParts(self::$Action); 66 | 67 | self::$Action[0] = strtolower(self::$Action[0]); 68 | 69 | $class = 'Dura_Controller_'.self::$Controller; 70 | 71 | if ( !class_exists($class) ) 72 | { 73 | die("Invalid Access"); 74 | } 75 | 76 | $instance = new $class(); 77 | $instance->main(); 78 | 79 | self::user()->updateExpire(); 80 | 81 | unset($instance); 82 | } 83 | 84 | public static function autoload($class) 85 | { 86 | if ( class_exists($class, false) ) return; 87 | if ( !preg_match('/^Dura_/', $class) ) return; 88 | 89 | $parts = explode('_', $class); 90 | $parts = array_map(array(__CLASS__, 'putintoPathParts'), $parts); 91 | 92 | $module = array_shift($parts); 93 | 94 | $class = implode('/', $parts); 95 | $path = sprintf('%s/%s.php', DURA_TRUST_PATH, $class); 96 | 97 | if ( !file_exists($path) ) return; 98 | 99 | require $path; 100 | } 101 | 102 | public static function get($name, $default = null) 103 | { 104 | $request = ( isset($_GET[$name]) ) ? $_GET[$name] : $default; 105 | if ( get_magic_quotes_gpc() and !is_array($request) ) $request = stripslashes($request); 106 | return $request; 107 | } 108 | 109 | public static function post($name, $default = null) 110 | { 111 | $request = ( isset($_POST[$name]) ) ? $_POST[$name] : $default; 112 | if ( get_magic_quotes_gpc() and !is_array($request) ) $request = stripslashes($request); 113 | return $request; 114 | } 115 | 116 | public static function putintoClassParts($str) 117 | { 118 | $str = preg_replace('/[^a-z0-9_]/', '', $str); 119 | $str = explode('_', $str); 120 | $str = array_map('trim', $str); 121 | $str = array_diff($str, array('')); 122 | $str = array_map('ucfirst', $str); 123 | $str = implode('', $str); 124 | return $str; 125 | } 126 | 127 | public static function putintoPathParts($str) 128 | { 129 | $str = preg_replace('/[^a-zA-Z0-9]/', '', $str); 130 | $str = preg_replace('/([A-Z])/', '_$1', $str); 131 | $str = strtolower($str); 132 | $str = substr($str, 1, strlen($str)); 133 | return $str; 134 | } 135 | 136 | public static function escapeHtml($string) 137 | { 138 | return htmlspecialchars($string, ENT_QUOTES); 139 | } 140 | 141 | public static function redirect($controller = null, $action = null, $extra = array()) 142 | { 143 | $url = self::url($controller, $action, $extra); 144 | header('Location: '.$url); 145 | die; 146 | } 147 | 148 | public static function url($controller = null, $action = null, $extra = array()) 149 | { 150 | $params = array(); 151 | 152 | if ( DURA_USE_REWRITE ) 153 | { 154 | $url = DURA_URL.'/'; 155 | } 156 | else 157 | { 158 | $url = DURA_URL.'/index.php'; 159 | } 160 | 161 | if ( $controller ) 162 | { 163 | if ( DURA_USE_REWRITE ) 164 | { 165 | $url .= $controller.'/'; 166 | } 167 | else 168 | { 169 | $params['controller'] = $controller; 170 | } 171 | } 172 | 173 | if ( $action ) 174 | { 175 | if ( DURA_USE_REWRITE ) 176 | { 177 | $url .= $action.'/'; 178 | } 179 | else 180 | { 181 | $params['action'] = $action; 182 | } 183 | } 184 | 185 | if ( is_array($extra) ) 186 | { 187 | $params = array_merge($params, $extra); 188 | } 189 | 190 | if ( $param = http_build_query($params) ) 191 | { 192 | $url .= '?'.$param; 193 | } 194 | 195 | return $url; 196 | } 197 | 198 | public static function &user() 199 | { 200 | $user =& Dura_Class_User::getInstance(); 201 | return $user; 202 | } 203 | 204 | public static function getUrl() 205 | { 206 | if ( isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on' ) 207 | { 208 | $protocol = 'https://'; 209 | } 210 | else 211 | { 212 | $protocol = 'http://'; 213 | } 214 | 215 | $url = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; 216 | 217 | $parts = parse_url($url); 218 | 219 | if ( preg_match('/\.php$/', $parts['path']) ) 220 | { 221 | $url = dirname($url); 222 | } 223 | elseif ( preg_match('/\/$/', $parts['path']) ) 224 | { 225 | $url = substr($url, 0, -1); 226 | } 227 | 228 | return $url; 229 | } 230 | 231 | public static function trans($message, $controller = null, $action = null, $extra = array()) 232 | { 233 | $url = self::url($controller, $action, $extra); 234 | 235 | $url = self::escapeHtml($url); 236 | $message = self::escapeHtml($message); 237 | 238 | require DURA_TEMPLATE_PATH.'/trans.php'; 239 | die; 240 | } 241 | } 242 | 243 | function t($message) 244 | { 245 | if ( isset(Dura::$catalog[$message]) ) 246 | { 247 | $message = Dura::$catalog[$message]; 248 | } 249 | 250 | if ( func_num_args() == 1 ) return $message; 251 | 252 | $params = func_get_args(); 253 | 254 | foreach ( $params as $i => $param ) 255 | { 256 | $message = str_replace('{'.$i.'}', $param, $message); 257 | } 258 | 259 | return $message; 260 | } 261 | 262 | function e($string) 263 | { 264 | echo $string; 265 | } 266 | 267 | ?> 268 | -------------------------------------------------------------------------------- /drrr/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/favicon.ico -------------------------------------------------------------------------------- /drrr/fonts/Ubuntu Font License 1.0.txt: -------------------------------------------------------------------------------- 1 | ------------------------------- UBUNTU FONT LICENSE Version 1.0 ------------------------------- 2 | 3 | PREAMBLE 4 | This License allows the licensed fonts to be used, studied, modified and redistributed freely. The fonts, including any derivative works, can be bundled, embedded, and redistributed provided the terms of this license are met. The fonts and derivatives, however, cannot be released under any other license. The requirement for fonts to remain under this license does not require any document created using the fonts or their derivatives to be published under this license, as long as the primary purpose of the document is not to be a vehicle for the distribution of the fonts. 5 | 6 | DEFINITIONS 7 | "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. 8 | 9 | "Original Version" refers to the collection of Font Software components as received under this license. 10 | 11 | "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. 12 | 13 | "Copyright Holder(s)" refers to all individuals and companies who have a copyright ownership of the Font Software. 14 | 15 | "Substantially Changed" refers to Modified Versions which can be easily identified as dissimilar to the Font Software by users of the Font Software comparing the Original Version with the Modified Version. 16 | 17 | To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification and with or without charging a redistribution fee), making available to the public, and in some countries other activities as well. 18 | 19 | PERMISSION & CONDITIONS 20 | This license does not grant any rights under trademark law and all such rights are reserved. 21 | 22 | Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to propagate the Font Software, subject to the below conditions: 23 | 24 | 1) Each copy of the Font Software must contain the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine- readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 25 | 26 | 2) The font name complies with the following: (a) The Original Version must retain its name, unmodified. (b) Modified Versions which are Substantially Changed must be renamed to avoid use of the name of the Original Version or similar names entirely. (c) Modified Versions which are not Substantially Changed must be renamed to both (i) retain the name of the Original Version and (ii) add additional naming elements to distinguish the Modified Version from the Original Version. The name of such Modified Versions must be the name of the Original Version, with "derivative X" where X represents the name of the new work, appended to that name. 27 | 28 | 3) The name(s) of the Copyright Holder(s) and any contributor to the Font Software shall not be used to promote, endorse or advertise any Modified Version, except (i) as required by this license, (ii) to acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with their explicit written permission. 29 | 30 | 4) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not affect any document created using the Font Software, except any version of the Font Software extracted from a document created using the Font Software may only be distributed under this license. 31 | 32 | TERMINATION 33 | This license becomes null and void if any of the above conditions are not met. 34 | 35 | DISCLAIMER THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 36 | -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-B-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-B-webfont.eot -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-B-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-B-webfont.ttf -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-B-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-B-webfont.woff -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-BI-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-BI-webfont.eot -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-BI-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-BI-webfont.ttf -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-BI-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-BI-webfont.woff -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-R-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-R-webfont.eot -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-R-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-R-webfont.ttf -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-R-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-R-webfont.woff -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-RI-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-RI-webfont.eot -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-RI-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-RI-webfont.ttf -------------------------------------------------------------------------------- /drrr/fonts/UbuntuMono-RI-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/fonts/UbuntuMono-RI-webfont.woff -------------------------------------------------------------------------------- /drrr/fonts/demo.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | Font Face Demo 9 | 10 | 24 | 25 | 26 | 27 |
28 |

Font-face Demo for the Ubuntu Mono Font

29 | 30 | 31 | 32 |

Ubuntu Mono Regular - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

33 | 34 | 35 | 36 |

Ubuntu Mono Italic - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

37 | 38 | 39 | 40 |

Ubuntu Mono Bold - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

41 | 42 | 43 | 44 |

Ubuntu Mono Bold Italic - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

45 | 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /drrr/fonts/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Generated by Font Squirrel (http://www.fontsquirrel.com) on October 26, 2012 02:27:39 PM America/New_York */ 2 | 3 | 4 | 5 | @font-face { 6 | font-family: 'UbuntuMonoRegular'; 7 | src: url('UbuntuMono-R-webfont.eot'); 8 | src: url('UbuntuMono-R-webfont.eot?#iefix') format('embedded-opentype'), 9 | url('UbuntuMono-R-webfont.woff') format('woff'), 10 | url('UbuntuMono-R-webfont.ttf') format('truetype'), 11 | url('UbuntuMono-R-webfont.svg#UbuntuMonoRegular') format('svg'); 12 | font-weight: normal; 13 | font-style: normal; 14 | 15 | } 16 | 17 | @font-face { 18 | font-family: 'UbuntuMonoItalic'; 19 | src: url('UbuntuMono-RI-webfont.eot'); 20 | src: url('UbuntuMono-RI-webfont.eot?#iefix') format('embedded-opentype'), 21 | url('UbuntuMono-RI-webfont.woff') format('woff'), 22 | url('UbuntuMono-RI-webfont.ttf') format('truetype'), 23 | url('UbuntuMono-RI-webfont.svg#UbuntuMonoItalic') format('svg'); 24 | font-weight: normal; 25 | font-style: normal; 26 | 27 | } 28 | 29 | @font-face { 30 | font-family: 'UbuntuMonoBold'; 31 | src: url('UbuntuMono-B-webfont.eot'); 32 | src: url('UbuntuMono-B-webfont.eot?#iefix') format('embedded-opentype'), 33 | url('UbuntuMono-B-webfont.woff') format('woff'), 34 | url('UbuntuMono-B-webfont.ttf') format('truetype'), 35 | url('UbuntuMono-B-webfont.svg#UbuntuMonoBold') format('svg'); 36 | font-weight: normal; 37 | font-style: normal; 38 | 39 | } 40 | 41 | @font-face { 42 | font-family: 'UbuntuMonoBoldItalic'; 43 | src: url('UbuntuMono-BI-webfont.eot'); 44 | src: url('UbuntuMono-BI-webfont.eot?#iefix') format('embedded-opentype'), 45 | url('UbuntuMono-BI-webfont.woff') format('woff'), 46 | url('UbuntuMono-BI-webfont.ttf') format('truetype'), 47 | url('UbuntuMono-BI-webfont.svg#UbuntuMonoBoldItalic') format('svg'); 48 | font-weight: normal; 49 | font-style: normal; 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /drrr/img/banner-200x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/img/banner-200x200.png -------------------------------------------------------------------------------- /drrr/img/banner-200x40-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/img/banner-200x40-1.png -------------------------------------------------------------------------------- /drrr/img/banner-200x40-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/img/banner-200x40-2.png -------------------------------------------------------------------------------- /drrr/img/banner-80x15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/img/banner-80x15.png -------------------------------------------------------------------------------- /drrr/index.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | if ( file_exists('setting.php') ) 15 | { 16 | require 'setting.php'; 17 | } 18 | else 19 | { 20 | require 'setting.dist.php'; 21 | } 22 | 23 | require 'dura.php'; 24 | 25 | Dura::setup(); 26 | Dura::execute(); 27 | 28 | ?> 29 | -------------------------------------------------------------------------------- /drrr/js/jquery.chat.js: -------------------------------------------------------------------------------- 1 | jQuery(function($) 2 | { 3 | var postAction = null; 4 | var getAction = null; 5 | 6 | var formElement = null; 7 | var textareaElement = null; 8 | var talksElement = null; 9 | var membersElement = null; 10 | var logoutElement = null; 11 | var buttonElement = null; 12 | var iconElement = null; 13 | var menuElement = null; 14 | var roomNameElement = null; 15 | var settingPannelElement = null; 16 | var userListElement = null; 17 | 18 | var lastMessage = ''; 19 | var lastUpdate = 0; 20 | var isSubmitting = false; 21 | var isLoggedOut = false; 22 | var isLoading = false; 23 | var isShowingSettinPannel = false; 24 | 25 | var isUseAnime = true; 26 | var isUseSound = true; 27 | var isShowMember = false; 28 | 29 | var userId = null; 30 | var userName = null; 31 | var userIcon = null; 32 | 33 | var messageLimit = 50; 34 | 35 | var construct = function() 36 | { 37 | var url = location.href.replace(/#/, ''); 38 | 39 | if ( url.replace(/\?/, '') != url ) 40 | { 41 | postAction = url+"&ajax=1"; 42 | } 43 | else 44 | { 45 | postAction = url+"?ajax=1"; 46 | } 47 | 48 | getAction = duraUrl+'/ajax.php'; 49 | 50 | formElement = $("#message"); 51 | textareaElement = $("#message textarea"); 52 | talksElement = $("#talks"); 53 | membersElement = $("#members"); 54 | logoutElement = $("input[name=logout]"); 55 | buttonElement = $("input[name=post]"); 56 | iconElement = $("dl.talk dt"); 57 | menuElement = $("ul.menu"); 58 | roomNameElement = $("#room_name"); 59 | settingPannelElement = $("#setting_pannel"); 60 | userListElement = $("#user_list"); 61 | 62 | userId = trim($("#user_id").text()); 63 | userName = trim($("#user_name").text()); 64 | userIcon = trim($("#user_icon").text()); 65 | 66 | messageMaxLength = 140; 67 | 68 | if ( typeof(GlobalMessageMaxLength) != 'undefined' ) 69 | { 70 | messageMaxLength = GlobalMessageMaxLength; 71 | } 72 | 73 | appendEvents(); 74 | separateMemberList(); 75 | roundBaloons(); 76 | showControllPanel(); 77 | 78 | if ( useComet ) 79 | { 80 | getMessages(); 81 | } 82 | else 83 | { 84 | var timer = setInterval(function(){getMessagesOnce();}, 1500); 85 | } 86 | 87 | $.each($(".bubble"), addTail); 88 | } 89 | 90 | var appendEvents = function() 91 | { 92 | formElement.submit(submitMessage); 93 | textareaElement.keyup(enterToSubmit); 94 | logoutElement.click(logout); 95 | iconElement.click(addUserNameToTextarea); 96 | menuElement.find("li.sound").click(toggleSound); 97 | menuElement.find("li.member").click(toggleMember); 98 | menuElement.find("li.animation").click(toggleAnimation); 99 | menuElement.find("li.setting").click(toggleSettingPannel); 100 | settingPannelElement.find("input[name=save]").click(changeRoomName); 101 | settingPannelElement.find("input[name=handover]").click(handoverHost); 102 | settingPannelElement.find("input[name=ban]").click(banUser); 103 | } 104 | 105 | var submitMessage = function() 106 | { 107 | var message = textareaElement.val(); 108 | message.replace(/[\r\n]+/g, ""); 109 | 110 | if ( message.replace(/^[ \n]+$/, '') == '' ) 111 | { 112 | if ( message.replace(/^\n+$/, '') == '' ) 113 | { 114 | textareaElement.val(''); 115 | } 116 | 117 | return false; 118 | } 119 | 120 | if ( isSubmitting ) 121 | { 122 | return false; 123 | } 124 | 125 | var data = formElement.serialize(); 126 | 127 | if ( message == lastMessage ) 128 | { 129 | if ( confirm(t("Will you stop sending the same message? If you click 'Cancel' you can send it again.")) ) 130 | { 131 | textareaElement.val(''); 132 | return false; 133 | } 134 | } 135 | 136 | textareaElement.val(''); 137 | isSubmitting = true; 138 | buttonElement.val(t("Sending...")); 139 | 140 | lastMessage = message; 141 | 142 | if ( message.length - 1 > messageMaxLength ) 143 | { 144 | message = message.substring(0, messageMaxLength)+"..."; 145 | } 146 | 147 | writeSelfMessage(message); 148 | 149 | $.post(postAction, data, 150 | function() 151 | { 152 | isSubmitting = false; 153 | buttonElement.val(t("P O S T")); 154 | } 155 | ); 156 | 157 | return false; 158 | } 159 | 160 | var getMessagesOnce = function() 161 | { 162 | if ( isLoading || isLoggedOut ) 163 | { 164 | return; 165 | } 166 | 167 | isLoading = true; 168 | 169 | $.post(getAction+'?fast=1', {}, 170 | function(data) 171 | { 172 | isLoading = false; 173 | updateProccess(data); 174 | } 175 | , 'xml'); 176 | } 177 | 178 | 179 | var getMessages = function() 180 | { 181 | $.post(getAction+'?fast=1', {}, 182 | function(data) 183 | { 184 | loadMessages(); 185 | updateProccess(data); 186 | } 187 | , 'xml'); 188 | } 189 | 190 | var loadMessages = function() 191 | { 192 | $.post(getAction, {}, 193 | function(data) 194 | { 195 | loadMessages(); 196 | updateProccess(data); 197 | } 198 | , 'xml'); 199 | } 200 | 201 | var updateProccess = function(data) 202 | { 203 | var update = $(data).find('room > update').text() * 1; 204 | 205 | if ( lastUpdate == update || settingPannelElement.is(":visible") ) 206 | { 207 | return; 208 | } 209 | 210 | lastUpdate = update; 211 | 212 | validateResult(data); 213 | writeRoomName(data); 214 | writeMessages(data); 215 | writeUserList(data); 216 | markHost(data); 217 | } 218 | 219 | var writeRoomName = function(data) 220 | { 221 | roomNameElement.text($(data).find('room > name').text()); 222 | } 223 | 224 | var writeMessages = function(data) 225 | { 226 | $.each($(data).find("talks"), writeMessage); 227 | } 228 | 229 | var writeMessage = function() 230 | { 231 | var id = $(this).find("id").text(); 232 | 233 | if ( $("#"+id).length > 0 ) 234 | { 235 | return; 236 | } 237 | 238 | var uid = trim($(this).find("uid").text()); 239 | var name = trim($(this).find("name").text()); 240 | var message = trim($(this).find("message").text()); 241 | var icon = trim($(this).find("icon").text()); 242 | var time = trim($(this).find("time").text()); 243 | 244 | name = escapeHTML(name); 245 | message = escapeHTML(message); 246 | 247 | if ( uid == 0 || uid == '0' ) 248 | { 249 | var content = '
'+message+'
'; 250 | talksElement.prepend(content); 251 | } 252 | else if ( uid != userId ) 253 | { 254 | var content = '
'; 255 | content += '
'+name+'
'; 256 | content += '
'; 257 | content += '

'+message+'

'; 258 | content += '
'; 259 | talksElement.prepend(content); 260 | effectBaloon(); 261 | } 262 | 263 | weepMessages(); 264 | } 265 | 266 | var writeUserList = function(data) 267 | { 268 | membersElement.find("li").remove(); 269 | userListElement.find("li").remove(); 270 | 271 | var total = $(data).find("users").length; 272 | membersElement.append('
  • ('+total+')
  • '); 273 | 274 | var host = $(data).find("host").text(); 275 | 276 | $.each($(data).find("users"), 277 | function() 278 | { 279 | var name = $(this).find("name").text(); 280 | var id = $(this).find("id").text(); 281 | var icon = $(this).find("icon").text(); 282 | var hostMark = ""; 283 | 284 | if ( host == id ) hostMark = " "+t("(host)"); 285 | 286 | membersElement.append('
  • '+name+hostMark+'
  • '); 287 | 288 | if ( host == id ) return; 289 | 290 | userListElement.append('
  • '+name+'
  • '); 291 | userListElement.find("li:last").css({ 292 | 'background':'transparent url("'+duraUrl+'/css/icon_'+icon+'.png") center top no-repeat' 293 | }).attr('name', id).click( 294 | function() 295 | { 296 | if ( $(this).hasClass('select') ) 297 | { 298 | userListElement.find("li").removeClass('select'); 299 | settingPannelElement.find("input[name=handover], input[name=ban]").attr('disabled', 'disabled'); 300 | } 301 | else 302 | { 303 | userListElement.find("li").removeClass('select'); 304 | $(this).addClass('select'); 305 | settingPannelElement.find("input[name=handover], input[name=ban]").removeAttr('disabled'); 306 | } 307 | } 308 | ); 309 | } 310 | ); 311 | 312 | separateMemberList(); 313 | } 314 | 315 | var writeSelfMessage = function(message) 316 | { 317 | var name = escapeHTML(userName); 318 | var message = escapeHTML(message); 319 | 320 | var content = '
    '; 321 | content += '
    '+name+'
    '; 322 | content += '
    '; 323 | content += '

    '+message+'

    '; 324 | content += '
    '; 325 | talksElement.prepend(content); 326 | effectBaloon(); 327 | weepMessages(); 328 | } 329 | 330 | var validateResult = function(data) 331 | { 332 | var error = $(data).find("error").text() * 1; 333 | 334 | if ( error == 0 || isLoggedOut ) 335 | { 336 | return; 337 | } 338 | else if ( error == 1 ) 339 | { 340 | isLoggedOut = true; 341 | alert(t("Session time out.")); 342 | } 343 | else if ( error == 2 ) 344 | { 345 | isLoggedOut = true; 346 | alert(t("Room was deleted.")); 347 | } 348 | else if ( error == 3 ) 349 | { 350 | isLoggedOut = true; 351 | alert(t("Login error.")); 352 | } 353 | 354 | location.href = duraUrl; 355 | } 356 | 357 | var effectBaloon = function() 358 | { 359 | var thisBobble = $(".bubble .body:first"); 360 | var thisBobblePrent = thisBobble.parent(); 361 | var oldWidth = thisBobble.width()+'px'; 362 | var oldHeight = thisBobble.height()+'px'; 363 | var newWidth = ( 5 + thisBobble.width() ) +'px'; 364 | var newHeight = ( 5 + thisBobble.height() ) +'px'; 365 | 366 | ringSound(); 367 | 368 | if ( !isUseAnime ) 369 | { 370 | $.each(thisBobblePrent, addTail); 371 | $.each(thisBobble, roundBaloon); 372 | return; 373 | } 374 | 375 | $("dl.talk:first dt").click(addUserNameToTextarea); 376 | 377 | if ( !isIE() ) 378 | { 379 | $.each(thisBobblePrent, addTail); 380 | 381 | thisBobblePrent.css({ 382 | 'opacity' : '0', 383 | 'width': '0px', 384 | 'height': '0px' 385 | }); 386 | thisBobblePrent.animate({ 387 | 'opacity' : 1, 388 | 'width': '22px', 389 | 'height': '16px' 390 | }, 200, "easeInQuart"); 391 | } 392 | 393 | thisBobble.css({ 394 | 'border-width' : '0px', 395 | 'font-size' : '0px', 396 | 'text-indent' : '-100000px', 397 | 'opacity' : '0', 398 | 'width': '0px', 399 | 'height': '0px' 400 | }); 401 | 402 | thisBobble.animate({ 403 | 'fontSize': "1em", 404 | 'borderWidth': "4px", 405 | 'width': newWidth, 406 | 'height': newHeight, 407 | 'opacity': 1, 408 | 'textIndent': 0 409 | }, 200, "easeInQuart", 410 | function() 411 | { 412 | $.each(thisBobble, roundBaloon); 413 | 414 | if ( isIE() ) 415 | { 416 | thisBobblePrent.animate({ 417 | 'width': thisBobblePrent.width() - 5 +"px" 418 | }, 100); 419 | } 420 | 421 | thisBobble.animate({ 422 | 'width': oldWidth, 423 | 'height': oldHeight 424 | }, 100); 425 | } 426 | ); 427 | } 428 | 429 | var ringSound = function() 430 | { 431 | if ( !isUseSound ) 432 | { 433 | return; 434 | } 435 | 436 | if ( $(".beep_sound").length ) 437 | { 438 | $(".beep_sound").remove(); 439 | } 440 | 441 | if ( $("a#sound").length ) 442 | { 443 | var soundUrl = $("a#sound").attr("href"); 444 | 445 | try 446 | { 447 | $.sound.play(soundUrl); 448 | } 449 | catch(e) 450 | { 451 | } 452 | } 453 | } 454 | 455 | var escapeHTML = function(ch) 456 | { 457 | ch = ch.replace(/&/g,"&"); 458 | ch = ch.replace(/"/g,"""); 459 | ch = ch.replace(/'/g,"'"); 460 | ch = ch.replace(//g,">"); 462 | return ch; 463 | } 464 | 465 | var enterToSubmit = function(e) 466 | { 467 | var content = textareaElement.val(); 468 | if ( content != content.replace(/[\r\n]+/g, "") ) 469 | { 470 | formElement.submit(); 471 | return false; 472 | } 473 | } 474 | 475 | var logout = function() 476 | { 477 | isLoggedOut = true; 478 | 479 | $.post(postAction, {'logout':'logout'}, 480 | function(result) 481 | { 482 | location.href = duraUrl; 483 | } 484 | ); 485 | } 486 | 487 | var weepMessages = function() 488 | { 489 | if ( $(".talk").length > messageLimit ) 490 | { 491 | while ( $(".talk").length > messageLimit ) 492 | { 493 | $(".talk:last").remove(); 494 | } 495 | } 496 | } 497 | 498 | var separateMemberList = function() 499 | { 500 | membersElement.find('li:not(:last)').each( 501 | function() 502 | { 503 | $(this).append(', '); 504 | } 505 | ); 506 | } 507 | 508 | var addUserNameToTextarea = function() 509 | { 510 | var name = $(this).text(); 511 | var text = textareaElement.val(); 512 | textareaElement.focus(); 513 | 514 | if ( text.length > 0 ) 515 | { 516 | textareaElement.val(text+' @'+name); 517 | } 518 | else 519 | { 520 | textareaElement.val(text+'@'+name+' '); 521 | } 522 | } 523 | 524 | var trim = function(string) 525 | { 526 | string = string.replace(/^\s+|\s+$/g, ''); 527 | return string; 528 | } 529 | 530 | var roundBaloons = function() 531 | { 532 | $("#talks dl.talk dd div.bubble p.body").each(roundBaloon); 533 | } 534 | 535 | var roundBaloon = function() 536 | { 537 | // IE 7 only... orz 538 | if ( !isIE() || !window.XMLHttpRequest || document.querySelectorAll ) 539 | { 540 | return; 541 | } 542 | 543 | var width = $(this).width(); 544 | var borderWidth = $(this).css('border-width'); 545 | var padding = $(this).css('padding-left'); 546 | var color = $(this).css('border-color'); 547 | width = width + padding.replace(/px/, '') * 2; 548 | 549 | $(this).corner("round 10px cc:"+color) 550 | .parent().css({ 551 | "background" : color, 552 | "padding" : borderWidth, 553 | "width" : width 554 | }).corner("round 13px"); 555 | } 556 | 557 | var addTail = function() 558 | { 559 | if ( isIE() ) 560 | { 561 | return; 562 | } 563 | 564 | var height = $(this).find(".body").height() + 30 + 8; 565 | var top = (Math.round((180 - height) / 2) + 23) * -1; 566 | var bgimg = $(this).find(".body").css("background-image"); 567 | var rand = Math.floor(Math.random()*2); 568 | var tailTop = "0px"; 569 | 570 | if ( rand == 1 ) 571 | { 572 | tailTop = "-17px"; 573 | } 574 | 575 | top = top + 1; 576 | 577 | $(this).find(".body").css({"margin": "0 0 0 15px"}); 578 | 579 | $(this).prepend('
    ') 580 | .css({"margin":"-16px 0 0 0"}); 581 | $(this).children("div").css({ 582 | "position":"relative", 583 | "float":"left", 584 | "margin":"0 0 0 0", 585 | "top": "39px", 586 | "left": "-3px", 587 | "width":"24px", 588 | "height":"16px", 589 | "background":"transparent "+bgimg+" left "+top+"px repeat-x" 590 | }); 591 | $(this).children("div").children("div").css({ 592 | "width":"100%", 593 | "height":"100%", 594 | "background":"transparent url('"+duraUrl+"/css/tail.png') left "+tailTop+" no-repeat" 595 | }); 596 | } 597 | 598 | var showControllPanel = function() 599 | { 600 | if ( isIE() ) 601 | { 602 | isUseSound = false; 603 | isUseAnime = false; 604 | } 605 | 606 | menuElement.find("li:hidden:not(.setting)").show(); 607 | var soundClass = ( isUseSound ) ? "sound_on" : "sound_off" ; 608 | var memberClass = ( isShowMember ) ? "member_on" : "member_off" ; 609 | var animationClass = ( isUseAnime ) ? "animation_on" : "animation_off" ; 610 | menuElement.find("li.sound").addClass(soundClass); 611 | menuElement.find("li.member").addClass(memberClass); 612 | menuElement.find("li.animation").addClass(animationClass); 613 | } 614 | 615 | var toggleSound = function() 616 | { 617 | if ( isUseSound ) 618 | { 619 | $(this).removeClass("sound_on"); 620 | $(this).addClass("sound_off"); 621 | isUseSound = false; 622 | } 623 | else 624 | { 625 | $(this).removeClass("sound_off"); 626 | $(this).addClass("sound_on"); 627 | isUseSound = true; 628 | } 629 | } 630 | 631 | var toggleMember = function() 632 | { 633 | if ( isShowMember ) 634 | { 635 | $(this).removeClass("member_on"); 636 | $(this).addClass("member_off"); 637 | membersElement.slideUp("slow"); 638 | isShowMember = false; 639 | } 640 | else 641 | { 642 | $(this).removeClass("member_off"); 643 | $(this).addClass("member_on"); 644 | membersElement.slideDown("slow"); 645 | isShowMember = true; 646 | } 647 | } 648 | 649 | var toggleAnimation = function() 650 | { 651 | if ( isUseAnime ) 652 | { 653 | $(this).removeClass("animation_on"); 654 | $(this).addClass("animation_off"); 655 | isUseAnime = false; 656 | } 657 | else 658 | { 659 | $(this).removeClass("animation_off"); 660 | $(this).addClass("animation_on"); 661 | isUseAnime = true; 662 | } 663 | } 664 | 665 | var toggleSettingPannel = function() 666 | { 667 | settingPannelElement.find("input[name=handover], input[name=ban]").attr('disabled', 'disabled'); 668 | buttonElement.slideToggle(); 669 | textareaElement.slideToggle(); 670 | settingPannelElement.slideToggle(); 671 | } 672 | 673 | var markHost = function(data) 674 | { 675 | if ( $(data).find('host').text() == userId ) 676 | { 677 | menuElement.find("li.setting").show(); 678 | } 679 | else 680 | { 681 | menuElement.find("li.setting").hide(); 682 | } 683 | } 684 | 685 | var changeRoomName = function() 686 | { 687 | var roomName = settingPannelElement.find("input[name=room_name]").val(); 688 | 689 | $.post(postAction, {'room_name':roomName}, 690 | function(result) 691 | { 692 | alert(result); 693 | toggleSettingPannel(); 694 | } 695 | ); 696 | } 697 | 698 | var handoverHost = function() 699 | { 700 | var id = userListElement.find("li.select").attr("name"); 701 | 702 | if ( confirm(t("Are you sure to handover host rights?")) ) 703 | { 704 | $.post(postAction, {'new_host':id}, 705 | function(result) 706 | { 707 | alert(result); 708 | toggleSettingPannel(); 709 | } 710 | ); 711 | } 712 | } 713 | 714 | var banUser = function() 715 | { 716 | var id = userListElement.find("li.select").attr("name"); 717 | 718 | if ( confirm(t("Are you sure to ban this user?")) ) 719 | { 720 | $.post(postAction, {'ban_user':id}, 721 | function(result) 722 | { 723 | alert(result); 724 | toggleSettingPannel(); 725 | } 726 | ); 727 | } 728 | } 729 | 730 | var isIE = function() 731 | { 732 | var isMSIE = /*@cc_on!@*/false; 733 | return isMSIE; 734 | } 735 | 736 | var dump = function($val) 737 | { 738 | talksElement.prepend($val); 739 | } 740 | 741 | construct(); 742 | }); -------------------------------------------------------------------------------- /drrr/js/jquery.corner.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery corner plugin: simple corner rounding 3 | * Examples and documentation at: http://jquery.malsup.com/corner/ 4 | * version 2.09 (11-MAR-2010) 5 | * Requires jQuery v1.3.2 or later 6 | * Dual licensed under the MIT and GPL licenses: 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.gnu.org/licenses/gpl.html 9 | * Authors: Dave Methvin and Mike Alsup 10 | */ 11 | 12 | /** 13 | * corner() takes a single string argument: $('#myDiv').corner("effect corners width") 14 | * 15 | * effect: name of the effect to apply, such as round, bevel, notch, bite, etc (default is round). 16 | * corners: one or more of: top, bottom, tr, tl, br, or bl. (default is all corners) 17 | * width: width of the effect; in the case of rounded corners this is the radius. 18 | * specify this value using the px suffix such as 10px (yes, it must be pixels). 19 | */ 20 | ;(function($) { 21 | 22 | var style = document.createElement('div').style; 23 | var moz = style['MozBorderRadius'] !== undefined; 24 | var webkit = style['WebkitBorderRadius'] !== undefined; 25 | var radius = style['borderRadius'] !== undefined || style['BorderRadius'] !== undefined; 26 | var mode = document.documentMode || 0; 27 | var noBottomFold = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8); 28 | 29 | var expr = $.browser.msie && (function() { 30 | var div = document.createElement('div'); 31 | try { div.style.setExpression('width','0+0'); div.style.removeExpression('width'); } 32 | catch(e) { return false; } 33 | return true; 34 | })(); 35 | 36 | function sz(el, p) { 37 | return parseInt($.css(el,p))||0; 38 | }; 39 | function hex2(s) { 40 | var s = parseInt(s).toString(16); 41 | return ( s.length < 2 ) ? '0'+s : s; 42 | }; 43 | function gpc(node) { 44 | while(node) { 45 | var v = $.css(node,'backgroundColor'); 46 | if (v && v != 'transparent' && v != 'rgba(0, 0, 0, 0)') { 47 | if (v.indexOf('rgb') >= 0) { 48 | var rgb = v.match(/\d+/g); 49 | return '#'+ hex2(rgb[0]) + hex2(rgb[1]) + hex2(rgb[2]); 50 | } 51 | return v; 52 | } 53 | node = node.parentNode; // keep walking if transparent 54 | } 55 | return '#ffffff'; 56 | }; 57 | 58 | function getWidth(fx, i, width) { 59 | switch(fx) { 60 | case 'round': return Math.round(width*(1-Math.cos(Math.asin(i/width)))); 61 | case 'cool': return Math.round(width*(1+Math.cos(Math.asin(i/width)))); 62 | case 'sharp': return Math.round(width*(1-Math.cos(Math.acos(i/width)))); 63 | case 'bite': return Math.round(width*(Math.cos(Math.asin((width-i-1)/width)))); 64 | case 'slide': return Math.round(width*(Math.atan2(i,width/i))); 65 | case 'jut': return Math.round(width*(Math.atan2(width,(width-i-1)))); 66 | case 'curl': return Math.round(width*(Math.atan(i))); 67 | case 'tear': return Math.round(width*(Math.cos(i))); 68 | case 'wicked': return Math.round(width*(Math.tan(i))); 69 | case 'long': return Math.round(width*(Math.sqrt(i))); 70 | case 'sculpt': return Math.round(width*(Math.log((width-i-1),width))); 71 | case 'dogfold': 72 | case 'dog': return (i&1) ? (i+1) : width; 73 | case 'dog2': return (i&2) ? (i+1) : width; 74 | case 'dog3': return (i&3) ? (i+1) : width; 75 | case 'fray': return (i%2)*width; 76 | case 'notch': return width; 77 | case 'bevelfold': 78 | case 'bevel': return i+1; 79 | } 80 | }; 81 | 82 | $.fn.corner = function(options) { 83 | // in 1.3+ we can fix mistakes with the ready state 84 | if (this.length == 0) { 85 | if (!$.isReady && this.selector) { 86 | var s = this.selector, c = this.context; 87 | $(function() { 88 | $(s,c).corner(options); 89 | }); 90 | } 91 | return this; 92 | } 93 | 94 | return this.each(function(index){ 95 | var $this = $(this); 96 | // meta values override options 97 | var o = [$this.attr($.fn.corner.defaults.metaAttr) || '', options || ''].join(' ').toLowerCase(); 98 | var keep = /keep/.test(o); // keep borders? 99 | var cc = ((o.match(/cc:(#[0-9a-f]+)/)||[])[1]); // corner color 100 | var sc = ((o.match(/sc:(#[0-9a-f]+)/)||[])[1]); // strip color 101 | var width = parseInt((o.match(/(\d+)px/)||[])[1]) || 10; // corner width 102 | var re = /round|bevelfold|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dogfold|dog/; 103 | var fx = ((o.match(re)||['round'])[0]); 104 | var fold = /dogfold|bevelfold/.test(o); 105 | var edges = { T:0, B:1 }; 106 | var opts = { 107 | TL: /top|tl|left/.test(o), TR: /top|tr|right/.test(o), 108 | BL: /bottom|bl|left/.test(o), BR: /bottom|br|right/.test(o) 109 | }; 110 | if ( !opts.TL && !opts.TR && !opts.BL && !opts.BR ) 111 | opts = { TL:1, TR:1, BL:1, BR:1 }; 112 | 113 | // support native rounding 114 | if ($.fn.corner.defaults.useNative && fx == 'round' && (radius || moz || webkit) && !cc && !sc) { 115 | if (opts.TL) 116 | $this.css(radius ? 'border-top-left-radius' : moz ? '-moz-border-radius-topleft' : '-webkit-border-top-left-radius', width + 'px'); 117 | if (opts.TR) 118 | $this.css(radius ? 'border-top-right-radius' : moz ? '-moz-border-radius-topright' : '-webkit-border-top-right-radius', width + 'px'); 119 | if (opts.BL) 120 | $this.css(radius ? 'border-bottom-left-radius' : moz ? '-moz-border-radius-bottomleft' : '-webkit-border-bottom-left-radius', width + 'px'); 121 | if (opts.BR) 122 | $this.css(radius ? 'border-bottom-right-radius' : moz ? '-moz-border-radius-bottomright' : '-webkit-border-bottom-right-radius', width + 'px'); 123 | return; 124 | } 125 | 126 | var strip = document.createElement('div'); 127 | $(strip).css({ 128 | overflow: 'hidden', 129 | height: '1px', 130 | minHeight: '1px', 131 | fontSize: '1px', 132 | backgroundColor: sc || 'transparent', 133 | borderStyle: 'solid' 134 | }); 135 | 136 | var pad = { 137 | T: parseInt($.css(this,'paddingTop'))||0, R: parseInt($.css(this,'paddingRight'))||0, 138 | B: parseInt($.css(this,'paddingBottom'))||0, L: parseInt($.css(this,'paddingLeft'))||0 139 | }; 140 | 141 | if (typeof this.style.zoom != undefined) this.style.zoom = 1; // force 'hasLayout' in IE 142 | if (!keep) this.style.border = 'none'; 143 | strip.style.borderColor = cc || gpc(this.parentNode); 144 | var cssHeight = $(this).outerHeight(); 145 | 146 | for (var j in edges) { 147 | var bot = edges[j]; 148 | // only add stips if needed 149 | if ((bot && (opts.BL || opts.BR)) || (!bot && (opts.TL || opts.TR))) { 150 | strip.style.borderStyle = 'none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none'); 151 | var d = document.createElement('div'); 152 | $(d).addClass('jquery-corner'); 153 | var ds = d.style; 154 | 155 | bot ? this.appendChild(d) : this.insertBefore(d, this.firstChild); 156 | 157 | if (bot && cssHeight != 'auto') { 158 | if ($.css(this,'position') == 'static') 159 | this.style.position = 'relative'; 160 | ds.position = 'absolute'; 161 | ds.bottom = ds.left = ds.padding = ds.margin = '0'; 162 | if (expr) 163 | ds.setExpression('width', 'this.parentNode.offsetWidth'); 164 | else 165 | ds.width = '100%'; 166 | } 167 | else if (!bot && $.browser.msie) { 168 | if ($.css(this,'position') == 'static') 169 | this.style.position = 'relative'; 170 | ds.position = 'absolute'; 171 | ds.top = ds.left = ds.right = ds.padding = ds.margin = '0'; 172 | 173 | // fix ie6 problem when blocked element has a border width 174 | if (expr) { 175 | var bw = sz(this,'borderLeftWidth') + sz(this,'borderRightWidth'); 176 | ds.setExpression('width', 'this.parentNode.offsetWidth - '+bw+'+ "px"'); 177 | } 178 | else 179 | ds.width = '100%'; 180 | } 181 | else { 182 | ds.position = 'relative'; 183 | ds.margin = !bot ? '-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px' : 184 | (pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px'; 185 | } 186 | 187 | for (var i=0; i < width; i++) { 188 | var w = Math.max(0,getWidth(fx,i, width)); 189 | var e = strip.cloneNode(false); 190 | e.style.borderWidth = '0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px'; 191 | bot ? d.appendChild(e) : d.insertBefore(e, d.firstChild); 192 | } 193 | 194 | if (fold && $.support.boxModel) { 195 | if (bot && noBottomFold) continue; 196 | for (var c in opts) { 197 | if (!opts[c]) continue; 198 | if (bot && (c == 'TL' || c == 'TR')) continue; 199 | if (!bot && (c == 'BL' || c == 'BR')) continue; 200 | 201 | var common = { position: 'absolute', border: 'none', margin: 0, padding: 0, overflow: 'hidden', backgroundColor: strip.style.borderColor }; 202 | var $horz = $('
    ').css(common).css({ width: width + 'px', height: '1px' }); 203 | switch(c) { 204 | case 'TL': $horz.css({ bottom: 0, left: 0 }); break; 205 | case 'TR': $horz.css({ bottom: 0, right: 0 }); break; 206 | case 'BL': $horz.css({ top: 0, left: 0 }); break; 207 | case 'BR': $horz.css({ top: 0, right: 0 }); break; 208 | } 209 | d.appendChild($horz[0]); 210 | 211 | var $vert = $('
    ').css(common).css({ top: 0, bottom: 0, width: '1px', height: width + 'px' }); 212 | switch(c) { 213 | case 'TL': $vert.css({ left: width }); break; 214 | case 'TR': $vert.css({ right: width }); break; 215 | case 'BL': $vert.css({ left: width }); break; 216 | case 'BR': $vert.css({ right: width }); break; 217 | } 218 | d.appendChild($vert[0]); 219 | } 220 | } 221 | } 222 | } 223 | }); 224 | }; 225 | 226 | $.fn.uncorner = function() { 227 | if (radius || moz || webkit) 228 | this.css(radius ? 'border-radius' : moz ? '-moz-border-radius' : '-webkit-border-radius', 0); 229 | $('div.jquery-corner', this).remove(); 230 | return this; 231 | }; 232 | 233 | // expose options 234 | $.fn.corner.defaults = { 235 | useNative: true, // true if plugin should attempt to use native browser support for border radius rounding 236 | metaAttr: 'data-corner' // name of meta attribute to use for options 237 | }; 238 | 239 | })(jQuery); 240 | -------------------------------------------------------------------------------- /drrr/js/jquery.sound.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery sound plugin (no flash) 3 | * 4 | * port of script.aculo.us' sound.js (http://script.aculo.us), based on code by Jules Gravinese (http://www.webveteran.com/) 5 | * 6 | * Copyright (c) 2007 Jテカrn Zaefferer (http://bassistance.de) 7 | * 8 | * Licensed under the MIT license: 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * 11 | * $Id$ 12 | */ 13 | 14 | /** 15 | * API Documentation 16 | * 17 | * // play a sound from the url 18 | * $.sound.play(url) 19 | * 20 | * // play a sound from the url, on a track, stopping any sound already running on that track 21 | * $.sound.play(url, { 22 | * track: "track1" 23 | * }); 24 | * 25 | * // increase the timeout to four seconds before removing the sound object from the dom for longer sounds 26 | * $.sound.play(url, { 27 | * timeout: 4000 28 | * }); 29 | * 30 | * // stop a sound by removing the element returned by play 31 | * var sound = $.sound.play(url); 32 | * sound.remove(); 33 | * 34 | * // disable playing sounds 35 | * $.sound.enabled = false; 36 | * 37 | * // enable playing sounds 38 | * $.sound.enabled = true 39 | */ 40 | 41 | (function($) { 42 | 43 | $.sound = { 44 | tracks: {}, 45 | enabled: true, 46 | template: function(src) { 47 | return ''; 48 | }, 49 | play: function(url, options){ 50 | if (!this.enabled) 51 | return; 52 | var settings = $.extend({ 53 | url: url, 54 | timeout: 2000 55 | }, options); 56 | 57 | if (settings.track) { 58 | if (this.tracks[settings.track]) { 59 | var current = this.tracks[settings.track]; 60 | // TODO check when Stop is avaiable, certainly not on a jQuery object 61 | current.Stop && current.Stop(); 62 | current.remove(); 63 | } 64 | } 65 | 66 | var element = $.browser.msie 67 | ? $('').attr({ 68 | src: settings.url, 69 | loop: 1, 70 | autostart: true 71 | }) 72 | : $(this.template(settings.url)); 73 | 74 | element.appendTo("body"); 75 | 76 | if (settings.track) { 77 | this.tracks[settings.track] = element; 78 | } 79 | 80 | setTimeout(function() { 81 | element.remove(); 82 | }, options.timeout) 83 | 84 | return element; 85 | } 86 | }; 87 | 88 | })(jQuery); -------------------------------------------------------------------------------- /drrr/js/language/en-US.js: -------------------------------------------------------------------------------- 1 | Translator.catalog = { 2 | "Will you stop sending the same message? If you click 'Cancel' you can send it again." : "Will you stop sending the same message? If you click 'Cancel' you can send it again.", 3 | "Session time out." : "Disconnected.", 4 | "Room was deleted." : "Room not found.", 5 | "Login error." : "Error: Disconnected.", 6 | "Sending..." : "Sending...", 7 | "POST!" : "POST!", 8 | "Are you sure to logout?" : "Are you sure to logout?", 9 | "Are you sure to handover host rights?": "Are you sure to handover host rights?", 10 | "Are you sure to ban this user?" : "Are you sure to ban this user?" 11 | }; -------------------------------------------------------------------------------- /drrr/js/language/ja-JP.js: -------------------------------------------------------------------------------- 1 | Translator.catalog = { 2 | "Will you stop sending the same message? If you click 'Cancel' you can send it again." : "連続送信を中止しますか?「キャンセル」を押すと再送信します。", 3 | "Session time out." : "接続が切れました。", 4 | "Room was deleted." : "削除されたなどの理由で部屋が見つかりません。", 5 | "Login error." : "ログインエラー:接続が切れました。", 6 | "Sending..." : "送信中", 7 | "POST!" : "POST!", 8 | "Are you sure to logout?" : "ログアウトしますか?", 9 | "Are you sure to handover host rights?": "管理権限を明け渡して良いですか?", 10 | "Are you sure to ban this user?" : "退室させて良いですか?" 11 | }; -------------------------------------------------------------------------------- /drrr/js/language/ko-KR.js: -------------------------------------------------------------------------------- 1 | Translator.catalog = { 2 | "Will you stop sending the same message? If you click 'Cancel' you can send it again." : "연속송신을 취소하겠습니까? '취소'를 누르시면 다시 송신됩니다.", 3 | "Session time out." : "접속이 끊겼습니다.", 4 | "Room was deleted." : "방이 없습니다.", 5 | "Login error." : "로그인 오류: 접속이 끊겼습니다.", 6 | "Sending..." : "송신중", 7 | "POST!" : "POST!", 8 | "Are you sure to logout?" : "로그아웃하시겠습니까?", 9 | "Are you sure to handover host rights?": "정말로 관리 권한을 옮겨도 됩니까?", 10 | "Are you sure to ban this user?" : "정말로 퇴실시킵니까?" 11 | }; -------------------------------------------------------------------------------- /drrr/js/language/ru-RU.js: -------------------------------------------------------------------------------- 1 | Translator.catalog = { 2 | "Will you stop sending the same message? If you click 'Cancel' you can send it again." : "Может быть вы перестанете посылать одинаковые сообщения? Если вы нажмёте \"Отмена\", вы сможете послать его опять.", 3 | "Session time out." : "Обрыв связи", 4 | "Room was deleted." : "Комната не найдена.", 5 | "Login error." : "Ошибка : Обрыв связи.", 6 | "Sending..." : "Посылаю...", 7 | "POST!" : "Послать!", 8 | "Are you sure to logout?" : "Вы точно хотите выйти?", 9 | "Are you sure to handover host rights?": "Вы уверены что хотите передать права модератора?", 10 | "Are you sure to ban this user?" : "Вы уверены, что хотите заблокировать данного пользователя ?" 11 | }; -------------------------------------------------------------------------------- /drrr/js/language/zh-CN.js: -------------------------------------------------------------------------------- 1 | Translator.catalog = { 2 | "Will you stop sending the same message? If you click 'Cancel' you can send it again." : "发送重复数据?按“确定”取消发送。", 3 | "Session time out." : "已中断连接。。", 4 | "Room was deleted." : "房间已被删除。", 5 | "Login error." : "登入错误:已中断连接。", 6 | "Sending..." : "发送中", 7 | "POST!" : "POST!", 8 | "Are you sure to logout?" : "是否确定登出?", 9 | "Are you sure to handover host rights?": "是否确定变更房间管理人?", 10 | "Are you sure to ban this user?" : "是否确定强制退出改成员?" 11 | }; -------------------------------------------------------------------------------- /drrr/js/language/zh-TW.js: -------------------------------------------------------------------------------- 1 | Translator.catalog = { 2 | "Will you stop sending the same message? If you click 'Cancel' you can send it again." : "是否確定發送相同訊息?按「取消」後重複發送。", 3 | "Session time out." : "已中斷連線。", 4 | "Room was deleted." : "部屋已被刪除。", 5 | "Login error." : "登入錯誤:已中斷連線。", 6 | "Sending..." : "送信中", 7 | "POST!" : "P O S T !", 8 | "Are you sure to logout?" : "是否確定登出?", 9 | "Are you sure to handover host rights?": "是否確定變更部屋管理人?", 10 | "Are you sure to ban this user?" : "是否確定強制退出該成員?" 11 | }; -------------------------------------------------------------------------------- /drrr/js/sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/js/sound.mp3 -------------------------------------------------------------------------------- /drrr/js/translator.js: -------------------------------------------------------------------------------- 1 | var Translator = function() 2 | { 3 | this.catalog = {}; 4 | 5 | this.translate = function(message) 6 | { 7 | try 8 | { 9 | if ( Translator.catalog[message] ) 10 | { 11 | return Translator.catalog[message]; 12 | } 13 | } 14 | catch(e) 15 | { 16 | } 17 | 18 | return message; 19 | }; 20 | 21 | return this; 22 | } 23 | 24 | translator = new Translator(); 25 | 26 | function t(message) 27 | { 28 | return translator.translate(message); 29 | } 30 | -------------------------------------------------------------------------------- /drrr/offline/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/offline/banner.png -------------------------------------------------------------------------------- /drrr/offline/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dollars! 离线讨论 7 | 8 | 9 | 10 |

    11 | 12 | 13 |
    14 |
    25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /drrr/readme/.htaccess: -------------------------------------------------------------------------------- 1 | order deny,allow 2 | deny from all 3 | -------------------------------------------------------------------------------- /drrr/readme/License.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /drrr/readme/readme-en.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
     7 | INTRODUCTION
     8 | 
     9 | This is Ajax-based Durarara-like-chat.
    10 | 
    11 | http://suin.asia/2010/03/26/durarara_like_chat (japanese)
    12 | 
    13 | 
    14 | WHY DID I DEVELOPED THIS?
    15 | 
    16 | - I like the interface of Durarara chat.
    17 | - I wanted to try make chat with Ajax.
    18 | 
    19 | 
    20 | LICENSE
    21 | 
    22 | This application can be used under General Public License 3.
    23 | See License.txt
    24 | 
    25 | 
    26 | REQUIREMENTS
    27 | 
    28 | - PHP 5.1.0 or later
    29 | - mbstring
    30 | - add writing permission(0777) to /trust_path/xml
    31 | 
    32 | 
    33 | HOW TO SET UP
    34 | 
    35 | - add writing permission(0777) to /trust_path/xml
    36 | 
    37 | 
    38 | CONFIGURE SETTINGS
    39 | 
    40 | - Please rename setting.dist.php to setting.php, and modify it.
    41 | 
    42 | 
    43 | SOUND EFFECT
    44 | 
    45 | If you prepare sound.mp3 and put it under /js, the sound effect is available.
    46 | 
    47 | 
    48 | ADDING ICONS
    49 | 
    50 | put icons under /css. Icon names must be like icon_XXX.png.
    51 | You have to modify /css/style.css, when you add your icons.
    52 | 
    53 | 
    54 | TRANSLATION
    55 | 
    56 | create two files {language code}-{country code}.php under /trust_path/language/ and {language code}-{country code}.js under /js/language/.
    57 | 
    58 | Example:
    59 | /trust_path/language/en-US.php // English(US)
    60 | /js/language/en-US.js
    61 | /trust_path/language/zh-TW.php // Chinese(Taiwan)
    62 | /js/language/zh-TW.js
    63 | /trust_path/language/ko-KR.php // Korean(South Korea)
    64 | /js/language/ko-KR.js
    65 | 
    66 | Left is source language.
    67 | Right is target language.
    68 | You must NOT modify source language.
    69 | 
    70 | Example:
    71 |        Source                Translation
    72 | "Please input name." => "名前を決めてください。", // *.php
    73 | "Please input name." : "名前を決めてください。", // *.js
    74 | 
    75 | Site language setting is defined by DURA_LANGUAGE in setting.php.
    76 | 
    77 | 
    78 | 79 | -------------------------------------------------------------------------------- /drrr/readme/readme-ja.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
     7 | ◆概要
     8 | 
     9 | アニメデュラララに出てくるチャットをモデルに作成したAjaxベースのチャットアプリケーションです。
    10 | http://suin.asia/2010/03/26/durarara_like_chat
    11 | 
    12 | 
    13 | ◆開発動機
    14 | 
    15 | ・デュララに登場するチャットのインターフェイスが好き
    16 | ・リアルタイムチャットはJavaやFlashが主流だが、PHPでもAjaxを駆使すれば実現可能ではないかという技術的な関心(特別な話ではない)
    17 | 
    18 | 
    19 | ◆開発方針
    20 | 
    21 | ・アニメに忠実に
    22 | 
    23 | 
    24 | ◆ライセンス
    25 | 
    26 | 本アプリケーションはオープンソースであり、ライセンスはGPL3になります。
    27 | ・本アプリケーションが無保証である
    28 | あなたはGPL3ライセンスに同意することで次の自由を行使できます。
    29 | ・本アプリケーションを無制限に実行・利用する
    30 | あなたは以下を遵守することでソースコードを研究・改良・修正・再頒布・翻訳することができます。
    31 | ・本アプリケーションの著作権表示を目立つ場所に適切に表示する
    32 | ・本アプリケーションのライセンスを目立つ場所に適切に表示する
    33 | ・本アプリケーションの再頒布物や二次的著作物にもGPL3ライセンスを適用する
    34 | 詳しくはLicense.txtを御覧下さい。
    35 | 
    36 | 
    37 | ◆動作要件
    38 | 
    39 | ・PHP 5.2.11- (運が良ければ、5.2.0-で動くかも)
    40 | ・mbstring
    41 | ・/trust_path/xmlへの書き込み権限 [0777]
    42 | 
    43 | 
    44 | ◆設置方法
    45 | 
    46 | /duraを任意の場所に設置
    47 | /trust_path/xml に書き込み権限を与える
    48 | 
    49 | 
    50 | ◆設定
    51 | 
    52 | setting.dist.phpをsetting.phpにリネームしてから修正してください。
    53 | 
    54 | 
    55 | ◆ビープ音の有効化
    56 | 
    57 | このパッケージにはライセンスの都合上、ビープ音の音源が付属しておりません。
    58 | ビープ音を有効にするには、各自でsound.mp3を用意し、/jsに配置してください。
    59 | 
    60 | 
    61 | ◆画像アイコンの追加
    62 | 
    63 | アイコンはicon_XXXX.gifという名前で、/cssディレクトリに配置してください。
    64 | なお、アイコンを追加した場合は、/css/style.cssを修正する必要があります。(CSSの知識が必要)
    65 | 
    66 | 
    67 | ◆翻訳・ローカリゼーション
    68 | 
    69 | 以下の各ディレクトリに、言語コード-国コード.php, 言語コード-国コード.jsをUTF-8エンコードで作ってください。
    70 | 言語コードは"ISO 639 Language Codes"を参考にしてください。
    71 | ja-JP.php, ja-JP.jsをコピー&リネームして翻訳するのが楽です。
    72 | 
    73 | /trust_path/language/
    74 | /js/language/
    75 | 
    76 | 例:
    77 | /trust_path/language/en-US.php // 英語(アメリカ)
    78 | /js/language/en-US.js
    79 | /trust_path/language/zh-TW.php // 中国語(台湾)
    80 | /js/language/zh-TW.js
    81 | /trust_path/language/ko-KR.php // 韓国語(韓国)
    82 | /js/language/ko-KR.js
    83 | 
    84 | 言語対訳ファイルは左が原文、右が翻訳です。
    85 | 左は修正せず、右を各言語に翻訳するようにしてください。
    86 | 
    87 | 例:
    88 |     原文             翻訳
    89 | "Please input name." => "名前を決めてください。", // *.php
    90 | "Please input name." : "名前を決めてください。", // *.js
    91 | 
    92 | 言語の設定はsetting.phpのDURA_LANGUAGEで指定します。
    93 | 
    94 | 
    95 | 96 | -------------------------------------------------------------------------------- /drrr/readme/update1.0.1-to-1.0.2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/readme/update1.0.1-to-1.0.2.txt -------------------------------------------------------------------------------- /drrr/readme/update1.0.2-to-1.0.3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/readme/update1.0.2-to-1.0.3.txt -------------------------------------------------------------------------------- /drrr/setting.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /drrr/trust_path/.htaccess: -------------------------------------------------------------------------------- 1 | order deny,allow 2 | deny from all 3 | -------------------------------------------------------------------------------- /drrr/trust_path/abstract/controller.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | abstract class Dura_Abstract_Controller 15 | { 16 | protected $output = array(); 17 | protected $template = null; 18 | 19 | public function __construct() 20 | { 21 | } 22 | 23 | public function main() 24 | { 25 | } 26 | 27 | protected function _view() 28 | { 29 | if ( !$this->template ) 30 | { 31 | $this->template = DURA_TEMPLATE_PATH.'/'.Dura::$controller.'.'.Dura::$action.'.php'; 32 | } 33 | 34 | $this->_escapeHtml($this->output); 35 | 36 | ob_start(); 37 | $this->_display($this->output); 38 | $content = ob_get_contents(); 39 | ob_end_clean(); 40 | 41 | $this->_render($content); 42 | } 43 | 44 | protected function _display($dura) 45 | { 46 | require $this->template; 47 | } 48 | 49 | protected function _render($content) 50 | { 51 | require DURA_TEMPLATE_PATH.'/theme.php'; 52 | } 53 | 54 | protected function _validateUser() 55 | { 56 | if ( !Dura::user()->isUser() ) 57 | { 58 | Dura::redirect(); 59 | } 60 | } 61 | 62 | protected function _validateAdmin() 63 | { 64 | if ( !Dura::user()->isAdmin() ) 65 | { 66 | Dura::redirect(); 67 | } 68 | } 69 | 70 | protected function _escapeHtml(&$vars) 71 | { 72 | foreach ( $vars as $key => &$var ) 73 | { 74 | if ( is_array($var) ) 75 | { 76 | $this->_escapeHtml($var); 77 | } 78 | elseif ( !is_object($var) ) 79 | { 80 | $var = Dura::escapeHtml($var); 81 | } 82 | } 83 | } 84 | } 85 | 86 | ?> 87 | -------------------------------------------------------------------------------- /drrr/trust_path/class/icon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Class_Icon 15 | { 16 | public static function &getIcons() 17 | { 18 | static $icons = null; 19 | 20 | if ( $icons === null ) 21 | { 22 | $icons = array(); 23 | $iconDir = DURA_PATH.'/css'; 24 | 25 | if ( $dir = opendir($iconDir) ) 26 | { 27 | while ( ($file = readdir($dir)) !== false ) 28 | { 29 | if ( preg_match('/^icon_(.+)\.png$/', $file, $match) ) 30 | { 31 | list($dummy, $icon) = $match; 32 | $icons[$icon] = $file; 33 | } 34 | } 35 | 36 | closedir($dir); 37 | } 38 | } 39 | 40 | return $icons; 41 | } 42 | 43 | public static function getIconUrl($icon) 44 | { 45 | $url = DURA_URL.'/css/icon_'.$icon.'.png'; 46 | return $url; 47 | } 48 | } 49 | 50 | ?> 51 | -------------------------------------------------------------------------------- /drrr/trust_path/class/room_session.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Class_RoomSession 15 | { 16 | public static function isCreated() 17 | { 18 | return isset($_SESSION['room']); 19 | } 20 | 21 | public static function get($var = null) 22 | { 23 | if ( $var ) 24 | { 25 | return $_SESSION['room'][$var]; 26 | } 27 | 28 | return $_SESSION['room']; 29 | } 30 | 31 | public static function create($id) 32 | { 33 | $_SESSION['room']['id'] = $id; 34 | } 35 | 36 | public static function delete() 37 | { 38 | unset($_SESSION['room']); 39 | } 40 | } 41 | 42 | ?> 43 | -------------------------------------------------------------------------------- /drrr/trust_path/class/ticket.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Class_Ticket 15 | { 16 | protected static $sessionName = 'dura_tickets'; 17 | 18 | public static function issue($timeout = 180) 19 | { 20 | $expire = time() + intval($timeout); 21 | $token = md5(uniqid().mt_rand()); 22 | 23 | if ( isset($_SESSION[self::$sessionName]) and is_array($_SESSION[self::$sessionName]) ) 24 | { 25 | if ( count($_SESSION[self::$sessionName]) >= 5 ) 26 | { 27 | asort($_SESSION[self::$sessionName]); 28 | $_SESSION[self::$sessionName] = array_slice($_SESSION[self::$sessionName], -4, 4); 29 | } 30 | 31 | $_SESSION[self::$sessionName][$token] = $expire; 32 | } 33 | else 34 | { 35 | $_SESSION[self::$sessionName] = array($token => $expire); 36 | } 37 | 38 | return $token; 39 | } 40 | 41 | public static function check($stub) 42 | { 43 | if ( !isset($_SESSION[self::$sessionName][$stub]) ) return false; 44 | if ( time() >= $_SESSION[self::$sessionName][$stub] ) return false; 45 | 46 | unset($_SESSION[self::$sessionName][$stub]); 47 | 48 | return true; 49 | } 50 | 51 | public static function destory() 52 | { 53 | unset($_SESSION[self::$sessionName]); 54 | } 55 | } 56 | 57 | ?> 58 | -------------------------------------------------------------------------------- /drrr/trust_path/class/user.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Class_User 15 | { 16 | protected $name = null; 17 | protected $icon = null; 18 | protected $id = null; 19 | protected $expire = null; 20 | protected $admin = false; 21 | protected $language = null; 22 | 23 | protected function __construct() 24 | { 25 | } 26 | 27 | public static function &getInstance() 28 | { 29 | static $instance = null; 30 | 31 | if ( $instance === null ) 32 | { 33 | $instance = new self(); 34 | } 35 | 36 | return $instance; 37 | } 38 | 39 | public function login($name, $icon, $language, $admin = false) 40 | { 41 | $this->name = $name; 42 | $this->icon = $icon; 43 | $this->id = md5($name.getenv('REMOTE_ADDR')); 44 | $this->language = $language; 45 | $this->admin = $admin; 46 | 47 | $_SESSION['user'] = $this; 48 | } 49 | 50 | public function loadSession() 51 | { 52 | if ( isset($_SESSION['user']) and $_SESSION['user'] instanceof self ) 53 | { 54 | $user = $_SESSION['user']; 55 | $this->name = $user->name; 56 | $this->icon = $user->icon; 57 | $this->id = $user->id; 58 | $this->expire = $user->expire; 59 | $this->id = $user->id; 60 | $this->language = $user->language; 61 | $this->admin = $user->admin; 62 | } 63 | } 64 | 65 | public function isUser() 66 | { 67 | return ( $this->id !== null ); 68 | } 69 | 70 | public function isAdmin() 71 | { 72 | if ( $this->isUser() ) 73 | { 74 | return $this->admin; 75 | } 76 | 77 | return false; 78 | } 79 | 80 | public function getName() 81 | { 82 | if ( !$this->isUser() ) return false; 83 | 84 | return $this->name; 85 | } 86 | 87 | public function getIcon() 88 | { 89 | if ( !$this->isUser() ) return false; 90 | 91 | return $this->icon; 92 | } 93 | 94 | public function getId() 95 | { 96 | if ( !$this->isUser() ) return false; 97 | 98 | return $this->id; 99 | } 100 | 101 | public function getLanguage() 102 | { 103 | return $this->language; 104 | } 105 | 106 | public function getExpire() 107 | { 108 | if ( !$this->isUser() ) return false; 109 | 110 | return $this->expire; 111 | } 112 | 113 | public function updateExpire() 114 | { 115 | $this->expire = time() + DURA_TIMEOUT; 116 | 117 | if ( isset($_SESSION['user']) and $_SESSION['user'] instanceof self ) 118 | { 119 | $_SESSION['user']->expire = $this->expire; 120 | } 121 | } 122 | } 123 | 124 | ?> 125 | -------------------------------------------------------------------------------- /drrr/trust_path/class/xml.php: -------------------------------------------------------------------------------- 1 | _creanupXML($string); 10 | return $string; 11 | } 12 | 13 | public function asArray() 14 | { 15 | $this->_objectToArray($this); 16 | return $this; 17 | } 18 | 19 | protected function _creanupXML(&$string) 20 | { 21 | $string = preg_replace("/>\s*\n<", $string); 22 | $lines = explode("\n", $string); 23 | $string = array_shift($lines) . "\n"; 24 | $depth = 0; 25 | 26 | foreach ( $lines as $line ) 27 | { 28 | if ( preg_match('/^<[\w]+>$/U', $line) ) 29 | { 30 | $string .= str_repeat("\t", $depth); 31 | $depth++; 32 | } 33 | elseif ( preg_match('/^<\/.+>$/', $line) ) 34 | { 35 | $depth--; 36 | $string .= str_repeat("\t", $depth); 37 | } 38 | else 39 | { 40 | $string .= str_repeat("\t", $depth); 41 | } 42 | 43 | $string .= $line . "\n"; 44 | } 45 | 46 | $string = trim($string); 47 | } 48 | 49 | protected function _objectToArray(&$object) 50 | { 51 | if ( is_object($object) ) $object = (array) $object; 52 | if ( !is_array($object) ) return; 53 | 54 | foreach ( $object as &$member ) 55 | { 56 | $this->_objectToArray($member); 57 | } 58 | } 59 | } 60 | 61 | ?> 62 | -------------------------------------------------------------------------------- /drrr/trust_path/class/xml_handler.php: -------------------------------------------------------------------------------- 1 | className = $className; 14 | } 15 | } 16 | 17 | public function getErrors() 18 | { 19 | return $this->errors; 20 | } 21 | 22 | public function create() 23 | { 24 | $string = $this->_getDefaultXml(); 25 | $xml = simplexml_load_string($string, $this->className); 26 | return $xml; 27 | } 28 | 29 | public function load($id) 30 | { 31 | $file = $this->getFilePath($id); 32 | 33 | libxml_use_internal_errors(true); 34 | $xml = simplexml_load_file($file, $this->className, LIBXML_NOCDATA); 35 | 36 | if ( !$xml ) 37 | { 38 | $error = array(); 39 | $error['file'] = $file; 40 | $error['message'] = ''; 41 | 42 | foreach ( libxml_get_errors() as $xmlError ) 43 | { 44 | $error['message'] .= $xmlError->message; 45 | } 46 | 47 | $this->errors[] = $error; 48 | 49 | // TODO >> Error Logger 50 | 51 | return false; 52 | } 53 | 54 | return $xml; 55 | } 56 | 57 | public function save($id, $xml) 58 | { 59 | $xml->update = time(); 60 | $file = $this->getFilePath($id); 61 | return file_put_contents($file, $xml->asXML(), LOCK_EX); 62 | } 63 | 64 | public function delete($id) 65 | { 66 | $file = $this->getFilePath($id); 67 | return @unlink($file); 68 | } 69 | 70 | public function getFilePath($id) 71 | { 72 | return DURA_XML_PATH.'/'.$this->fileName.'_'.$id.'.xml'; 73 | } 74 | 75 | protected function _getDefaultXml() 76 | { 77 | return 78 | ' 79 | 80 | '; 81 | } 82 | } 83 | 84 | ?> 85 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/admin.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_Admin extends Dura_Abstract_Controller 15 | { 16 | protected $error = null; 17 | 18 | public function __construct() 19 | { 20 | parent::__construct(); 21 | } 22 | 23 | public function main() 24 | { 25 | if ( Dura::user()->isUser() ) 26 | { 27 | Dura::redirect('lounge'); 28 | } 29 | 30 | if ( Dura::post('name') ) 31 | { 32 | try 33 | { 34 | $this->_login(); 35 | } 36 | catch ( Exception $e ) 37 | { 38 | $this->error = $e->getMessage(); 39 | } 40 | } 41 | 42 | $this->_default(); 43 | } 44 | 45 | protected function _login() 46 | { 47 | $name = Dura::post('name'); 48 | $pass = Dura::post('pass'); 49 | $name = trim($name); 50 | $pass = trim($pass); 51 | 52 | if ( $name === '' ) 53 | { 54 | throw new Exception(t("Please input name.")); 55 | } 56 | 57 | $token = Dura::post('token'); 58 | 59 | if ( !Dura_Class_Ticket::check($token) ) 60 | { 61 | throw new Exception(t("Login error happened.")); 62 | } 63 | 64 | if ( $name !== DURA_ADMIN_NAME or $pass !== DURA_ADMIN_PASS ) 65 | { 66 | throw new Exception(t("ID or password is wrong.")); 67 | } 68 | 69 | $user =& Dura_Class_User::getInstance(); 70 | $user->login($name, 'admin', DURA_LANGUAGE, true); 71 | 72 | Dura_Class_Ticket::destory(); 73 | 74 | Dura::redirect('lounge'); 75 | } 76 | 77 | protected function _default() 78 | { 79 | $this->output['error'] = $this->error; 80 | $this->output['token'] = Dura_Class_Ticket::issue(); 81 | $this->_view(); 82 | } 83 | } 84 | 85 | ?> 86 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/admin_announce.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_AdminAnnounce extends Dura_Abstract_Controller 15 | { 16 | protected $roomHandler = null; 17 | protected $roomModel = null; 18 | 19 | public function __construct() 20 | { 21 | parent::__construct(); 22 | 23 | $this->_validateAdmin(); 24 | 25 | $this->roomHandler = new Dura_Model_RoomHandler; 26 | $this->roomModels = $this->roomHandler->loadAll(); 27 | } 28 | 29 | public function main() 30 | { 31 | if ( Dura::post('message') ) 32 | { 33 | $this->_message(); 34 | } 35 | 36 | $this->_default(); 37 | } 38 | 39 | protected function _message() 40 | { 41 | $message = Dura::post('message'); 42 | $message = trim($message); 43 | $messageId = md5(microtime().mt_rand()); 44 | 45 | if ( !$message ) return; 46 | 47 | foreach ( $this->roomModels as $roomId => $roomModel ) 48 | { 49 | $talk = $roomModel->addChild('talks'); 50 | $talk->addChild('id', $messageId); 51 | $talk->addChild('uid', Dura::user()->getId()); 52 | $talk->addChild('name', Dura::user()->getName()); 53 | $talk->addChild('message', $message); 54 | $talk->addChild('icon', Dura::user()->getIcon()); 55 | $talk->addChild('time', time()); 56 | 57 | $id = Dura::user()->getId(); 58 | 59 | foreach ( $roomModel->users as $user ) 60 | { 61 | if ( $id == (string) $user->id ) 62 | { 63 | $user->update = time(); 64 | } 65 | } 66 | 67 | while ( count($roomModel->talks) > DURA_LOG_LIMIT ) 68 | { 69 | unset($roomModel->talks[0]); 70 | } 71 | 72 | $this->roomHandler->save($roomId, $roomModel); 73 | } 74 | 75 | Dura::redirect('admin_announce'); 76 | } 77 | 78 | protected function _default() 79 | { 80 | $talks = array(); 81 | $userId = Dura::user()->getId(); 82 | 83 | foreach ( $this->roomModels as $roomModel ) 84 | { 85 | foreach ( $roomModel->talks as $talk ) 86 | { 87 | $time = (int) $talk->time; 88 | $id = (string) $talk->id; 89 | 90 | if ( isset($talks[$time][$id]) ) continue; 91 | 92 | $talks[$time][$id] = (array) $talk; 93 | } 94 | } 95 | 96 | ksort($talks); 97 | 98 | $talks = array_reverse($talks); 99 | 100 | $this->output['talks'] = $talks; 101 | 102 | $this->_view(); 103 | } 104 | } 105 | 106 | ?> 107 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/create_room.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_CreateRoom extends Dura_Abstract_Controller 15 | { 16 | protected $error = null; 17 | protected $input = null; 18 | 19 | protected $userMax = null; 20 | protected $languages = array(); 21 | 22 | public function __construct() 23 | { 24 | parent::__construct(); 25 | } 26 | 27 | public function main() 28 | { 29 | $this->_redirectToRoom(); 30 | 31 | $this->_languages(); 32 | 33 | $this->_roomLimit(); 34 | 35 | $this->_getInput(); 36 | 37 | if ( Dura::post('name') ) 38 | { 39 | try 40 | { 41 | $this->_create(); 42 | } 43 | catch ( Exception $e ) 44 | { 45 | $this->error = $e->getMessage(); 46 | } 47 | } 48 | 49 | $this->_default(); 50 | } 51 | 52 | protected function _redirectToRoom() 53 | { 54 | if ( Dura_Class_RoomSession::isCreated() ) 55 | { 56 | Dura::redirect('room'); 57 | } 58 | } 59 | 60 | protected function _getInput() 61 | { 62 | $this->input['name'] = Dura::post('name'); 63 | $this->input['limit'] = Dura::post('limit'); 64 | $this->input['language'] = Dura::post('language'); 65 | $this->input['name'] = trim($this->input['name']); 66 | $this->input['language'] = trim($this->input['language']); 67 | } 68 | 69 | protected function _default() 70 | { 71 | $this->output['user_min'] = DURA_USER_MIN; 72 | $this->output['user_max'] = $this->userMax; 73 | $this->output['languages'] = $this->languages; 74 | $this->output['input'] = $this->input; 75 | $this->output['error'] = $this->error; 76 | $this->_view(); 77 | } 78 | 79 | protected function _create() 80 | { 81 | $this->_validate(); 82 | 83 | $this->_createRoom(); 84 | } 85 | 86 | protected function _validate() 87 | { 88 | $name = $this->input['name']; 89 | 90 | if ( $name === '' ) 91 | { 92 | throw new Exception(t("Please input name.")); 93 | } 94 | 95 | if ( mb_strlen($name) > 10 ) 96 | { 97 | throw new Exception(t("Name should be less than 10 letters.")); 98 | } 99 | 100 | $limit = $this->input['limit']; 101 | 102 | if ( $limit < DURA_USER_MIN ) 103 | { 104 | throw new Exception(t("Member should be more than {1}.", DURA_USER_MIN)); 105 | } 106 | 107 | if ( $limit > $this->userMax ) 108 | { 109 | throw new Exception(t("Member should be less than {1}.", $this->userMax)); 110 | } 111 | 112 | if ( !in_array($this->input['language'], array_keys($this->languages)) ) 113 | { 114 | throw new Exception(t("The language is not in the option.")); 115 | } 116 | } 117 | 118 | protected function _roomLimit() 119 | { 120 | $roomHandler = new Dura_Model_RoomHandler; 121 | $roomModels = $roomHandler->loadAll(); 122 | 123 | $roomExpire = time() - DURA_CHAT_ROOM_EXPIRE; 124 | 125 | $usedCapacity = 0; 126 | 127 | foreach ( $roomModels as $id => $roomModel ) 128 | { 129 | if ( intval($roomModel->update) < $roomExpire ) 130 | { 131 | $roomHandler->delete($id); 132 | continue; 133 | } 134 | 135 | $usedCapacity += (int) $roomModel->limit; 136 | } 137 | 138 | unset($roomHandler, $roomModels, $roomModel); 139 | 140 | if ( $usedCapacity >= DURA_SITE_USER_CAPACITY ) 141 | { 142 | Dura::trans(t("Cannot create new room any more."), 'lounge'); 143 | } 144 | 145 | $this->userMax = DURA_SITE_USER_CAPACITY - $usedCapacity; 146 | 147 | if ( $this->userMax > DURA_USER_MAX ) 148 | { 149 | $this->userMax = DURA_USER_MAX; 150 | } 151 | 152 | if ( $this->userMax < DURA_USER_MIN ) 153 | { 154 | Dura::trans(t("Cannot create new room any more."), 'lounge'); 155 | } 156 | } 157 | 158 | protected function _createRoom() 159 | { 160 | $userName = Dura::user()->getName(); 161 | $userId = Dura::user()->getId(); 162 | $userIcon = Dura::user()->getIcon(); 163 | 164 | $roomHandler = new Dura_Model_RoomHandler; 165 | $roomModel = $roomHandler->create(); 166 | $roomModel->name = $this->input['name']; 167 | $roomModel->update = time(); 168 | $roomModel->limit = $this->input['limit']; 169 | $roomModel->host = $userId; 170 | $roomModel->language = $this->input['language']; 171 | 172 | $users = $roomModel->addChild('users'); 173 | $users->addChild('name', $userName); 174 | $users->addChild('id', $userId); 175 | $users->addChild('icon', $userIcon); 176 | $users->addChild('update', time()); 177 | 178 | if ( Dura::$language != $this->input['language'] ) 179 | { 180 | $langFile = DURA_TRUST_PATH.'/language/'.$this->input['language'].'.php'; 181 | Dura::$catalog = require $langFile; 182 | } 183 | 184 | $talk = $roomModel->addChild('talks'); 185 | $talk->addChild('id', md5(microtime().mt_rand())); 186 | $talk->addChild('uid', 0); 187 | $talk->addChild('name', $userName); 188 | $talk->addChild('message', "{1} logged in."); 189 | $talk->addChild('icon', ''); 190 | $talk->addChild('time', time()); 191 | 192 | $id = md5(microtime().mt_rand()); 193 | 194 | if ( !$roomHandler->save($id, $roomModel) ) 195 | { 196 | throw new Exception(t("Data Error: Room creating failed.")); 197 | } 198 | 199 | Dura_Class_RoomSession::create($id); 200 | 201 | Dura::redirect('room'); 202 | } 203 | 204 | protected function _languages() 205 | { 206 | require_once DURA_TRUST_PATH.'/language/list.php'; 207 | 208 | $languages = dura_get_language_list(); 209 | 210 | foreach ( $languages as $langcode => $name ) 211 | { 212 | if ( !file_exists(DURA_TRUST_PATH.'/language/'.$langcode.'.php') ) 213 | { 214 | unset($languages[$langcode]); 215 | } 216 | } 217 | 218 | $this->languages = $languages; 219 | } 220 | } 221 | 222 | ?> 223 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/default.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_Default extends Dura_Abstract_Controller 15 | { 16 | protected $error = null; 17 | protected $icons = array(); 18 | 19 | public function __construct() 20 | { 21 | parent::__construct(); 22 | $this->icons = Dura_Class_Icon::getIcons(); 23 | 24 | unset($this->icons['admin']); 25 | } 26 | 27 | public function main() 28 | { 29 | if ( Dura::user()->isUser() ) 30 | { 31 | Dura::redirect('lounge'); 32 | } 33 | 34 | if ( Dura::post('name') ) 35 | { 36 | try 37 | { 38 | $this->_login(); 39 | } 40 | catch ( Exception $e ) 41 | { 42 | $this->error = $e->getMessage(); 43 | } 44 | } 45 | 46 | $this->_default(); 47 | } 48 | 49 | protected function _login() 50 | { 51 | $name = Dura::post('name'); 52 | $icon = Dura::post('icon'); 53 | $language = Dura::post('language'); 54 | $name = trim($name); 55 | $icon = trim($icon); 56 | $language = trim($language); 57 | 58 | if ( $name === '' ) 59 | { 60 | throw new Exception(t("Please input name.")); 61 | } 62 | 63 | if ( mb_strlen($name) > 10 ) 64 | { 65 | throw new Exception(t("Name should be less than 10 letters.")); 66 | } 67 | 68 | $token = Dura::post('token'); 69 | 70 | if ( !Dura_Class_Ticket::check($token) ) 71 | { 72 | throw new Exception(t("Login error happened.")); 73 | } 74 | 75 | if ( !isset($this->icons[$icon]) ) 76 | { 77 | $icons = array_keys($this->icons); 78 | $icon = reset($icons); 79 | } 80 | 81 | $user =& Dura_Class_User::getInstance(); 82 | $user->login($name, $icon, $language); 83 | 84 | Dura_Class_Ticket::destory(); 85 | 86 | Dura::redirect('lounge'); 87 | } 88 | 89 | protected function _default() 90 | { 91 | require_once DURA_TRUST_PATH.'/language/list.php'; 92 | 93 | $languages = dura_get_language_list(); 94 | 95 | foreach ( $languages as $langcode => $name ) 96 | { 97 | if ( !file_exists(DURA_TRUST_PATH.'/language/'.$langcode.'.php') ) 98 | { 99 | unset($languages[$langcode]); 100 | } 101 | } 102 | 103 | $acceptLangs = getenv('HTTP_ACCEPT_LANGUAGE'); 104 | $acceptLangs = explode(',', $acceptLangs); 105 | $defaultLanguage = DURA_LANGUAGE; 106 | 107 | foreach ( $acceptLangs as $k => $acceptLang ) 108 | { 109 | @list($langcode, $dummy) = explode(';', $acceptLang); 110 | 111 | foreach ( $languages as $language => $v ) 112 | { 113 | if ( stripos($language, $langcode) === 0 ) 114 | { 115 | $defaultLanguage = $language; 116 | break 2; 117 | } 118 | } 119 | } 120 | 121 | $this->output['languages'] = $languages; 122 | $this->output['default_language'] = $defaultLanguage; 123 | $this->output['icons'] = $this->icons; 124 | $this->output['error'] = $this->error; 125 | $this->output['token'] = Dura_Class_Ticket::issue(); 126 | $this->_view(); 127 | } 128 | } 129 | 130 | ?> 131 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/logout.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_Logout extends Dura_Abstract_Controller 15 | { 16 | public function __construct() 17 | { 18 | parent::__construct(); 19 | } 20 | 21 | public function main() 22 | { 23 | if ( !Dura::user()->isUser() ) 24 | { 25 | Dura::redirect(); 26 | } 27 | 28 | $this->_default(); 29 | } 30 | 31 | protected function _default() 32 | { 33 | session_destroy(); 34 | 35 | Dura::redirect(); 36 | } 37 | } 38 | 39 | ?> 40 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/lounge.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_Lounge extends Dura_Abstract_Controller 15 | { 16 | public function __construct() 17 | { 18 | parent::__construct(); 19 | } 20 | 21 | public function main() 22 | { 23 | $this->_validateUser(); 24 | 25 | $this->_default(); 26 | } 27 | 28 | protected function _default() 29 | { 30 | $this->_redirectToRoom(); 31 | 32 | $this->_rooms(); 33 | 34 | $this->_profile(); 35 | 36 | $this->output['create_room_url'] = Dura::url('create_room'); 37 | 38 | $this->_view(); 39 | } 40 | 41 | protected function _redirectToRoom() 42 | { 43 | if ( Dura_Class_RoomSession::isCreated() ) 44 | { 45 | Dura::redirect('room'); 46 | } 47 | } 48 | 49 | protected function _rooms() 50 | { 51 | $roomHandler = new Dura_Model_RoomHandler; 52 | $roomModels = $roomHandler->loadAll(); 53 | 54 | $rooms = array(); 55 | 56 | $roomExpire = time() - DURA_CHAT_ROOM_EXPIRE; 57 | $activeUser = 0; 58 | 59 | foreach ( $roomModels as $id => $roomModel ) 60 | { 61 | $room = $roomModel->asArray(); 62 | 63 | if ( $room['update'] < $roomExpire ) 64 | { 65 | $roomHandler->delete($id); 66 | continue; 67 | } 68 | 69 | $room['creater'] = ''; 70 | 71 | foreach ( $room['users'] as $user ) 72 | { 73 | if ( $user['id'] == $room['host'] ) 74 | { 75 | $room['creater'] = $user['name']; 76 | } 77 | } 78 | 79 | $room['id'] = $id; 80 | $room['total'] = count($room['users']); 81 | $room['url'] = Dura::url('room'); 82 | 83 | $lang = (int) ( $room['language'] != Dura::user()->getLanguage() ); 84 | 85 | $rooms[$lang][] = $room; 86 | 87 | $activeUser += $room['total']; 88 | } 89 | 90 | unset($roomHandler, $roomModels, $roomModel, $room); 91 | 92 | ksort($rooms); 93 | 94 | $this->output['rooms'] = $rooms; 95 | $this->output['active_user'] = $activeUser; 96 | } 97 | 98 | protected function _profile() 99 | { 100 | $user =& Dura::user(); 101 | $icon = $user->getIcon(); 102 | $icon = Dura_Class_Icon::getIconUrl($icon); 103 | 104 | $profile = array( 105 | 'icon' => $icon, 106 | 'name' => $user->getName(), 107 | ); 108 | 109 | $this->output['profile'] = $profile; 110 | } 111 | } 112 | 113 | ?> 114 | -------------------------------------------------------------------------------- /drrr/trust_path/controller/room.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Controller_Room extends Dura_Abstract_Controller 15 | { 16 | protected $id = null; 17 | protected $chat = null; 18 | protected $isAjax = null; 19 | protected $roomHandler = null; 20 | protected $roomModels = null; 21 | 22 | public function __construct() 23 | { 24 | parent::__construct(); 25 | 26 | $this->_validateUser(); 27 | 28 | if ( Dura_Class_RoomSession::isCreated() ) 29 | { 30 | $this->id = Dura_Class_RoomSession::get('id'); 31 | } 32 | else 33 | { 34 | $this->id = Dura::post('id'); 35 | } 36 | 37 | if ( !$this->id ) 38 | { 39 | Dura::redirect('lounge'); 40 | } 41 | 42 | $this->roomHandler = new Dura_Model_RoomHandler; 43 | $this->roomModel = $this->roomHandler->load($this->id); 44 | 45 | if ( !$this->roomModel ) 46 | { 47 | Dura_Class_RoomSession::delete(); 48 | Dura::trans(t("Room not found.", 'lounge')); 49 | } 50 | } 51 | 52 | public function main() 53 | { 54 | if ( Dura::post('login') ) 55 | { 56 | $this->_login(); 57 | } 58 | 59 | if ( !$this->_isLogin() ) 60 | { 61 | Dura_Class_RoomSession::delete(); 62 | Dura::redirect('lounge'); 63 | } 64 | 65 | if ( Dura::post('logout') ) 66 | { 67 | $this->_logout(); 68 | } 69 | elseif ( Dura::post('message') ) 70 | { 71 | $this->_message(); 72 | } 73 | elseif ( isset($_POST['room_name']) ) 74 | { 75 | $this->_changeRoomName(); 76 | } 77 | elseif ( isset($_POST['new_host']) ) 78 | { 79 | $this->_handoverHostRight(); 80 | } 81 | elseif ( isset($_POST['ban_user']) ) 82 | { 83 | $this->_banUser(); 84 | } 85 | 86 | $this->_default(); 87 | } 88 | 89 | protected function _login() 90 | { 91 | if ( $this->_isLogin() ) 92 | { 93 | return; 94 | } 95 | 96 | if ( count($this->roomModel->users) >= (int) $this->roomModel->limit ) 97 | { 98 | Dura::trans(t("Room is full.", 'lounge')); 99 | } 100 | 101 | $unsetUsers = array(); 102 | $offset = 0; 103 | $changeHost = false; 104 | 105 | foreach ( $this->roomModel->users as $user ) 106 | { 107 | if ( $user->update < time() - DURA_CHAT_ROOM_EXPIRE ) 108 | { 109 | $userName = (string) $user->name; 110 | 111 | $this->_npcDisconnect($userName); 112 | 113 | if ( $this->_isHost($user->id) ) 114 | { 115 | $changeHost = true; 116 | } 117 | 118 | $unsetUsers[] = $offset; 119 | } 120 | 121 | $offset++; 122 | } 123 | 124 | foreach ( $unsetUsers as $unsetUser ) 125 | { 126 | unset($this->roomModel->users[$unsetUser]); 127 | } 128 | 129 | $userName = Dura::user()->getName(); 130 | $userId = Dura::user()->getId(); 131 | $userIcon = Dura::user()->getIcon(); 132 | 133 | foreach ( $this->roomModel->users as $user ) 134 | { 135 | if ( $userName == (string) $user->name and $userIcon == (string) $user->icon ) 136 | { 137 | Dura::trans(t("Same name user exists. Please rename or change icon.", 'lounge')); 138 | } 139 | } 140 | 141 | $users = $this->roomModel->addChild('users'); 142 | $users->addChild('name', $userName); 143 | $users->addChild('id', $userId); 144 | $users->addChild('icon', $userIcon); 145 | $users->addChild('update', time()); 146 | 147 | if ( $changeHost ) 148 | { 149 | $this->_moveHostRight(); 150 | } 151 | 152 | $this->_npcLogin($userName); 153 | 154 | $this->roomHandler->save($this->id, $this->roomModel); 155 | 156 | Dura_Class_RoomSession::create($this->id); 157 | 158 | Dura::redirect('room'); 159 | } 160 | 161 | protected function _logout() 162 | { 163 | $userName = Dura::user()->getName(); 164 | $userId = Dura::user()->getId(); 165 | 166 | $userOffset = 0; 167 | 168 | foreach ( $this->roomModel->users as $user ) 169 | { 170 | if ( $userId == (string) $user->id ) 171 | { 172 | break; 173 | } 174 | 175 | $userOffset++; 176 | } 177 | 178 | unset($this->roomModel->users[$userOffset]); 179 | 180 | if ( count($this->roomModel->users) ) 181 | { 182 | $this->_npcLogout($userName); 183 | 184 | if ( $this->_isHost() ) 185 | { 186 | $this->_moveHostRight(); 187 | } 188 | 189 | $this->roomHandler->save($this->id, $this->roomModel); 190 | } 191 | else 192 | { 193 | $this->roomHandler->delete($this->id); 194 | } 195 | 196 | Dura_Class_RoomSession::delete(); 197 | 198 | Dura::redirect('lounge'); 199 | } 200 | 201 | protected function _message() 202 | { 203 | $message = Dura::post('message'); 204 | $message = preg_replace('/^[  ]*(.*?)[  ]*$/u', '$1', $message); 205 | $message = trim($message); 206 | 207 | if ( !$message ) return; 208 | 209 | if ( mb_strlen($message) > DURA_MESSAGE_MAX_LENGTH ) 210 | { 211 | $message = mb_substr($message, 0, DURA_MESSAGE_MAX_LENGTH).'...'; 212 | } 213 | 214 | $talk = $this->roomModel->addChild('talks'); 215 | $talk->addChild('id', md5(microtime().mt_rand())); 216 | $talk->addChild('uid', Dura::user()->getId()); 217 | $talk->addChild('name', Dura::user()->getName()); 218 | $talk->addChild('message', $message); 219 | $talk->addChild('icon', Dura::user()->getIcon()); 220 | $talk->addChild('time', time()); 221 | 222 | $id = Dura::user()->getId(); 223 | 224 | foreach ( $this->roomModel->users as $user ) 225 | { 226 | if ( $id == (string) $user->id ) 227 | { 228 | $user->update = time(); 229 | } 230 | } 231 | 232 | while ( count($this->roomModel->talks) > DURA_LOG_LIMIT ) 233 | { 234 | unset($this->roomModel->talks[0]); 235 | } 236 | 237 | $this->roomHandler->save($this->id, $this->roomModel); 238 | 239 | if ( Dura::get('ajax') ) die; // TODO 240 | 241 | Dura::redirect('room'); 242 | } 243 | 244 | protected function _default() 245 | { 246 | $room = $this->roomModel->asArray(); 247 | 248 | $room['talks'] = array_reverse($room['talks']); 249 | 250 | foreach ( $room['talks'] as $k => $talk ) 251 | { 252 | if ( $talk['uid'] == 0 ) 253 | { 254 | $name = $talk['name']; 255 | $room['talks'][$k]['message'] = t($talk['message'], $name); 256 | } 257 | } 258 | 259 | $this->output['room'] = $room; 260 | 261 | $this->output['user'] = array( 262 | 'id' => Dura::user()->getId(), 263 | 'name' => Dura::user()->getName(), 264 | 'icon' => Dura::user()->getIcon(), 265 | ); 266 | 267 | $this->_view(); 268 | } 269 | 270 | protected function _isLogin() 271 | { 272 | $users = $this->roomModel->users; 273 | $id = Dura::user()->getId(); 274 | 275 | foreach ( $users as $user ) 276 | { 277 | if ( $id == (string) $user->id ) 278 | { 279 | return true; 280 | } 281 | } 282 | 283 | return false; 284 | } 285 | 286 | protected function _moveHostRight() 287 | { 288 | foreach ( $this->roomModel->users as $user ) 289 | { 290 | $this->roomModel->host = (string) $user->id; 291 | $nextHost = (string) $user->name; 292 | break; 293 | } 294 | 295 | $this->_npcNewHost($nextHost); 296 | } 297 | 298 | protected function _changeRoomName() 299 | { 300 | if ( !$this->_isHost() ) 301 | { 302 | die(t("You are not host.")); 303 | } 304 | 305 | $roomName = Dura::post('room_name'); 306 | $roomName = trim($roomName); 307 | 308 | if ( $roomName === '' ) 309 | { 310 | die(t("Room name is blank.")); 311 | } 312 | 313 | if ( mb_strlen($roomName) > 10 ) 314 | { 315 | die(t("Name should be less than 10 letters.")); 316 | } 317 | 318 | $this->roomModel->name = $roomName; 319 | 320 | $this->roomHandler->save($this->id, $this->roomModel); 321 | 322 | die(t("Room name is modified.")); 323 | } 324 | 325 | protected function _handoverHostRight() 326 | { 327 | if ( !$this->_isHost() ) 328 | { 329 | die(t("You are not host.")); 330 | } 331 | 332 | $nextHostId = Dura::post('new_host'); 333 | 334 | if ( $nextHostId === '' ) 335 | { 336 | die(t("Host is invaild.")); 337 | } 338 | 339 | $userFound = false; 340 | 341 | foreach ( $this->roomModel->users as $user ) 342 | { 343 | if ( $nextHostId == (string) $user->id ) 344 | { 345 | $userFound = true; 346 | $nextHost = (string) $user->name; 347 | break; 348 | } 349 | } 350 | 351 | if ( !$userFound ) 352 | { 353 | die(t("User not found.")); 354 | } 355 | 356 | $this->roomModel->host = $nextHostId; 357 | 358 | $this->_npcNewHost($nextHost); 359 | 360 | $this->roomHandler->save($this->id, $this->roomModel); 361 | 362 | die(t("Gave host rights to {1}.", $nextHost)); 363 | } 364 | 365 | protected function _banUser() 366 | { 367 | if ( !$this->_isHost() ) 368 | { 369 | die(t("You are not host.")); 370 | } 371 | 372 | $userId = Dura::post('ban_user'); 373 | 374 | if ( $userId === '' ) 375 | { 376 | die(t("User is invaild.")); 377 | } 378 | 379 | $userFound = false; 380 | $userOffset = 0; 381 | 382 | foreach ( $this->roomModel->users as $user ) 383 | { 384 | if ( $userId == (string) $user->id ) 385 | { 386 | $userFound = true; 387 | $userName = (string) $user->name; 388 | break; 389 | } 390 | 391 | $userOffset++; 392 | } 393 | 394 | if ( !$userFound ) 395 | { 396 | die(t("User not found.")); 397 | } 398 | 399 | unset($this->roomModel->users[$userOffset]); 400 | 401 | $this->_npcDisconnect($userName); 402 | 403 | $this->roomHandler->save($this->id, $this->roomModel); 404 | 405 | die(t("Banned {1}.", $userName)); 406 | } 407 | 408 | protected function _isHost($userId = null) 409 | { 410 | if ( $userId === null ) 411 | { 412 | $userId = Dura::user()->getId(); 413 | } 414 | 415 | return ( $userId == (string) $this->roomModel->host ); 416 | } 417 | 418 | protected function _npcLogin($userName) 419 | { 420 | $talk = $this->roomModel->addChild('talks'); 421 | $talk->addChild('id', md5(microtime().mt_rand())); 422 | $talk->addChild('uid', 0); 423 | $talk->addChild('name', $userName); 424 | $talk->addChild('message', "{1} logged in."); 425 | $talk->addChild('icon', ''); 426 | $talk->addChild('time', time()); 427 | } 428 | 429 | protected function _npcLogout($userName) 430 | { 431 | $talk = $this->roomModel->addChild('talks'); 432 | $talk->addChild('id', md5(microtime().mt_rand())); 433 | $talk->addChild('uid', 0); 434 | $talk->addChild('name', $userName); 435 | $talk->addChild('message', "{1} logged out."); 436 | $talk->addChild('icon', ''); 437 | $talk->addChild('time', time()); 438 | } 439 | 440 | protected function _npcDisconnect($userName) 441 | { 442 | $talk = $this->roomModel->addChild('talks'); 443 | $talk->addChild('id', md5(microtime().mt_rand())); 444 | $talk->addChild('uid', 0); 445 | $talk->addChild('name', $userName); 446 | $talk->addChild('message', "{1} lost the connection."); 447 | $talk->addChild('icon', ''); 448 | $talk->addChild('time', time()); 449 | } 450 | 451 | protected function _npcNewHost($userName) 452 | { 453 | $talk = $this->roomModel->addChild('talks'); 454 | $talk->addChild('id', md5(microtime().mt_rand())); 455 | $talk->addChild('uid', 0); 456 | $talk->addChild('name', $userName); 457 | $talk->addChild('message', "{1} is a new host."); 458 | $talk->addChild('icon', ''); 459 | $talk->addChild('time', time()); 460 | } 461 | } 462 | 463 | ?> 464 | -------------------------------------------------------------------------------- /drrr/trust_path/language/en-US.php: -------------------------------------------------------------------------------- 1 | "Please input name.", 5 | "Name should be less than 10 letters." => "Name must be less than 10 letters.", 6 | "Member should be more than {1}." => "User capacity must be more than{1}.", 7 | "Member should be less than {1}." => "User capacity must be less than {1}.", 8 | "Cannot create new room any more." => "You can't create a new room any more.", 9 | "{1} logged in." => "-- {1} logged in.", 10 | "{1} logged out." => "-- {1} logged out.", 11 | "{1} lost the connection." => "-- {1} got disconnected.", 12 | "Data Error: Room creating failed." => "Error: Failed to create a room.", 13 | "Room Name" => "Room name", 14 | "Max Members" => "User capacity", 15 | "{1} members" => "{1} users", 16 | "Up to {1} rooms can be created." => "*You can create {1} rooms in maximam.", 17 | "Create Room" => "Create Room", 18 | 'If auto reload doesn\'t work, please click here.' => 'If the page does not automatically reload, please click here', 19 | "LOGOUT" => "LOGOUT", 20 | "CREATE ROOM" => "CREATE ROOM", 21 | "Lounge" => "Lounge", 22 | "full" => "full", 23 | "LOGIN" => "LOGIN", 24 | "Login error happened." => "Login error.", 25 | "ENTER" => "ENTER", 26 | "Room not found." => "Room not found.", 27 | "Room is full." => "Room is full.", 28 | "{1} users online!" => "{1} users online!", 29 | "Admin" => "Admin", 30 | "Admin ID" => "Admin ID", 31 | "Password" => "Password", 32 | "ID or password is wrong." => "ID or password is wrong.", 33 | "Announce" => "Announce", 34 | "Admin Announce" => "Admin Announce", 35 | "{1} is a new host." => "-- {1} is a new host.", 36 | "Change" => "Change", 37 | "Same name user exists. Please rename or change icon." => "Same name user exists. Please change your name or icon.", 38 | "You are not host." => "You are not host.", 39 | "Room name is blank." => "Room name is blank.", 40 | "Room name is modified." => "Room name is modified.", 41 | "Handover host" => "Handover host rights", 42 | "Ban user" => "Ban user", 43 | "Host is invaild." => "Host is invaild.", 44 | "User not found." => "User not found.", 45 | "Gave host rights to {1}." => "Gave host rights to {1}.", 46 | "User is invaild." => "User is invaild.", 47 | "Banned {1}." => "Banned {1}.", 48 | "Language" => "Language", 49 | "The language is not in the option." => "The language is not in the option.", 50 | "Durarara like chat room" => "Durarara like chat room", 51 | "Durarara fan community" => "Durarara fan community", 52 | ); 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /drrr/trust_path/language/ja-JP.php: -------------------------------------------------------------------------------- 1 | "名前を決めてください。", 5 | "Name should be less than 10 letters." => "名前は10文字以内にしてください。", 6 | "Member should be more than {1}." => "人数は{1}人以上にしてください。", 7 | "Member should be less than {1}." => "人数は{1}人以下にしてください。", 8 | "Cannot create new room any more." => "これ以上部屋を増やすことはできません。", 9 | "{1} logged in." => "ーー {1}さんが入室しました", 10 | "{1} logged out." => "ーー {1}さんが退室しました", 11 | "{1} lost the connection." => "ーー {1}さんの接続が切れました", 12 | "Data Error: Room creating failed." => "データエラー:ルーム作成に失敗しました。", 13 | "Room Name" => "部屋名", 14 | "Max Members" => "定員", 15 | "{1} members" => "{1}人", 16 | "Up to {1} rooms can be created." => "*部屋は{1}部屋まで作ることができます。", 17 | "Create Room" => "部屋を作る", 18 | 'If auto reload doesn\'t work, please click here.' => '転送されない場合はここをクリックしてください。', 19 | "LOGOUT" => "LOGOUT", 20 | "CREATE ROOM" => "部屋を作る", 21 | "Lounge" => "ラウンジ", 22 | "full" => "満員", 23 | "LOGIN" => "LOGIN", 24 | "Login error happened." => "外部からログインを試みたなどの原因でエラーが発生しました。", 25 | "ENTER" => "ENTER", 26 | "Room not found." => "部屋が存在しないか削除されました。", 27 | "Room is full." => "部屋が満員になりました。", 28 | "{1} users online!" => "{1}人がチャット参加中!", 29 | "Admin" => "管理", 30 | "Admin ID" => "管理者ID", 31 | "Password" => "パスワード", 32 | "ID or password is wrong." => "IDかパスワードが正しくありません。", 33 | "Announce" => "全室アナウンス", 34 | "Admin Announce" => "管理者アナウンス", 35 | "{1} is a new host." => "ーー {1}さんにルーム管理権限が移動しました", 36 | "Change" => "変更", 37 | "Same name user exists. Please rename or change icon." => "同じ名前のユーザがいるため参加できません。名前かアイコンを変更してください。", 38 | "You are not host." => "権限がありません。", 39 | "Room name is blank." => "部屋名が空欄です。", 40 | "Room name is modified." => "部屋名を変更しました。", 41 | "Handover host" => "管理権限を渡す", 42 | "Ban user" => "退室させる", 43 | "Host is invaild." => "ユーザの選択エラー。", 44 | "User not found." => "ユーザが見つかりません。", 45 | "Gave host rights to {1}." => "{1}さんに管理権限を渡しました。", 46 | "User is invaild." => "ユーザの選択エラー。", 47 | "Banned {1}." => "{1}さんを退室させました。", 48 | "Language" => "使用言語", 49 | "The language is not in the option." => "選択肢にない言語が選択されました。", 50 | "Durarara like chat room" => "デュラララ!!チャットルーム", 51 | "Durarara fan community" => "ファンコミュニティ", 52 | ); 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /drrr/trust_path/language/ko-KR.php: -------------------------------------------------------------------------------- 1 | "이름을 입력해 주십시오.", 5 | "Name should be less than 10 letters." => "이름은 10글짜 이내로 입력해 주십시오.", 6 | "Member should be more than {1}." => "인수는 {1} 명 이상으로 해 주십시오.", 7 | "Member should be less than {1}." => "인수는 {1} 명 이하로 해 주십시오.", 8 | "Cannot create new room any more." => "더 이상 방을 만들 수 없습니다.", 9 | "{1} logged in." => "-- {1}님이 로그인 하셨습니다.", 10 | "{1} logged out." => "-- {1}님이 로그아웃 하셨습니다.", 11 | "{1} lost the connection." => "-- {1}님의 접속이 끊겼습니다.", 12 | "Data Error: Room creating failed." => "오류: 방 작성 실패", 13 | "Room Name" => "방 이름", 14 | "Max Members" => "정원", 15 | "{1} members" => "{1} 명", 16 | "Up to {1} rooms can be created." => "*방은 최대로 {1} 실까지 만들 수 있습니다.", 17 | "Create Room" => "방 만들기", 18 | 'If auto reload doesn\'t work, please click here.' => '자동 전송이 안 될 경우 여기를 클릭해 주십시오.', 19 | "LOGOUT" => "LOGOUT", 20 | "CREATE ROOM" => "방 만들기", 21 | "Lounge" => "로비", 22 | "full" => "만원", 23 | "LOGIN" => "LOGIN", 24 | "Login error happened." => "외부에서 로그인을 시도했다 등의 이유로 인해 오류가 발생했습니다.", 25 | "ENTER" => "ENTER", 26 | "Room not found." => "방이 없거나 삭제되었습니다.", 27 | "Room is full." => "방이 만원이 되었습니다.", 28 | "{1} users online!" => "{1} 명이 채팅중!", 29 | "Admin" => "관리", 30 | "Admin ID" => "관리자ID", 31 | "Password" => "비밀변호", 32 | "ID or password is wrong." => "ID나 비밀번호가 옳지 않습니다.", 33 | "Announce" => "전체 아나운스", 34 | "Admin Announce" => "관리자 아나운스", 35 | "{1} is a new host." => "-- {1} 님에게 관리권한이 이동했습니다.", 36 | "Change" => "변경", 37 | "Same name user exists. Please rename or change icon." => "같은 이름의 참가자가 있습니다. 이름 또는 아이콘을 바꾸셔서 로그인하세요.", 38 | "You are not host." => "권한이 없습니다.", 39 | "Room name is blank." => "방 이름이 공백입니다.", 40 | "Room name is modified." => "방 이름을 변경했습니다.", 41 | "Handover host" => "관리권한 옮기기", 42 | "Ban user" => "퇴실시키기", 43 | "Host is invaild." => "선택 어류가 발생했습니다.", 44 | "User not found." => "유저를 못 찾았습니다.", 45 | "Gave host rights to {1}." => "{1} 님에게 관리권한을 옮겼습니다.", 46 | "User is invaild." => "선택 어류가 발생했습니다.", 47 | "Banned {1}." => "{1} 님을 퇴실시켰습니다.", 48 | "Language" => "언어", 49 | "The language is not in the option." => "선택자에 없는 언어가 선택됐습니다.", 50 | "Durarara like chat room" => "듀라라라!!채팅방", 51 | "Durarara fan community" => "팬 교류 사이트", 52 | ); 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /drrr/trust_path/language/list.php: -------------------------------------------------------------------------------- 1 | "English", 7 | 'ja-JP' => "日本語", 8 | 'ko-KR' => "한국어", 9 | 'zh-CN' => "中文(简体)", 10 | 'zh-TW' => "中文(繁體)", 11 | 'ru-RU' => "Русский", 12 | ); 13 | } 14 | 15 | ?> 16 | -------------------------------------------------------------------------------- /drrr/trust_path/language/ru-RU.php: -------------------------------------------------------------------------------- 1 | "Пожалуйста, введите ник.", 5 | "Name should be less than 10 letters." => "Ник должен быть меньше 10 знаков.", 6 | "Member should be more than {1}." => "Число пользователей должно быть больше {1}.", 7 | "Member should be less than {1}." => "Число пользователей должно быть меньше {1}.", 8 | "Cannot create new room any more." => "Вы больше не можете создать новую комнату.", 9 | "{1} logged in." => "-- {1} в чате.", 10 | "{1} logged out." => "-- {1} покинул(а) чат.", 11 | "{1} lost the connection." => "-- {1} был(а) отключен(а).", 12 | "Data Error: Room creating failed." => "Ошибка: Ошибка при создании комнаты.", 13 | "Room Name" => "Название комнаты", 14 | "Max Members" => "Макс. число пользователей", 15 | "{1} members" => "{1} пользователей", 16 | "Up to {1} rooms can be created." => "*Всего можно создать {1} комнат.", 17 | "Create Room" => "Создать комнату", 18 | 'If auto reload doesn\'t work, please click here.' => 'Если страница автоматически не перезагружается, нажмите сюда', 19 | "LOGOUT" => "Выйти", 20 | "CREATE ROOM" => "Создать комнату", 21 | "Lounge" => "Лобби", 22 | "full" => "Полная", 23 | "LOGIN" => "Войти", 24 | "Login error happened." => "Ошибка авторизации", 25 | "ENTER" => "Войти", 26 | "Room not found." => "Комната не найдена.", 27 | "Room is full." => "Комната переполнена.", 28 | "{1} users online!" => "{1} пользователей в сети!", 29 | "Admin" => "Админ", 30 | "Admin ID" => "Админ ID", 31 | "Password" => "Пароль", 32 | "ID or password is wrong." => "ID или пароль не те.", 33 | "Announce" => "Обьявление", 34 | "Admin Announce" => "Обьявление админа", 35 | "{1} is a new host." => "-- {1} подключился.", 36 | "Change" => "Изменить", 37 | "Same name user exists. Please rename or change icon." => "Такое имя уже занято. Пожалуйста, смените имя или аватар.", 38 | "You are not host." => "Вы не вошли.", 39 | "Room name is blank." => "Пустое имя комнаты", 40 | "Room name is modified." => "Имя комнаты изменено.", 41 | "Handover host" => "Передача прав", 42 | "Ban user" => "Забанить", 43 | "Host is invaild." => "Ошибка подключения.", 44 | "User not found." => "Юзер не найден.", 45 | "Gave host rights to {1}." => "Передать права {1}.", 46 | "User is invaild." => "Юзер инвалид.", 47 | "Banned {1}." => "Забанен {1}.", 48 | "Language" => "Язык", 49 | "The language is not in the option." => "Язык не выбран.", 50 | "Durarara like chat room" => "Чат, как в «Durarara»", 51 | "Durarara fan community" => "Фан-сообщество «Durarara»", 52 | ); 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /drrr/trust_path/language/zh-CN.php: -------------------------------------------------------------------------------- 1 | "请输入显示名称。", 5 | "Name should be less than 10 letters." => "名称必须少于 10 字节。", 6 | "Member should be more than {1}." => "成员人数必须多于 {1} 人。", 7 | "Member should be less than {1}." => "成员人数必须少于 {1} 人。", 8 | "Cannot create new room any more." => "已无法创立更多新房间。", 9 | "{1} logged in." => "—— {1} 已登入房间", 10 | "{1} logged out." => "—— {1} 已退出房间", 11 | "{1} lost the connection." => "———— {1} 已中断连接", 12 | "Data Error: Room creating failed." => "资料错误:房间创立失败。", 13 | "Room Name" => "房间名称", 14 | "Max Members" => "成员人数", 15 | "{1} members" => "{1}人", 16 | "Up to {1} rooms can be created." => "本站最多仅能创立 {1} 间房间。", 17 | "Create Room" => "创立房间", 18 | 'If auto reload doesn\'t work, please click here.' => '若自动转移无任何反映,请按这里。', 19 | "LOGOUT" => "EXIT!", 20 | "CREATE ROOM" => "创立房间", 21 | "Lounge" => "房间一览", 22 | "full" => "客满", 23 | "LOGIN" => "登入", 24 | "Login error happened." => "登入发生错误。", 25 | "ENTER" => "ENTER", 26 | "Room not found." => "房间不存在或已被删除。", 27 | "Room is full." => "房间已经满员", 28 | "{1} users online!" => "目测共有 {1} 人在线上!", 29 | "Admin" => "管理", 30 | "Admin ID" => "帐号", 31 | "Password" => "密码", 32 | "ID or password is wrong." => "帐号或密码错误。", 33 | "Announce" => "Broadcast", 34 | "Admin Announce" => "管理者广播", 35 | "{1} is a new host." => "———— {1} 为新房间管理人", 36 | "Change" => "变更", 37 | "Same name user exists. Please rename or change icon." => "抱歉,这个显示名称已有人使用。请更爱显示名称或图示。", 38 | "You are not host." => "没有管理权限。", 39 | "Room name is blank." => "尚未输入房间名称。", 40 | "Room name is modified." => "房间名称已更改。", 41 | "Handover host" => "更改管理人", 42 | "Ban user" => "强制退出", 43 | "Host is invaild." => "成员选择错误。", 44 | "User not found." => "找不到成员。", 45 | "Gave host rights to {1}." => "{1} 取得管理权限。", 46 | "User is invaild." => "请选择成员。", 47 | "Banned {1}." => "{1} 已强制退出。", 48 | "Language" => "选择语言", 49 | "The language is not in the option." => "请选择可用的语言。", 50 | "Durarara like chat room" => "DOLLARS", 51 | "Durarara fan community" => "聊天室", 52 | ); 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /drrr/trust_path/language/zh-TW.php: -------------------------------------------------------------------------------- 1 | "請輸入顯示名稱。", 5 | "Name should be less than 10 letters." => "名稱必須少於 10 字元。", 6 | "Member should be more than {1}." => "成員人數必須多於 {1} 人。", 7 | "Member should be less than {1}." => "成員人數必須少於 {1} 人。", 8 | "Cannot create new room any more." => "已無法創立更多新部屋。", 9 | "{1} logged in." => "ーー {1} 已登入部屋", 10 | "{1} logged out." => "ーー {1} 已退出部屋", 11 | "{1} lost the connection." => "ーー {1} 已中斷連線", 12 | "Data Error: Room creating failed." => "資料錯誤:部屋創立失敗。", 13 | "Room Name" => "部屋名稱", 14 | "Max Members" => "成員人數", 15 | "{1} members" => "{1}人", 16 | "Up to {1} rooms can be created." => "*本站最多僅能創立 {1} 間部屋。", 17 | "Create Room" => "創立部屋", 18 | 'If auto reload doesn\'t work, please click here.' => '若自動轉移無任何反應,請按這裡。', 19 | "LOGOUT" => "LOGOUT", 20 | "CREATE ROOM" => "創立部屋", 21 | "Lounge" => "部屋一覽", 22 | "full" => "額滿", 23 | "LOGIN" => "LOGIN", 24 | "Login error happened." => "登入發生錯誤。", 25 | "ENTER" => "ENTER", 26 | "Room not found." => "部屋不存在或已被刪除。", 27 | "Room is full." => "部屋已經額滿。", 28 | "{1} users online!" => "目前共有 {1} 人在線上!", 29 | "Admin" => "管理", 30 | "Admin ID" => "帳號", 31 | "Password" => "密碼", 32 | "ID or password is wrong." => "帳號密碼錯誤。", 33 | "Announce" => "全室廣播", 34 | "Admin Announce" => "管理者廣播", 35 | "{1} is a new host." => "ーー {1} 為新部屋管理人", 36 | "Change" => "變更", 37 | "Same name user exists. Please rename or change icon." => "抱歉,這個顯示名稱已有人使用。請更改顯示名稱或圖示。", 38 | "You are not host." => "沒有管理權限。", 39 | "Room name is blank." => "尚未輸入部屋名稱。", 40 | "Room name is modified." => "部屋名稱已修改。", 41 | "Handover host" => "更改管理人", 42 | "Ban user" => "強制退出", 43 | "Host is invaild." => "成員選擇錯誤。", 44 | "User not found." => "找不到成員。", 45 | "Gave host rights to {1}." => "{1} 取得管理權限。", 46 | "User is invaild." => "請選擇成員。", 47 | "Banned {1}." => "{1} 已強制退出。", 48 | "Language" => "選擇語言", 49 | "The language is not in the option." => "請選擇可用的語言。", 50 | "Durarara like chat room" => "Durarara 聊天室", 51 | "Durarara fan community" => "中文版", 52 | ); 53 | 54 | ?> 55 | -------------------------------------------------------------------------------- /drrr/trust_path/model/room.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright 2010 Hidehito NOZAWA 10 | * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3 11 | * 12 | */ 13 | 14 | class Dura_Model_Room extends Dura_Class_Xml 15 | { 16 | public function asArray() 17 | { 18 | $result = array(); 19 | 20 | $result['name'] = (string) $this->name; 21 | $result['update'] = (int) $this->update; 22 | $result['limit'] = (int) $this->limit; 23 | $result['host'] = (string) $this->host; 24 | $result['language'] = (string) $this->language; 25 | 26 | if ( isset($this->talks) ) 27 | { 28 | foreach ( $this->talks as $talk ) 29 | { 30 | $result['talks'][] = (array) $talk; 31 | } 32 | } 33 | 34 | foreach ( $this->users as $user ) 35 | { 36 | $result['users'][] = (array) $user; 37 | } 38 | 39 | return $result; 40 | } 41 | } 42 | 43 | ?> 44 | -------------------------------------------------------------------------------- /drrr/trust_path/model/room_handler.php: -------------------------------------------------------------------------------- 1 | fileName) !== 0 ) 18 | { 19 | continue; 20 | } 21 | 22 | $id = str_replace($this->fileName.'_', '', $file); 23 | $id = str_replace('.xml', '', $id); 24 | 25 | $xml = $this->load($id); 26 | 27 | if ( $xml ) 28 | { 29 | $xmls[$id] = $xml; 30 | } 31 | } 32 | 33 | closedir($dir); 34 | 35 | return $xmls; 36 | } 37 | 38 | protected function _getDefaultXml() 39 | { 40 | return 41 | ' 42 | 43 | 44 | 45 | 46 | '; 47 | } 48 | } 49 | 50 | ?> 51 | -------------------------------------------------------------------------------- /drrr/trust_path/resource/image.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/trust_path/resource/image.docx -------------------------------------------------------------------------------- /drrr/trust_path/template/admin.default.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 |
    5 | 6 |
    7 | 8 |
    9 | 10 |
    11 |
    12 | 13 |
    14 | 15 | " /> 16 | 17 |
    18 | 19 | 20 | 21 |
    22 | 23 |
    24 |
    -------------------------------------------------------------------------------- /drrr/trust_path/template/admin_announce.default.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    4 |
    5 | 6 |
    7 | 8 |
    9 |
    10 |
    11 | 12 |
    13 | 14 | 15 |
    16 | 17 |
    18 |
    19 |
    20 |
    21 |

    22 |
    23 |
    24 |
    25 | 26 | 27 |
    28 |
    -------------------------------------------------------------------------------- /drrr/trust_path/template/create_room.default.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |

    5 |
    6 | 7 |
    8 | 9 |
    10 | 11 | 12 |
    13 | 14 | 15 | 16 | 17 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | 37 | 42 | 43 |
    18 | 23 |
    28 | 33 |
    38 | 39 | 40 | 41 |
    44 | 45 |
    46 |
    47 |
    48 |
    -------------------------------------------------------------------------------- /drrr/trust_path/template/default.default.php: -------------------------------------------------------------------------------- 1 | ` 2 |
    3 | 4 |
    5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |
    12 |

    13 | 14 |

    15 | 16 | " /> 17 | 18 |
    19 | 20 | 23 | 46 | 47 | 48 | 49 |
    50 |
    -------------------------------------------------------------------------------- /drrr/trust_path/template/footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/trust_path/template/footer.html -------------------------------------------------------------------------------- /drrr/trust_path/template/header.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/1a57danc3/drrr-like-chat/e6aedab7928ca6960b37b1624a7aa8078663877d/drrr/trust_path/template/header.html -------------------------------------------------------------------------------- /drrr/trust_path/template/lounge.default.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
      4 |
    • 5 |
    • 6 |
    • 7 |
      8 | 9 | isAdmin() ) : ?> 10 | 11 | 12 | " /> 13 |
      14 |
    • 15 |
    16 | 17 |
    18 | 19 | 20 |
    21 |

    22 | 23 |
    24 | 25 |
    26 | 27 | 28 |
    29 |
    30 | " /> 31 |
    32 |
    33 | 34 |
    35 | 36 | 37 | 38 |
      39 |
    • 40 |
    • 41 |
    • /
    • 42 | 54 |
    55 | 56 | 57 | 58 |
    59 | 60 |
    61 |
    62 |
    -------------------------------------------------------------------------------- /drrr/trust_path/template/room.default.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 5 | 6 | 7 |
    8 | 9 |
    10 | 11 | sound 12 | 13 |
    14 | 15 |
    16 |
      17 | 18 |
    • 19 | 20 |
    21 |
      22 |
    • 23 |
    • 24 |
    • 25 |
    26 |
    27 | 28 |
    29 | " />
    30 |
    31 | " disabled="disabled" /> 32 | " disabled="disabled" /> 33 | 34 |
    35 |
    36 | 37 | 41 |
    42 | 43 |
    44 | 45 |
    46 |
    47 | 48 | 49 |
    50 | 51 |
    52 |
    53 |
    54 |
    55 |

    56 |
    57 |
    58 |
    59 | 60 | 61 |
    62 |
    63 | 64 |
    -------------------------------------------------------------------------------- /drrr/trust_path/template/theme.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <?php e(t(DURA_TITLE)) ?> - <?php e(t(DURA_SUBTITLE)) ?> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 36 | 37 | 38 |
    39 | 40 |
    41 | 42 | -------------------------------------------------------------------------------- /drrr/trust_path/template/trans.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <?php e(t(DURA_SUBTITLE)) ?> 7 | 8 | 9 | 10 |
    11 |
    12 |

    13 |

    here.', $url)) ?>

    14 |
    15 |
    16 | 17 | --------------------------------------------------------------------------------