diff --git a/.gitignore b/.gitignore index 6c82ac0c5..8f6eb45ce 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ composer.lock composer.phar ttf vendor +data # Compiled source # ################### @@ -53,3 +54,4 @@ dwsync.xml ################### *.komodoproject .komodotools +*.bak diff --git a/README.md b/README.md index cbe4fbf8a..c5d93a93e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,39 @@ -# rep2 expack +# rep2 expack 全部入り by open774 -なんだかんだで歴史の長い、PHPでつくられたサーバーサイド2ちゃんねるビューワーです。 +* rep2-expack https://github.com/rsky/p2-php +* rep2-expack +live https://github.com/pluslive/p2-php +* rep2-expack test https://github.com/orzisun/p2-php -作りがレガシーなのは作っているひとがいちばんよくわかっているので、勘弁してつかあさい。 +上記やスレに上げられた修正を取り込んで全部入りを目指す闇鍋バージョンです。 -[次世代版建設予定地](https://github.com/rsky/page2) +独自の改良も行っています。 +* [スクリーンショット](https://open774.github.io/p2-php/screenshots.html) +* [Wiki](https://github.com/open774/p2-php/wiki) +* **[FAQ](https://github.com/open774/p2-php/wiki/FAQ) スレに書く前にからならず確認** + +### 主な追加機能 + +各機能の説明はdocディレクトリのREADMEファイルを見てください。 + +* cronとかで最近読んだスレなどのdatをDL出来るスクリプト追加 +
 php scripts/fetch-dat.php --mode モードを一つ指定(fav recent res_hist)
+* 名無しが節穴になる板に名無しで書き込むときに警告を出す機能を追加 +* NGあぼーんの対象になったレスのIDを自動的にNGあぼーんする機能を追加 +* 「設定管理」からキャッシュ・履歴の消去できる機能を追加 +* 本家からbeのログイン部分を移植してBE2.0に対応 +* rep2に登録された外部板のリンクををrep2で開けるようにした(Janeと同じ動作) +* 0ちゃんねるスクリプトを使用した外部板の過去ログDATを取り込み対応 +* SOCKS5プロクシ経由の接続に対応(人柱) +* tor内の掲示板(.onionドメイン)をtor経由で閲覧する機能を追加(人柱) +* curl を用いた並列ダウンロード機能を追加(人柱機能) ## セットアップ ### Git & Composerで 1. 本体をclone -
git clone git://github.com/rsky/p2-php.git
+  
git clone git://github.com/open774/p2-php.git
   cd p2-php
2. 依存ライブラリをダウンロード @@ -25,6 +46,10 @@ ## 動作環境 +Linux(openSUSE Leap)のPHP7+Apacheで動作確認しています。 +PHP5.6以降で動くはずですが、PHP7.*推奨です。 +PHP7での不具合修正を優先するため突然PHP5.xのサポートが終わる可能性があります。 + 以下のコマンドを実行して、全ての項目で `OK` が出たなら大丈夫です。 何かエラーが出たらがんばって環境を整えてください。 @@ -48,7 +73,7 @@ moriyoshi++ スレに貼られている画像を自動で保存する機能、**ImageCache2**があります。 -see also [doc/ImageCache2/README.txt](https://github.com/rsky/p2-php/blob/master/doc/ImageCache2/README.txt), [doc/ImageCache2/INSTALL.txt](https://github.com/rsky/p2-php/blob/master/doc/ImageCache2/INSTALL.txt) +see also [doc/ImageCache2/README.txt](https://github.com/open774/p2-php/blob/master/doc/ImageCache2/README.txt), [doc/ImageCache2/INSTALL.txt](https://github.com/open774/p2-php/blob/master/doc/ImageCache2/INSTALL.txt) ### 準備 @@ -73,10 +98,25 @@ see also [doc/ImageCache2/README.txt](https://github.com/rsky/p2-php/blob/master 細かい挙動の変更は `メニュー > 設定管理 > ユーザー設定編集` から行えます。 -Webブラウザから変更できない項目は [conf/conf_admin.inc.php](https://github.com/rsky/p2-php/blob/master/conf/conf_admin.inc.php) (基本), [conf/conf_admin_ex.inc.php](https://github.com/rsky/p2-php/blob/master/conf/conf_admin_ex.inc.php) (拡張パック), [conf/conf_ic2.inc.php](https://github.com/rsky/p2-php/blob/master/conf/conf_ic2.inc.php) (ImageCache2) を直接編集します。 +Webブラウザから変更できない項目は [conf/conf_admin.inc.php](https://github.com/open774/p2-php/blob/master/conf/conf_admin.inc.php) (基本), [conf/conf_admin_ex.inc.php](https://github.com/open774/p2-php/blob/master/conf/conf_admin_ex.inc.php) (拡張パック), [conf/conf_ic2.inc.php](https://github.com/open774/p2-php/blob/master/conf/conf_ic2.inc.php) (ImageCache2) を直接編集します。 どういうことができるか書き起こすのが面倒なので設定ファイルのコメントを見てください。 +## cronを使った便利機能 +下記のスクリプトをcronで定期的に回すとより便利にrep2を使用することが出来ます。 +必要に応じてどちらか一つを使用すれば充分でしょう。 + +### 履歴の新着数更新 +ブラウザから更新を行うと一覧の表示に時間がかかるため、subject.txtを更新するためのスクリプトが付属しています。 +並列ダウンロードで高速ですが、使用するために設定変更を行う必要があります。 + +
php scripts/fetch-subject-txt.php --mode モードを一つ指定(fav recent res_hist)
+ +### 更新ついでにDATのダウンロード +並列ダウンロードの代わりにsubject.txtとDATのダウンロード機能を実装したスクリプトです。 +時間はかかりますが、設定変更無しで使えるのでこちらがお手軽です。 + +
php scripts/fetch-dat.php --mode モードを一つ指定(fav recent res_hist)
## 更新 @@ -96,6 +136,10 @@ Webブラウザから変更できない項目は [conf/conf_admin.inc.php](https * **unpush** https://github.com/unpush/p2-php/ * **thermon** https://github.com/thermon/p2-php/ * **part32の892** *(+live)* https://github.com/pluslive/p2-php/ +* **orzisun** https://github.com/orzisun/p2-php +* **open774** https://github.com/open774/p2-php +* **killer4989** https://github.com/killer4989/p2-php +* **dgg712** https://github.com/dgg712/p2-php * **2ch p2/rep2スレの>>1-1000** diff --git a/composer.json b/composer.json index 84ff66609..4714155ec 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,15 @@ { - "name": "rsky/p2-php", + "name": "open774/p2-php", "description": "The server side 2ch viewer written in PHP", "license": "X11", "repositories": [ { "type": "pear", - "url": "http://pear.php.net" + "url": "https://pear.php.net" + }, + { + "type": "vcs", + "url": "https://github.com/open774/quickform" } ], "require": { @@ -13,26 +17,28 @@ "rsky/pear-core-min": "dev-master", "rsky/pear-pager": ">=2.4.9beta2", "rsky/pear-html_template_flexy": ">=1.3.13alpha6", - "pear-pear/benchmark": "1.2.9", - "pear-pear/cache_lite": "1.7.15", - "pear-pear/db": "1.7.14", - "pear-pear/db_dataobject": "1.11.2", - "pear-pear/date": "1.4.7", - "pear-pear/file": "1.4.1", - "pear-pear/file_util": "1.0.0", - "pear-pear/html_common": "1.2.5", - "pear-pear/html_quickform": "3.2.13", - "pear-pear/http_client": "1.2.1", - "pear-pear/http_request": "1.4.4", - "pear-pear/net_socket": "1.0.10", - "pear-pear/net_url": "1.0.15", - "pear-pear/net_useragent_mobile": "1.0.0", - "pear-pear/validate": "0.8.5", - "pear-pear/var_dump": "1.0.4", - "pear-pear/xml_parser": "1.3.4", - "pear-pear/xml_rss": "1.0.2", + "pear-pear.php.net/benchmark": "1.2.9", + "pear-pear.php.net/cache_lite": "1.7.15", + "pear-pear.php.net/db": "1.7.14", + "pear-pear.php.net/db_dataobject": "1.11.2", + "pear-pear.php.net/date": "1.4.7", + "pear-pear.php.net/file": "1.4.1", + "pear-pear.php.net/file_util": "1.0.0", + "pear-pear.php.net/html_common": "1.2.5", + "2ch774/quickform": "dev-master", + "pear-pear.php.net/http_request2": "2.2.1", + "pear-pear.php.net/net_socket": "1.0.10", + "pear-pear.php.net/net_url": "1.0.15", + "pear-pear.php.net/net_url2": "2.1.1", + "pear-pear.php.net/net_useragent_mobile": "1.0.0", + "pear-pear.php.net/validate": "0.8.5", + "pear-pear.php.net/var_dump": "1.0.4", + "pear-pear.php.net/xml_parser": "1.3.4", + "pear-pear.php.net/xml_rss": "1.0.2", "symfony/console": "2.2.*", "symfony/yaml": "2.2.*", + "jakeasmith/http_build_url": "1.0.*", "dropbox/dropbox-sdk": "dev-master" + } } diff --git a/conf/conf.inc.php b/conf/conf.inc.php index 62ff4666f..d037ef844 100644 --- a/conf/conf.inc.php +++ b/conf/conf.inc.php @@ -6,16 +6,15 @@ // o[W $_conf = array( - 'p2name' => 'rep2-expack', // rep2̖O - 'p2version' => '130331.2233', // rep2̃o[W + 'p2name' => 'rep2-expack_allinone', // rep2̖O + 'p2version' => '180705.1300', // rep2̃o[W ); $_conf['p2ua'] = "{$_conf['p2name']}/{$_conf['p2version']}"; define('P2_VERSION_ID', sprintf('%u', crc32($_conf['p2ua']))); -$_conf['jquery_version'] = '1.8.3'; -$_conf['have_glyphish_2x'] = false; +$_conf['jquery_version'] = '3.2.1'; /* * ʏ̓ZbVt@C̃bN҂ɗ͒Z邽 @@ -74,12 +73,14 @@ function p2_init() $_conf['p2web_url'] = 'http://akid.s17.xrea.com/'; $_conf['p2ime_url'] = 'http://akid.s17.xrea.com/p2ime.php'; - $_conf['favrank_url'] = 'http://akid.s17.xrea.com/favrank/favrank.php'; - $_conf['expack.web_url'] = 'http://page2.skr.jp/rep2/'; - $_conf['expack.download_url'] = 'http://page2.skr.jp/rep2/downloads.html'; - $_conf['expack.history_url'] = 'http://page2.skr.jp/rep2/history.html'; +// $_conf['favrank_url'] = 'http://akid.s17.xrea.com/favrank/favrank.php'; + $_conf['expack.web_url'] = 'https://open774.github.io/p2-php/'; + $_conf['expack.download_url'] = 'https://github.com/open774/p2-php/releases'; + $_conf['expack.history_url'] = 'https://github.com/open774/p2-php/blob/master/doc/README-774.txt'; $_conf['expack.tgrep_url'] = 'http://page2.xrea.jp/tgrep/search'; - $_conf['expack.gate_php'] = 'http://page2.skr.jp/gate.php'; + $_conf['test.dig2ch_url'] = 'https://dig.5ch.net/'; + $_conf['expack.gate_php'] = '//open774.github.io/p2-php/gate.html'; + $_conf['title_php'] = 'title.php'; $_conf['menu_php'] = 'menu.php'; $_conf['subject_php'] = 'subject.php'; $_conf['read_php'] = 'read.php'; @@ -176,8 +177,6 @@ function p2_init() include P2_LIB_DIR . '/startup.funcs.php'; spl_autoload_register('p2_load_class'); - include P2_LIB_DIR . '/wiki/P2UtilWiki.php'; - if ($debug) { $profiler = new Benchmark_Profiler(true); // p2_print_memory_usage(); @@ -189,8 +188,10 @@ function p2_init() mb_internal_encoding('SJIS-win'); mb_http_output('pass'); - mb_substitute_character(63); // R[hϊɎs "?" ɂȂ + //mb_substitute_character(63); // R[hϊɎs "?" ɂȂ //mb_substitute_character(0x3013); // + + mb_substitute_character('entity'); //R[hϊɎslQƂɒu //ob_start('mb_output_handler'); if (function_exists('mb_ereg_replace')) { @@ -261,6 +262,7 @@ function p2_init() 'auth_user_file' => 'p2_auth_user.php', // F؃[Uݒt@C(f[^PHP) 'login_log_file' => 'p2_login.log.php', // OC (f[^PHP) 'login_failed_log_file' => 'p2_login_failed.dat.php', // OCs (f[^PHP) + 'sid2chapi_php' => 'p2_sid2chapi.php', // 2ch APIZbVIDL^t@C (f[^PHP) ); foreach ($preferences as $k => $v) { $_conf[$k] = $_conf['pref_dir'] . '/' . $v; diff --git a/conf/conf_admin.inc.php b/conf/conf_admin.inc.php index 633b761b7..5bb3dbd76 100644 --- a/conf/conf_admin.inc.php +++ b/conf/conf_admin.inc.php @@ -71,15 +71,11 @@ // Cookie ID̗L $_conf['cid_expire_day'] = 30; // (30) -// lbg[Nڑ^CAEg (b) -// @deprecated use $_conf['http_conn_timeout'] and $_conf['http_read_timeout'] -$_conf['fsockopen_time_limit'] = 7; // (7) - // HTTPڑ^CAEg (b) -$_conf['http_conn_timeout'] = 2; // (2) +$_conf['http_conn_timeout'] = 5; // (5) // HTTPǍ^CAEg (b) -$_conf['http_read_timeout'] = 8; // (8) +$_conf['http_read_timeout'] = 10; // (10) // p2̍ŐVo[W`FbN(:1, Ȃ:0) $_conf['updatan_haahaa'] = 1; // (1) @@ -111,6 +107,9 @@ // V܂Ƃߓǂ݂̃LbVc (:0, :-1) $_conf['matome_cache_max'] = 5; // (5) +// OF؂gpOC i:1, Ȃ:0j +$_conf['external_authentication'] = 0; // (0) + // }}} // ---------------------------------------------------------------------- // {{{ gуANZXL[ diff --git a/conf/conf_admin_ex.inc.php b/conf/conf_admin_ex.inc.php index 680288feb..022056c1f 100644 --- a/conf/conf_admin_ex.inc.php +++ b/conf/conf_admin_ex.inc.php @@ -17,14 +17,25 @@ // Zend Framework (Zend Gdatał) libraryfBNgւ̃pX $_conf['expack.zf_path'] = ""; // ("") +// curl ɂ_E[hLɂ +// (off:0, on:1) +$_conf['expack.use_curl_multi'] = 0; // (1) + +// curl ɂ_E[h̍ő厝Iڑ +$_conf['expack.curl_per_host'] = 2; // (1) + // pecl_http płꍇAHttpRequestPool ɂ_E[hLɂ // (off:0, on:1, R}hCŎs:2) -$_conf['expack.use_pecl_http'] = 1; // (1) +$_conf['expack.use_pecl_http'] = 0; // (0) // expack.use_pecl_http 2 CLIpphp.inihttpGNXeV // [h悤ɂȂĂȂꍇ̂ 1 ɂ $_conf['expack.dl_pecl_http'] = 0; // (0) +// X^Cdig.2ch.netōs +$_conf['test.search_dig2ch'] = 1; // (1) + + // }}} // {{{ XL diff --git a/conf/conf_ic2.inc.php b/conf/conf_ic2.inc.php index 4bb5d6750..7e244c00e 100644 --- a/conf/conf_ic2.inc.php +++ b/conf/conf_ic2.inc.php @@ -12,7 +12,7 @@ // DSN (DBɐڑ邽߂̃f[^\[X) // @link http://jp.pear.php.net/manual/ja/package.database.db.intro-dsn.php // ) -// MySQL: 'mysql://username:password@localhost:3306/database' +// MySQL: 'mysqli://username:password@localhost:3306/database' // PostgreSQL: 'pgsql://username:password@localhost:5432/database' // SQLite2: 'sqlite:///' . $_conf['db_dir'] . '/imgcache.sqlite' // 1: username,password,database͎ۂ̂̂ƓǂݑւB @@ -138,12 +138,6 @@ // y[W^Cg $_conf['expack.ic2.getter.title'] = "ImageCache2::Getter"; -// T[oɐڑۂɃ^CAEg܂ł̎ԁibj -$_conf['expack.ic2.getter.conn_timeout'] = 5; - -// _E[h^CAEg܂ł̎ԁibj -$_conf['expack.ic2.getter.read_timeout'] = 60; - // G[Oɂ摜̓_E[h݂Ȃ (no:0;yes:1) $_conf['expack.ic2.getter.checkerror'] = 1; diff --git a/conf/conf_user_def.inc.php b/conf/conf_user_def.inc.php index 1afa95b2c..acefca2f0 100644 --- a/conf/conf_user_def.inc.php +++ b/conf/conf_user_def.inc.php @@ -7,34 +7,23 @@ // {{{ be.2ch.netAJEg -// be.2ch.net̔F؃R[h(pX[hł͂Ȃ) -$conf_user_def['be_2ch_code'] = ""; // ("") +// be.2ch.net̔F؃pX[h(F؃R[h͎gȂȂ܂) +$conf_user_def['be_2ch_password'] = ""; // ("") // be.2ch.net̓o^[AhX $conf_user_def['be_2ch_mail'] = ""; // ("") -// }}} -// {{{ p2.2ch.netAJEg - -// p2.2ch.net̃T[o[ -$conf_user_def['p2_2ch_host'] = "w1.p2.2ch.net"; // ("w1.p2.2ch.net") -$conf_user_rules['p2_2ch_host'] = array('/^(?:w\\d+\\.)?p2\\.2ch\\.net$/'); - -// p2.2ch.net̓o^[AhX -$conf_user_def['p2_2ch_mail'] = ""; // ("") +// be.2ch.netDMDM(蓮ݒ肷ꍇ̂ݓ) +$conf_user_def['be_2ch_DMDM'] = ""; // ("") -// p2.2ch.net̃OCpX[h -$conf_user_def['p2_2ch_pass'] = ""; // ("") - -// p2.2ch.net CookieF؎IPAhX̓ꐫ`FbN -$conf_user_def['p2_2ch_ignore_cip'] = 0; // (0) -$conf_user_rad['p2_2ch_ignore_cip'] = array('0' => '`FbN', '1' => '`FbNȂ'); +// be.2ch.netMDMD(蓮ݒ肷ꍇ̂ݓ) +$conf_user_def['be_2ch_MDMD'] = ""; // ("") // }}} // {{{ PATH // Eɍŏɕ\y[WBICURLB -$conf_user_def['first_page'] = "first_cont.php"; // ("first_cont.php") +$conf_user_def['first_page'] = "first_cont.php"; // ("first_cont.php") /* ƒXg̓ICƃ[J̗ǂݍ߂ @@ -59,9 +48,9 @@ // Xbhꗗ̎XVԊuBiwB0Ȃ玩XVȂBj $conf_user_def['refresh_time'] = 0; // (0) -// XbhꗗŖ擾Xɑ΂ČXւ̃NiEj\ (:1, Ȃ:0) +// XbhꗗŖ擾Xɑ΂ČXւ̃NiEj\ (:1, Ȃ:0, 擾Xł:2) $conf_user_def['sb_show_motothre'] = 1; // (1) -$conf_user_rad['sb_show_motothre'] = array('1' => '', '0' => 'Ȃ'); +$conf_user_rad['sb_show_motothre'] = array('1' => '', '0' => 'Ȃ', '2' => '擾Xł'); // PC{AXbhꗗi•\j ޭ>>1 \ (:1, Ȃ:0, j[Xn̂:2) $conf_user_def['sb_show_one'] = 0; // (0) @@ -86,7 +75,7 @@ // •\̃Xbhꗗł̃ftHg̃\[gw $conf_user_def['sb_sort_ita'] = 'ikioi'; // ('ikioi') $conf_user_sel['sb_sort_ita'] = array( - 'midoku' => 'V', 'res' => 'X', 'no' => 'No.', 'title' => '^Cg', // 'spd' => '΂₳', + 'midoku' => 'V', 'res' => 'X', 'no' => 'No.', 'title' => '^Cg', // 'spd' => '΂₳', 'ikioi' => '', 'bd' => 'Birthday'); // , 'fav' => 'CɃX' // V\[gł́uȂv́uV[vɑ΂\[gD揇 (:0.1, :0, :-0.1) @@ -101,6 +90,14 @@ $conf_user_def['cmp_title_norm'] = 0; // (0) $conf_user_rad['cmp_title_norm'] = array('1' => '', '0' => 'Ȃ'); +// Xbh̃^Cg璘쌠\L폜 +$conf_user_def['delete_copyright'] = 0; // (0) +$conf_user_rad['delete_copyright'] = array('1' => '', '0' => 'Ȃ'); + +//폜钘쌠\L̕(J}؂) +$conf_user_def['delete_copyright.list'] = "[]ڋ֎~],©2ch.net"; +$conf_user_rules['delete_copyright.list'] = array('emptyToDef'); + // gщ{Axɕ\X̐ $conf_user_def['mobile.sb_disp_range'] = 30; // (30) $conf_user_rules['mobile.sb_disp_range'] = array('emptyToDef', 'notIntExceptMinusToDef'); @@ -121,6 +118,15 @@ $conf_user_def['mobile.sb_ttitle_trim_pos'] = 1; // (1) $conf_user_rad['mobile.sb_ttitle_trim_pos'] = array('-1' => '擪', '0' => '', '1' => ''); +// Xbh쐬̕\tH[}bg +$conf_user_def['birth_format'] = 'y/m/d'; +$conf_user_sel['birth_format'] = array( + 'y/m/d' => 'YY/MM/DD', + 'y/m/d H:i:s' => 'YY/MM/DD HH:MM:SS', + 'Y/m/d' => 'YYYY/MM/DD', + 'Y/m/d H:i:s' => 'YYYY/MM/DD HH:MM:SS', + ); + // }}} // {{{ read @@ -156,14 +162,6 @@ $conf_user_def['pre_thumb_width'] = "32"; // ("32") //$conf_user_rules['pre_thumb_width'] = array('emptyToDef', 'notIntExceptMinusToDef'); -// YouTubẽNvr[\i:1, Ȃ:0, 蓮ł:2j -$conf_user_def['link_youtube'] = 1; // (1) -$conf_user_rad['link_youtube'] = array('1' => '', '0' => 'Ȃ', '2' => '蓮ł'); - -// jRjR̃Nvr[\i:1, Ȃ:0, 蓮ł:2j -$conf_user_def['link_niconico'] = 1; // (1) -$conf_user_rad['link_niconico'] = array('1' => '', '0' => 'Ȃ', '2' => '蓮ł'); - // HTML|bvAbvi:1, Ȃ:0, pł:2, 摜ł:3j $conf_user_def['iframe_popup'] = 2; // (2) $conf_user_sel['iframe_popup'] = array('1' => '', '0' => 'Ȃ', '2' => 'pł', '3' => '摜ł'); @@ -337,6 +335,10 @@ $conf_user_def['coloredid.coloring.type'] = 0; $conf_user_rad['coloredid.coloring.type'] = array('0' => 'IWi', '1' => 'thermon'); +// ܂BBSŃ[gzXg\ +$conf_user_def['machibbs.disphost.enable'] = 1; +$conf_user_rad['machibbs.disphost.enable'] = array('1' => '', '0' => 'Ȃ'); + // }}} // {{{ NG/ځ[ @@ -360,6 +362,10 @@ $conf_user_def['ngaborn_chain'] = 0; // (0) $conf_user_rad['ngaborn_chain'] = array('1' => '', '0' => 'Ȃ', '2' => 'ׂNGɂ'); +// NGځ[̑ΏۂɂȂXIDINGځ[񂷂(:1, Ȃ:0 NGɂ:2) +$conf_user_def['ngaborn_auto'] = 0; // (0) +$conf_user_rad['ngaborn_auto'] = array('1' => '', '0' => 'Ȃ'); + // \͈͊ÕXANGځ[̑Ώۂɂ(:1, Ȃ:0) // y邽߁AftHgł͂Ȃ $conf_user_def['ngaborn_chain_all'] = 0; // (0) @@ -373,6 +379,58 @@ $conf_user_def['ngaborn_purge_aborn'] = 0; // (0) $conf_user_rad['ngaborn_purge_aborn'] = array('1' => '͂', '0' => ''); +// }}} +// {{{ 2ch API + +// 2ch API gp +$conf_user_def['2chapi_use'] = 0; // (0) +$conf_user_rad['2chapi_use'] = array('1' => '', '0' => 'Ȃ'); + +// 2ch API F؂Ԋu(P:) +$conf_user_def['2chapi_interval'] = 1; // (1) +$conf_user_rules['2chapi_interval'] = array('emptyToDef', 'notIntExceptMinusToDef'); + +// APPKey +$conf_user_def['2chapi_appkey'] = ""; // ("") + +// HMKey +$conf_user_def['2chapi_hmkey'] = ""; // ("") + +// AppName +$conf_user_def['2chapi_appname'] = ""; // ("") + +// APIF؂ŎgpUser-Agent +$conf_user_def['2chapi_ua.auth'] = "Monazilla/1.3"; // ("Monazilla/1.3") +$conf_user_sel['2chapi_ua.auth'] = array( + 'DOLIB/1.00' => '1 DOLIB/1.00', + 'Monazilla/1.3' => '2 Monazilla/1.3', + 'Monazilla/1.00 (%s)' => '3 Monazilla/1.00 (AppName)', + 'Mozilla/5.0 (compatible; %s)' => '4 Mozilla/5.0 (compatible; AppName)', +); + +//DAT擾ŎgpUser-Agent +$conf_user_def['2chapi_ua.read'] = "Mozilla/3.0 (compatible; %s)"; // ("Monazilla/1.3") +$conf_user_sel['2chapi_ua.read'] = array( + 'Monazilla/1.00 (%s)' => '1 Monazilla/1.00 (AppName)', + 'Mozilla/5.0 (compatible; %s)' => '2 Mozilla/5.0 (compatible; AppName)', +); + +// APIF؂SSLgp +$conf_user_def['2chapi_ssl.auth'] = 1; // (1) +$conf_user_rad['2chapi_ssl.auth'] = array('1' => '', '0' => 'Ȃ'); + +// DAT擾SSLgp +$conf_user_def['2chapi_ssl.read'] = 1; // (1) +$conf_user_rad['2chapi_ssl.read'] = array('1' => '', '0' => 'Ȃ'); + +// fobOp̏o͂ +$conf_user_def['2chapi_debug_print'] = 0; // (0) +$conf_user_rad['2chapi_debug_print'] = array('1' => '', '0' => 'Ȃ'); + +// 2ch API gp +$conf_user_def['2chapi_post'] = 0; // (0) +$conf_user_rad['2chapi_post'] = array('1' => '', '0' => 'Ȃ'); + // }}} // {{{ ETC @@ -401,9 +459,13 @@ $conf_user_def['res_write_rec'] = 1; // (1) $conf_user_rad['res_write_rec'] = array('1' => '', '0' => 'Ȃ'); +// |bvAbv珑ݐXēǂݍ݂(:1, Ȃ:0) +$conf_user_def['res_popup_reload'] = 1; // (1) +$conf_user_rad['res_popup_reload'] = array('1' => '', '0' => 'Ȃ'); + // OURLWvۂɒʂQ[g // uځvłCookiegȂ[ł gate.php ʂ -$conf_user_def['through_ime'] = "exm"; // ("exm") +$conf_user_def['through_ime'] = "exm"; // ("exm") $conf_user_sel['through_ime'] = array( '' => '', 'p2' => 'p2 ime (])', @@ -414,6 +476,7 @@ 'exm' => 'gate.php (蓮])', 'expm' => 'gate.php (p̂ݎ蓮])', 'google' => 'Google', + 'hawker' => 'Hawker!(jump.x0.to)', ); // HTTPSŃANZXĂƂ͊OURLQ[gʂȂiHTTPSł͒:1, ɒʂ:0j @@ -421,11 +484,13 @@ $conf_user_rad['through_ime_http_only'] = array('1' => 'HTTPSł͒', '0' => 'ɒʂ'); // Q[gŎ]ȂgqiJ}؂ŁAgq̑ÕsIh͕svj -$conf_user_def['ime_manual_ext'] = "exe,zip"; // ("exe,zip") +$conf_user_def['ime_manual_ext'] = "exe,zip"; // ("exe,zip") +/* // CɃXLɎQi:1, Ȃ:0j $conf_user_def['join_favrank'] = 0; // (0) $conf_user_rad['join_favrank'] = array('1' => '', '0' => 'Ȃ'); + */ // Cɔ‚̃Xꗗ܂Ƃ߂ĕ\ (:1, Ȃ:0, X̂:2) $conf_user_def['merge_favita'] = 0; // (0) @@ -459,7 +524,7 @@ $conf_user_def['brocra_checker_query'] = ""; // ("") // gщ{ApPbgʂ炷߁ASppEJiEXy[X𔼊pɕϊ (:1, Ȃ:0) -$conf_user_def['mobile.save_packet'] = 1; // (1) +$conf_user_def['mobile.save_packet'] = 1; // (1) $conf_user_rad['mobile.save_packet'] = array('1' => '', '0' => 'Ȃ'); // vLV𗘗p(:1, Ȃ:0) @@ -472,6 +537,42 @@ // vLV|[g ex)"8080" $conf_user_def['proxy_port'] = ""; // ("") +// vLV[U[ (gpꍇ̂) +$conf_user_def['proxy_user'] = ""; // ("") + +// vLVpX[h (gpꍇ̂) +$conf_user_def['proxy_password'] = ""; // ("") + +// vLV̎ +$conf_user_def['proxy_mode'] = "http"; // ("http") +$conf_user_sel['proxy_mode'] = array( + 'socks5' => 'SOCKS5 vLV', + 'http' => 'HTTP vLV', +); + +// Tor f(.onion hC)̃ANZX Tor gp(:1, Ȃ:0) +$conf_user_def['tor_use'] = 0; // (0) +$conf_user_rad['tor_use'] = array('1' => '', '0' => 'Ȃ'); + +// Tor vLVzXg ex)"127.0.0.1", "www.p2proxy.com" +$conf_user_def['tor_proxy_host'] = ""; // ("") + +// Tor vLV|[g ex)"8080" +$conf_user_def['tor_proxy_port'] = ""; // ("") + +// Tor vLV[U[ (gpꍇ̂) +$conf_user_def['tor_proxy_user'] = ""; // ("") + +// Tor vLVpX[h (gpꍇ̂) +$conf_user_def['tor_proxy_password'] = ""; // ("") + +// Tor vLV̎ +$conf_user_def['tor_proxy_mode'] = "socks5"; // ("socks5") +$conf_user_sel['tor_proxy_mode'] = array( + 'socks5' => 'SOCKS5 vLV', + 'http' => 'HTTP vLV', +); + // t[ ƒj[ ̕\ $conf_user_def['frame_menu_width'] = "158"; // ("158") @@ -479,16 +580,31 @@ $conf_user_def['frame_subject_width'] = "40%"; // ("40%") // t[E X{ ̕\ -$conf_user_def['frame_read_width'] = "60%"; // ("40%") - - -// OCA܂opensslŎ݂BPHP 4.3.0ȍ~ŁAOpenSSLÓIɃNĂKv -$conf_user_def['precede_openssl'] = 0; // (0) -$conf_user_rad['precede_openssl'] = array('1' => 'Yes', '0' => 'No'); - -// curlgAR}hCłPHP֐łǂD悷邩 (R}hC:0, PHP֐:1) -$conf_user_def['precede_phpcurl'] = 0; // (0) -$conf_user_rad['precede_phpcurl'] = array('0' => 'R}hC', '1' => 'PHP֐'); +$conf_user_def['frame_read_width'] = "60%"; // ("60%") + +// 3yCʂ̃t[̕ו +$conf_user_def['pane_mode'] = 0; // (0) +$conf_user_rad['pane_mode'] = array('0' => 'WiɌ`j', '1' => 'i`j'); + +// SSLʐM̐ڑ؂邽߂Ɏgpؖi[ꂽfBNg ؂łȂ̂ݎw +$conf_user_def['ssl_capath'] = ""; // () + +// 2ch.netsubjec.txtSETTING.TXT̎擾SSLgp +$conf_user_def['2ch_ssl.subject'] = 0; // (0) +$conf_user_rad['2ch_ssl.subject'] = array('1' => '', '0' => 'Ȃ'); + +// 2ch.net݂̏SSLgp +$conf_user_def['2ch_ssl.post'] = 0; // (0) +$conf_user_rad['2ch_ssl.post'] = array('1' => '', '0' => 'Ȃ'); + +// Ql̗L\ +$conf_user_def['disp_ronin_expiration'] = 0; // (0) +$conf_user_sel['disp_ronin_expiration'] = array( + '0' => '', + '1' => 'G[؂̏ꍇ̂ݕ\', + '2' => '^Cgʂ̂ݕ\', + '3' => 'Ȃ' +); // }}} // {{{ gpbNiPhone @@ -501,6 +617,11 @@ include P2_CONFIG_DIR . '/conf_user_def_wiki.inc.php'; +// }}} +// {{{ +live + +include P2_CONFIG_DIR . '/conf_user_def_live.inc.php'; + // }}} /* diff --git a/conf/conf_user_def_ex.inc.php b/conf/conf_user_def_ex.inc.php index 112a88d63..7e584ce58 100644 --- a/conf/conf_user_def_ex.inc.php +++ b/conf/conf_user_def_ex.inc.php @@ -141,11 +141,11 @@ $conf_user_rad['expack.editor.dpreview_chkaa'] = array('1' => '', '0' => 'Ȃ'); // {łȂ`FbN -$conf_user_def['expack.editor.check_message'] = 0; // (0) +$conf_user_def['expack.editor.check_message'] = 1; // (1) $conf_user_rad['expack.editor.check_message'] = array('1' => '', '0' => 'Ȃ'); // sage `FbN -$conf_user_def['expack.editor.check_sage'] = 0; // (0) +$conf_user_def['expack.editor.check_sage'] = 1; // (1) $conf_user_rad['expack.editor.check_sage'] = array('1' => '', '0' => 'Ȃ'); // ۑ @@ -220,6 +220,14 @@ $conf_user_def['expack.ic2.fav_auto_rank_override'] = 0; // (0) $conf_user_rad['expack.ic2.fav_auto_rank_override'] = array('1' => '', '2' => 'N0炷', '3' => 'NオȂ炷', '0' => 'Ȃ'); +// T[oɐڑۂɃ^CAEg܂ł̎ԁibj[0 => http_conn_timeout Ɉˑ] +$conf_user_def['expack.ic2.getter_conn_timeout'] = 5; +$conf_user_rules['expack.ic2.getter_conn_timeout'] = array('notIntExceptMinusToDef'); + +// _E[h^CAEg܂ł̎ԁibj[0 => http_read_timeout Ɉˑ] +$conf_user_def['expack.ic2.getter_read_timeout'] = 60; +$conf_user_rules['expack.ic2.getter_read_timeout'] = array('notIntExceptMinusToDef'); + // }}} // {{{ AAS diff --git a/conf/conf_user_def_live.inc.php b/conf/conf_user_def_live.inc.php new file mode 100755 index 000000000..27eec8ff5 --- /dev/null +++ b/conf/conf_user_def_live.inc.php @@ -0,0 +1,81 @@ + 'SĂ̔‚ŕ\', '1' => '‚̂ݕ\', '0' => '\Ȃ'); + +// 'X\̃wb_ƃtb^[Ɏ\ւ̃N\ +$conf_user_def['live.livelink_thread'] = "2"; // ("2") +$conf_user_sel['live.livelink_thread'] = array('2' => 'SĂ̔‚ŕ\', '1' => '‚̂ݕ\', '0' => '\Ȃ'); + +// ‚̃XbhɎp\ŊJ +$conf_user_def['live.livebbs_forcelive'] = 0; // (0) +$conf_user_rad['live.livebbs_forcelive'] = array('1' => '', '0' => 'Ȃ'); + +// X\̎ +$conf_user_def['live.view_type'] = "1"; // ("1") +$conf_user_sel['live.view_type'] = array('0' => 'ɃftHg\', '1' => '̂ݎp\', '2' => 'Ɏp\'); + +// ID O (g) P (p2) Q (tuEU) I (iPhone) 𑾎 +$conf_user_def['live.id_b'] = 0; // (0) +$conf_user_rad['live.id_b'] = array('1' => '', '0' => 'Ȃ'); + +// AnCCg (\͈͂̃X݂̂ɘA) +$conf_user_def['live.highlight_chain'] = 0; // (0) +$conf_user_rad['live.highlight_chain'] = array('1' => '', '0' => 'Ȃ'); + +// }}} +// {{{ ݒ + +// \郌X (100ȉ) +$conf_user_def['live.before_respointer'] = "50"; // ("50") + +// t[̍ (px) +$conf_user_def['live.post_width'] = "85"; // ("85") + +// ftHg̖̕\ +$conf_user_def['live.bbs_noname'] = 0; // (0) +$conf_user_rad['live.bbs_noname'] = array('1' => '', '0' => 'Ȃ'); + +// sage +$conf_user_def['live.mail_sage'] = 1; // (1) +$conf_user_rad['live.mail_sage'] = array('1' => '', '0' => 'Ȃ'); + +// SẲsƃXy[X̍폜 +$conf_user_def['live.msg'] = 1; // (1) +$conf_user_rad['live.msg'] = array('1' => '', '0' => 'Ȃ'); + +// [ɃX] ̕@ +$conf_user_def['live.res_button'] = 0; // (0) +$conf_user_sel['live.res_button'] = array('0' => '[ re: ] {^', '1' => '', '2' => 'e_uNbN'); + +// Kp^C}[ +$conf_user_def['live.write_regulation'] = 0; // (0) +$conf_user_sel['live.write_regulation'] = array('0' => '^C}[', '1' => '15b', '2' => '20b', '3' => '30b', '4' => '40b', '5' => '50b', '6' => '1'); + +// ImageCache2̃TlC쐬 +$conf_user_def['live.ic2_onoff'] = "1"; // ("1") +$conf_user_rad['live.ic2_onoff'] = array('1' => 'on', '0' => 'off'); + +// }}} +// {{{ [h/XN[ + +// I[g[h̊Ԋu +$conf_user_def['live.reload_time'] = 2; // (2) +$conf_user_sel['live.reload_time'] = array('0' => '[h', '1' => '5b', '2' => '10b', '3' => '15b', '4' => '20b'); + +// I[gXN[̊炩 (ł炩 1 AXN[ 0) +$conf_user_def['live.scroll_move'] = 3; // (3) + +// I[gXN[̑x (ő 1 AXN[̏ꍇ͏̊炩̒l 0 ) +$conf_user_def['live.scroll_speed'] = 10; // (10) + +// }}} +?> diff --git a/conf/conf_user_def_wiki.inc.php b/conf/conf_user_def_wiki.inc.php index fcfcdc4c5..a480af3aa 100644 --- a/conf/conf_user_def_wiki.inc.php +++ b/conf/conf_user_def_wiki.inc.php @@ -44,14 +44,3 @@ $conf_user_rules['wiki.samba_cache'] = array('emptyToDef', 'notIntExceptMinusToDef'); // }}} - -// {{{ samba - -// NGXbhLɂ (:1, Ȃ:0) -$conf_user_def['wiki.ng_thread'] = 0; // (0) -$conf_user_rad['wiki.ng_thread'] = array('1' => '', '0' => 'Ȃ'); -// gщ{AXԍSPM‚ (‚:1, ‚Ȃ:0) -$conf_user_def['wiki.spm.mobile'] = 0; // (0) -$conf_user_rad['wiki.spm.mobile'] = array('1' => '', '0' => 'Ȃ'); - -// }}} diff --git a/conf/conf_user_style.inc.php b/conf/conf_user_style.inc.php index 13848b2cd..d4b3dde3f 100644 --- a/conf/conf_user_style.inc.php +++ b/conf/conf_user_style.inc.php @@ -15,7 +15,7 @@ $STYLE['fontfamily'] = "qMmpS Pro W3"; // ("qMmpS Pro W3") {̃tHg if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) { - if(!P2Util::isBrowserSafariGroup()){ /* uEU Mac Safari ȊO Ȃ */ + if(!UA::isSafariGroup()){ /* uEU Mac Safari ȊO Ȃ */ $STYLE['fontfamily_bold'] = "qMmpS Pro W6"; // ("qMmpS Pro W6") {{[hptHgiʂɑɂꍇ͎w肵Ȃ("")j } @@ -151,6 +151,19 @@ $STYLE['mobile_read_ngword_color'] = "#bbbbbb"; // ("#bbbbbb") $STYLE['mobile_read_onthefly_color'] = "#00aa00"; // ("#00aa00") +// }}} +// {{{ +live [h + +$STYLE['live_b_l'] = "1px #999 dotted"; // ("1px #999 dotted") +live XԂ̎dؐ +$STYLE['live_b_s'] = "1px #999 dotted"; // ("1px #999 dotted") +live ԍ ڗ O t ID \ƃX\̎dؐ +$STYLE['live_b_n'] = "2px #f30 dotted"; // ("2px #f30 dotted") +live \&I[g[h̊ǁ`V̎dؐ +$STYLE['live_highlight'] = "#cff"; // ("#cff") +live nCCg[h\̔wiF +$STYLE['live_highlight_chain'] = "#ffc"; // ("#ffc") +live AnCCg\̔wiF +$STYLE['live_highlight_word_weight'] = "bold"; // ("bold") +live AnCCg\̃tHg̑ +$STYLE['live_highlight_word_border'] = "3px #f30 double"; // ("3px #f30 double") +live AnCCg\̃A_[C +$STYLE['live_font-size'] = "10px"; // ("10px") +live ԍ ڗ O t ID ̃tHgTCY +$STYLE['live2_color'] = "#ddd"; // ("#ddd") +live Type-B ԍ ڗ O t ID \̔wiF + // }}} /* diff --git a/conf/setup_info.php b/conf/setup_info.php index 5b0340329..948f56550 100644 --- a/conf/setup_info.php +++ b/conf/setup_info.php @@ -4,11 +4,12 @@ */ // K{o[W -$p2_required_version_5_3 = '5.3.2'; -$p2_required_version_5_4 = '5.4.0'; +$p2_required_version_5_x = '5.6.0'; +$p2_required_version_7_x = '7.0.0'; // K{gW[ $p2_required_extensions = array( + 'curl', 'dom', 'json', 'libxml', diff --git a/data/board/.gitignore b/data/board/.gitignore new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/data/board/.gitignore @@ -0,0 +1 @@ +* diff --git a/doc/README-774.txt b/doc/README-774.txt new file mode 100644 index 000000000..fdbcf19ac --- /dev/null +++ b/doc/README-774.txt @@ -0,0 +1,307 @@ +rep2 @\gpbN S by 2ch774 + +H + +rep2-expack https://github.com/rsky/p2-php +rep2-expack +live https://github.com/pluslive/p2-php +rep2-expack test https://github.com/orzisun/p2-php +LXɏグꂽC荞őSڎwœo[WłB +Ǝ̉ǂsĂ܂B + +‹ +Linux(openSUSE Leap)PHP7+ApacheœmFĂ܂B +PHP5.6ȍ~œ͂łAPHP7.*łB +PHP7ł̕sCD悷邽ߓˑRPHP5.x̃T|[gI”\܂B + +ȋ@\ +### ݒ̒lj +* u[U[ݒҏWv+liveN̕\ݒύX”\ +* ‚̃XꗗXJƂɎIɎ[hŃXJݒlj +* 3yC\̔zuύXłݒlj +* Xbh^Cg璘쌠\L폜ݒlj +* Xbh쐬̕\tH[}bgwł悤ɂ +* ܂BBS̃zXg\ݒlj + +### V@\ +* cronƂōŋߓǂ񂾃XȂǂdatDLoXNvglj + - php scripts/fetch-dat.php --mode [hŽw(fav recent res_hist) +* ߌɂȂ‚ɖŏނƂɌxo@\lj +* NGځ[̑ΏۂɂȂXIDINGځ[񂷂@\lj + - NGځ[̏폜ꍇ͎NGځ[̃f[^ȂƔf܂ + - NGځ[̃f[^͎蓮NGځ[ƓƗĂANGځ[ON̎ǂݍ܂܂B +* uݒǗvLbVȄł@\lj +* {ƂbẽOCڐABE2.0ɑΉ +* rep2ɓo^ꂽO‚̃Nrep2ŊJ悤ɂiJaneƓj +* 0˂XNvggpO‚̉ߋODAT荞ݑΉ +* SOCKS5vNVoR̐ڑɑΉ(l) +* tořf(.onionhC)toroRʼn{@\lj(l) +* curl p_E[h@\lj(l@\) + +### dlύX +* [Jˆꗗp.brdt@C̒uꏊrep2/board$_conf['data_dir']/brardɕύX + - .brdopenJaneƓ`łB +* X}zpʂ̃c[o[ACR𑜓xʂɑΉ(thx https://github.com/dgg712/p2-php) +* X}zpX|bvAbvASPMAIC2̊O^bvƕ‚悤ɕύX + - X|bvAbvJX|bvAbv^bvۂɌ̃X|bvAbv͎̂dlƂĂ܂B + - XN[͎w̏I_|bvAbvɂȂ悤ɂΏ܂B +* headline.2ch.netŋߓǂ񂾃XɒNjLȂ悤ɕύX +* YoutubeƃjRjR\@\폜 + - NvOCgpĂ http://akid.s17.xrea.com/p2puki/index.phtml?%A5%EA%A5%F3%A5%AF%A5%D7%A5%E9%A5%B0%A5%A4%A5%F3 +* X}zpʂ̃fUCύX +* 2chUnicodeGeɑΉ +* \X̏200065535ɕύX + +̑̃Aɍ킹Cgit̃R~bgOmFĂB + + +Ɛ + + {\tgEFA̎gpɂ蒼ڂъԐړIɐȂ鑹Q⏞܂B + gp͎ȐӔCŁB + + + + + ݒuҖ{lp̂͂AF؂؂Ȃǂ + O҂ɈpĂdȂ‹Ŏĝ͂߂ĂB + + +CZX + + {p2ƓAX11CZXłB + + +ChangeLog +180705.1300 +* 2chAPIꂽ̂Őڑ5chɕύX +* api.5ch.net̃X|Xwb_[Content-LengthtȂsɑΉ +* composer.jsonCĐVKCXg[̕sC +* ݂Ɏsۂ̃G[bZ[WύX +* DAŤmF邽߂read.cgiANZXLbV悤ɕύX +* ̃o[Wȍ~ʼnߋOqɂ荞񂾃XDATĎ擾Ȃ悤ɕύX +* IE11IE6̃R[hsĉۑ@\ȂsC + +171122.1500 +* itest(https://itest.5ch.net/T[o[/test/read.cgi//X)̃NJ@\lj +* DATjh~̂߂ɋdlitestNȂ悤ɕύX +* ̍PHP 2chBBSXNvg(http://script.s16.xrea.com/)gpO‚ɑΉ +* SPMgpNGځ[o^ɁA–̓o^o@\lj +* ic2:_E[_[fatal erroroȂ悤ɏC +* P2HttpExt.phpȊO̒ʐMׂcURLɓ +* QlSSLK{ɂȂ̂Őݒ荀ڂ +* dig5chJSONform^OsɑΉ +* ȉAkiller4989 ̃pb`荞 +* dat擾s‚ꍇ̃bZ[W\悤ɂ +* ImageCache2 ł̃^CAEglݒł悤ɂ +* Ql̗LmFł悤ɂ +* 5ch ł̋DAT񋟏IbZ[WG[悤ɂ + +171018.1540 +* bintan ǂݍݑΉ +* QlOCp2chv.tora3.netSSLK{ɂȂ̂őΉ +* X}z readF|bvAbv̕‚{^ۂɑ̃|bvAbvYɕ‚sC +* subject̃`FbN{bNX@\ȂsC +* X}zFV܂Ƃߓǂ݂珑񂾍ۂɃ[hȂ悤ɕύX +* V܂Ƃߓǂ݂珑񂾍ۂɏ݃EChE悤ɕύX + +171013.2230 +* X}zFꕔ̊‹ŃXCvj[삵ȂsC +* X}z:res_popup_reload̐ݒ肪fȂsC +* PHP7.1ŃX^CgpWarningosC +* cURLMultiL̂fetch-subject-txt.phpPECL_HTTP`FbN폜 +* expack.ic2.enabled2ɂ‹PCANZXfatal errorosC + +171011.1515 +* X}zpread̃c[o[|bvAbvj[`ɕύX +* X}zpread̊ONtarget="_blank"w +* X}zp摜\̃{^ɑ΂čׂsC +* FirefoxAndroidłX}zɕύX +* Android 2.2ȉɑΉ邽߂̃R[h폜ĕ\ +* X}zpXꗗAndroidłXCvj[悤ɏC + +171009.0000 +* X}zpʂ̍XV{^̕\Ɍ肪̂C +* headline.5ch.net̃X𗚗ɒljȂ悤ɏC +* HTTPʐM̃wb_[̃Xy~XC +* XV`FbNɎsۂɃG[osC +* X^CSSLK{ɂȂ̂ŏC +* ꕔ̊‹ŃXꗗ\ۂɌxosC + +171005.1930 +* ˑCuXVicomposer updateK{j +* X}zpŋߓǂ񂾃XꗗɍXV{^lj +* ɔIɍXVȂ悤ɕύXiPCƓj +* Ïړ]ɑΉ邽߁A2ch(sc)open2chDATۑfBNgύX +* dl̃fBNgDATLƂ͂D悷 +* 5chbΉ +* rss[_[삵ȂsC +* rss[_[HTTPSURLljłȂsC +* X}zy[WbootstrapljĈꕔfUCύX +* `FbN̍ŒPHP5.6ȏɕύX + +170921.1800 +* vip2ch.comǂݍݑΉ +* 2chUnicodeGeɑΉ +* PHP7.1łꂪǂ߂ȂsC +* TorȂsC +* 2chAPI gpł‚ɑΉ +* ܂BBS ɂăhCłX悤ɂ +* SS R ̈ړ]mł悤ɂ +* (l@\)curl p_E[h@\lj +* X}zpݗ̃fUCύX + +160410.0125 +* NGXbh@\{̂+WikiŏdĎĂ̂ō폜 +* 160409.1000 ɐVZߓǂ݂Ǝ삵Ȃs̂ŏC +* N&lstȂ悤ɕύX +* [U[ݒǗ+Wikisamba^C}[Ɋւݒ荀ڂ\悤ɕύX + +160409.1000 +* NGXbh@\삵ȂsC +* 摜uURL삵ȂsC +* т񂽂URLXV +* composer.jsonURLXVĐVKCXg[̕sC + +160309.0710 +* ȉ̕ύX_killer4989̃pb`荞 +* SOCKS5ڑtorڑ@\ĂȂsC +* X}zł΂URLJ悤ɕύX + +160304.1333 +* sĂ𑜓xACRlj thx! http://potato.2ch.net/test/read.cgi/software/1431258367/767 +* DAT_E[hׂ̃R[hƃN +* DAT̔2ch API̓ƎX|Xwb_gp悤ɕύX +* API+QlŎ擾DATߋO悤ɕύX +* SOCKS5vNVoR̐ڑɑΉ(l) +* tořf(.onionhC)toroRʼn{@\lj(l) +* ȉ̕ύX_killer4989̃pb`荞 +* vip2ch.com Ή +* т񂽂ׂ񂱂 URL w肳ꂽɐX\悤ɂ +* Ql𗧂c[̃Nlj +* Xbh쐬̕\tH[}bgwł悤ɂ +* ̑X + +150815.1030 +* \X̏200065535ɕύX +* ܂BBS̃zXg\ݒljikiller4989̃pb`荞݁j + +150711.1000 +* o[Wԍ̐~XĂ̂ 151710.1400 Ԃɂĕt +* XVeɖ薳͂Ȃ̂œe 151710.1400 ƓłB + +151710.1400 +* LbVmF30ɍXV͂30ԂɂȂĂ̂ŏC +* DAT 2sڂߋOł邱ƂĂ悤łΉߋOɂ +* P2 ֘ÃR[h폜 +* offlaw2(shiro=kuma)폜 +* L̕ύX_killer4989̃pb`荞 +* ݒ荀2chapi_rounin폜iONɕύXj + +150510.1111 +* YoutubeƃjR̓NvOC폜 +* Youtube֘A̐ݒSč폜 +* show{^NvOC痘po悤ɕύX +* X}zreadPC̃NvOCf悤ɂ +* 摜uURLEXTRACT̏dURL𖳎悤ɕύX +* T[rXIɔĎgpłȂȂ@\̐ݒꕔ폜 + +150426.1033 +* KP[readsyntax errorC +* 302URLRSS[_퓮삵ȂsC +* RSS[_HTTP_Request2ɑ݂Ȃ֐ĂяoĂ폜 +* P2Util::fileDownloadIf-Modified-Since𑗐MȂsC +* LbV폜ɔˆꗗ̍폜@\lj +* ߂{^𑜓xΉɕύX + +150418.1111 +* X}zpʂ̃c[o[ACR𑜓xʂɑΉ(thx https://github.com/dgg712/p2-php) +* rep2ɓo^ꂽO‚փN@\lj +* 0˂XNvggpO‚̉ߋODAT荞ݑΉ +* headline.2ch.netŋߓǂ񂾃XɒNjLȂ悤ɕύX +* FirefoxŃX}zp\sC +* X}zpIC2̃|bvAbvŊɐݒς݂̐^bvۂɃG[oȂ悤ɕύX +* X}zpIC2̃|bvAbvɕ\URLNɕύX(thx http://anago.2ch.net/test/read.cgi/software/1426940268/711) +* X}zpIC2ʼn摜\_u^bvƕ‚悤ɕύX(txh http://anago.2ch.net/test/read.cgi/software/1426940268/711) +* X}zpX|bvAbvASPMAIC2̊O^bvƕ‚悤ɕύX + +150414.2333 +* X}zpreadɏ݃tH[lj +* X}zpʂ̃fUCύX +* DAT擾vOC삵ȂsC +* ̑X + +150408.1234 +* NGځ[̑ΏۂɂȂXIDINGځ[񂷂@\lj +* HTTPʐM̃wb_ +* dig2ch.phpʼn̓G[ۂɏڍ׏o悤ɕύX + +150406.2211 +* ߌ‚Ɩŏ݂łȂ‚̏𐳂삷悤ɏC +* ŏoȂ‚͏ݑsłȂ悤ɕύX +* expacksage`FbN@\Ɩ{`FbN@\̃ftHglONɕύX + +150406.1111 +* ߌɂȂ‚ɖŏނƂɌxo@\lj +* ݒǗCookie₻̗̑폜o@\lj +* http://page2.skr.jp/rep2/ łĂ܂̂gate.php̑ւlj +* HTTPڑłSSL֌W̐ݒ𖳎悤ɕύX +* 2ch.netƂSSLʐMݒőIׂ悤ɕύX +* ݂ŗOۂɃG[bZ[W\ȂsC +* ̑X + +150402.1350 +* ڑ悪2ch.netȂSSLʐMs悤ɕύX(pinkbeOCF؂͑ΉĂȂ̂łȂ) +* ssl_functioñftHgݒcURLɕύX +* SSLʐMȊOłSSL̐ݒ肪f悤ɕύX +* LύX̂cURLK{ɕύX + +150401.2321 +* FؕtvLVɑΉiBASICF؂̂݁j +* SSLʐMopenSSLcURL؂ւ邱Ƃoݒlj +* dig.2ch.netɑwb_ύX +* 2chƂ̒ʐMHTTP_Request2ɕύX + +150328.2132 +* dig2ch̎IɌyȕsƂ̑΍u +* dig2chŌʂ̔ԍ1\悤ɏC +* dig2chjsonG[ύX +* dig2chvLVݒ(proxy_use)ɑΉĂȂsC +* dig2chŁu‚ōi荞ށvɑΉ +* u[h|bvAbvɂ悤ɕύX +* X|bvAbv(quote_res_view)ȂƂɎ[hIDFÂ(coloredid)ȂsC + +150320.1020 +* |bvAbv珑ݐɃXēǂݍ݂Ȃݒlj +* [h݂̏CookiemFꍇ[hɖ߂ȂsC +* eiXコ邽live_ShowThreadPc.phplive_ShowThread.php̑ +* live_ShowThreadLive.phpƖ{̂ShowThread.phpgp悤ɕύX +* ۑ(expack.editor.savedraft)ȂƂɎ[h珑߂ȂsC +* X^CWarningosC + +150317.1200 +* ̑X + +150316.1120 +* 3yC\̔zuύXłݒlj +* BẽACR\ł悤ɂ +* ̑X + +150315.0117 +* youtu.benico.(ms|sc)̃vr[ɑΉ +* YouTube̖ߍݕ@objectiframeɕύX +* cronƂōŋߓǂ񂾃XȂǂdatDLoXNvglj +* ꕔ̉ʃfUC{ƂۂfUCɕύX +* ꕔ̃X̉s폜sC +* IDFÂȂݒ̍ۂID̕\ȂsC +* 2chDAT񋟏IɔOj΍lj +* {ƂbẽOCڐABE2.0ɑΉ +* 擾XłXꗗɌX̃N\łݒlj +* ̑X + +150307.1230 +* docfBNgɊe@\Readme.txt쐬 +* u[U[ݒҏWv+liveN̕\ݒύX”\ +* ‚̃XꗗXJƂɎIɎ[hŃXJݒlj +* Xbh^Cg璘쌠\L폜ݒlj +* [Jˆꗗp.brdt@C̒uꏊrep2/board$_conf['data_dir']/brardɕύX +* ̑X \ No newline at end of file diff --git a/doc/README-API.txt b/doc/README-API.txt new file mode 100644 index 000000000..3002ba7ef --- /dev/null +++ b/doc/README-API.txt @@ -0,0 +1,41 @@ +APIΉpb` README + +H +܂ŔȎ@\łB +@\gp邽߂ɂ͐ݒ肪KvɂȂ܂B + +2ch APIgpdat̎擾ɑΉĂ܂B + +PHPOpenSSLɑΉĂKv܂B + +ݒ@ +uݒǗvu[U[ݒҏWvurep2{ݒvu2ch APIvݒύXł܂B + +2chapi_use +uvɐݒ肵ꍇ2ch APIdat̎擾s܂B +dat擾ȊOUser-Agentrep2W2chapi_appnamegpɕύX܂B +O‚User-Agentdat擾͂rep2Ŵ܂܂łB + +2chapi_ssl.auth +2chapi_ssl.read +̐ݒSSLʐMG[ƂȂ‹̐ݒłB +2chapi_use uȂv̏ꍇ͖܂B + +2chapi_interval +2ch API F؂ԊułBSessionIDǂꂭ炢̊Ԏ‚̂sȂ߂Ƃ肠1ԂɂĂ܂B + +2chapi_appkey +2chapi_hmkey +2ch API̔F؏łB +ύXꍇ͍ĔF؂sKv܂B + +2chapi_appname +2ch APIgpƂ2chɑMUser-AgentłB +uHoge/1.00v̌`Ŏw肵܂B +ŁuMonazilla/1.00 (Hoge/1.00)v̂悤User-AgenẗꕔƂĎgp܂B + +lj@\ +uOCǗvɁu2ch APIF؊ǗvljĂ܂B +2ch APIF؏󋵂̊mFƔF؁EF؉EĔF؂sƂo܂B +ʏdat擾2chapi_intervalɐݒ肵ԊuŎIɔF؂s܂A +2ch API̔F؏ύXꍇ͎蓮ōĔF؂sKv܂B \ No newline at end of file diff --git a/doc/README-Live.txt b/doc/README-Live.txt new file mode 100644 index 000000000..37669c8c3 --- /dev/null +++ b/doc/README-Live.txt @@ -0,0 +1,150 @@ +# rep2 expack +live + +rsk rep2expack ɁAp@\ljĂ܂B + + +### lj@\ + +* p\ +* I[g[h/XN[ +* nCCg[h/AnCCg + +̑{@\̓x[XƂȂĂ rep2expack ƓłB + +ȉ2ch774Internetw ArchiveTx[W+live@\̐łB +http://web.archive.org/web/20101105031616/http://plus-live.main.jp/ + +\ݒ + + X\̎ށB + l (̂ݎp\) + + X\̎ނm[}Ǝp2ނIׂ܂B + TuWFNgŃX^CNbNƒʏ\AX^C live.png NbNƕʑŎ\悤ɂȂĂ܂B + + ID O (g) P (p2) Q (tuEU) I (iPhone) 𑾎ɁB + l (Ȃ) + + gт̏ O Ap2̏ PAtuEȔ QAiPhonȅ I 𑾎ɂ܂B + + AnCCg + l (Ȃ) + + nCCg[hɃqbgXɑ΂AJ[܂ރX\܂B + A͈̔͂NGځ[ł̐ݒ (ngaborn_chain_all) ƘAĂ܂B + + YouTubevr[\̃TCY + l (m[}TCY) + + vr[\̃TCY2iKŎwo܂B + m[}TCY 425~350px + n[tTCY 212~175px + + +ݒ + + \郌XB + l (50) + + \̃X\łB + \Ɠ삪dȂAȂNG/ځ[/nCCg̘AȂȂ܂B + + t[̍B + l (85) + + \̉t[̍łB + sNZPʂŎw肵܂B + + ftHg̖̕\B + l (Ȃ) + + Xy[Xߖ̈׃ftHǵuv\ɂ܂B + + sage B (I[g[h/XN[X̂) + l () + + Xy[Xߖ̈ sage ɕϊ܂B + [ sage ȊǑt܂ޏꍇ ɂȂ܂B + }EXI[o[œe\܂B + + SẲsƃXy[X̍폜B + l () + + SẲs폜ĔpXy[Xɕϊ܂AAsXy[XpXy[X1‚ɂȂ܂B + SppyуXy[X͑SĔpɕϊ܂B + AA͑SlĂȂ̂ŕ܂B + ON␨ꗗ܂ޓ̈ꕔ̃Xɂ͓Kp܂B + + pop.png (p) ŔQƃX|bvAbvB + l () + + YXɑ΂ẴAJ[ (>>) L郌X pop.png (p) Ń|bvAbv܂B + \HTML|bvAbv̐ݒƘAĂ܂B + + X̕@B + l (X{^摜 re.png ) + + X̕@2ނIׂ܂B + + X{^摜 re.png (re:)B + e_uNbNB + gp鎖”\łB + + Kp^C}[B + l (^C}[) + + 10,20,30bŐݒł܂B + JEg_E0ɂȂƏ{^\܂B + + ImageCache2̃TlC쐬B + l (on) + + offɐݒ肵ꍇApɃEChEJۂImageCache2̃TlC쐬ꎞIoffɂ܂B + ēxTlC쐬onɂꍇ́ATChj[ݒ肵ĉ + + +[h/XN[ݒ + + I[g[h̊ԊuB + l (10b) + + XeI[g[h鎞Ԃw肵܂B + ݒł鎞Ԃ́A5,10,15,20błB + + y[WǍ݂ƓɎԂJEgn߂̂ŁȂXł̓XN[Ɏ̓Ǎ݂ɂȂĂ܂L܂B + + I[gXN[̊炩B + l (3) + + XN[̊炩łB + ł炩Ȃ̂ 1 AI[gXN[̏ꍇ 0 ɂȂ܂B + + I[gXN[̑xB + l (10) + + I[gXN[̑łB + ő 1 AI[gXN[̏ꍇ͏̊炩̒l 0 ɂĉB + + XN[̓́u炩vƁuxv̑gŕω܂B + uxvlłAu炩v̐ݒlɂĕςĂ܂A炩ȒF͏オ܂Atɑx͗Ă܂B + ftHg葬ꍇ́u炩v͂̂܂܂Łuxv 1 ɋ߂ÂĉB + ftHgł͑Ƃꍇ́uxv͂̂܂܂Łu炩v 1 ɂƂł傤B + uxv 0 ɂĂXN[͎~܂܂A~߂ꍇ́u炩v 0 ɂĉB + + +ݒɊւ钍ӓ_ + + pɃXJۂ́A̔‚̃Xbhꗗ̃X^C {^JĉBX̃NJƒʏ̕\ɂȂ܂B + + ~VԂ̎d؂胉C̓I[g[h/XN[ɐݒ肵X̂ݕ\܂B + + VX̐擪ځ[񂳂ĂꍇAd؂胉C͕\܂B + + uFatal error: Maximum execution time of 60 seconds exceeded in `voꍇ́Aconf.inc.php91sڂɗLXNvgsԂ̒l𑝂₵ĉB + + ĨXybNɂĂ͉s̍폜ǂ‚AXbhe̕\~܂ꍇ܂B̏ꍇ͉s̍폜offɂĉB + + safari 4ł͎̏݃{^pAccess Keyuctl+zvgȂ悤łBAccess Key̎dlςׁuctl+opt+zvɂȂ܂B + + ɃXԍ|bvAbv́uɃXvgpƁǍ̃[hŎ[hĂ܂܂BȂ̂Ŏ́uɃXv [Re:] NbNA͊YX̃_uNbNsĉB + diff --git a/doc/README-killer.txt b/doc/README-killer.txt new file mode 100644 index 000000000..81b073ae7 --- /dev/null +++ b/doc/README-killer.txt @@ -0,0 +1,40 @@ +rep2 機能拡張パック 全部入り(expack all in one) by killer + + +●何? + + rep2-expack_allinone https://github.com/open774/p2-php + + 上記やスレに上げられた修正を取り込みつつ気になったところをゴニョゴニョするバージョンです。 + + +●動作環境 + + Windows の PHP5.6 + Apache で動作確認しています。 + が突然、環境を PHP7 系にガラッと変えることがあります。 + + +●免責 + + 本ソフトウェアの使用により直接および間接的に生じたいかなる損害も補償いたしません。 + 使用は自己責任で。 + + +●注意 + + 設置者本人が悪用するのはもちろん、認証を切るなどして + 第三者に悪用されても仕方ない環境で使うのはやめてください。 + また個人でカスタムしたものもあるので変なバグ・ゴミもあったりします。 + 「あれ?」と思ったら pull や clone、 fork し直したり、open774 さんの本家 rep2 をお使いください。 + (たまにこのリポジトリもフォークし直すことが多いのです。。。) + + +●ライセンス + + 本家p2と同じく、X11ライセンスです。 + + +●ChangeLog + + https://github.com/killer4989/p2-php/commits/master に書いてあるコミットログでどうぞ(コラ + diff --git a/doc/data/Readme.txt b/doc/data/Readme.txt new file mode 100644 index 000000000..7df6aa584 --- /dev/null +++ b/doc/data/Readme.txt @@ -0,0 +1,15 @@ ++Wikiݒt@C̃TvW + +Wݒ̏ꍇdata/pref/ɓƋ@\܂B +ڂdoc/wiki/̃eLXgɋLڂĂ܂B + +p2_plugin_dat.txt DAT擾vOC +p2_plugin_link.txt NvOC +p2_replace_imageurl.txt u摜URL(JaneImageViewURLReplace.dat) + +L̃t@C͒ڕҏWKv܂B +ҏW@doc/wiki/̃eLXg悭ǂłB +p2_replace_mail.txt [ +p2_replace_name.txt O +p2_replace_date.txt tEID +p2_replace_msg.txt { diff --git a/doc/data/p2_replace_imageurl.txt b/doc/data/p2_replace_imageurl.txt index c5ae9b1fe..685870d4d 100644 --- a/doc/data/p2_replace_imageurl.txt +++ b/doc/data/p2_replace_imageurl.txt @@ -8,20 +8,20 @@ ;EXTRACTĎ擾 HTML擾邩 ;ID擾 EXTRACTuʂ̉摜URLɑ΂鐳K\Bw肳Ăꍇ͂Ń}b`őOLbVƔrAłΓ摜ƌ􂷁B ; -http://((?:(?:www\.)?(?:kiken|sekai)\.(?:nu|jp)|www\.animar-japan\.com|altair\.mydns\.jp).+)/image\.php\?\./(log/\d{14}/img/img\d+\.(?:jpe?g|png|gif|bmp)) http://$1/$2 $& +http://((?:(?:www\.)?(?:kiken|sekai)\.(?:nu|jp)|www\.animar-japan\.com|altair\.mydns\.jp).+)/image\.php\?\./(log/\d{14}/img/img\d+\.(?:jpe?g|png|gif|bmp)) http://$1/$2 $& http://((?:[^/]+\.)?(?:haru\.gs|byonavi\.com|byokan\.net|aki\.gs)/.*vip.*)/html/(\w+)\.html http://$1/vip$EXTRACT $& $EXTRACT (/data/$2\.(?:jpe?g|png|gif|bmp)) http://((?:[^/]+\.)?(?:haru\.gs|byonavi\.com|byokan\.net|aki\.gs)/.+(/vip/\w+))\.html http://$1.$EXTRACT $& $EXTRACT $2\.(jpe?g|png|gif|bmp) http://((?:[^/]+\.)?(?:haru\.gs|byonavi\.com|byokan\.net|aki\.gs)/.+)/html/(\w+)\.html http://$1$EXTRACT $& $EXTRACT (/data/$2\.(?:jpe?g|png|gif|bmp)) http://((?:\d\.)?new\.cx)/\?(\w+) $EXTRACT $& $EXTRACT (http://$1/[^"']+$2\.(?:jpe?g|png|gif|bmp)) -http://((?:arn|asc)\.kyosui\.net/ib)/disp\.php\?img=(\w+)_(\d+\.(?:jpe?g|gif|png|bmp)) http://$1/img/$2/$2_$3 $& +http://((?:arn|asc)\.kyosui\.net/ib)/disp\.php\?img=(\w+)_(\d+\.(?:jpe?g|gif|png|bmp)) http://$1/img/$2/$2_$3 $& http://((?:gazou\.tank\.jp|momiage\.sakura\.ne\.jp|namamono\.tk|8\.pro\.tok2.com/~namamono)/\w+)/ref/(\d+)\.htm http://$1$EXTRACT $& $EXTRACT=$& (/src/$2\.(?:jpe?g|png|gif)) -http://((?:gazou\.tank\.jp|momiage\.sakura\.ne\.jp|namamono\.tk|8\.pro\.tok2.com/~namamono)/\w+/)src(/\d+\.)(?:jpe?g|png|gif|bmp) $& http://$1ref$2htm -http://((?:lapislazuli|adularia)\.ath\.cx/)image(/\d+) http://$1uploader$2_tb.gif -http://((?:pinknotora\.net|\dserver\.harikonotora\.net|\dserver\.sakura\.ne\.jp)/[^/]+)/pc/img\.php\?src=\.\.(/src/\d+-\d+\.(?:jpe?g|png|gif|bmp)) http://$1$2 +http://((?:gazou\.tank\.jp|momiage\.sakura\.ne\.jp|namamono\.tk|8\.pro\.tok2.com/~namamono)/\w+/)src(/\d+\.)(?:jpe?g|png|gif|bmp) $& http://$1ref$2htm +http://((?:lapislazuli|adularia)\.ath\.cx/)image(/\d+) http://$1uploader$2_tb.gif +http://((?:pinknotora\.net|\dserver\.harikonotora\.net|\dserver\.sakura\.ne\.jp)/[^/]+)/pc/img\.php\?src=\.\.(/src/\d+-\d+\.(?:jpe?g|png|gif|bmp)) http://$1$2 http://((?:pinknotora\.net|\dserver\.harikonotora\.net|\dserver\.sakura\.ne\.jp)/[^/]+)/pc/index\.php\?res=(\d+) http://$1$EXTRACT $& $EXTRACT (/src/$2-1\.(?:jpe?g|png|gif|bmp)) http://((img\d+)\.imageshack\.us/)my\.php\?image=(.+?\.(?:jpe?g|png|gif|bmp)) $EXTRACT $& $EXTRACT src="(http://$1$2/\d+/$3)" http://((www\.happinetonline\.com).+Action=\w+)(?:(?!_pict)(&.+#)|_pict(&.+))$ http://$2$EXTRACT http://$1_pict$3$4 $EXTRACT src="(.+\.(?:jpe?g|png|gif|bmp))" -http://((www\d?\.uploader\.jp/)dl(/[^/]+/)([^/]+\.(?:jpe?g|png|gif|bmp)))(?:\.html)? http://$2user$3images/$4 http://$1.html +http://((www\d?\.uploader\.jp/)dl(/[^/]+/)([^/]+\.(?:jpe?g|png|gif|bmp)))(?:\.html)? http://$2user$3images/$4 http://$1.html http://(?:img\.)?0bbs\.jp/(?:(\w+)/img|u/(\w+)/[^/]+/)(\d+_\d+) $EXTRACT http://0bbs.jp/$1$2/img$3 $EXTRACT (http://img\.0bbs\.jp/u/$1$2/[^/]+/$3) http://(?:imgb(\d)?|c)(\.rentalcgi\.com/view)(?:(?:(?!1)(\d)|1)/\w+)?/(\w+/\d+\.(?:jpe?g|gif|png|bmp))(?:\.html)? $EXTRACT http://imgb$1$3$2/$4.html $EXTRACT (http://c$2\d/\w+/$4) http://(?:www\.)?77c\.org/[dp]\.php\?f=(\w+\.(?:jpe?g|png|gif)) http://77c.org/$EXTRACT $& $EXTRACT href="(p\.php\?f=$1&c=\w+) @@ -32,122 +32,122 @@ http://(\w+)a\.updoga\.com/(\w+)/?$ $EXTRACT http://wwwa.updoga.com/img.php/$1/$ http://(\w+\.(?:artemisweb|imgbbs)\.jp/.+/)(?!index)[^/]*(\d+)\.html? http://$1$EXTRACT $& $EXTRACT src=["']?((?:[^"']+)?$2\.(?:jpe?g|png|gif|bmp))["']? http://(\w+\.)?p2\.ms/(\w{5}).* http://$1p2.ms$EXTRACT240 $& $EXTRACT (/skur-$2\d&s=)(?:240|30) http://(\w+\.2chan\.net/\w+)/red/(\d+)\.htm http://$1$EXTRACT $& $EXTRACT (/src/$2(?:\w+)?\.(?:jpe?g|png|gif|bmp)) -http://(\w+\.4chan\.org/\w+)/src\.cgi/(\d{13}\.\w+) http://$1/src/$2 -http://(\w+\.meiwasuisan\.com/bbs(?:pink)?/)bin/img/(\w+/)(\d+\.(?:jpe?g|png|gif|bmp)) http://$1$2img/$3 -http://(\w+\.oekakibbs\.com/bbs/\w+)/oekakibbs\.cgi\?.*thisfile=(\d+\.(?:jpe?g|png|gif|bmp)) http://$1/data/$2 -http://(\w+\.s\d\+\.x-beat\.com/)upfile\.php\?n=(img/.+\.(?:jpe?g|png|gif|bmp)) http://$1$2 $& -http://(\w+\.vip2ch\.com|files\.or\.tp)/dl(?:\.p(?:hp)?)?\?f=((?:\w+)\.(?:jpe?g|png|gif|bmp)) http://$1/$2 -http://(\w+\.wtakumi\.com)/bbs\.cgi\?id=(\w+).+&file=(\d+\.(?:jpe?g|png|gif|bmp)) http://$1/s/$2/$3 +http://(\w+\.4chan\.org/\w+)/src\.cgi/(\d{13}\.\w+) http://$1/src/$2 +http://(\w+\.meiwasuisan\.com/bbs(?:pink)?/)bin/img/(\w+/)(\d+\.(?:jpe?g|png|gif|bmp)) http://$1$2img/$3 +http://(\w+\.oekakibbs\.com/bbs/\w+)/oekakibbs\.cgi\?.*thisfile=(\d+\.(?:jpe?g|png|gif|bmp)) http://$1/data/$2 +http://(\w+\.s\d\+\.x-beat\.com/)upfile\.php\?n=(img/.+\.(?:jpe?g|png|gif|bmp)) http://$1$2 $& +http://(\w+\.vip2ch\.com|files\.or\.tp)/dl(?:\.p(?:hp)?)?\?f=((?:\w+)\.(?:jpe?g|png|gif|bmp)) http://$1/$2 +http://(\w+\.wtakumi\.com)/bbs\.cgi\?id=(\w+).+&file=(\d+\.(?:jpe?g|png|gif|bmp)) http://$1/s/$2/$3 http://(\w\.pic\.to/)(\w+)(?:(\?r)=(\d+))?$ http://$1$EXTRACT http://$1$2$3$4 $EXTRACT src='($2-$4[^']+\.(?:jpe?g|png|gif|bmp))' 1 http://\w\.pic\.to/([^-]+-[^-]+)-[^"']+\.(?:jpe?g|png|gif|bmp) http://(18ban\.jp/photo\.php\?)(?:&.*)?(?:kid=(\d+)(?:&.*)?&wid=(\d+)|wid=(\d+)(?:&.*)?&kid=(\d+))(?:&.*)? $EXTRACT http://$1kid=$2$5&wid=$3$4&br=m $EXTRACT (http://[^"]+/photo/\d/$2$5/$2$5-\d+-\d+-$3$4(?:-pc)?\.(?:jpe?g|png|gif|bmp)) http://(appleup\.bbsnow\.net/\w+)/html/(\w+)\.html http://$1$EXTRACT $& $EXTRACT (/data/$2\.(?:jpe?g|png|gif|bmp)) http://(bbs\.avi\.jp/photo)/(\d+)/(\d+)(?:[&/].*)? $EXTRACT http://$1.php?kid=$2&wid=$3&br=m $EXTRACT (http://photo\d\.avi\.jp/photo/\d/$2/$2-\d+-\d+-$3(?:-pc)?\.(?:jpe?g|png|gif|bmp)) http://(bbs\.avi\.jp/photo\.php\?).*(?:kid=(\d+).*&wid=(\d+)|wid=(\d+).*&kid=(\d+)).* $EXTRACT http://$1kid=$2$5&wid=$3$4&br=m $EXTRACT (http://photo\d\.avi\.jp/photo/\d/$2$5/$2$5-\d+-\d+-$3$4(?:-pc)?\.(?:jpe?g|png|gif|bmp)) http://(bbs\.j-banana\.net/\w+)/gazou\.cgi\?room=(\w+)&no=(\d+) http://$1$EXTRACT $& $EXTRACT (/user/(?:images/)?$2_img/$3\.(?:jpe?g|png|gif|bmp)) -http://(bbs\d+\.aimix-z\.com)/photovw\.cgi\?room=(\w+)&image=(\d+\.(?:jpe?g|png|gif|bmp)).* http://$1/gbbsimg/$2/$3 $& +http://(bbs\d+\.aimix-z\.com)/photovw\.cgi\?room=(\w+)&image=(\d+\.(?:jpe?g|png|gif|bmp)).* http://$1/gbbsimg/$2/$3 $& http://(bbs01\.apricot-fizz\.net/\w+/)(?:(?:index\.php)?\?.*&num=)(\d+) http://$1$EXTRACT $& $EXTRACT (grpview.php/$2\.\d{10}\.(?:jpe?g|png|gif|bmp)) http://(beach\.dip\.jp/BBS)/(\w+/\d+\.)html http://$1$EXTRACT $& $EXTRACT (/img/$2(?:jpe?g|png|gif)) -http://(cheke|sabayomi)\.jp/detail/((\w{2})(\w{2})\w+) http://img.$1.jp/$3/$4/$2.jpg -http://(chiba\.tm\.land\.to/upload/src/(\w+\.(?:jpe?g|png|gif|bmp))) http://$1/$2 -http://(cream\.ath\.cx/ichigo)/cream/(IchigoCream\d+\.\w+) $& http://$1/dl.cgi?filename=$2 -http://(cream\.ath\.cx/ichigo)/dl\.cgi\?filename=(IchigoCream\d+\.\w+) http://$1/cream/$2 $& +http://(cheke|sabayomi)\.jp/detail/((\w{2})(\w{2})\w+) http://img.$1.jp/$3/$4/$2.jpg +http://(chiba\.tm\.land\.to/upload/src/(\w+\.(?:jpe?g|png|gif|bmp))) http://$1/$2 +http://(cream\.ath\.cx/ichigo)/cream/(IchigoCream\d+\.\w+) $& http://$1/dl.cgi?filename=$2 +http://(cream\.ath\.cx/ichigo)/dl\.cgi\?filename=(IchigoCream\d+\.\w+) http://$1/cream/$2 $& http://(f\.hatena\.ne\.jp)/(([^/])[^/]+)/((\d{8})\d+) http://$1$EXTRACT $& $EXTRACT (/images/fotolife/$3/$2/$5/$4\.(?:jpe?g|png|gif)) -http://(fancyfree\.myphotos\.cc/[^/]+/)img/\d+\.(?:jpe?g|png|gif|bmp) $& http://$1 +http://(fancyfree\.myphotos\.cc/[^/]+/)img/\d+\.(?:jpe?g|png|gif|bmp) $& http://$1 http://(img\d+\.imagevenue\.com/)[^/]+\.php.*[?&]image=[^&]+\.(?:jpe?g|png|gif|bmp) http://$1$EXTRACT $& $EXTRACT SRC="([^"/]+/loc\d+/[^"/]+\.(?:jpe?g|png|gif|bmp)) http://(imgb1\.ziyu\.net)/view(/[^/]+/\d+\.(?:jpe?g|png|gif))(?:\.html)? http://$1$EXTRACT http://$1/view$2.html $EXTRACT SRC=['"](/[^/]+$2) http://(kjm\.kir\.jp)/(?:mailbbs\d?\.php)?\?pt?=(\d+) http://$1$EXTRACT http://$1/mailbbs2.php?pt=$2 $EXTRACT (/data/\d+\.(?:jpe?g|png|gif|bmp)) -http://(moeboard\.neuromancer\.se)/info/(moeb/.+\.(?:jpe?g|png|gif|bmp)) http://$1/image/32fdab6559cdfa4f167f8c31b9199643/i/$2 +http://(moeboard\.neuromancer\.se)/info/(moeb/.+\.(?:jpe?g|png|gif|bmp)) http://$1/image/32fdab6559cdfa4f167f8c31b9199643/i/$2 http://(mup\.vip2ch\.com)/m?dl(?:\.p(?:hp)?)?\?(?:f|img)=(?:vipper)?(\d+)(?:[&.].+)? http://$1$EXTRACT $& $EXTRACT (/up/vipper$2\.(?:jpe?g|png|gif|bmp)) http://(ona-mona\.s5\.x-beat\.com/file)/html/(\w+)\.html http://$1$EXTRACT $& $EXTRACT (/data/$2\.(?:jpe?g|png|gif|bmp)) -http://(pc\.gban\.jp(?:/[fm])?)/(?:index\.php)?\?p=(.+\.(?:jpe?g|png|gif|bmp)) http://$1/img/$2 $& +http://(pc\.gban\.jp(?:/[fm])?)/(?:index\.php)?\?p=(.+\.(?:jpe?g|png|gif|bmp)) http://$1/img/$2 $& http://(siokara\.ath\.cx/sio2?)/ref/(\d+)\.htm http://$1$EXTRACT $& $EXTRACT (/sio_src/$2\.(?:jpe?g|png|gif|bmp)) http://(siokara\.ath\.cx/sio3)/ref/(\d+)\.htm http://$1$EXTRACT $& $EXTRACT (/src/$2\.(?:jpe?g|png|gif|bmp)) http://(siokara-3\.ath\.cx/hokan/\w+)/refer/(\w+)\.htm http://$1$EXTRACT $& $EXTRACT (/img/$2\.(?:jpe?g|png|gif|bmp)) http://(sourceforge\.net)/project/screenshots\.php\?.+ http://$1$EXTRACT $& $EXTRACT src="(/dbimage\.php\?id=\d+)" -http://(thumb2?\.(?:(?:imgup|uploda|vipper)\.org|vipper\.net)/v?)html/(\w+\.(?:jpe?g|png|gif|bmp))\.html http://$1file/$2 -http://(up2\.viploader\.net/\w+/)link\.php\?updir=([^&]+)&file=(\w+\.)(jpe?g|png|gif|bmp) http://$1$2/$3$4 http://$1refer/$3htm +http://(thumb2?\.(?:(?:imgup|uploda|vipper)\.org|vipper\.net)/v?)html/(\w+\.(?:jpe?g|png|gif|bmp))\.html http://$1file/$2 +http://(up2\.viploader\.net/\w+/)link\.php\?updir=([^&]+)&file=(\w+\.)(jpe?g|png|gif|bmp) http://$1$2/$3$4 http://$1refer/$3htm http://(up2\.viploader\.net/\w+/)refer/(\w+)\.htm http://$1$EXTRACT $& $EXTRACT (\w+/$2\.(?:jpe?g|png|gif|bmp)) http://(upld\.dip\.jp:8713/files/s)/link\.php\?id=(\d+) $EXTRACT $& $EXTRACT (http://$1/img/mohemohe$2\.(?:jpe?g|png|gif|bmp)) -http://(wp\.madcowdisease\.org)/gp(/.+\.(?:jpe?g|png|gif|bmp)) http://$1$2 -http://(www\.774\.cc)/down/downcon\.cgi\?name=(up\d+\.(?:jpe?g|png|gif|bmp))@Uploda(\w+) http://$1:8020/upload-$3/src/files/$2 -http://(www\.774\.cc:80)0(0/upload-\w+/src)/(up\d+\.(?:jpe?g|png|gif|bmp))\.html http://$12$2/files/$3 -http://(www\.channel-h\.net/img(\d)?/cgi)/(?:img-box/img\d{14}\.(?:jpe?g|png|gif|bmp)) $& http://$1/imgboard$2.cgi +http://(wp\.madcowdisease\.org)/gp(/.+\.(?:jpe?g|png|gif|bmp)) http://$1$2 +http://(www\.774\.cc)/down/downcon\.cgi\?name=(up\d+\.(?:jpe?g|png|gif|bmp))@Uploda(\w+) http://$1:8020/upload-$3/src/files/$2 +http://(www\.774\.cc:80)0(0/upload-\w+/src)/(up\d+\.(?:jpe?g|png|gif|bmp))\.html http://$12$2/files/$3 +http://(www\.channel-h\.net/img(\d)?/cgi)/(?:img-box/img\d{14}\.(?:jpe?g|png|gif|bmp)) $& http://$1/imgboard$2.cgi http://(www\.csync\.net/service/file)/view\.cgi\?id=(\d+) http://$1$EXTRACT $& $EXTRACT src="\.(/data/$2\.(?:jpe?g|gif|png|bmp))" http://(www\.ec2up\.com)/view/_(\w+) http://$1$EXTRACT $& $EXTRACT src="(/pics/$2\.(?:jpe?g|gif|png)) http://(www\.ec2up\.com/v)p?(\.php\?\w+) $EXTRACT http://$1p$2 $EXTRACT (http://$1p$2) -http://(www\.gz-loader\.com/[^/]+/)mailbbs\.php\?mode=graphic&log=([^.]+)\.dat&file=(.+\.(?:jpe?g|png|gif|bmp)) http://$1data/$2/org/$3 -http://(www\.hotass\.jp/more-\w+/\d+/)pages(/[^/]+_(jpe?g|gif|png|bmp)\.)htm http://$1images$2$3 +http://(www\.gz-loader\.com/[^/]+/)mailbbs\.php\?mode=graphic&log=([^.]+)\.dat&file=(.+\.(?:jpe?g|png|gif|bmp)) http://$1data/$2/org/$3 +http://(www\.hotass\.jp/more-\w+/\d+/)pages(/[^/]+_(jpe?g|gif|png|bmp)\.)htm http://$1images$2$3 http://(www\.inverse\.jp/perl2/gazou)/html/(\d+)\.htm http://$1$EXTRACT $& $EXTRACT=$& (/src/$2\.(?:jpe?g|png|gif)) -http://(www\.inverse\.jp/perl2/gazou)/src/(\d+)\.(?:jpe?g|png|gif) $& http://$1/html/$2.htm -http://(www\.sukebegazou\.com/(?:[^/]*/)?(?:img)?bbs\d)/image\.cgi\?id=(.+\.(?:jpe?g|png|gif|bmp)) http://$1/$2 $& -http://(www\d+\.axfc\.net/uploader/\d+/so)/(?:l/\d+/|view\.cgi\?dr=\d+&file=)?([^/]+\.(?:jpe?g|png|gif|bmp))(?:\.html)? http://$1/s/$2 http://$1/$2.html -http://[^/.]+\.(?:freespace\.jp|poosan\.net)/(.+(?:jpe?g|png|gif|bmp)) http://new1314.freespace.jp/$1 http://www.sunseagull.com/freespace/download.html?download1314&$1 -http://[^/]*18ban[^/]+/photo/\d/(\d+)/\d+-\d+-\d+-(\d+)(?:-pc)?\.(?:jpe?g|png|gif|bmp) $& http://18ban.jp/photo.php?kid=$1&wid=$2&br=m +http://(www\.inverse\.jp/perl2/gazou)/src/(\d+)\.(?:jpe?g|png|gif) $& http://$1/html/$2.htm +http://(www\.sukebegazou\.com/(?:[^/]*/)?(?:img)?bbs\d)/image\.cgi\?id=(.+\.(?:jpe?g|png|gif|bmp)) http://$1/$2 $& +http://(www\d+\.axfc\.net/uploader/\d+/so)/(?:l/\d+/|view\.cgi\?dr=\d+&file=)?([^/]+\.(?:jpe?g|png|gif|bmp))(?:\.html)? http://$1/s/$2 http://$1/$2.html +http://[^/.]+\.(?:freespace\.jp|poosan\.net)/(.+(?:jpe?g|png|gif|bmp)) http://new1314.freespace.jp/$1 http://www.sunseagull.com/freespace/download.html?download1314&$1 +http://[^/]*18ban[^/]+/photo/\d/(\d+)/\d+-\d+-\d+-(\d+)(?:-pc)?\.(?:jpe?g|png|gif|bmp) $& http://18ban.jp/photo.php?kid=$1&wid=$2&br=m http://\w+\.bannch\.com/\w+/BBSmsg2\?bbsid=\d+&fname=(\d{10}\.(?:jpe?g|png|gif|bmp)) $EXTRACT $& $EXTRACT href="([^"]+/$1)" http://\w+\.updoga\.com/[^/]+(/\w+/\w+)(?:/?$|(/\d+).*$) $EXTRACTe http://wwwa.updoga.com/img.php$1$2/ORG/ $EXTRACT src="([^"]+\.jp)[eg]" http://a\.upup\.be/(?:index(?:\.php)?)?\?(.*)(?:&l=\d)?(.*) http://a.upup.be/?mode=imageout$EXTRACT http://a.upup.be/?$1$2 $EXTRACT src=/\?mode=imageout.*(&k=\w+) http://an\.to/(?:\w+/)?\?.+ $EXTRACT $& $EXTRACT (http://[^"']+?\.(?:jpe?g|png|gif|bmp)) http://atk\.jp/.+ $EXTRACT $& $EXTRACT (http://[^"']+?\.(?:jpe?g|png|gif|bmp)) -http://bbs\.2ch2\.net/(\w+)/\?m=[^/]*/\w+/(img/.+\.(?:jpe?g|png|gif|bmp)) http://bbs.2ch2.net/$1/$2 -http://co0\.sakura\.ne\.jp/ph/link\.php\?f=(\d{10})x(jpe?g|png|gif|bmp) http://co0.sakura.ne.jp/ph/src/$1.$2 +http://bbs\.2ch2\.net/(\w+)/\?m=[^/]*/\w+/(img/.+\.(?:jpe?g|png|gif|bmp)) http://bbs.2ch2.net/$1/$2 +http://co0\.sakura\.ne\.jp/ph/link\.php\?f=(\d{10})x(jpe?g|png|gif|bmp) http://co0.sakura.ne.jp/ph/src/$1.$2 http://doup\.org/(?:files/)?(\w+) http://doup.org/files/$1/$EXTRACT http://doup.org/$1 $EXTRACT src=([^\s]+(?:jpe?g|png|gif|bmp)) http://fout\.garon\.jp/\?key=.+:(\w+)&ext=(jpe?g|png|gif|bmp) $EXTRACT $& $EXTRACT (http://g\d{3}\.garon\.jp/gdb/[^"]+$1\.$2) http://gban\.jp/i/(\w+(\w)) $EXTRACT $& $EXTRACT (http://gban\.jp/d/$2/$1\.(?:jpe?g|png|gif|bmp)) http://hidebbs\.net/bbs/(\w+)\?.*no=\d+ $EXTRACT $& $EXTRACT (http://www7\.hidebbs\.net/\d+/$1/bbs/\d{4}/\d{2}/\d{2}/\w+\.(?:jpe?g|gif|png|bmp)) -http://i\.turboimagehost\.com/p/(\d+/[^/]+\.(?:jpe?g|png|gif|bmp))\.html http://i2.turboimagehost.com/b1/$1 -http://i-bbs\.sijex\.net/imageDisp\.jsp\?id=(.*)&file=([^.]+\.(?:jpe?g|png|gif|bmp)) http://image.i-bbs.sijex.net/bbs/$1/$2 -http://i-bbs\.sijex\.net/servlet/ImageOutput\?pa=([^.]+\.(?:jpe?g|png|gif|bmp))&id=(\w+)&t=\d+ http://i-bbs.sijex.net/bbs/$2/$1 http://i-bbs.sijex.net/imageBoard.jsp?id=$2 +http://i\.turboimagehost\.com/p/(\d+/[^/]+\.(?:jpe?g|png|gif|bmp))\.html http://i2.turboimagehost.com/b1/$1 +http://i-bbs\.sijex\.net/imageDisp\.jsp\?id=(.*)&file=([^.]+\.(?:jpe?g|png|gif|bmp)) http://image.i-bbs.sijex.net/bbs/$1/$2 +http://i-bbs\.sijex\.net/servlet/ImageOutput\?pa=([^.]+\.(?:jpe?g|png|gif|bmp))&id=(\w+)&t=\d+ http://i-bbs.sijex.net/bbs/$2/$1 http://i-bbs.sijex.net/imageBoard.jsp?id=$2 http://iboard\d\.to/GAZOimage/\d{6}/\w\d+_\d+_\w+ $EXTRACT $& $EXTRACT ($&) -http://image\.(i-bbs\.sijex\.net/bbs/\w+/\d{13}o\.(?:jpe?g|png|gif|bmp)) $& http://$1 -http://imagesocket\.com/view/(.+(?:jpe?g|png|gif|bmp)) http://content.imagesocket.com/images/$1 +http://image\.(i-bbs\.sijex\.net/bbs/\w+/\d{13}o\.(?:jpe?g|png|gif|bmp)) $& http://$1 +http://imagesocket\.com/view/(.+(?:jpe?g|png|gif|bmp)) http://content.imagesocket.com/images/$1 http://imepita\.jp/(?:image/)?(\d{8}/\d{6}) http://imepita.jp/image/$1 http://imepita.jp/$1 http://imgcash\d\.imageshack\.us/Himg\d+/scaled\.php\?(?:.+&)?filename=[^&]+\.(?:jpe?g|png|gif|bmp).* $EXTRACT $& $EXTRACT ($&) -http://imgup5\.myphotos\.cc/image/\d+/[^/]+\.(?:jpe?g|png|gif|bmp) $& -http://kjm\.kir\.jp/pc/.*\?p=(.+\.(?:jpe?g|png|gif|bmp)) http://kjm.kir.jp/pc/img/$1 $& +http://imgup5\.myphotos\.cc/image/\d+/[^/]+\.(?:jpe?g|png|gif|bmp) $& +http://kjm\.kir\.jp/pc/.*\?p=(.+\.(?:jpe?g|png|gif|bmp)) http://kjm.kir.jp/pc/img/$1 $& http://mokei\.net/up/img/img\d+\.(?:jpe?g|png|gif|bmp) http://mokei.net$EXTRACT $& $EXTRACT "(/up/gresize\.cgi\?rn=[^"]+)" http://nurupo\.net/(?:(?:index\.php)?\?d=|cabinet/)([^&/]+)(?:&f=|/)([^?&/]+\.(?:jpe?g|png|gif|bmp))[&?](ak=\w+) $EXTRACT http://nurupo.net/cabinet/$1/$2?$3 $EXTRACT (http://nurupo\.net/cabinet/$1/$2\?$3) -http://nurupo\.net/(?:index\.php)?\?d=([^&]+)&f=([^/&]+\.(?:jpe?g|png|gif|bmp))$ http://nurupo.net/cabinet/$1/$2 $& +http://nurupo\.net/(?:index\.php)?\?d=([^&]+)&f=([^/&]+\.(?:jpe?g|png|gif|bmp))$ http://nurupo.net/cabinet/$1/$2 $& http://p\.pita\.st/\?(?:m=)?(\w{8}) $EXTRACT $& $EXTRACT .+img src="?([^"\s]+\.(?:jpe?g|png|gif|bmp)) -http://www\.gazoru\.com/g-((\w)\w{31}\.(?:jpe?g|png|gif|bmp))\.html http://www.gazoru.com/file/pic/$2/$1 -http://www\.sunseagull\.com/freespace/download\.html\?download(\d+)&(.+) http://new$1.freespace.jp/$2 $& -http://www\.uploda\.net/cgi/uploader1/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://aploda.com/dl.php?mode=pass&file_id=$1 -http://www\.uploda\.net/cgi/uploader2/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://aploda.net/dl.php?mode=pass&file_id=$1 -http://www\.uploda\.net/cgi/uploader3/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://xelhes.com/dl.php?mode=pass&file_id=$1 -http://www\.uploda\.net/cgi/uploader4/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://aploda.org/dl.php?mode=pass&file_id=$1 -http://www\.uploda\.net/i/cgi/upk1/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://lieza.net/dl.php?mode=pass&file_id=$1 +http://www\.gazoru\.com/g-((\w)\w{31}\.(?:jpe?g|png|gif|bmp))\.html http://www.gazoru.com/file/pic/$2/$1 +http://www\.sunseagull\.com/freespace/download\.html\?download(\d+)&(.+) http://new$1.freespace.jp/$2 $& +http://www\.uploda\.net/cgi/uploader1/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://aploda.com/dl.php?mode=pass&file_id=$1 +http://www\.uploda\.net/cgi/uploader2/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://aploda.net/dl.php?mode=pass&file_id=$1 +http://www\.uploda\.net/cgi/uploader3/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://xelhes.com/dl.php?mode=pass&file_id=$1 +http://www\.uploda\.net/cgi/uploader4/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://aploda.org/dl.php?mode=pass&file_id=$1 +http://www\.uploda\.net/i/cgi/upk1/index\.php\?file_id=(\d{10}\.(?:jpe?g|png|gif|bmp)) http://lieza.net/dl.php?mode=pass&file_id=$1 http://www-2ch\.net:8080/up/download/\d+\.[^?]+ $EXTRACT $& $EXTRACT ($&) -http://((?:\w+\.)?ascii24\.com/.+/\d{4}/\d{2}/\d{2}/image)view/(images\d{6}\.(?:jpe?g|png|gif|bmp))\.html http://$1s/$2 $& +http://((?:\w+\.)?ascii24\.com/.+/\d{4}/\d{2}/\d{2}/image)view/(images\d{6}\.(?:jpe?g|png|gif|bmp))\.html http://$1s/$2 $& http://((?:www\.)?jeux-france\.com/)images\d+_\d_\d+\.html http://$1$EXTRACT $& $EXTRACT src="(Webmasters/[^"]+_big\.jpg) http://(\w+\.nikkeibp\.co\.jp/.+/\d+/\d+)/\?SS=(?:\w+)?imgview&FD=.+ http://$1/$EXTRACT $& $EXTRACT src="([^/]+\.(?:jpe?g|png|gif|bmp))" http://(\w+\.watch\.impress\.co\.jp)/cda/parts/image_for_link/\d+-\d+-\d+-\d+\.html http://$1$EXTRACT $& $EXTRACT (/cda/static/image/\d{4}/\d{2}/\d{2}/[^/]+\.(?:jpe?g|png|gif|bmp)) http://(arena\.nikkeibp\.co\.jp/.+/\d+/\d+/)(\d{2}v)\.shtml http://$1$EXTRACT $& $EXTRACT src="($2\.(?:jpe?g|png|gif|bmp))" -http://(cms\.rbbtoday\.com/review/(?:photo|images)/[^/]+)\.html http://$1.jpg +http://(cms\.rbbtoday\.com/review/(?:photo|images)/[^/]+)\.html http://$1.jpg http://(ga\.sbcr\.jp/(?!wall/|sound/).+/)(\d{2})(?:-640|-1024)?\.html http://$1$EXTRACT $& $EXTRACT SRC="(?:\./)?(images/$2(?:-640|-1024)?\.jpg)" -http://(ga\.sbcr\.jp/sound/\w+)/(\d{2})\.html http://$1/images/image$2.jpg +http://(ga\.sbcr\.jp/sound/\w+)/(\d{2})\.html http://$1/images/image$2.jpg http://(ga\.sbcr\.jp/wall)/(640|1024)\.html http://$1$EXTRACT $& $EXTRACT SRC="\.(/\d+/images/$2\.jpg)" -http://(ga\.sbcr\.jp/wall/\d+)/(\d{2})\.html http://$1/images/gallery$2.jpg -http://(image\.itmedia\.co\.jp)/(?:l/im/)?(.+\.(?:jpe?g|png|gif|bmp)) http://$1/$2 $& +http://(ga\.sbcr\.jp/wall/\d+)/(\d{2})\.html http://$1/images/gallery$2.jpg +http://(image\.itmedia\.co\.jp)/(?:l/im/)?(.+\.(?:jpe?g|png|gif|bmp)) http://$1/$2 $& http://(it\.nikkei\.co\.jp)/.+\.aspx\?n=[^&]+.*&ps=\d+ http://$1$EXTRACT $& $EXTRACT (/photo/[^"]+\.(?:jpe?g|png|gif|bmp)) -http://(journal\.mycom\.co\.jp)/photo/(.+/images/\w+\.(?:jpe?g|png|gif)) http://$1/$2 +http://(journal\.mycom\.co\.jp)/photo/(.+/images/\w+\.(?:jpe?g|png|gif)) http://$1/$2 http://(k-tai\.impress\.co\.jp)/cda/parts/image_for_link/\d+-\d+-\d+-\d+\.html http://$1$EXTRACT $& $EXTRACT SRC="(/cda/static/image/\d{4}/\d{2}/\d{2}/[^/"]+\.(?:jpe?g|png|gif|bmp)) http://(news\.livedoor\.com)/article/image_detail/\d+/\?img_id=\d+ $EXTRACT $& $EXTRACT (http://image\.$1/newsimage/\w/\w/[^/"]+\.(?:jpe?g|gif|png|bmp)) http://(news\.www\.infoseek\.co\.jp)/photo/(?:\w+)/full/story/\w+/ $EXTRACT $& $EXTRACT (http://$1/img/photos/\w+/[^/]+\.(?:jpe?g|png|gif|bmp)) http://(pc\.nikkeibp\.co\.jp/.+/\d+/\d+)/[^/]+_imgview(\d)\.html http://$1/$2.$EXTRACT $& $EXTRACT $2\.(jpe?g|png|gif|bmp) -http://(release\.nikkei\.co\.jp)/attach\.cfm\?attID=(.+\.(?:jpe?g|gif|png|bmp)) http://$1/attach_file/$2 $& +http://(release\.nikkei\.co\.jp)/attach\.cfm\?attID=(.+\.(?:jpe?g|gif|png|bmp)) http://$1/attach_file/$2 $& http://(sports\.livedoor\.com)/photo/detail-\d+\.html.* $EXTRACT $& $EXTRACT (http://image.$1/photo/\w/\w/[^/"]+\.(?:jpe?g|gif|png|bmp)) http://(www\.4gamer\.net/news/image/\d{4}\.\d{2}/)(\d{14}_\w+)\.html http://$1$EXTRACT $& $EXTRACT ($2\.(?:jpe?g|png|gif|bmp)) http://(www\.asahi\.com)/photonews/\w+\.html http://$1$EXTRACT $& $EXTRACT src="(/photonews/images/\w+\.jpg)" @@ -156,103 +156,105 @@ http://(www\.dengekionline\.com/data/\w+/\d{4}/(?:\d{1,2}/){1,2})\w+_\d+\.html h http://(www\.forest\.impress\.co\.jp/article/.+)/(\w+\d+r)\.html http://$1/$EXTRACT $& $EXTRACT ($2\.(?:jpe?g|png|gif|bmp)) http://(www\.iza\.ne\.jp)/\w+/(?:newsarticle/.+/\d+/slideshow|(?:news)?photo/.+/\d+)/.* http://$1$EXTRACT.jpg $& $EXTRACT (/images/news/\d{8}/\d+)(?:_c350)?\.jpg http://(www\.mainichi-msn\.co\.jp/.+/graph/.+/)\d+\.html http://$1$EXTRACT $& $EXTRACT img src="(\d+\.jpg)" -http://(www\.rbbtoday\.com)/cgi-bin/news/pict/(\d+)/\d+/jpg/([^/]+)\.html http://$1/news/$2/$3.jpg -http://(www\.sponichi\.co\.jp/.+)(/K.+\d{11})_p\.html http://$1/images$2_l.jpg -http://(www\.vector\.co\.jp/games/news)/(\d{6})/(\d{2})/(\d{2})/images_(\d{2})\.html http://$1/$2/$3/$4/images/$2$3_$4_$5.jpg -http://(www\.vector\.co\.jp/games/review/\d{4})/images_(\d{2})\.html http://$1/images/$2_l.gif -http://(www\.vector\.co\.jp/magazine/\w+/\d{6})/(\w+[^b])b?_pic\.html http://$1/images/$2b.gif +http://(www\.rbbtoday\.com)/cgi-bin/news/pict/(\d+)/\d+/jpg/([^/]+)\.html http://$1/news/$2/$3.jpg +http://(www\.sponichi\.co\.jp/.+)(/K.+\d{11})_p\.html http://$1/images$2_l.jpg +http://(www\.vector\.co\.jp/games/news)/(\d{6})/(\d{2})/(\d{2})/images_(\d{2})\.html http://$1/$2/$3/$4/images/$2$3_$4_$5.jpg +http://(www\.vector\.co\.jp/games/review/\d{4})/images_(\d{2})\.html http://$1/images/$2_l.gif +http://(www\.vector\.co\.jp/magazine/\w+/\d{6})/(\w+[^b])b?_pic\.html http://$1/images/$2b.gif http://(www\.watch\.impress\.co\.jp/akiba/hotline/\d{8}/image/)(\w+\d)\.html http://$1$EXTRACT $& $EXTRACT src="($2\.(?:jpe?g|png|gif|bmp))" http://(www\.watch\.impress\.co\.jp/game/docs/\d{8}/)(?:\w*(?:\D|_))?\d{2}\.htm http://$1$EXTRACT $& $EXTRACT .* diff --git a/doc/test.txt b/doc/test.txt new file mode 100644 index 000000000..44ef83aea --- /dev/null +++ b/doc/test.txt @@ -0,0 +1,28 @@ +2014/09/07 (140907.1420) +@EX^CAND/ORł悤ɂ +@EpXy[XASpXy[X̏ + +2014/09/03 (140903.1600) +@Edig.2ch.netŃX^Cł悤ɂ (tgrepc.php̕ύXAdig2.php쐬) + +2014/07/19 (140719.1733) +@EߋO擾offlawōsrokka(ID)ōsI悤ɂ + +2014/07/18 (140718.2130) +@EߋO擾offlaw2.sooRArokkaoRɑΉ() +@@Eread.cgioRŊmFHTMLłǂ𗘗p邩I + +2014/07/16 (140716.1150) +@EߋO@̕ύX +@@E2ch.netoffraw.soAshoro=kumaŎ擾 +@@EbbspinkrokkaŎ擾 +@@2chꕔ (IH)rokkaŎ擾ł肷邪ʓ|̂ŏL̂悤ɂ + +2014/07/15 (140715.1701) +@EQlIDłdat擾ɑΉ (rokka systempAꕔIA‚ł͎擾s”\) +@Evip2ch.comǂݍ݊֌WC ({ ver.1.8.85ɍ킹) + +2014/07/15 (140715.1530) +@Evip2ch.comǂݍݑΉ +@EΌfˆړ]Ή +@Ecomposer.jsonύX (pear-pear pear-pear.php.net ) \ No newline at end of file diff --git a/doc/wiki/WIKI-774.txt b/doc/wiki/WIKI-774.txt new file mode 100644 index 000000000..0103620c0 --- /dev/null +++ b/doc/wiki/WIKI-774.txt @@ -0,0 +1,31 @@ +NvOCŎg774Ǝ@\ + + show{^ +jQuery̗͂ɂANbNiframeɕϐg܂B + + +Match +^(?:https?://(?:www\.|m\.)?youtube\.(?:com|jp)/(?:watch\?(?:.*&)?(?:v|video_id)=|v/)|(?:https?://youtu\.be/|https://www\.youtube-nocookie\.com/v/))([\w\-_]+)(?:.*)?$ + +Replace +show + +data-video_url(K{) iframesrc +data-video_width(K{) iframewidth +data-video_height(K{) iframeheight +data-video_style(IvV) iframestyle +data-video_harf(IvV) 1ɂwidthheightɂȂ܂ +data-video_option(IvV) Javascript̘Azz`iframe̒ljw肵܂BOƒl͕KyAłKv܂B + + 萔 +NvOCReplaceɈȉ̍ڂw肷ƁA̓eɕϊ܂B +E$atag rep2̐ݒƐڑ[ɉea^Oɕϊ܂B +$atag̈ +Match +^(?:https?://(?:www\.|m\.)?youtube\.(?:com|jp)/(?:watch\?(?:.*&)?(?:v|video_id)=|v/)|(?:https?://youtu\.be/|https://www\.youtube-nocookie\.com/v/))([\w\-_]+)(?:.*)?$ + +Replace +$atag
+ +iframe_popup=upłvɐݒ肵ԂłPCANZXꍇ$atag +u
(p)$strvɕϊ܂B \ No newline at end of file diff --git a/lib/BbsMap.php b/lib/BbsMap.php deleted file mode 100644 index df29457cb..000000000 --- a/lib/BbsMap.php +++ /dev/null @@ -1,444 +0,0 @@ -rep2 info: zXg̈ړ]o܂B(%s/%s %s/%s)
'; - $msg_fmt .= 'CɔACɃXAŋߓǂ񂾃Xœ܂B

'; - P2Util::pushInfoHtml(sprintf($msg_fmt, $host, $bbs, $new_host, $bbs)); - self::syncFav(); - $synced = true; - } - $host = $new_host; - } - - return $host; - } - - // }}} - // {{{ getBbsName() - - /** - * –LONG擾 - * - * @param string $host zXg - * @param string $bbs – - * @return string ƒj[ɋLڂÖ - */ - static public function getBbsName($host, $bbs) - { - // }bsOǂݍ - $map = self::_getMapping(); - if (!$map) { - return $bbs; - } - $type = self::_detectHostType($host); - - // `FbN - if (isset($map[$type]) && isset($map[$type][$bbs])) { - $itaj = $map[$type][$bbs]['itaj']; - } else { - $itaj = $bbs; - } - - return $itaj; - } - - // }}} - // {{{ syncBrd() - - /** - * Cɔ‚Ȃǂbrdt@C𓯊 - * - * @param string $brd_path brdt@C̃pX - * @return void - */ - static public function syncBrd($brd_path) - { - global $_conf; - static $done = array(); - - // {{{ Ǎ - - if (isset($done[$brd_path])) { - return; - } - - if (!($lines = FileCtl::file_read_lines($brd_path))) { - return; - } - $map = self::_getMapping(); - if (!$map) { - return; - } - $neolines = array(); - $updated = false; - - // }}} - // {{{ - - foreach ($lines as $line) { - $setitaj = false; - $data = explode("\t", rtrim($line, "\n")); - $hoge = $data[0]; // \? - $host = $data[1]; - $bbs = $data[2]; - $itaj = $data[3]; - $type = self::_detectHostType($host); - - if (isset($map[$type]) && isset($map[$type][$bbs])) { - $newhost = $map[$type][$bbs]['host']; - if ($itaj === '') { - $itaj = $map[$type][$bbs]['itaj']; - if ($itaj != $bbs) { - $setitaj = true; - } else { - $itaj = ''; - } - } - } else { - $newhost = $host; - } - - if ($host != $newhost || $setitaj) { - $neolines[] = "{$hoge}\t{$newhost}\t{$bbs}\t{$itaj}\n"; - $updated = true; - } else { - $neolines[] = $line; - } - } - - // }}} - // {{{ - - $brd_name = p2h(basename($brd_path)); - if ($updated) { - self::_writeData($brd_path, $neolines); - P2Util::pushInfoHtml(sprintf('

rep2 info: %s 𓯊܂B

', $brd_name)); - } else { - P2Util::pushInfoHtml(sprintf('

rep2 info: %s ͕ύX܂łB

', $brd_name)); - } - $done[$brd_path] = true; - - // }}} - } - - // }}} - // {{{ syncIdx() - - /** - * CɃXȂǂidxt@C𓯊 - * - * @param string $idx_path idxt@C̃pX - * @return void - */ - static public function syncIdx($idx_path) - { - global $_conf; - static $done = array(); - - // {{{ Ǎ - - if (isset($done[$idx_path])) { - return; - } - - if (!($lines = FileCtl::file_read_lines($idx_path))) { - return; - } - $map = self::_getMapping(); - if (!$map) { - return; - } - $neolines = array(); - $updated = false; - - // }}} - // {{{ - - foreach ($lines as $line) { - $data = explode('<>', rtrim($line, "\n")); - $host = $data[10]; - $bbs = $data[11]; - $type = self::_detectHostType($host); - - if (isset($map[$type]) && isset($map[$type][$bbs])) { - $newhost = $map[$type][$bbs]['host']; - } else { - $newhost = $host; - } - - if ($host != $newhost) { - $data[10] = $newhost; - $neolines[] = implode('<>', $data) . "\n"; - $updated = true; - } else { - $neolines[] = $line; - } - } - - // }}} - // {{{ - - $idx_name = p2h(basename($idx_path)); - if ($updated) { - self::_writeData($idx_path, $neolines); - P2Util::pushInfoHtml(sprintf('

rep2 info: %s 𓯊܂B

', $idx_name)); - } else { - P2Util::pushInfoHtml(sprintf('

rep2 info: %s ͕ύX܂łB

', $idx_name)); - } - $done[$idx_path] = true; - - // }}} - } - - // }}} - // {{{ syncFav() - - /** - * CɔACɃXAŋߓǂ񂾃X𓯊 - * - * @return void - */ - static public function syncFav() - { - global $_conf; - self::syncBrd($_conf['favita_brd']); - self::syncIdx($_conf['favlist_idx']); - self::syncIdx($_conf['recent_idx']); - } - - // }}} - // {{{ _getMapping() - - /** - * 2chj[p[XA-zXg̑Ή\쐬 - * - * @return array site/bbs/(host,itaj) ̑Azz - * _E[hɎsƂ false - */ - static private function _getMapping() - { - global $_conf; - - // {{{ ݒ - - $bbsmenu_url = 'http://menu.2ch.net/bbsmenu.html'; // j[ URL - $altmenu_url = 'http://www.2ch.se/bbsmenu.html'; // փj[ URL - $map_cache_path = $_conf['cache_dir'] . '/host_bbs_map.txt'; - $map_cache_lifetime = 600; // TTL͏Z߂ - $err_fmt = '

rep2 error: BbsMap: %s - %s _E[hł܂łB

'; - $use_alt = false; - - // }}} - // {{{ LbVmF - - if (!is_null(self::$_map)) { - return self::$_map; - } elseif (file_exists($map_cache_path)) { - $mtime = filemtime($map_cache_path); - $expires = $mtime + $map_cache_lifetime; - if (time() < $expires) { - $map_cahce = file_get_contents($map_cache_path); - self::$_map = unserialize($map_cahce); - return self::$_map; - } - } else { - FileCtl::mkdirFor($map_cache_path); - } - touch($map_cache_path); - clearstatcache(); - - // }}} - // {{{ j[_E[h - - $params = array(); - $params['timeout'] = $_conf['http_conn_timeout']; - $params['readTimeout'] = array($_conf['http_read_timeout'], 0); - if (isset($mtime)) { - $params['requestHeaders'] = array('If-Modified-Since' => http_date($mtime)); - } - if ($_conf['proxy_use']) { - $params['proxy_host'] = $_conf['proxy_host']; - $params['proxy_port'] = $_conf['proxy_port']; - } - $req = new HTTP_Request($bbsmenu_url, $params); - $req->setMethod('GET'); - $err = $req->sendRequest(true); - - // G[̂ƂÃj[gĂ݂ - if (PEAR::isError($err) && $use_alt) { - P2Util::pushInfoHtml(sprintf($err_fmt, p2h($err->getMessage()), p2h($bbsmenu_url))); - P2Util::pushInfoHtml(sprintf("

%s _E[h܂B

", p2h($altmenu_url))); - $bbsmenu_url = $altmenu_url; - unset ($req, $err); - $req = new HTTP_Request($bbsmenu_url, $params); - $req->setMethod('GET'); - $err = $req->sendRequest(true); - } - - // G[ - if (PEAR::isError($err)) { - P2Util::pushInfoHtml(sprintf($err_fmt, p2h($err->getMessage()), p2h($bbsmenu_url))); - if (file_exists($map_cache_path)) { - return unserialize(file_get_contents($map_cache_path)); - } else { - return false; - } - } - - // X|XR[h - $code = $req->getResponseCode(); - if ($code == 304) { - $map_cahce = file_get_contents($map_cache_path); - self::$_map = unserialize($map_cahce); - return self::$_map; - } elseif ($code != 200) { - P2Util::pushInfoHtml(sprintf($err_fmt, p2h(strval($code)), p2h($bbsmenu_url))); - if (file_exists($map_cache_path)) { - return unserialize(file_get_contents($map_cache_path)); - } else { - return false; - } - } - - $res_body = $req->getResponseBody(); - - // }}} - // {{{ p[X - - $regex = '!(.+?)!'; - preg_match_all($regex, $res_body, $matches, PREG_SET_ORDER); - - $map = array(); - foreach ($matches as $match) { - $host = $match[1]; - $bbs = $match[2]; - $itaj = $match[3]; - $type = self::_detectHostType($host); - if (!isset($map[$type])) { - $map[$type] = array(); - } - $map[$type][$bbs] = array('host' => $host, 'itaj' => $itaj); - } - - // }}} - // {{{ LbV - - $map_cache = serialize($map); - if (FileCtl::file_write_contents($map_cache_path, $map_cache) === false) { - p2die("cannot write file. ({$map_cache_path})"); - } - - // }}} - - return (self::$_map = $map); - } - - // }}} - // {{{ _writeData() - - /** - * XṼf[^ - * - * @param string $path ރt@C̃pX - * @param array $neolines ރf[^̔z - * @return void - */ - static private function _writeData($path, $neolines) - { - if (is_array($neolines) && count($neolines) > 0) { - $cont = implode('', $neolines); - /*} elseif (is_scalar($neolines)) { - $cont = strval($neolines);*/ - } else { - $cont = ''; - } - if (FileCtl::file_write_contents($path, $cont) === false) { - p2die("cannot write file. ({$path})"); - } - } - - // }}} - // {{{ _detectHostType() - - /** - * zXg̎ނ𔻒肷 - * - * @param string $host zXg - * @return string zXg̎ - */ - static private function _detectHostType($host) - { - if (P2Util::isHostBbsPink($host)) { - $type = 'bbspink'; - } elseif (P2Util::isHost2chs($host)) { - $type = '2channel'; - } elseif (P2Util::isHostMachiBbs($host)) { - $type = 'machibbs'; - } elseif (P2Util::isHostJbbsShitaraba($host)) { - $type = 'jbbs'; - } else { - $type = $host; - } - return $type; - } - - // }}} -} - -// }}} - -/* - * Local Variables: - * mode: php - * coding: cp932 - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ -// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/BrdCtl.php b/lib/BrdCtl.php index 66ca87942..f857fa053 100644 --- a/lib/BrdCtl.php +++ b/lib/BrdCtl.php @@ -30,8 +30,19 @@ static public function read_brds() */ static public function read_brd_dir() { + global $_conf; $brd_menus = array(); - $brd_dir = './board'; + $brd_dir = $_conf['data_dir'] . '/board'; + + // fBNgȂꍇ͐VKō쐬 + if (!file_exists($brd_dir)) { + FileCtl::mkdirRecursive($brd_dir); + if(!is_writable($brd_dir)){ + // ݌𓾂Ȃꍇ̓p[~bV̒ӊN + p2die("efBNg̃p[~bVĉB"); + } + return $brd_menus; + } if ($cdir = @dir($brd_dir)) { // fBNg @@ -71,30 +82,19 @@ static public function read_brd_online() if ($_conf['brdfile_online']) { $cachefile = P2Util::cacheFileForDL($_conf['brdfile_online']); - $noDL = false; - $read_html_flag = false; - // LbVꍇ - if (file_exists($cachefile.'.p2.brd')) { - // norefreshȂDLȂ - if (!empty($_GET['nr'])) { - $noDL = true; - // LbV̍XVw莞ԈȓȂDLȂ - } elseif (@filemtime($cachefile.'.p2.brd') > time() - 60 * 60 * $_conf['menu_dl_interval']) { - $noDL = true; - } - } + $read_html_flag = false; - // DLȂ - if ($noDL) { - ; - // DL - } else { + // DLAnorefreshȂDLȂ + if (empty($_GET['nr']) || !file_exists($cachefile.'.p2.brd')) { //echo "DL!
";// - $brdfile_online_res = P2Util::fileDownload($_conf['brdfile_online'], $cachefile); - if ($brdfile_online_res->isSuccess() && $brdfile_online_res->code != 304) { + $cache_time = time() - 60 * 30 * $_conf['menu_dl_interval']; + $brdfile_online_res = P2Commun::fileDownload($_conf['brdfile_online'], $cachefile, $cache_time); + if (isset($brdfile_online_res) && $brdfile_online_res->getStatus() != 304) { $isNewDL = true; } + + unset($brdfile_online_res); } // html`Ȃ diff --git a/lib/DownloadDatMachiBbs.php b/lib/DownloadDatMachiBbs.php index 7a8566356..9f122054e 100644 --- a/lib/DownloadDatMachiBbs.php +++ b/lib/DownloadDatMachiBbs.php @@ -53,7 +53,11 @@ static public function invoke(ThreadRead $thread) } // http://[SERVER]/bbs/offlaw.cgi/[BBS]/[KEY]/[OPTION]; - $url = "http://{$host}/bbs/offlaw.cgi/{$bbs}/{$key}/{$option}"; + if($_conf['machibbs.disphost.enable']){ + $url = "http://{$host}/bbs/offlaw.cgi/2/{$bbs}/{$key}/{$option}"; + } else { + $url = "http://{$host}/bbs/offlaw.cgi/{$bbs}/{$key}/{$option}"; + } $tempfile = $thread->keydat . '.tmp'; FileCtl::mkdirFor($tempfile); @@ -62,14 +66,13 @@ static public function invoke(ThreadRead $thread) } elseif (file_exists($tempfile)) { unlink($tempfile); } - $response = P2Util::fileDownload($url, $tempfile); + $response = P2Commun::fileDownload($url, $tempfile); - if ($response->isError()) { - if (304 != $response->code) { - $thread->diedat = true; - } + if (empty($response)) { + $thread->diedat = true; return false; } + unset($response); // }}} // {{{ _E[hes`FbN‚ƒ[Jdatɏ @@ -105,6 +108,12 @@ static public function invoke(ThreadRead $thread) fwrite($fp, $abn); $thread->gotnum++; } + + if($_conf['machibbs.disphost.enable']){ + $lar[2] .= sprintf(" [ %s ]", $lar[5]); + } + unset($lar[5]); + // s fwrite($fp, implode('<>', $lar) . "\n"); } else { diff --git a/lib/FavSetManager.php b/lib/FavSetManager.php index e136e420b..b145a9930 100644 --- a/lib/FavSetManager.php +++ b/lib/FavSetManager.php @@ -91,7 +91,7 @@ static public function loadAllFavSet($force = false) $key = $lar[1]; $host = $lar[10]; $bbs = $lar[11]; - $group = P2Util::getHostGroupName($host); + $group = P2HostMgr::getHostGroupName($host); $_conf['favlists'][$i][] = array('group' => $group, 'host' => $host, 'bbs' => $bbs, 'key' => $key); } } @@ -107,7 +107,7 @@ static public function loadAllFavSet($force = false) $host = $lar[1]; $bbs = $lar[2]; $itaj = $lar[3]; - $group = P2Util::getHostGroupName($host); + $group = P2HostMgr::getHostGroupName($host); $_conf['favitas'][$i][] = array('group' => $group, 'host' => $host, 'bbs' => $bbs, 'itaj' => $itaj); } } diff --git a/lib/HostCheck.php b/lib/HostCheck.php deleted file mode 100644 index 7fde9f23f..000000000 --- a/lib/HostCheck.php +++ /dev/null @@ -1,167 +0,0 @@ -= 6) { - return false; - } - $zeros = ':' . str_repeat('0:', 6 - $nsecs); - $pos = strpos($address, '::'); - if ($pos === 0) { - $zeros = '0' . $zeros; - } - if ($pos === strlen($address) - 2) { - $zeros .= '0'; - } - $address = str_replace('::', $zeros, $address); - case 0: - break; - default: - return false; - } - - // ŏI`FbN - if (preg_match('/^([0-9a-f]{1,4}):([0-9a-f]{1,4}):([0-9a-f]{1,4}):([0-9a-f]{1,4}):([0-9a-f]{1,4}):([0-9a-f]{1,4}):([0-9a-f]{1,4}):([0-9a-f]{1,4})$/', $address, $matches)) { - array_shift($matches); - if ($binary) { - return vsprintf('%016b%016b%016b%016b%016b%016b%016b%016b', array_map('hexdec', $matches)); - } - return vsprintf('%04s:%04s:%04s:%04s:%04s:%04s:%04s:%04s', $matches); - } - - return false; - } - - // }}} - // {{{ isAddressPrivate() - - /** - * vCx[gAhX? - * - * @see RFC1918 - * - * @param string $address - * @param string $class - * - * @return bool - */ - static public function isAddressPrivate($address = '', $class = 'ABC') - { - if (!$address) { - $address = $_SERVER['REMOTE_ADDR']; - } - - $lval = ip2long($address); - if ($lval === false) { - return false; - } - - $classes = array( - 'A' => array('10.0.0.0', '255.0.0.0'), - 'B' => array('172.16.0.0','255.240.0.0'), - 'C' => array('192.168.0.0', '255.255.0.0'), - ); - - foreach ($classes as $k => $v) { - if (stripos($class, $k) !== false) { - $rval = ip2long($v[0]); - $mask = ip2long($v[1]); - if (($lval & $mask) === $rval) { - return true; - } - } - } - - return false; - } - - // }}} -} - -// }}} - -/* - * Local Variables: - * mode: php - * coding: cp932 - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ -// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/JStyle.php b/lib/JStyle.php index 77515a2cb..6c43699a4 100644 --- a/lib/JStyle.php +++ b/lib/JStyle.php @@ -30,21 +30,6 @@ static public function singleton() return self::$_instance; } - // }}} - // {{{ encode() - - /** - * lShift_JISUTF-8Ԋ҂ĂJSONGR[h - * - * @param mixed $value - * @return string - */ - static public function encode($value) - { - mb_convert_variables('UTF-8', 'SJIS-win', $value); - return json_encode($value); - } - // }}} // {{{ __construct() @@ -99,7 +84,7 @@ public function offsetGet($key) sscanf($this->_style[$key], '%u,%u', $width, $height); $this->_cache[$key] = sprintf('%u,%u', $width, $height); } else { - $this->_cache[$key] = self::encode($this->_style[$key]); + $this->_cache[$key] = p2_json_encode($this->_style[$key]); } } diff --git a/lib/LastmodifyTxt.php b/lib/LastmodifyTxt.php new file mode 100644 index 000000000..d2b4437f8 --- /dev/null +++ b/lib/LastmodifyTxt.php @@ -0,0 +1,224 @@ +host = $host; + $this->bbs = $bbs; + $this->storage = 'file'; + + $this->lastmodify_file = P2Util::datDirOfHostBbs($host, $bbs) . 'lastmodify.txt'; + // ڑ悪 2ch.net / 5ch / pink ȊȌꍇ_E[hȂ + if (!P2HostMgr::isHost2chs($this->host)) { + return ; + } + $this->lastmodify_url = 'https://' . $host . '/' . $bbs . '/lastmodify.txt'; + + // lastmodify.txt _E[hZbg + $this->dlAndSetLastmodify(); + } + + // }}} + // {{{ dlAndSetLastmodify() + + /** + * lastmodify.txt_E[hZbg + * + * @return boolean Zbgł trueAłȂ false + */ + public function dlAndSetLastmodify() + { + $cont = $this->downloadLastmodify(); + if ($this->setLastmodifyLines($cont)) { + return true; + } else { + return false; + } + } + + // }}} + // {{{ downloadLastmodify() + + /** + * lastmodify.txt_E[h + * + * @return string lastmodify.txt ̒g + */ + public function downloadLastmodify() + { + global $_conf; + + if ($this->storage === 'file') { + FileCtl::mkdirFor($this->lastmodify_file); // ƒfBNg΍ + + if (file_exists($this->lastmodify_file)) { + if (!empty($_REQUEST['norefresh']) || (empty($_REQUEST['refresh']) && isset($_REQUEST['word']))) { + return; // XVȂꍇ́ȀŔĂ܂ + } elseif (!empty($GLOBALS['expack.subject.multi-threaded-download.done'])) { + return; // _E[hς̏ꍇ + } elseif (empty($_POST['newthread']) and $this->isLastmodifyTxtFresh()) { + return; // VKXĎłȂAXVVꍇ + } + $modified = http_date(filemtime($this->lastmodify_file)); + } else { + $modified = false; + } + } + + // DL + try { + $req = P2Commun::createHTTPRequest($this->lastmodify_url, HTTP_Request2::METHOD_GET); + $modified && $req->setHeader("If-Modified-Since", $modified); + + $response = P2Commun::getHTTPResponse($req); + + $code = $response->getStatus(); + if ($code == 302) { + // zXg̈ړ]ǐ + $new_host = P2HostMgr::getCurrentHost($this->host, $this->bbs); + if ($new_host != $this->host) { + $aNewLastmodifyTxt = new LastmodifyTxt($new_host, $this->bbs); + $body = $aNewLastmodifyTxt->downloadLastmodify(); + return $body; + } + } elseif ($code == 200 || $code == 206) { + //var_dump($response->getHeader()); + $body = $response->getBody(); + // or be.2ch.net ȂEUCSJISɕϊ + if (P2HostMgr::isHostJbbsShitaraba($this->host) || P2HostMgr::isHostBe2chs($this->host)) { + $body = mb_convert_encoding($body, 'CP932', 'CP51932'); + } + if (FileCtl::file_write_contents($this->lastmodify_file, $body) === false) { + p2die('cannot write file'); + } + } elseif ($code == 304) { + // touch邱ƂōXVC^[ôŁA΂炭ă`FbNȂȂ + // iύXȂ̂ɏCԂXV̂́ACi܂ȂAł͓ɖȂ낤j + if ($this->storage === 'file') { + touch($this->lastmodify_file); + } + } else { + $error_msg = $code; + } + } catch (Exception $e) { + $error_msg = $e->getMessage(); + } + + if (isset($error_msg) && strlen($error_msg) > 0) { + $url_t = P2Util::throughIme($this->lastmodify_url); + $info_msg_ht = "

Error: {$error_msg}
"; + $info_msg_ht .= "rep2 info: {$this->lastmodify_url} ɐڑł܂łB

"; + P2Util::pushInfoHtml($info_msg_ht); + $body = ''; + } + + return $body; + } + + // }}} + // {{{ isLastmodifyTxtFresh() + + /** + * lastmodify.txt VNȂ true Ԃ + * + * @return boolean VNȂ trueBłȂ falseB + */ + public function isLastmodifyTxtFresh() + { + global $_conf; + + // LbVꍇ + if (file_exists($this->lastmodify_file)) { + // LbV̍XVw莞ԈȓȂ + // clearstatcache(); + if (filemtime($this->lastmodify_file) > time() - $_conf['sb_dl_interval']) { + return true; + } + } + + return false; + } + + // }}} + // {{{ setLastmodifyLines() + + /** + * lastmodify.txt ǂݍ + * + * ΁A$this->lastmodify_lines Zbg + * + * @param string $cont eashm pɓnĂB + * @return boolean s + */ + public function setLastmodifyLines($cont = '') + { + $this->lastmodify_lines = FileCtl::file_read_lines($this->lastmodify_file); + + if ($this->lastmodify_lines) { + return true; + } else { + return false; + } + } + + // }}} + // {{{ getThreadExtend() + + /** + * extdat ǂݍ + * + * ΁A$this->lastmodify_lines Zbg + * + * @param string $cont eashm pɓnĂB + * @return boolean s + */ + public function getThreadExtend($key) + { + // ڑ悪 2ch / 5ch / pink ȊȌꍇ '' Ԃ + if (!file_exists($this->lastmodify_file)) { + return ''; + } + + foreach($this->lastmodify_lines as $l){ + if (preg_match("/^($key\.(?:dat|cgi))<>(.+?)<>(\d+)<>(\d+)<>(\d+)<>(\d+)<>(.+?)<>(.+?)<>/", $l, $matches)) { break; } + } + return $matches[8]; + } + + // }}} +} + +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/Login.php b/lib/Login.php index a012b63d2..a8157e45a 100644 --- a/lib/Login.php +++ b/lib/Login.php @@ -59,6 +59,7 @@ public function setUser($user) */ public function setdownLoginUser() { + global $_conf; $login_user = null; // [U̗D揇ʂɉ @@ -86,21 +87,9 @@ public function setdownLoginUser() } elseif (isset($_SESSION['login_user']) && preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_SESSION['login_user'])) { $login_user = $_SESSION['login_user']; - /* - // BasicF؂Ŏw - } elseif (!empty($_REQUEST['basic'])) { - - if (isset($_SERVER['PHP_AUTH_USER']) && (preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_SERVER['PHP_AUTH_USER']))) { - $login_user = $_SERVER['PHP_AUTH_USER']; - - } else { - header('WWW-Authenticate: Basic realm="zone"'); - header('HTTP/1.0 401 Unauthorized'); - echo 'Login Failed. [UF؂Ɏs܂B'; - exit; - } - */ - + // OF؂Ŏw + } elseif ($_conf['external_authentication'] && isset($_SERVER['REMOTE_USER']) && (preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_SERVER['REMOTE_USER']))) { + $login_user = $_SERVER['REMOTE_USER']; } return $login_user; diff --git a/lib/NgAbornCtl.php b/lib/NgAbornCtl.php index 6c49767e1..d1162979e 100644 --- a/lib/NgAbornCtl.php +++ b/lib/NgAbornCtl.php @@ -14,19 +14,25 @@ 'aborn_name' => 0, 'aborn_res' => 0, 'aborn_thread' => 0, + 'aborn_auto' => 0, 'ng_chain' => 0, 'ng_freq' => 0, 'ng_id' => 0, 'ng_mail' => 0, 'ng_msg' => 0, 'ng_name' => 0, + 'ng_auto' => 0, + 'highlight_chain' => 0, + 'highlight_id' => 0, + 'highlight_mail' => 0, + 'highlight_msg' => 0, + 'highlight_name' => 0, ); // }}} // {{{ NgAbornCtl -class NgAbornCtl -{ +class NgAbornCtl { // {{{ saveNgAborns() /** @@ -35,8 +41,7 @@ class NgAbornCtl * @param void * @return void */ - static public function saveNgAborns() - { + static public function saveNgAborns() { global $ngaborns, $ngaborns_hits; global $_conf; @@ -111,8 +116,7 @@ static public function saveNgAborns() * @param array $aborn_threads * @return void */ - static public function saveAbornThreads(array $aborn_threads) - { + static public function saveAbornThreads(array $aborn_threads) { if (array_key_exists('ngaborns', $GLOBALS)) { $orig_ngaborns = $GLOBALS['ngaborns']; $restore_ngaborns = true; @@ -136,8 +140,7 @@ static public function saveAbornThreads(array $aborn_threads) /** * NGځ[HITL^XVԂŃ\[g */ - static public function cmpLastTime($a, $b) - { + static public function cmpLastTime($a, $b) { if (empty($a['lasttime']) || empty($b['lasttime'])) { return strcmp($a['lasttime'], $b['lasttime']); } @@ -156,8 +159,8 @@ static public function cmpLastTime($a, $b) * @param void * @return array */ - static public function loadNgAborns() - { + static public function loadNgAborns() { + global $_conf; $ngaborns = array(); $ngaborns['aborn_res'] = self::_readNgAbornFromFile('p2_aborn_res.txt'); // ꂾiقȂ @@ -172,6 +175,17 @@ static public function loadNgAborns() // +Wiki $ngaborns['aborn_be'] = self::_readNgAbornFromFile('p2_aborn_be.txt'); $ngaborns['ng_be'] = self::_readNgAbornFromFile('p2_ng_be.txt'); + // +live + $ngaborns['highlight_name'] = self::_readNgAbornFromFile('p2_highlight_name.txt'); + $ngaborns['highlight_mail'] = self::_readNgAbornFromFile('p2_highlight_mail.txt'); + $ngaborns['highlight_msg'] = self::_readNgAbornFromFile('p2_highlight_msg.txt'); + $ngaborns['highlight_id'] = self::_readNgAbornFromFile('p2_highlight_id.txt'); + + if ($_conf['ngaborn_auto']) { + // NG + $ngaborns['aborn_auto'] = self::_readNgAbornFromFile('p2_aborn_auto.txt'); + $ngaborns['ng_auto'] = self::_readNgAbornFromFile('p2_ng_auto.txt'); + } return $ngaborns; } @@ -185,28 +199,56 @@ static public function loadNgAborns() * @param void * @return array */ - static public function loadAbornThreads() - { + static public function loadAbornThreads() { return self::_readNgAbornFromFile('p2_aborn_thread.txt'); } + // }}} + // {{{ ngAbornAdd() + /** + * ځ[&NG[hݒlj + * + * @param string ǂɒlj邩 + * @param string lje + * @return bool o^ꂽtrue + */ + static public function ngAbornAdd($code, $word) { + global $ngaborns; + foreach ($ngaborns[$code]['data'] as $data) { + if ($data['cond'] === $word) { + return false; //‚ljɔ + } + } + + // lj + $ngaborns[$code]['data'][] = array( + 'cond' => $word, // + 'word' => $word, // Ώە + 'lasttime' => null, // ŌHIT + 'hits' => 0, // HIT + 'regex' => false, // p^[}b`֐ + 'ignorecase' => false, // 啶𖳎 + ); + return true; + } // }}} // {{{ _readNgAbornFromFile() /** * readNgAbornFromFile */ - static protected function _readNgAbornFromFile($filename) - { + static protected function _readNgAbornFromFile($filename) { global $_conf; $file = $_conf['pref_dir'] . '/' . $filename; $data = array(); if ($lines = FileCtl::file_read_lines($file)) { + // Oɏoč + $replace_pairs = array('<' => '<', '>' => '>'); foreach ($lines as $l) { $lar = explode("\t", trim($l)); - if (strlen($lar[0]) == 0) { + if ($lar[0] === '') { continue; } $ar = array( @@ -224,64 +266,55 @@ static protected function _readNgAbornFromFile($filename) $data[] = $ar; continue; } - - // ” - if (preg_match('!(.+?)!', $ar['word'], $matches)) { - $ar['bbs'] = explode(',', $matches[1]); - } - $ar['word'] = preg_replace('!(.*)!', '', $ar['word']); - - // ^Cg - if (preg_match('!(.+?)!', $ar['word'], $matches)) { - $ar['title'] = $matches[1]; - } - $ar['word'] = preg_replace('!(.*)!', '', $ar['word']); - - // K\ - if (preg_match('/^<(mb_ereg|preg_match|regex)(:[imsxeADSUXu]+)?>(.+)$/', $ar['word'], $matches)) { - // }b`O֐ƃp^[ݒ - if ($matches[1] == 'regex') { - if (P2_MBREGEX_AVAILABLE) { - $ar['regex'] = 'mb_ereg'; - $ar['word'] = $matches[3]; - } else { - $ar['regex'] = 'preg_match'; - $ar['word'] = '/' . str_replace('/', '\\/', $matches[3]) . '/'; - } - } else { - $ar['regex'] = $matches[1]; - $ar['word'] = $matches[3]; + // e(edit_aborn_word.phpʂȂK̏ԂɂȂ) + if (preg_match('{^(?:<(regex|regexi|i)>)?(?:(.+?))?(?:(.+?))?(.+)$}s', $ar['word'], $matches)) { + switch ($matches[1]) { + // K\ + case "regex": + if (P2_MBREGEX_AVAILABLE) { + $ar['regex'] = 'mb_ereg'; + $ar['word'] = $matches[4]; + } else { + $ar['regex'] = 'preg_match'; + $ar['word'] = '/' . str_replace('/', '\\/', $matches[4]) . '/'; + } + break; + // K\E啶𖳎 + case 'regexi': + if (P2_MBREGEX_AVAILABLE) { + $ar['regex'] = 'mb_eregi'; + $ar['word'] = $matches[4]; + } else { + $ar['regex'] = 'preg_match'; + $ar['word'] = '/' . str_replace('/', '\\/', $matches[4]) . '/i'; + } + break; + // 啶𖳎 + case 'i': + $ar['word'] = $matches[4]; + $ar['ignorecase'] = true; + default: + // GXP[vĂȂꕶGXP[v + // $ar['word'] = p2h($ar['word'], false); + // 2ch̎dlA͊Ғʂ̌ʂȂƂ̂ŁA<>̎QƂɂ + $ar['word'] = strtr($matches[4], $replace_pairs); + break; } - // 啶𖳎 - if ($matches[2] && strpos($matches[2], 'i') !== false) { - if ($ar['regex'] == 'mb_ereg') { - $ar['regex'] = 'mb_eregi'; - } else { - $ar['word'] .= 'i'; - } + // ” + if ($matches[2] !== '') { + $ar['bbs'] = explode(',', $matches[2]); + } + // ^Cg + if ($matches[3] !== '') { + $ar['title'] = $matches[3]; } - // 啶𖳎 - } elseif (preg_match('/^(.+)$/', $ar['word'], $matches)) { - $ar['word'] = $matches[1]; - $ar['ignorecase'] = true; - } - - // K\łȂȂAGXP[vĂȂꕶGXP[v - /*if (!$ar['regex']) { - $ar['word'] = p2h($ar['word'], false); - }*/ - // 2ch̎dlA͊Ғʂ̌ʂȂƂ̂ŁA<>̎QƂɂ - if (!$ar['regex']) { - $ar['word'] = str_replace(array('<', '>'), array('<', '>'), $ar['word']); } - $data[] = $ar; } } return array('file' => $file, 'data' => $data); } - // }}} } diff --git a/lib/P2Commun.php b/lib/P2Commun.php new file mode 100644 index 000000000..d66d7d93f --- /dev/null +++ b/lib/P2Commun.php @@ -0,0 +1,233 @@ +setHeader ('User-Agent', self::getP2UA(true,P2HostMgr::isHost2chs($purl['host']))); + $req->setHeader ('Accept-Language', 'ja,en-us;q=0.7,en;q=0.3'); + $req->setHeader ('Accept', '*/*'); + $req->setHeader ('Accept-Encoding', 'gzip, deflate'); + + // ^CAEg̐ݒ + $req->setConfig (array ( + 'connect_timeout' => $_conf['http_conn_timeout'], + 'timeout' => $_conf['http_read_timeout'], + )); + + // OƂ̒ʐM͑ScURLgisocketopenSSL݂Œnނ̂ŐΎgp֎~Ij + $req->setAdapter('curl'); + + // SSL̐ݒ + if($purl['scheme'] == 'https') { + if($_conf['ssl_capath']) + { + $req->setConfig ('ssl_capath', $_conf['ssl_capath']); + } + } + + // vLV + if ($_conf['tor_use'] && P2HostMgr::isHostTor($purl['host'], 0)) { // Tor(.onion)Torp̐ݒZbg + $req->setConfig (array ( + 'proxy_host' => $_conf['tor_proxy_host'], + 'proxy_port' => $_conf['tor_proxy_port'], + 'proxy_user' => $_conf['tor_proxy_user'], + 'proxy_password' => $_conf['tor_proxy_password'] + )); + if($_conf['tor_proxy_mode'] == 'socks5'){ + $req->setConfig('proxy_type', $_conf['tor_proxy_mode']); + } + } elseif ($_conf['proxy_use']) { + $req->setConfig (array ( + 'proxy_host' => $_conf['proxy_host'], + 'proxy_port' => $_conf['proxy_port'], + 'proxy_user' => $_conf['proxy_user'], + 'proxy_password' => $_conf['proxy_password'] + )); + if($_conf['proxy_mode'] == 'socks5'){ + $req->setConfig('proxy_type', $_conf['proxy_mode']); + } + } + + unset ($purl); + + return $req; + } + + static public function getHTTPResponse($req) { + if($req->getConfig('proxy_type') == 'socks5') { + $socks = new HTTP_Request2_Adapter_Socket(); + $res = $socks->sendRequest($req); + unset($socks); + } else { + $res = $req->send (); + } + return $res; + } + // }}} + // {{{ getP2UA() + /** + * p2APIUAԂ + * @param bool $withMonazilla trueȂMonazilla/1.00t + * @param bool $apiUA trueŏAPIp”\ȂƂAPIUAԂ + * @return string + */ + static public function getP2UA($withMonazilla = true,$apiUA = false) + { + global $_conf; + + // APIgpݒ̏ꍇAPIUAԂ + if ($apiUA && $_conf['2chapi_use'] == 1) { + if ($_conf['2chapi_appname'] != "") { + $p2ua = $_conf['2chapi_appname']; + } else { + p2die("2chƒʐM邽߂ɕKvȏ񂪐ݒ肳Ă܂B"); + } + } else { + $p2ua = $_conf['p2ua']; + } + + if ($withMonazilla) { + $p2ua = sprintf('Monazilla/1.00 (%s)', $p2ua); + } + + return $p2ua; + } + // }}} + // {{{ getWebPage + + /** + * Weby[W擾 + * + * 200 OK + * 206 Partial Content + * 304 Not Modified s + * + * @return string|false y[WeԂBsfalseԂB + */ + static public function getWebPage($url, &$error_msg, $timeout = 15) + { + try { + $req = self::createHTTPRequest($url, HTTP_Request2::METHOD_GET); + //$req->addHeader("X-PHP-Version", phpversion()); + + $response = self::getHTTPResponse($req); + + $code = $response->getStatus(); + if ($code == 200 || $code == 206) { // || $code == 304) { + return $response->getBody(); + } + } catch (Exception $e) { + return false; + } + return false; + } + + // }}} + // {{{ fileDownload() + + /** + * t@C_E[hۑ + */ + static public function fileDownload($url, $localfile, + $cache_time = 0, + $disp_error = true, + $trace_redirection = false) + { + global $_conf; + + if (file_exists($localfile)) { + // LbVLԂȂ_E[hȂ + if (filemtime($localfile) > time() - $cache_time) { + return null; + } + } + + try { + // DL + $req = self::createHTTPRequest($url, HTTP_Request2::METHOD_GET); + + $req->setConfig(array('follow_redirects' => $trace_redirection)); + + if (file_exists($localfile)) { + $req->setHeader ('If-Modified-Since', http_date(filemtime($localfile)) ); + } + + $response = self::getHTTPResponse($req); + + $code = $response->getStatus(); + if (!($code == 200 || $code == 206 || $code == 304)) { + $error_msg = $code; + } + $body = $response->getBody(); + + } catch (Exception $e) { + $error_msg = $e->getMessage(); + } + + // G[onullԂďI + if (isset($error_msg) && strlen($error_msg) > 0) { + // G[bZ[Wݒ + if ($disp_error) { + $url_t = P2Util::throughIme($url); + $info_msg_ht = "

Error: {$error_msg}
"; + $info_msg_ht .= "rep2 info: {$url} ɐڑł܂łB

"; + P2Util::pushInfoHtml($info_msg_ht); + } + return null; + } + + // XVĂۑ + if ($code != 304) { + if (FileCtl::file_write_contents($localfile, $body) === false) { + p2die('cannot write file.'); + } + } + + return $response; + } + + // }}} + public static function getResponseCode($url) + { + try { + $req = self::createHTTPRequest ($url, HTTP_Request2::METHOD_HEAD); + $response = self::getHTTPResponse($req); + return $response->getStatus(); + + } catch (Exception $e) { + return false; // $error_msg + } + } +} \ No newline at end of file diff --git a/lib/P2CurlMulti.php b/lib/P2CurlMulti.php new file mode 100644 index 000000000..4ad2fc0ac --- /dev/null +++ b/lib/P2CurlMulti.php @@ -0,0 +1,295 @@ +mh = curl_multi_init(); + $this->ch = array(); + $this->file_update = array(); + } + + private function __destruct() { + foreach ($this->ch as $ch_array) { + curl_multi_remove_handle($this->mh, $ch_array); + curl_close($ch_array); + } + curl_multi_close($this->mh); + } + + + private function add($subjects, $force = false) { + global $_conf; + + if(empty($subjects)){ return; } + + $time = time() - $_conf['sb_dl_interval']; + $isOldFile = array(); + + foreach ($subjects as $key => $subject) { + list($host, $bbs) = explode("_", $key); + + $url = "http://{$host}/{$bbs}/subject.txt"; + $file = P2Util::datDirOfHostBbs($host, $bbs) . 'subject.txt'; + + $isOldFile[$key] = false; + if (!$force && file_exists($file) && $time <= filemtime($file)) { + $isOldFile[$key] = true; + continue; + } + + $this->ch[$key] = curl_init(); + + $this->file_update[$key] = file_exists($file) ? filemtime($file) : 0; + + // dat擾pheader + $header = array(); + $header["If-Modified-Since"] = gmdate('D, d M Y H:i:s T', $this->file_update[$key]); + $header["Connection"] = 'close'; + + curl_setopt($this->ch[$key], CURLOPT_URL, $url); + curl_setopt($this->ch[$key], CURLOPT_RETURNTRANSFER, true); + curl_setopt($this->ch[$key], CURLOPT_TIMEOUT, $_conf['http_read_timeout']); + curl_setopt($this->ch[$key], CURLOPT_CONNECTTIMEOUT, $_conf['http_conn_timeout']); + curl_setopt($this->ch[$key], CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($this->ch[$key], CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); + curl_setopt($this->ch[$key], CURLOPT_FILETIME, true); + curl_setopt($this->ch[$key], CURLOPT_HTTPHEADER, $header); + curl_setopt($this->ch[$key], CURLINFO_HEADER_OUT, true); + curl_setopt($this->ch[$key], CURLOPT_HEADER, true); + curl_setopt($this->ch[$key], CURLOPT_MAXCONNECTS, $_conf['expack.curl_per_host']); + + // User-Agent + if(P2HostMgr::isHost2chs($host) && !P2HostMgr::isNotUse2chsAPI($host) && $_conf['2chapi_use']){ + $user_agent = sprintf ($_conf['2chapi_ua.read'], $_conf['2chapi_appname']); + } else { + $user_agent = P2Commun::getP2UA(true, P2HostMgr::isHost2chs($purl['host'])); + } + curl_setopt($this->ch[$key], CURLOPT_USERAGENT, $user_agent); + + // vLV + if ($_conf['tor_use'] && P2HostMgr::isHostTor($purl['host'], 0)) { // Tor(.onion)Torp̐ݒZbg + $tor_user_info = sprintf("%s%s@", $_conf['tor_proxy_user'], empty($_conf['tor_proxy_password']) ? "" : ":{$_conf['tor_proxy_password']}"); + $tor_address = "{$_conf['tor_proxy_host']}:{$_conf['tor_proxy_port']}"; + $address = sprintf("http://%s%s", strpos($tor_user_info, "@") === 0 ? "" : $tor_user_info, $tor_address); + + curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); + curl_setopt($ch, CURLOPT_PROXY, $address); + + if($_conf['tor_proxy_mode'] == 'socks5'){ + curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); + } + + } elseif ($_conf['proxy_use']) { + $proxy_user_info = sprintf("%s%s@", $_conf['proxy_user'], empty($_conf['proxy_password']) ? "" : ":{$_conf['proxy_password']}"); + $proxy_address = "{$_conf['proxy_host']}:{$_conf['proxy_port']}"; + $address = sprintf("http://%s%s", strpos($proxy_user_info, "@") === 0 ? "" : $proxy_user_info, $proxy_address); + + curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1); + curl_setopt($ch, CURLOPT_PROXY, $address); + + if($_conf['proxy_mode'] == 'socks5'){ + curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); + } + } + + curl_multi_add_handle($this->mh, $this->ch[$key]); + } + } + + private function execute() { + global $_conf; + + if(is_null($this->mh) && is_null($this->ch)){ + return; + } + + // execute + do { + $stat = curl_multi_exec($this->mh, $running); + } while ($stat === CURLM_CALL_MULTI_PERFORM); + + // check + // bŎc(not start Download ȂIł?) +// if (!$running || $stat !== CURLM_OK) { +// // throw new RuntimeException("$running $stat"); +// error_log("not start download. please check. running:[$running], stat:[$stat]\n"); +// } + + // wait + do { + switch (curl_multi_select($this->mh, $_conf['http_conn_timeout'] + $_conf['http_read_timeout'])) { + case -1: // selectɎsP[X炵 https://bugs.php.net/bug.php?id=61141 + usleep(10); + do{ + $stat = curl_multi_exec($this->mh, $running); + } while ($stat === CURLM_CALL_MULTI_PERFORM); + continue 2; + + case 0: //timeout + continue 2; + + default: + //ω + do{ + $stat = curl_multi_exec($this->mh, $running); + } while ($stat === CURLM_CALL_MULTI_PERFORM); + } + } while ($running); + } + + private function getResult() { + + $eucjp2sjis = null; + + foreach ($this->ch as $key => $ch_array) { + list($host, $bbs) = explode("_", $key); + + if ($isOldFile[$key]) { + continue; + } + + $file = P2Util::datDirOfHostBbs($host, $bbs) . 'subject.txt'; + + if(is_null($this->mh)){ + return; + } + + if(empty($ch_array)){ + continue; + } + + $tmp = curl_getinfo($ch_array); + $tmp += array("before_time" => $this->file_update[$key], "after_time" => empty($tmp['filetime']) ? time() : $tmp['filetime']); + // $result[$key] = $tmp; + + $data = curl_multi_getcontent($ch_array); + $header_size = $tmp['header_size']; + + if (P2HostMgr::isHostJbbsShitaraba($host) || P2HostMgr::isHostBe2chs($host)) { + $data = mb_convert_encoding($data, 'CP932', 'CP51932'); + } + + // 304ȂƂp + if($tmp['http_code'] != "304" && $tmp['before_time'] <= $tmp['after_time']){ + $body = substr($data, $header_size); + if (file_put_contents($file, $body) === false) { + error_log("cannot write file.[$file]\n"); + } + } + } + } + + // {{{ fetchSubjectTxt() + + /** + * subject.txtꊇ_E[h&ۑ + * + * @param array|string $subjects + * @param bool $force + * @return void + */ + static public function fetchSubjectTxt($subjects, $force = false) + { + global $_conf; + + $makeIdFormat = "%s_%s"; + + // {{{ _E[hΏۂݒ + + // Cɔ“.idx`̃t@Cp[X + if (is_string($subjects)) { + $lines = FileCtl::file_read_lines($subjects, FILE_IGNORE_NEW_LINES); + if (!$lines) { + return; + } + + $subjects = array(); + + foreach ($lines as $l) { + $la = explode('<>', $l); + if (count($la) < 12) { + continue; + } + + $host = $la[10]; + $bbs = $la[11]; + if ($host === '' || $bbs === '') { + continue; + } + + $key = sprintf($makeIdFormat, $host, $bbs); + if (isset($subjects[$key])) { + continue; + } + + $subjects[$key] = array($host, $bbs); + } + + // [host, bbs] ̘Azz + } elseif (is_array($subjects)) { + $originals = $subjects; + $subjects = array(); + + foreach ($originals as $s) { + if (!is_array($s) || !isset($s['host']) || !isset($s['bbs'])) { + continue; + } + + $key = sprintf($makeIdFormat, $s['host'], $s['bbs']); + if (isset($subjects[$key])) { + continue; + } + + $subjects[$key] = array($s['host'], $s['bbs']); + } + + // LȊO + } else { + return; + } + + if (!count($subjects)) { + return; + } + + // }}} + // {{{ + + ksort($subjects); + + $self = new self; + + // e subject.txt ւ̃NGXgL[ɒlj + $self->add($subjects, $force); + + // _E[hX^[g + $self->execute(); + + // e subject.txt ۑ + $self->getResult(); + + // }}} + + return ; + } + + // }}} +} + +// }}} +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/P2HostMgr.php b/lib/P2HostMgr.php new file mode 100644 index 000000000..4f8886a5e --- /dev/null +++ b/lib/P2HostMgr.php @@ -0,0 +1,895 @@ +', $host); + } + return self::$_hostIs2ch[$host]; + } + + // }}} + // {{{ isHostBe2chNet() + + /** + * host be.2ch.net Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostBe2chNet($host) + { + return $host == 'be.2ch.net'; + } + + // }}} + // {{{ isNotUse2chAPI() + + /** + * host API pȂĂ擾łꍇȂ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isNotUse2chAPI($host) + { + return ($host == 'qb5.2ch.net' || $host == 'carpenter.2ch.net'); + } + + // }}} + // {{{ isHost5ch() + + /** + * host 5ch Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHost5ch($host) + { + if (!array_key_exists($host, self::$_hostIs5ch)) { + self::$_hostIs5ch[$host] = (bool)preg_match('<^\\w+\\.(?:5ch\\.net)$>', $host); + } + return self::$_hostIs5ch[$host]; + } + + // }}} + // {{{ isHostBe5chNet() + + /** + * host be.2ch.net Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostBe5chNet($host) + { + return $host == 'be.5ch.net'; + } + + // }}} + // {{{ isNotUse5chAPI() + + /** + * host API pȂĂ擾łꍇȂ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isNotUse5chAPI($host) + { + return ($host == 'qb5.5ch.net' || $host == 'carpenter.5ch.net'); + } + + // }}} + // {{{ isHostBbsPink() + + /** + * host bbspink Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostBbsPink($host) + { + if (!array_key_exists($host, self::$_hostIsBbsPink)) { + self::$_hostIsBbsPink[$host] = (bool)preg_match('<^\\w+\\.bbspink\\.com$>', $host); + } + return self::$_hostIsBbsPink[$host]; + } + + // }}} + // {{{ isHost2chSc() + + /** + * host 2ch.sc Ȃ true Ԃ + * + * @param string $host + * @return boolean + */ + static public function isHost2chSc($host) + { + if (!array_key_exists($host, self::$_hostIs2chSc)) { + self::$_hostIs2chSc[$host] = (bool)preg_match('/\\.(2ch\\.sc)$/', $host); + } + return self::$_hostIs2chSc[$host]; + } + + // }}} + // {{{ isHostOpen2ch() + + /** + * host [Ղ2ch Ȃ true Ԃ + * + * @param string $host + * @return boolean + */ + static public function isHostOpen2ch($host) + { + if (!array_key_exists($host, self::$_hostIsOpen2ch)) { + self::$_hostIsOpen2ch[$host] = (bool)preg_match('/\\.(open2ch\\.net)$/', $host); + } + return self::$_hostIsOpen2ch[$host]; + } + + // }}} + // {{{ isHostNext2ch() + + /** + * host next2ch Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostNext2ch($host) + { + if ($host === 'next2ch.net') { + return true; + } + + if (!array_key_exists($host, self::$_hostIsNext2ch)) { + self::$_hostIsNext2ch[$host] = (bool)preg_match('/\\.(next2ch\\.net)$/', $host); + } + return self::$_hostIsNext2ch[$host]; + } + + // }}} + // {{{ isHostSuper2ch() + + /** + * host super2ch Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostSuper2ch($host) + { + if ($host === 'super2ch.net') { + return true; + } + + if (!array_key_exists($host, self::$_hostIsSuper2ch)) { + self::$_hostIsSuper2ch[$host] = (bool)preg_match('/\\.(super2ch\\.net)$/', $host); + } + return self::$_hostIsSuper2ch[$host]; + } + + // }}} + // {{{ isHostMachiBbs() + + /** + * host machibbs Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostMachiBbs($host) + { + if ($host === "machi.to") { + return true; + } + + if (!array_key_exists($host, self::$_hostIsMachiBbs)) { + self::$_hostIsMachiBbs[$host] = (bool)preg_match('<^\\w+\\.machi(?:bbs\\.com|\\.to)$>', $host); + } + return self::$_hostIsMachiBbs[$host]; + } + + // }}} + // {{{ isHostMachiBbsNet() + + /** + * host machibbs.net ܂r˂ Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostMachiBbsNet($host) + { + if (!array_key_exists($host, self::$_hostIsMachiBbsNet)) { + self::$_hostIsMachiBbsNet[$host] = (bool)preg_match('<^\\w+\\.machibbs\\.net$>', $host); + } + return self::$_hostIsMachiBbsNet[$host]; + } + + // }}} + // {{{ isHostJbbsShitaraba() + + /** + * host livedoor ^f : Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostJbbsShitaraba($in_host) + { + if (!array_key_exists($in_host, self::$_hostIsJbbsShitaraba)) { + if ($in_host == 'rentalbbs.livedoor.com') { + self::$_hostIsJbbsShitaraba[$in_host] = true; + } elseif (preg_match('<^jbbs\\.(?:shitaraba\\.(?:net|com)|livedoor\\.(?:com|jp))(?:/|$)>', $in_host)) { + self::$_hostIsJbbsShitaraba[$in_host] = true; + } else { + self::$_hostIsJbbsShitaraba[$in_host] = false; + } + } + return self::$_hostIsJbbsShitaraba[$in_host]; + } + + // }}} + // {{{ adjustHostJbbs() + + /** + * livedoor ^f : ΂̃zXgύXɑΉĕύX + * + * @param string $in_str zXgłURLłȂłǂ + * @return string + */ + static public function adjustHostJbbs($in_str) + { + return preg_replace('<(^|/)jbbs\\.(?:shitaraba|livedoor)\\.(?:net|com)(/|$)>', '\\1jbbs.shitaraba.net\\2', $in_str, 1); + } + + // }}} + // {{{ isHostTor() + + /** + * host tor n Ȃ true Ԃ + * + * @access public + * @param string $host + * @return boolean + */ + static function isHostTor($host, $isGatewayMode = 99) + { + switch ($isGatewayMode) { + case 0: + $ret = (bool)preg_match('/\\.onion$/', $host); + break; + + case 1: + $ret = (bool)preg_match('/\\.(onion\\.cab|onion\\.city|onion\\.direct|onion\\.link|onion\\.nu|onion\\.to|onion\\.rip)$/', $host); + break; + + default: + $ret = (bool)preg_match('/\\.(onion\\.cab|onion\\.city|onion\\.direct|onion\\.link|onion\\.nu|onion\\.to|onion\\.rip|onion)$/', $host); + break; + } + + return $ret; + } + + // }}} + // {{{ isHostVip2ch() + + /** + * host vip2ch Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostVip2ch($host) + { + if (!array_key_exists($host, self::$_hostIsVip2ch)) { + self::$_hostIsVip2ch[$host] = (bool)preg_match('<^\\w+\\.(?:vip2ch\\.com)$>', $host); + } + return self::$_hostIsVip2ch[$host]; + } + + // }}} + // {{{ isHostJikkyoOrg() + + /** + * host jikkyo.org Ȃ true Ԃ + * + * @param string $host + * @return bool + */ + static public function isHostJikkyoOrg($host) + { + if ($host === 'jikkyo.org' || $host === 'livech.sakura.ne.jp') { + return true; + } + + if (!array_key_exists($host, self::$_hostIsJikkyoOrg)) { + self::$_hostIsJikkyoOrg[$host] = (bool)preg_match('/\\.(jikkyo\\.org)$/', $host); + } + return self::$_hostIsJikkyoOrg[$host]; + } + + // }}} + // {{{ isUrlWikipediaJa() + + /** + * URLEBLyfBA{ł̋LȂtrueԂ + */ + static public function isUrlWikipediaJa($url) + { + return (strncmp($url, 'http://ja.wikipedia.org/wiki/', 29) == 0); + } + + // }}} + // {{{ getCurrentHost() + + /** + * ŐṼzXg擾 + * + * @param string $host zXg + * @param string $bbs – + * @param bool $autosync ړ]oƂɎœ邩ۂ + * @return string ‚ɑΉŐṼzXg + */ + static public function getCurrentHost($host, $bbs, $autosync = true) + { + static $synced = false; + + // }bsOǂݍ + $map = self::_getMapping(); + if (!$map) { + return $host; + } + $type = self::getHostGroupName($host); + + // `FbN + if (isset($map[$type]) && isset($map[$type][$bbs])) { + $new_host = $map[$type][$bbs]['host']; + if ($host != $new_host && $autosync && !$synced) { + // ړ]o炨CɔACɃXAŋߓǂ񂾃Xœ + $msg_fmt = '

rep2 info: zXg̈ړ]o܂B(%s/%s %s/%s)
'; + $msg_fmt .= 'CɔACɃXAŋߓǂ񂾃Xœ܂B

'; + P2Util::pushInfoHtml(sprintf($msg_fmt, $host, $bbs, $new_host, $bbs)); + self::syncFav(); + $synced = true; + } + $host = $new_host; + } + + return $host; + } + + // }}} + // {{{ getItaName() + + /** + * –LONG擾 + * + * @param string $host zXg + * @param string $bbs – + * @return string ƒj[ɋLڂÖ + */ + static public function getItaName($host, $bbs) + { + // }bsOǂݍ + $map = self::_getMapping(); + if (!$map) { + return $bbs; + } + $type = self::getHostGroupName($host); + + // `FbN + if (isset($map[$type]) && isset($map[$type][$bbs])) { + $itaj = $map[$type][$bbs]['itaj']; + } else { + $itaj = $bbs; + } + + return $itaj; + } + + // }}} + // {{{ isRegisteredBbs() + + /** + * ‚rep2ɓo^Ă邩ǂ + * + * @param string $host zXg + * @param string $bbs – + * @return bool rep2ɒljÂȂtrue + */ + static public function isRegisteredBbs($host, $bbs) + { + global $_conf; + + $type = self::getHostGroupName($host); + + // datjh~̂itest.[25]ch.net͖ⓚpfalse + if($host == 'itest.5ch.net'||$host == 'itest.2ch.net') { + return false; + } + + // o^łrep2ň‚̓`FbNtrue + if($host != $type) { + return true; + } + + // }bsOǂݍ + $map = self::_getMapping(); + if (!$map) { + return false; + } + + // `FbN + if (isset($map[$type]) && isset($map[$type][$bbs])) { + return true; + } + + // ‚Ȃ΂Cɔ‚̓emF(O‚o^”\ɂȂĂ邽) + if ($lines = FileCtl::file_read_lines($_conf['favita_brd'], FILE_IGNORE_NEW_LINES)) { + foreach ($lines as $l) { + if (preg_match("/^\t?(.+)\t(.+)\t(.+)\$/", $l, $matches)) { + if ($host == $matches[1]) + { + return true; + } + } + } + } + return false; + } + + // }}} + // {{{ syncBrd() + + /** + * Cɔ‚Ȃǂbrdt@C𓯊 + * + * @param string $brd_path brdt@C̃pX + * @return void + */ + static public function syncBrd($brd_path) + { + global $_conf; + static $done = array(); + + // {{{ Ǎ + + if (isset($done[$brd_path])) { + return; + } + + if (!($lines = FileCtl::file_read_lines($brd_path))) { + return; + } + $map = self::_getMapping(); + if (!$map) { + return; + } + $neolines = array(); + $updated = false; + + // }}} + // {{{ + + foreach ($lines as $line) { + $setitaj = false; + $data = explode("\t", rtrim($line, "\n")); + $hoge = $data[0]; // \? + $host = $data[1]; + $bbs = $data[2]; + $itaj = $data[3]; + $type = self::getHostGroupName($host); + + if (isset($map[$type]) && isset($map[$type][$bbs])) { + $newhost = $map[$type][$bbs]['host']; + if ($itaj === '') { + $itaj = $map[$type][$bbs]['itaj']; + if ($itaj != $bbs) { + $setitaj = true; + } else { + $itaj = ''; + } + } + } else { + $newhost = $host; + } + + if ($host != $newhost || $setitaj) { + $neolines[] = "{$hoge}\t{$newhost}\t{$bbs}\t{$itaj}\n"; + $updated = true; + } else { + $neolines[] = $line; + } + } + + // }}} + // {{{ + + $brd_name = p2h(basename($brd_path)); + if ($updated) { + self::_writeData($brd_path, $neolines); + P2Util::pushInfoHtml(sprintf('

rep2 info: %s 𓯊܂B

', $brd_name)); + } else { + P2Util::pushInfoHtml(sprintf('

rep2 info: %s ͕ύX܂łB

', $brd_name)); + } + $done[$brd_path] = true; + + // }}} + } + + // }}} + // {{{ syncIdx() + + /** + * CɃXȂǂidxt@C𓯊 + * + * @param string $idx_path idxt@C̃pX + * @return void + */ + static public function syncIdx($idx_path) + { + global $_conf; + static $done = array(); + + // {{{ Ǎ + + if (isset($done[$idx_path])) { + return; + } + + if (!($lines = FileCtl::file_read_lines($idx_path))) { + return; + } + $map = self::_getMapping(); + if (!$map) { + return; + } + $neolines = array(); + $updated = false; + + // }}} + // {{{ + + foreach ($lines as $line) { + $data = explode('<>', rtrim($line, "\n")); + $host = $data[10]; + $bbs = $data[11]; + $type = self::getHostGroupName($host); + + if (isset($map[$type]) && isset($map[$type][$bbs])) { + $newhost = $map[$type][$bbs]['host']; + } else { + $newhost = $host; + } + + if ($host != $newhost) { + $data[10] = $newhost; + $neolines[] = implode('<>', $data) . "\n"; + $updated = true; + } else { + $neolines[] = $line; + } + } + + // }}} + // {{{ + + $idx_name = p2h(basename($idx_path)); + if ($updated) { + self::_writeData($idx_path, $neolines); + P2Util::pushInfoHtml(sprintf('

rep2 info: %s 𓯊܂B

', $idx_name)); + } else { + P2Util::pushInfoHtml(sprintf('

rep2 info: %s ͕ύX܂łB

', $idx_name)); + } + $done[$idx_path] = true; + + // }}} + } + + // }}} + // {{{ syncFav() + + /** + * CɔACɃXAŋߓǂ񂾃X𓯊 + * + * @return void + */ + static public function syncFav() + { + global $_conf; + self::syncBrd($_conf['favita_brd']); + self::syncIdx($_conf['favlist_idx']); + self::syncIdx($_conf['recent_idx']); + } + + // }}} + // {{{ _getMapping() + + /** + * 2chj[p[XA-zXg̑Ή\쐬 + * + * @return array site/bbs/(host,itaj) ̑Azz + * _E[hɎsƂ false + */ + static private function _getMapping() + { + global $_conf; + + // {{{ ݒ + $map_cache_path = $_conf['cache_dir'] . '/host_bbs_map.txt'; + $map_cache_lifetime = 60 * 10; // 10ɃLbVč\z邪ABrdCtlōŒ30̓ANZXȂB + + // }}} + // {{{ LbVmF + + if (!is_null(self::$_map)) { + return self::$_map; + } elseif (file_exists($map_cache_path)) { + $mtime = filemtime($map_cache_path); + $expires = $mtime + $map_cache_lifetime; + if (time() < $expires) { + $map_cahce = file_get_contents($map_cache_path); + self::$_map = unserialize($map_cahce); + return self::$_map; + } + } else { + FileCtl::mkdirFor($map_cache_path); + } + touch($map_cache_path); + clearstatcache(); + + // }}} + // {{{ j[_E[h + $brd_menus_online = BrdCtl::read_brds(); + $map = array(); + + foreach ($brd_menus_online as $a_brd_menu) { + foreach ($a_brd_menu->categories as $cate) { + if ($cate->num > 0) { + foreach ($cate->menuitas as $mita) { + $host = $mita->host; + $bbs = $mita->bbs; + $itaj = $mita->itaj; + $type = self::getHostGroupName($host); + if (!isset($map[$type])) { + $map[$type] = array(); + } + $map[$type][$bbs] = array('host' => $host, 'itaj' => $itaj); + } + } + } + } + unset ($brd_menus_online); + // }}} + // {{{ LbV + + $map_cache = serialize($map); + if (FileCtl::file_write_contents($map_cache_path, $map_cache) === false) { + p2die("cannot write file. ({$map_cache_path})"); + } + + // }}} + + return (self::$_map = $map); + } + + // }}} + // {{{ _writeData() + + /** + * XṼf[^ + * + * @param string $path ރt@C̃pX + * @param array $neolines ރf[^̔z + * @return void + */ + static private function _writeData($path, $neolines) + { + if (is_array($neolines) && count($neolines) > 0) { + $cont = implode('', $neolines); + /*} elseif (is_scalar($neolines)) { + $cont = strval($neolines);*/ + } else { + $cont = ''; + } + if (FileCtl::file_write_contents($path, $cont) === false) { + p2die("cannot write file. ({$path})"); + } + } + // }}} + // {{{ getHostGroupName() + + /** + * zXgɑΉ邨CɔECɃXO[v擾 + * + * @param string $host + * @return void + */ + static public function getHostGroupName($host) + { + if (self::isHost2chs($host)) { + return '2channel'; + } elseif (self::isHostMachiBbs($host)) { + return 'machibbs'; + } elseif (self::isHostJbbsShitaraba($host)) { + return 'shitaraba'; + } elseif (self::isHostVip2ch($host)) { + return 'vip2ch'; + } else { + return $host; + } + } + + // }}} +} + +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/P2HttpExt.php b/lib/P2HttpExt.php index ce35a77d6..1dae07957 100644 --- a/lib/P2HttpExt.php +++ b/lib/P2HttpExt.php @@ -246,7 +246,9 @@ public function __construct($url, } if (!isset($options['useragent'])) { - $options['useragent'] = "Monazilla/1.00 ({$_conf['p2ua']})"; + $purl = parse_url($url); // URL + $options['useragent'] = P2Commun::getP2UA(true,P2HostMgr::isHost2chs($purl['host'])); + unset($purl); } if ($_conf['proxy_use'] && !isset($options['proxyhost']) && !empty($_conf['proxy_host'])) { @@ -256,6 +258,12 @@ public function __construct($url, } elseif (strpos($_conf['proxy_host'], ':') === false) { $options['proxyport'] = 80; } + + if ($_conf['proxy_user'] && $_conf['proxy_password']) + { + $options['proxy_auth'] = sprintf('%s:%s', $_conf['proxy_user'], $_conf['proxy_password']); + $options['proxyauthtype'] = HTTP_AUTH_BASIC; + } /* $options['proxytype'] = HTTP_PROXY_HTTP; if (isset($_conf['proxy_type'])) { @@ -923,7 +931,7 @@ static public function fetchSubjectTxt($subjects, $force = false) $url = 'http://' . $host . '/' . $bbs . '/subject.txt'; - if (P2Util::isHostJbbsShitaraba($host) || P2Util::isHostBe2chNet($host)) { + if (P2HostMgr::isHostJbbsShitaraba($host) || P2HostMgr::isHostBe2chs($host)) { if ($eucjp2sjis === null) { $eucjp2sjis = new P2HttpCallback_SaveEucjpAsSjis(); } diff --git a/lib/P2Ime.php b/lib/P2Ime.php index 7514142b8..e8fcd6d14 100644 --- a/lib/P2Ime.php +++ b/lib/P2Ime.php @@ -152,12 +152,18 @@ public function __construct($type = null, array $exceptions = null, $ignoreHttp case 'google': $this->_method = '_throughGoogleGateway'; if ($_conf['ktai'] && !$_conf['iphone']) { - $this->_gateUrl = 'http://www.google.co.jp/gwt/x?u='; + $this->_gateUrl = '//www.google.co.jp/gwt/x?u='; } else { - $this->_gateUrl = 'http://www.google.co.jp/url?q='; + $this->_gateUrl = '//www.google.co.jp/url?q='; } break; // }}} + // {{{ Hawker!(jump.x0.to) + case 'hawker': + $this->_method = '_throughHawkerGateway'; + $this->_gateUrl = '//jump.x0.to/'; + break; + // }}} default: $this->_method = '_passThrough'; $this->_gateUrl = null; @@ -248,6 +254,21 @@ protected function _throughGoogleGateway($url, $delay) return $this->_gateUrl . rawurlencode($url); } + // }}} + // {{{ _throughHawkerGateway() + + /** + * Hawker!URLQ[gEFCʂ悤URLϊ + * + * @param string $url + * @param int $delay (unused) + * @return string + */ + protected function _throughHawkerGateway($url, $delay) + { + return $this->_gateUrl . $url; + } + // }}} // {{{ _passThrough() diff --git a/lib/P2Util.php b/lib/P2Util.php index a0fde9636..60a53fedd 100644 --- a/lib/P2Util.php +++ b/lib/P2Util.php @@ -23,36 +23,6 @@ class P2Util */ static private $_hostDirs = array(); - /** - * isHost2chs() ̃LbV - */ - static private $_hostIs2chs = array(); - - /** - * isHostBe2chNet() ̃LbV - */ - //static private $_hostIsBe2chNet = array(); - - /** - * isHostBbsPink() ̃LbV - */ - static private $_hostIsBbsPink = array(); - - /** - * isHostMachiBbs() ̃LbV - */ - static private $_hostIsMachiBbs = array(); - - /** - * isHostMachiBbsNet() ̃LbV - */ - static private $_hostIsMachiBbsNet = array(); - - /** - * isHostJbbsShitaraba() ̃LbV - */ - static private $_hostIsJbbsShitaraba = array(); - /** * P2ImeIuWFNg * @@ -120,11 +90,11 @@ static private function encodeCookieName($key) * setcookie() ł́AauŕKvmax ageݒ肳Ȃ̂ŁA𗘗p * * @access public - * @param string $key - * @param string $value - * @param int $expires - * @param string $path - * @param string $domain + * @param string $key + * @param string $value + * @param int $expires + * @param string $path + * @param string $domain * @param boolean $secure * @param boolean $httponly * @return boolean @@ -158,14 +128,14 @@ static public function setCookie($key, $value = '', $expires = null, $path = '', } header( - 'Set-Cookie: '. self::encodeCookieName($key) . '=' . rawurlencode($value) - . (empty($domain) ? '' : '; Domain=' . $domain) - . (empty($expires) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s', $expires) . ' GMT') - . (empty($maxage) ? '' : '; Max-Age=' . $maxage) - . (empty($path) ? '' : '; Path=' . $path) - . (!$secure ? '' : '; Secure') - . (!$httponly ? '' : '; HttpOnly'), - $replace = false + 'Set-Cookie: ' . self::encodeCookieName($key) . '=' . rawurlencode($value) + . (empty($domain) ? '' : '; Domain=' . $domain) + . (empty($expires) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s', $expires) . ' GMT') + . (empty($maxage) ? '' : '; Max-Age=' . $maxage) + . (empty($path) ? '' : '; Path=' . $path) + . (!$secure ? '' : '; Secure') + . (!$httponly ? '' : '; HttpOnly'), + $replace = false ); return true; @@ -177,9 +147,9 @@ static public function setCookie($key, $value = '', $expires = null, $path = '', /** * NbL[Bϐ $_COOKIE B * - * @param string $key key, k1[k2] - * @param string $path - * @param string $domain + * @param string $key key, k1[k2] + * @param string $path + * @param string $domain * @return boolean */ static public function unsetCookie($key, $path = '', $domain = null) @@ -233,68 +203,6 @@ static public function unsetCookie($key, $path = '', $domain = null) return false; } - // }}} - // {{{ fileDownload() - - /** - * t@C_E[hۑ - */ - static public function fileDownload($url, $localfile, - $disp_error = true, - $trace_redirection = false) - { - global $_conf; - - if (file_exists($localfile)) { - $modified = http_date(filemtime($localfile)); - } else { - $modified = false; - } - - // DL - $wap_ua = new WapUserAgent(); - $wap_ua->setTimeout($_conf['http_conn_timeout'], $_conf['http_read_timeout']); - $wap_ua->setAtFsockopen(true); - $wap_req = new WapRequest(); - $wap_req->setUrl($url); - $wap_req->setModified($modified); - if ($_conf['proxy_use']) { - $wap_req->setProxy($_conf['proxy_host'], $_conf['proxy_port']); - } - $wap_res = $wap_ua->request($wap_req); - - // 1iK_CNgǐ - if ($wap_res->isRedirect() && array_key_exists('Location', $wap_res->headers) && - ($trace_redirection === true || $trace_redirection == $wap_res->code)) - { - $wap_req->setUrl($wap_res->headers['Location']); - $wap_res = $wap_ua->request($wap_req); - } - - // G[bZ[Wݒ - if ($wap_res->isError() && $disp_error) { - $url_t = self::throughIme($wap_req->url); - $info_msg_ht = "

Error: {$wap_res->code} {$wap_res->message}
"; - if ($wap_res->isRedirect() && array_key_exists('Location', $wap_res->headers)) { - $location = $wap_res->headers['Location']; - $location_ht = p2h($location); - $location_t = self::throughIme($location); - $info_msg_ht .= "Location: {$location_ht}
"; - } - $info_msg_ht .= "rep2 info: {$wap_req->url} ɐڑł܂łB

"; - self::pushInfoHtml($info_msg_ht); - } - - // XVĂ - if ($wap_res->isSuccess() && $wap_res->code != 304) { - if (FileCtl::file_write_contents($localfile, $wap_res->content) === false) { - p2die('cannot write file.'); - } - } - - return $wap_res; - } - // }}} // {{{ checkDirWritable() @@ -316,13 +224,13 @@ static public function checkDirWritable($aDir) */ if (is_dir(dirname(realpath($aDir))) && is_writable(dirname(realpath($aDir)))) { //$info_msg_ht .= "fBNg̎쐬݂܂...
"; - if (mkdir($aDir)) { + if (FileCtl::mkdirRecursive($aDir)) { //$info_msg_ht .= "fBNg̎쐬܂B"; } else { //$info_msg_ht .= "fBNg쐬ł܂łB
蓮ŃfBNg쐬Ap[~bVݒ肵ĉB"; } } else { - //$info_msg_ht .= "fBNg쐬Ap[~bVݒ肵ĉB"; + //$info_msg_ht .= "fBNg쐬Ap[~bVݒ肵ĉB"; } //$info_msg_ht .= '

'; @@ -347,13 +255,17 @@ static public function cacheFileForDL($url) $parsed = parse_url($url); // URL - $save_uri = isset($parsed['host']) ? $parsed['host'] : ''; - $save_uri .= isset($parsed['port']) ? ':' . $parsed['port'] : ''; - $save_uri .= isset($parsed['path']) ? $parsed['path'] : ''; + $save_uri = isset($parsed['host']) ? $parsed['host'] : ''; + $save_uri .= isset($parsed['port']) ? ':' . $parsed['port'] : ''; + $save_uri .= isset($parsed['path']) ? $parsed['path'] : ''; $save_uri .= isset($parsed['query']) ? '?' . $parsed['query'] : ''; $cachefile = $_conf['cache_dir'] . '/' . $save_uri; + if(substr($cachefile, -1)=='/') { + $cachefile = substr($cachefile,0, -1); + } + FileCtl::mkdirFor($cachefile); return $cachefile; @@ -375,10 +287,9 @@ static public function getItaName($host, $bbs) return self::$_itaNames[$id]; } + // –Long p2_setting 擾 $p2_setting_txt = self::idxDirOfHostBbs($host, $bbs) . 'p2_setting.txt'; - if (file_exists($p2_setting_txt)) { - $p2_setting_cont = FileCtl::file_read_contents($p2_setting_txt); if ($p2_setting_cont) { $p2_setting = unserialize($p2_setting_cont); @@ -389,9 +300,9 @@ static public function getItaName($host, $bbs) } } - // –Long̎擾 + // –Long}bsOf[^擾 if (!isset($p2_setting['itaj'])) { - $itaj = BbsMap::getBbsName($host, $bbs); + $itaj = P2HostMgr::getItaName($host, $bbs); if ($itaj != $bbs) { self::$_itaNames[$id] = $p2_setting['itaj'] = $itaj; @@ -404,6 +315,20 @@ static public function getItaName($host, $bbs) } } + // –Long p2_kb_setting 擾 + $p2_setting_srd = self::datDirOfHostBbs($host, $bbs) . 'p2_kb_setting.srd'; + if (file_exists($p2_setting_srd)) { + $p2_setting_cont = file_get_contents($p2_setting_srd); + + if ($p2_setting_cont) { + $p2_setting = unserialize($p2_setting_cont); + if (isset($p2_setting['BBS_TITLE'])) { + $ita_names[$id] = $p2_setting['BBS_TITLE']; + return $ita_names[$id]; + } + } + } + return null; } @@ -431,22 +356,52 @@ static private function _p2DirOfHost($base_dir, $host, $dir_sep = true) $host = self::normalizeHostName($host); // 2channel or bbspink - if (self::isHost2chs($host)) { + if (P2HostMgr::isHost2chs($host)) { $host_dir = $base_dir . DIRECTORY_SEPARATOR . '2channel'; + } elseif (P2HostMgr::isHostOpen2ch($host)) { + //݊ێ̂ߋ̃fBNgw + $host_dir = $base_dir . DIRECTORY_SEPARATOR . rawurlencode($host); + if (!file_exists($host_dir)) { + //̃fBNg=VKCXg[orIړ]̂߁AfBNg̎wύX + $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'open2ch'; + } - // machibbs.com - } elseif (self::isHostMachiBbs($host)) { + } elseif (P2HostMgr::isHost2chSc($host)) { + //݊ێ̂ߋ̃fBNgw + $host_dir = $base_dir . DIRECTORY_SEPARATOR . rawurlencode($host); + if (!file_exists($host_dir)) { + //̃fBNg=VKCXg[orIړ]̂߁AfBNg̎wύX + $host_dir = $base_dir . DIRECTORY_SEPARATOR . '2channel_sc'; + } + // next2ch.net + } elseif (P2HostMgr::isHostNext2ch($host)) { + $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'next2ch.net'; + // super2ch.net + } elseif (P2HostMgr::isHostSuper2ch($host)) { + $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'super2ch.net'; + // machibbs.com + } elseif (P2HostMgr::isHostMachiBbs($host)) { $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'machibbs.com'; - - // jbbs.livedoor.jp (livedoor ^f) - } elseif (self::isHostJbbsShitaraba($host)) { + // tor + } elseif (P2HostMgr::isHostTor($host)) { + $tor_host = preg_replace('/\.onion\.(\w+)$/', '.onion', $host); + $host_dir = $base_dir . DIRECTORY_SEPARATOR . $tor_host; + unset($tor_host); + // jbbs.livedoor.jp (livedoor ^f) + } elseif (P2HostMgr::isHostJbbsShitaraba($host)) { if (DIRECTORY_SEPARATOR == '/') { $host_dir = $base_dir . DIRECTORY_SEPARATOR . $host; } else { $host_dir = $base_dir . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $host); } - - // livedoor ^fˆȊOŃXbV̕܂ނƂ + // jikkyo.org + } elseif (P2HostMgr::isHostJikkyoOrg($host)) { + $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'jikkyo.org'; + // vip.2ch.com + } elseif (P2HostMgr::isHostVip2ch($host)) { + $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'ex14.vip2ch.com'; + + // livedoor ^fˆȊOŃXbV̕܂ނƂ } elseif (preg_match('/[^0-9A-Za-z.\\-_]/', $host)) { $host_dir = $base_dir . DIRECTORY_SEPARATOR . rawurlencode($host); /* @@ -461,7 +416,7 @@ static private function _p2DirOfHost($base_dir, $host, $dir_sep = true) } */ - // ̑ + // ̑ } else { $host_dir = $base_dir . DIRECTORY_SEPARATOR . $host; } @@ -581,7 +536,7 @@ static public function getKeyPath($base_dir, $key, $extension = '') } return $old_path; - } + } // }}} // {{{ getDatPath() @@ -676,14 +631,14 @@ static public function getListNaviRange($disp_from, $disp_range, $disp_all_num) { if (!$disp_all_num) { return array( - 'all_once' => true, - 'from' => 0, - 'end' => 0, - 'limit' => 0, - 'offset' => 0, - 'mae_from' => 1, + 'all_once' => true, + 'from' => 0, + 'end' => 0, + 'limit' => 0, + 'offset' => 0, + 'mae_from' => 1, 'tugi_from' => 1, - 'range_st' => '-', + 'range_st' => '-', ); } @@ -699,7 +654,7 @@ static public function getListNaviRange($disp_from, $disp_range, $disp_all_num) $disp_navi['from'] = max(1, $disp_all_num - $disp_range); $disp_navi['end'] = $disp_all_num; - // from zȂ + // from zȂ } else { $disp_navi['end'] = $disp_navi['from'] + $disp_range; @@ -735,7 +690,7 @@ static public function getListNaviRange($disp_from, $disp_range, $disp_all_num) /** * key.idx data L^ * - * @param array $data vf̏ԂɈӖB + * @param array $data vf̏ԂɈӖB */ static public function recKeyIdx($keyidx, $data) { @@ -744,7 +699,7 @@ static public function recKeyIdx($keyidx, $data) // {͔zŎ󂯎 if (is_array($data)) { $cont = implode('<>', $data); - // ݊pstringt + // ݊pstringt } else { $cont = rtrim($data); } @@ -764,8 +719,8 @@ static public function recKeyIdx($keyidx, $data) /** * pQ[gʂ߂URLϊ * - * @param string $url - * @param int $delay ̏ꍇ͎蓮]AȊO̓Q[g̎dlɂ + * @param string $url + * @param int $delay ̏ꍇ͎蓮]AȊO̓Q[g̎dlɂ * @return string */ static public function throughIme($url, $delay = null) @@ -783,8 +738,8 @@ static public function throughIme($url, $delay = null) /** * URLϊ̐ݒ * - * @param string $type - * @param array $exceptions + * @param string $type + * @param array $exceptions * @param boolean $ignoreHttp * @return void * @see P2Ime::__construct() @@ -812,146 +767,6 @@ static public function normalizeHostName($host) return strtolower($host); } - // }}} - // {{ isHostExample - - /** - * host ᎦphCȂ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHostExample($host) - { - return (bool)preg_match('/(?:^|\\.)example\\.(?:com|net|org|jp)$/i', $host); - } - - // }}} - // {{{ isHost2chs() - - /** - * host 2ch or bbspink Ȃ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHost2chs($host) - { - if (!array_key_exists($host, self::$_hostIs2chs)) { - self::$_hostIs2chs[$host] = (bool)preg_match('<^\\w+\\.(?:2ch\\.net|bbspink\\.com)$>', $host); - } - return self::$_hostIs2chs[$host]; - } - - // }}} - // {{{ isHostBe2chNet() - - /** - * host be.2ch.net Ȃ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHostBe2chNet($host) - { - return ($host == 'be.2ch.net'); - /* - if (!array_key_exists($host, self::$_hostIsBe2chNet)) { - self::$_hostIsBe2chNet[$host] = ($host == 'be.2ch.net'); - } - return self::$_hostIsBe2chNet[$host]; - */ - } - - // }}} - // {{{ isHostBbsPink() - - /** - * host bbspink Ȃ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHostBbsPink($host) - { - if (!array_key_exists($host, self::$_hostIsBbsPink)) { - self::$_hostIsBbsPink[$host] = (bool)preg_match('<^\\w+\\.bbspink\\.com$>', $host); - } - return self::$_hostIsBbsPink[$host]; - } - - // }}} - // {{{ isHostMachiBbs() - - /** - * host machibbs Ȃ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHostMachiBbs($host) - { - if (!array_key_exists($host, self::$_hostIsMachiBbs)) { - self::$_hostIsMachiBbs[$host] = (bool)preg_match('<^\\w+\\.machi(?:bbs\\.com|\\.to)$>', $host); - } - return self::$_hostIsMachiBbs[$host]; - } - - // }}} - // {{{ isHostMachiBbsNet() - - /** - * host machibbs.net ܂r˂ Ȃ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHostMachiBbsNet($host) - { - if (!array_key_exists($host, self::$_hostIsMachiBbsNet)) { - self::$_hostIsMachiBbsNet[$host] = (bool)preg_match('<^\\w+\\.machibbs\\.net$>', $host); - } - return self::$_hostIsMachiBbsNet[$host]; - } - - // }}} - // {{{ isHostJbbsShitaraba() - - /** - * host livedoor ^f : Ȃ true Ԃ - * - * @param string $host - * @return bool - */ - static public function isHostJbbsShitaraba($in_host) - { - if (!array_key_exists($in_host, self::$_hostIsJbbsShitaraba)) { - if ($in_host == 'rentalbbs.livedoor.com') { - self::$_hostIsJbbsShitaraba[$in_host] = true; - } elseif (preg_match('<^jbbs\\.(?:shitaraba\\.com|livedoor\\.(?:com|jp))(?:/|$)>', $in_host)) { - self::$_hostIsJbbsShitaraba[$in_host] = true; - } else { - self::$_hostIsJbbsShitaraba[$in_host] = false; - } - } - return self::$_hostIsJbbsShitaraba[$in_host]; - } - - // }}} - // {{{ adjustHostJbbs() - - /** - * livedoor ^f : ΂̃zXgύXɑΉĕύX - * - * @param string $in_str zXgłURLłȂłǂ - * @return string - */ - static public function adjustHostJbbs($in_str) - { - return preg_replace('<(^|/)jbbs\\.(?:shitaraba|livedoor)\\.com(/|$)>', '\\1jbbs.livedoor.jp\\2', $in_str, 1); - //return preg_replace('<(^|/)jbbs\\.(?:shitaraba\\.com|livedoor\\.(?:com|jp))(/|$)>', '\\1rentalbbs.livedoor.com\\2', $in_str, 1); - } - // }}} // {{{ header_nocache() @@ -1038,38 +853,6 @@ static public function transResHistLogPhpToDat() return true; } - // }}} - // {{{ transResHistLogDatToPhp() - - /** - * dat`i<>j̏ݗf[^PHP`iTABjɕϊ - */ - static public function transResHistLogDatToPhp() - { - global $_conf; - - // ݗL^Ȃݒ̏ꍇ͉Ȃ - if ($_conf['res_write_rec'] == 0) { - return true; - } - - // p2_res_hist.dat.php ȂāAp2_res_hist.dat ǂݍ݉”\ł - if ((!file_exists($_conf['res_hist_dat_php'])) and is_readable($_conf['res_hist_dat'])) { - // ǂݍ - if ($cont = FileCtl::file_read_contents($_conf['res_hist_dat'])) { - // <>؂肩^u؂ɕύX - // ܂^uSĊO - $cont = str_replace("\t", "", $cont); - // <>^uɕϊ - $cont = str_replace("<>", "\t", $cont); - - // f[^PHP`ŕۑ - DataPhp::writeDataPhp($_conf['res_hist_dat_php'], $cont); - } - } - return true; - } - // }}} // {{{ getLastAccessLog() @@ -1117,7 +900,7 @@ static public function recAccessLog($logfile, $maxline = 100, $format = 'dataphp if ($lines) { // s - while (sizeof($lines) > $maxline -1) { + while (sizeof($lines) > $maxline - 1) { array_pop($lines); } } else { @@ -1189,72 +972,7 @@ static public function recAccessLog($logfile, $maxline = 100, $format = 'dataphp } // }}} - // {{{ isBrowserSafariGroup() - - /** - * uEUSafarinȂtrueԂ - */ - static public function isBrowserSafariGroup() - { - return UA::isSafariGroup(); - } - - // }}} - // {{{ isClientOSWindowsCE() - - /** - * uEUWindows CEœ삷̂ȂtrueԂ - */ - static public function isClientOSWindowsCE() - { - return (strpos($_SERVER['HTTP_USER_AGENT'], 'Windows CE') !== false); - } - - // }}} - // {{{ isBrowserNintendoDS() - - /** - * jeh[DSuEU[ȂtrueԂ - */ - static public function isBrowserNintendoDS() - { - return UA::isNintendoDS(); - } - - // }}} - // {{{ isBrowserPSP() - /** - * uEUPSPȂtrueԂ - */ - static public function isBrowserPSP() - { - return UA::isPSP(); - } - - // }}} - // {{{ isBrowserIphone() - - /** - * uEUiPhone, iPod Touch or AndroidȂtrueԂ - */ - static public function isBrowserIphone() - { - return UA::isIPhoneGroup(); - } - - // }}} - // {{{ isUrlWikipediaJa() - - /** - * URLEBLyfBA{ł̋LȂtrueԂ - */ - static public function isUrlWikipediaJa($url) - { - return (strncmp($url, 'http://ja.wikipedia.org/wiki/', 29) == 0); - } - - // }}} // {{{ saveIdPw2ch() /** @@ -1320,9 +1038,11 @@ static public function readIdPw2ch() } $autoLogin2ch = (bool)$rec_autoLogin2ch; + + return array($login2chID, $login2chPW, $autoLogin2ch); } - return array($login2chID, $login2chPW, $autoLogin2ch); + return false; } // }}} @@ -1380,7 +1100,7 @@ static public function print403($msg = '') ERR; // IEftHg̃bZ[W\Ȃ悤ɃXy[Xo if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { - for ($i = 0 ; $i < 512; $i++) { + for ($i = 0; $i < 512; $i++) { echo ' '; } } @@ -1427,11 +1147,11 @@ static public function scandir_r($dir) * * $targetDirŏIXV$lifeTimebȏソt@C폜 * - * @param string $targetDir K[xbWRNVΏۃfBNg - * @param integer $lifeTime t@C̗Libj - * @param string $prefix Ώۃt@C̐ړiIvVj - * @param string $suffix Ώۃt@C̐ڔiIvVj - * @param boolean $recurive ċAIɃK[xbWRNV邩ۂiftHgłfalsej + * @param string $targetDir K[xbWRNVΏۃfBNg + * @param integer $lifeTime t@C̗Libj + * @param string $prefix Ώۃt@C̐ړiIvVj + * @param string $suffix Ώۃt@C̐ڔiIvVj + * @param boolean $recurive ċAIɃK[xbWRNV邩ۂiftHgłfalsej * @return array 폜ɐt@CƎst@CʁXɋL^񎟌̔z */ static public function garbageCollection($targetDir, @@ -1439,7 +1159,7 @@ static public function garbageCollection($targetDir, $prefix = '', $suffix = '', $recursive = false - ) + ) { $result = array('successed' => array(), 'failed' => array(), 'skipped' => array()); $expire = time() - $lifeTime; @@ -1452,7 +1172,9 @@ static public function garbageCollection($targetDir, $files = array(); $targetDir = realpath($targetDir) . DIRECTORY_SEPARATOR; foreach ($list as $filename) { - if ($filename == '.' || $filename == '..') { continue; } + if ($filename == '.' || $filename == '..') { + continue; + } $files[] = $targetDir . $filename; } } @@ -1522,8 +1244,8 @@ static public function session_gc() * (o[W1.0.0ȍ~AVar_Dump::display() ̑^̂Ƃ * ڕ\ɁA_vʂƂĕԂB) * - * @param array $info e[uɂz - * @param integer $indent ʂHTML₷邽߂̃Cfg + * @param array $info e[uɂz + * @param integer $indent ʂHTML₷邽߂̃Cfg * @return string ~
*/ static public function Info_Dump($info, $indent = 0) @@ -1532,16 +1254,18 @@ static public function Info_Dump($info, $indent = 0) $n = count($info); foreach ($info as $key => $value) { if (!is_object($value) && !is_resource($value)) { - for ($i = 0; $i < $indent; $i++) { $table .= "\t"; } + for ($i = 0; $i < $indent; $i++) { + $table .= "\t"; + } if ($n == 1 && $key === 0) { $table .= ''; - /*} elseif (preg_match('/^\w+$/', $key)) { - $table .= '' . $key . '';*/ + /*} elseif (preg_match('/^\w+$/', $key)) { + $table .= '' . $key . '';*/ } else { $table .= '' . $key . ''; } if (is_array($value)) { - $table .= self::Info_Dump($value, $indent+1); //z̏ꍇ͍ċAĂяoœWJ + $table .= self::Info_Dump($value, $indent + 1); //z̏ꍇ͍ċAĂяoœWJ } elseif ($value === true) { $table .= 'true'; } elseif ($value === false) { @@ -1567,7 +1291,9 @@ static public function Info_Dump($info, $indent = 0) $table .= '' . "\n"; } } - for ($i = 1; $i < $indent; $i++) { $table .= "\t"; } + for ($i = 1; $i < $indent; $i++) { + $table .= "\t"; + } $table .= ''; $table = str_replace('', '\n +{$ita_name_ht}\n EOP; } @@ -336,7 +347,7 @@ function sb_print($aThreadList) // X $moto_thre_ht = ''; if ($_conf['sb_show_motothre']) { - if (!$aThread->isKitoku()) { + if ($_conf['sb_show_motothre'] == 2 || !$aThread->isKitoku()) { $moto_thre_ht = 'E'; @@ -360,7 +371,14 @@ function sb_print($aThreadList) $offline_q = '&offline=true'; $anum_ht = ''; } - $thre_url = "{$_conf['read_php']}?{$host_bbs_key_q}{$rescount_q}{$offline_q}{$word_q}{$anum_ht}"; + $thre_url = "{$_conf['read_php']}?{$host_bbs_key_q}{$rescount_q}{$offline_q}{$word_q}{$anum_ht}{$_conf['k_at_a']}"; + + // +live N\ؑ + if($_conf['live.livelink_subject']==2||$livebbs_bool) + { + // $ttitle_en_q ͐ߌȗ + $live_url = "live_frame.php?{$host_bbs_key_q}&live=1{$rescount_q}"; + } // I[>>1 if ($only_one_bool) { @@ -430,9 +448,27 @@ function sb_print($aThreadList) $td['ikioi'] = "{$dayres_st}\n"; } - // Birthday - $birthday = date('y/m/d', $aThread->key); // (y/m/d H:i) - $td['birth'] = "{$birthday}\n"; + // Birth + $birth_format = isset($_conf['birth_format']) ? $_conf['birth_format'] : 'y/m/d'; + $birth = date($birth_format, intval($aThread->key)); // (y/m/d H:i) + $td['birth'] = "{$birth}\n"; + unset($birth_format); + + // +live {^̏ + // +live ic2̃TlC쐬onoff + if ($_conf['expack.ic2.enabled'] + && (!$_conf['live.ic2_onoff'])) { + $live_ic2_off = "onclick=\"javascript:parent.menu.ic2_menu_switch(0);\""; + } + // +live X̃Nɏ + if($_conf['live.livebbs_forcelive']==1&&$livebbs_bool) { + $thre_addtag = $live_ic2_off."target=\"_blank\""; + $thre_url = $live_url; + } elseif (isset($live_url)) { + $livelink_body = <<+live  +EOP; + } //==================================================================================== // Xbhꗗ table {fB HTMLvg @@ -442,7 +478,9 @@ function sb_print($aThreadList) echo << {$td['edit']}{$td['offrec']}{$td['unum']}{$td['rescount']}{$td['one']}{$td['checkbox']}{$torder_ht} -
{$moto_thre_ht}{$ttitle_ht}
+
{$moto_thre_ht} +{$livelink_body} +{$ttitle_ht}
{$td['ita']}{$td['spd']}{$td['ikioi']}{$td['birth']}{$td['fav']}\n EOR; diff --git a/lib/sb_print_k.inc.php b/lib/sb_print_k.inc.php index db15c40c5..4309b186f 100644 --- a/lib/sb_print_k.inc.php +++ b/lib/sb_print_k.inc.php @@ -240,7 +240,7 @@ function sb_print_k($aThreadList) } // >>1̂, >>1 - if (P2Util::isHost2chs($aThreadList->host) && !$aThread->isKitoku()) { + if (P2HostMgr::isHost2chs($aThreadList->host) && !$aThread->isKitoku()) { switch ($_conf['mobile.sb_show_first']) { case 1: $thre_url = $onlyone_url; diff --git a/lib/sb_toolbar.inc.php b/lib/sb_toolbar.inc.php index ff3cb3dd1..467b959d3 100644 --- a/lib/sb_toolbar.inc.php +++ b/lib/sb_toolbar.inc.php @@ -24,8 +24,10 @@ } else { $shinchaku_num_ht = ''; } + $shinchaku_matome_url = "{$_conf['read_new_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}{$norefresh_q}&nt={$newtime}"; $shinchaku_matome_ht =<<V܂Ƃߓǂ{$shinchaku_num_ht} +V܂Ƃߓǂ{$shinchaku_num_ht} [S] +[ꕔ] EOP; } else { $shinchaku_matome_ht = ''; diff --git a/lib/setbookmark.inc.php b/lib/setbookmark.inc.php deleted file mode 100644 index 907aca509..000000000 --- a/lib/setbookmark.inc.php +++ /dev/null @@ -1,36 +0,0 @@ - 1.0) { - $hd = $GLOBALS['_conf']['have_glyphish_2x']; - } - } - } - if ($hd && preg_match('@img/glyphish/icons2/\\d+-[\\-\\w]+\\.png$@', $icon)) { - $icon = substr($icon, 0, -4) . '@2x.png'; + $srcset = "{$icon} 1x"; + $ratios = array(2,3); //w肷pixel ratio + foreach($ratios as $ratio) { + //hoge.pngɑ΂Ahoge@?x.png݂鎞(?͔{) + if (file_exists(str_replace(".png", "@{$ratio}x.png", $icon))==TRUE) { + $srcset .= ", ".str_replace(".png", "@{$ratio}x.png", $icon)." {$ratio}x"; + } } - - return $icon; + return $srcset; } + + /** * c[o[{^ (N) * @@ -54,16 +50,57 @@ function _toolbar_i_button($icon, $label, $uri, $attrs = '') $attrs = str_replace('class="', 'class="hoverable ', $attrs); } - if (empty($_conf['expack.iphone.toolbars.no_label'])) { - $label = '
' . $label; - } else { - $label = ''; + $srcset = _toolbar_i_srcset($icon); + + return <<{$label} +EOS; +} + +// }}} +/** + * c[o[{^ (N) + * + * @param string $icon + * @param string $label + * @param string $uri + * @param string $attrs + * @return string + */ +function toolbar_i_menuItem($icon, $label, $uri, $attrs = '') +{ + global $_conf; + + if (strlen($attrs) && strncmp($attrs, ' ', 1) !== 0) { + $attrs = ' ' . $attrs; } - $icon = _toolbar_i_icon($icon); + $srcset = _toolbar_i_srcset($icon); return <<{$label} +
  • {$label}
  • +EOS; +} + +// }}} +// {{{ toolbar_i_disabled_button() + +/** + * ȃc[o[{^ + * + * @param string $icon + * @param string $label + * @param string $uri + * @return string + */ +function toolbar_i_disabled_menuItem($icon, $label) +{ + global $_conf; + + $srcset = _toolbar_i_srcset($icon); + + return <<{$label}{$label} EOS; } @@ -85,6 +122,12 @@ function toolbar_i_standard_button($icon, $label, $uri) } else { $attrs = ''; } + + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } return _toolbar_i_button($icon, $label, $uri, $attrs); } @@ -102,8 +145,13 @@ function toolbar_i_standard_button($icon, $label, $uri) */ function toolbar_i_badged_button($icon, $label, $uri, $badge) { + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } $label .= sprintf('%s', min(strlen($badge), 4), $badge); - return _toolbar_i_button($icon, $label, $uri); + return '
    '._toolbar_i_button($icon, $label, $uri).'
    '; } // }}} @@ -119,6 +167,11 @@ function toolbar_i_badged_button($icon, $label, $uri, $badge) */ function toolbar_i_opentab_button($icon, $label, $uri) { + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } return _toolbar_i_button($icon, $label, $uri, ' target="_blank"'); } @@ -137,16 +190,16 @@ function toolbar_i_disabled_button($icon, $label) { global $_conf; - if (empty($_conf['expack.iphone.toolbars.no_label'])) { + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label)) { $label = '
    ' . $label; } else { $label = ''; } - $icon = _toolbar_i_icon($icon); + $srcset = _toolbar_i_srcset($icon); return <<{$label} +{$label} EOS; } @@ -164,6 +217,11 @@ function toolbar_i_disabled_button($icon, $label) function toolbar_i_showhide_button($icon, $label, $id) { $attrs = ' onclick="return iutil.toolbarShowHide(this, event);"'; + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } return _toolbar_i_button($icon, $label, "#{$id}", $attrs); } @@ -199,7 +257,17 @@ function toolbar_i_favita_button($icon, $label, $info, $setnum = 0) 'setfavita' => 2, ), '', '&'); - return _toolbar_i_button($icon, $fav['title'], $uri, $attrs); + if(isset($label)) // nulllabelɂ邽 + { + $label = $fav['title']; + } + + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } + return _toolbar_i_button($icon, $label, $uri, $attrs); } // }}} @@ -234,8 +302,17 @@ function toolbar_i_fav_button($icon, $label, $info, $setnum = 0) 'setnum' => $setnum, 'setfav' => 2, ), '', '&'); + if(isset($label)) // nulllabelɂ邽 + { + $label = $fav['title']; + } + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } - return _toolbar_i_button($icon, $fav['title'], $uri, $attrs); + return _toolbar_i_button($icon, $label, $uri, $attrs); } // }}} @@ -249,7 +326,7 @@ function toolbar_i_fav_button($icon, $label, $info, $setnum = 0) * @param object $info @see lib/get_info.inc.php: get_thread_info() * @return string */ -function toolbar_i_palace_button($icon, $label, $info) +function toolbar_i_palace_menuItem($icon, $label, $info) { $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"'; if (!$info->palace) { @@ -264,7 +341,7 @@ function toolbar_i_palace_button($icon, $label, $info) 'setpal' => 2, ), '', '&'); - return _toolbar_i_button($icon, $label, $uri, $attrs); + return toolbar_i_menuItem($icon, $label, $uri, $attrs); } // }}} @@ -278,7 +355,7 @@ function toolbar_i_palace_button($icon, $label, $info) * @param object $info @see lib/get_info.inc.php: get_thread_info() * @return string */ -function toolbar_i_aborn_button($icon, $label, $info) +function toolbar_i_aborn_menuItem($icon, $label, $info) { $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"'; if (!$info->taborn) { @@ -293,7 +370,7 @@ function toolbar_i_aborn_button($icon, $label, $info) 'taborn' => 2, ), '', '&'); - return _toolbar_i_button($icon, $label, $uri, $attrs); + return toolbar_i_menuItem($icon, $label, $uri, $attrs); } // }}} @@ -332,6 +409,11 @@ function toolbar_i_action_board_button($icon, $label, ThreadList $aThreadList) if ($title !== '') { $label = p2h($title, false); } + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } return _toolbar_i_button($icon, $label, $uri); } @@ -373,11 +455,34 @@ function toolbar_i_action_thread_button($icon, $label, Thread $aThread) if ($title !== '') { $label = p2h($title, false); } + if (empty($_conf['expack.iphone.toolbars.no_label']) && !empty($label) ) { + $label = '
    ' . $label; + } else { + $label = ''; + } return _toolbar_i_button($icon, $label, $uri); } // }}} +// {{{ toolbar_i_action_thread_button() + +/** + * ̃obN{^ + * + * @param string $label + * @return string + */ +function toolbar_i_back_button($label, $uri) +{ + global $_conf; + + + return <<{$label} +EOS; +} + // {{{ _toolbar_i_client_type() /** @@ -392,7 +497,7 @@ function _toolbar_i_client_type() switch ($_conf['client_type']) { case 'i': - $type = UA::isAndroidWebKit() ? 'android' : 'iphone'; + $type = UA::isAndroid() ? 'android' : 'iphone'; break; case 'i': $type = 'mobile'; diff --git a/lib/wiki/DatPluginCtl.php b/lib/wiki/DatPluginCtl.php index 16db5598b..ace65f379 100644 --- a/lib/wiki/DatPluginCtl.php +++ b/lib/wiki/DatPluginCtl.php @@ -26,9 +26,8 @@ public function load() { global $_conf; - $lines = array(); $path = $_conf['pref_dir'].'/'.$this->filename; - if ($lines = @file($path)) { + if ($lines = FileCtl::file_read_lines($path)) { foreach ($lines as $l) { $lar = explode("\t", trim($l)); if (strlen($lar[0]) == 0) { diff --git a/lib/wiki/LinkPluginCtl.php b/lib/wiki/LinkPluginCtl.php index 9fbd0e4bc..5accea500 100644 --- a/lib/wiki/LinkPluginCtl.php +++ b/lib/wiki/LinkPluginCtl.php @@ -73,18 +73,46 @@ public function save($data) public function replaceLinkToHTML($url, $str) { + global $_conf; + $this->setup(); $src = false; foreach ($this->data as $v) { - if (preg_match('{'.$v['match'].'}', $url)) { - $src = @preg_replace ('{'.$v['match'].'}', $v['replace'], $url); + // us + $temp = @preg_replace ('{'.$v['match'].'}', $v['replace'], $url, -1, $count); + // uꂽꍇ + if ($count) { + $src = $temp; + $replace_pairs = array(); if (strstr($v['replace'], '$ime_url')) { - $src = str_replace('$ime_url', P2Util::throughIme($url), $src); + $replace_pairs['$ime_url'] = P2Util::throughIme($url); } if (strstr($v['replace'], '$str')) { - $src = str_replace('$str', $str, $src); + $replace_pairs['$str'] = $str; + } + if (strstr($v['replace'], '$atag')) { + // ime + if ($_conf['through_ime']) { + $link_url = P2Util::throughIme($url); + } else { + $link_url = $url; + } + // HTML|bvAbv(PC̎) + if ($_conf['iframe_popup'] && !$_conf['ktai']) { + // *pm w̏ꍇ̂݁AʂɎ蓮]wlj + if (substr($_conf['through_ime'], -2) == 'pm') { + $pop_url = P2Util::throughIme($url, -1); + } else { + $pop_url = $link_url; + } + $replace_pairs['$atag'] = ShowThreadPc::iframePopup(array($link_url, $pop_url), $str, $_conf['ext_win_target_at']); + } else { + $replace_pairs['$atag'] = "{$str}"; + } } + // ϐWJ + $src = strtr($src, $replace_pairs); break; } } diff --git a/lib/wiki/NgThreadCtl.php b/lib/wiki/NgThreadCtl.php deleted file mode 100644 index 9663c9b35..000000000 --- a/lib/wiki/NgThreadCtl.php +++ /dev/null @@ -1,182 +0,0 @@ -dataXV鎖ɂo^ -Eꊇœo^ -Es̓o^ -f[^\ -word ignorecase regex bbs lasttime hits -*/ - -require_once __DIR__ . '/WikiPluginCtlBase.php'; - -class NgThreadCtl -{ - const DATE_FORMAT = 'Y/m/d G:i'; - - protected $filename = 'p2_aborn_thread.txt'; - protected $data = array(); - public $hits = 0; - - /* - f[^NA - */ - public function clear() - { - global $_conf; - - $path = $_conf['pref_dir'] . '/' . $this->filename; - - return @unlink($path); - } - - /* - f[^ǂݍŕԂ - */ - public function load() - { - global $_conf; - - $lines = array(); - $path = $_conf['pref_dir'] . '/' . $this->filename; - if ($lines = @file($path)) { - foreach ($lines as $l) { - $lar = explode("\t", trim($l)); - if (strlen($lar[0]) == 0) { - continue; - } - $ar = array( - 'word' => $lar[0], // Ώە - 'ignorecase' => $lar[1], // 啶𖳎 - 'regex' => $lar[2], // K\ - 'bbs' => $lar[3], // ” - 'lasttime' => $lar[4] == '--' ? '' : $lar[4], // ŌHIT - 'hits' => (int) $lar[5], // HIT - ); - - $this->data[] = $ar; - } - } - - return $this->data; - } - - /* - ۑ - w肳Ă˂̃f[^ŕۑ - $this->dataȂ˕ۑȂ - */ - public function save($data) - { - global $_conf; - - if ($data) { - $new_data = true; - $this->data = $data; - } elseif (!$this->isLoaded) { - return; - } else { - $new_data = false; - } - // HIT̂ݍXV - if ($this->hits > 0 || $new_data) { - $cont = ''; - - foreach ($this->data as $v) { - if ($v['del']) { - continue; - } - - // KvȂ炱ŌÂf[^̓XLbvi폜j - if (!empty($v['lasttime']) && $_conf['ngaborn_daylimit']) { - if (strtotime($v['lasttime']) < time() - 60 * 60 * 24 * $_conf['ngaborn_daylimit']) { - continue; - } - } - - $a['word'] = strtr(trim($v['word'], "\t\r\n"), "\t\r\n", " "); - $a['ignorecase'] = $v['ignorecase']; - $a['regex'] = $v['regex']; - $a['bbs'] = strtr(trim($v['bbs'], "\t\r\n"), "\t\r\n", " "); - $a['lasttime'] = $v['lasttime']; - $a['hits'] = $v['hits']; - - // lasttimeݒ肳ĂȂ猻ݎԂݒ({Ȃo^ɂׂ) - if (empty($v['lasttime'])) { - $v['lasttime'] = date(self::DATE_FORMAT); - } - - $cont .= implode("\t", $v) . "\n"; - } - - return FileCtl::file_write_contents($_conf['pref_dir'].'/'.$this->filename); - } - } - - /* - ځ[`FbN - ځ[Ώہtrue - */ - public function check($aThread) - { - $this->setup(); - - if ($aThreadList->spmode != "taborn" && isset($this->data) && is_array($this->data)) { - foreach ($this->data as $k => $v) { - // ƒ`FbN - if (!in_array($aThread->bbs, explode(',', $v['bbs']))) { - continue; - } - // K\ - if (!empty($v['regex'])) { - if ($v['ignorecase']) { - $match = '{' . $v['word'] . '}i'; - } else { - $match = '{' . $v['word'] . '}'; - } - if (preg_match('{' . $v['word'] . '}i', $aThread->ttitle_hc)) { - $this->update($k); - return true; - } - // 啶𖳎 - } elseif (!empty($v['ignorecase'])) { - if(stristr($aThread->ttitle_hc,$v['word'])){ - $this->update($k); - return true; - } - // Pɕ񂪊܂܂邩ǂ`FbN - } else { - if (strstr($aThread->ttitle_hc,$v['word'])) { - $this->update($k); - return true; - } - } - } - } - - return false; - } - - /* - ̃f[^̂ځ[XV - */ - public function update($k) - { - $this->hits++; - if (isset($this->data[$k])) { - $this->data[$k]['lasttime'] = date(self::DATE_FORMAT); // HITԂXV - if (empty($v['hits'])) { - $this->data[$k]['hits'] = 1; // HIT - } else { - $this->data[$k]['hits']++; // HIT񐔂XV - } - } - } - -} diff --git a/lib/wiki/P2UtilWiki.php b/lib/wiki/P2UtilWiki.php deleted file mode 100644 index 8350828f5..000000000 --- a/lib/wiki/P2UtilWiki.php +++ /dev/null @@ -1,68 +0,0 @@ -setRequestParameter('timeout', $timeout); - $client->setDefaultHeader('User-Agent', 'Monazilla/1.00'); - if (!empty($_conf['proxy_use'])) { - $client->setRequestParameter('proxy_host', $_conf['proxy_host']); - $client->setRequestParameter('proxy_port', $_conf['proxy_port']); - } - return $client->head($url); - } - - /** - * Wiki:Last-Modified`FbNăLbV - * time:`FbNȂ(unixtime) - */ - public static function cacheDownload($url, $path, $time = 0) - { - $filetime = @filemtime($path); - - // LbVLԂȂ_E[hȂ - if ($filetime !== false && $filetime > time() - $time) { - return; - } - - // VΎ擾 - P2Util::fileDownload($url, $path); - } -} diff --git a/lib/wiki/ReplaceImageUrlCtl.php b/lib/wiki/ReplaceImageUrlCtl.php index 9dcc5d112..01c2321a5 100644 --- a/lib/wiki/ReplaceImageUrlCtl.php +++ b/lib/wiki/ReplaceImageUrlCtl.php @@ -222,7 +222,7 @@ public function replaceImageUrl($url) break; } } - /* plugin_imageCache2ŏ邽߃RgAEg + /* plugin_imageCache2ŏ邽߃RgAEg plugin_imageCache2폜ו by 2ch774*/ // qbgȂꍇ if (!$return[0]) { // 摜ۂURL̏ꍇ @@ -231,7 +231,6 @@ public function replaceImageUrl($url) $return[0]['referer'] = ''; } } - */ return $this->_reply($url, $return); } @@ -255,27 +254,53 @@ public function extractPage($url, $match, $replace, $referer, $source, $ident=nu ? $this->cacheData[$url]['data'] : $ret; } - $params = array(); - $params['timeout'] = $_conf['http_conn_timeout']; - $params['readTimeout'] = array($_conf['http_read_timeout'], 0); - if ($_conf['proxy_use']) { - $params['proxy_host'] = $_conf['proxy_host']; - $params['proxy_port'] = $_conf['proxy_port']; - } - $req = new HTTP_Request($get_url, $params); - if ($this->cacheData[$url] && $this->cacheData[$url]['responseHeaders'] - && $this->cacheData[$url]['responseHeaders']['last-modified'] - && strlen($this->cacheData[$url]['responseHeaders']['last-modified'])) { - $req->addHeader("If-Modified-Since", - $this->cacheData[$url]['responseHeaders']['last-modified']); + try { + $req = P2Commun::createHTTPRequest ($get_url, HTTP_Request2::METHOD_GET); + if ($this->cacheData[$url] && $this->cacheData[$url]['responseHeaders'] + && $this->cacheData[$url]['responseHeaders']['last-modified'] + && strlen($this->cacheData[$url]['responseHeaders']['last-modified'])) { + $req->setHeader("If-Modified-Since", + $this->cacheData[$url]['responseHeaders']['last-modified']); + } + + $req->setHeader('User-Agent', + (!empty($_conf['expack.user_agent'])) ? $_conf['expack.user_agent'] + : $_SERVER['HTTP_USER_AGENT']); + + $response = P2Commun::getHTTPResponse($req); + + $code = $response->getStatus (); + + if ($code == 304 && $this->cacheData[$url]) { + return $this->cacheData[$url]['data']; + } + + $body = $response->getBody(); + preg_match_all('{' . $source . '}i', $body, $extracted, PREG_SET_ORDER); + foreach ($extracted as $i => $extract) { + $_url = $replace; $_referer = $referer; + foreach ($extract as $j => $part) { + if ($j < 1) continue; + $_url = str_replace('$EXTRACT'.$j, $part, $_url); + $_referer = str_replace('$EXTRACT'.$j, $part, $_referer); + } + if ($extract[1]) { + $_url = str_replace('$EXTRACT', $part, $_url); + $_referer = str_replace('$EXTRACT', $part, $_referer); + } + $ret[$i]['url'] = $_url; + $ret[$i]['referer'] = $_referer; + } + } catch (Exception $e) { + $errmsg = $e->getMessage (); } - $req->addHeader('User-Agent', - (!empty($_conf['expack.user_agent'])) ? $_conf['expack.user_agent'] - : $_SERVER['HTTP_USER_AGENT']); - $response = $req->sendRequest(); - $code = $req->getResponseCode(); - if (PEAR::isError($response) || ($code != 200 && $code != 206 && $code != 304)) { - $errmsg = PEAR::isError($response) ? $response->getMessage() : $code; + + // 擾G[ꍇ + if (isset($errmsg) || ($code != 200 && $code != 206 && $code != 304)) { + if(!isset($errmsg)) + { + $errmsg = $code; + } // 񃊃NGXgł̃G[ICLbV $this->extractErrors[$get_url] = $errmsg; // T[oG[ȊOȂiLbVɕۑ @@ -286,32 +311,12 @@ public function extractPage($url, $match, $replace, $referer, $source, $ident=nu } $this->storeCache($url, array('code' => $code, 'errmsg' => $errmsg, - 'responseHeaders' => $req->getResponseHeader(), + 'responseHeaders' => $response->getHeader(), 'data' => $ret)); } return ($this->cacheData[$url] && $this->cacheData[$url]['data']) ? $this->cacheData[$url]['data'] : $ret; } - if ($code == 304 && $this->cacheData[$url]) { - return $this->cacheData[$url]['data']; - } - - $body = $req->getResponseBody(); - preg_match_all('{' . $source . '}i', $body, $extracted, PREG_SET_ORDER); - foreach ($extracted as $i => $extract) { - $_url = $replace; $_referer = $referer; - foreach ($extract as $j => $part) { - if ($j < 1) continue; - $_url = str_replace('$EXTRACT'.$j, $part, $_url); - $_referer = str_replace('$EXTRACT'.$j, $part, $_referer); - } - if ($extract[1]) { - $_url = str_replace('$EXTRACT', $part, $_url); - $_referer = str_replace('$EXTRACT', $part, $_referer); - } - $ret[$i]['url'] = $_url; - $ret[$i]['referer'] = $_referer; - } // y[WĂꍇ if ($this->_checkLost($url, $ret)) { @@ -322,9 +327,12 @@ public function extractPage($url, $match, $replace, $referer, $source, $ident=nu $ret = self::_identByCacheData($ret, $this->cacheData[$url]['data'], $ident); } + // ʂd폜 + $ret = array_unique($ret); + // ʂiLbVɕۑ $this->storeCache($url, array('code' => $code, - 'responseHeaders' => $req->getResponseHeader(), + 'responseHeaders' => $response->getHeader(), 'data' => $ret)); return $ret; diff --git a/lib/wiki/ReplaceWordCtl.php b/lib/wiki/ReplaceWordCtl.php index 02396f040..dae84732f 100644 --- a/lib/wiki/ReplaceWordCtl.php +++ b/lib/wiki/ReplaceWordCtl.php @@ -5,12 +5,12 @@ load() f[^ǂݍŕԂ(IɎs) clear() f[^폜 */ - class ReplaceWordCtl { protected $isLoaded = false; protected $data = array(); - + protected $data_filtered = array(); + protected $data_nocache = array(); public function setup() { if (!$this->isLoaded) { @@ -53,7 +53,9 @@ public function loadFile($cont) $lines = array(); $path = $_conf['pref_dir'].'/'.$this->filename($cont); + $this->data_nocache[$cont] = false; if ($lines = @file($path)) { + $check_mode = $_conf['ktai'] ? 1 : 2; foreach ($lines as $l) { if (substr($l, 0, 1) === ';' || substr($l, 0, 1) === "'" || substr($l, 0, 1) === '#' || substr($l, 0, 2) === '//') { @@ -71,6 +73,13 @@ public function loadFile($cont) ); $this->data[$cont][] = $ar; + if ($lar[2] != $check_mode) { + $this->data_filtered[$cont][] = $ar; + // replaceɃXŗL̕ϐ$i($id, $id_base64)܂܂ꍇ + if (!$this->data_nocache[$cont] && strpos($lar[1], '$' !== FALSE)) { + $this->data_nocache[$cont] = true; + } + } } } return $this->data[$cont]; @@ -110,47 +119,66 @@ public function save($data) */ public function replace($cont, $aThread, $ares, $i) { - global $_conf; + // LbV + /* + LbVLɂȂ + Ereplace$i, $id, $id_base64gĂȂ + gƒu[ȟʂ͓f[^łXԍƂɈقȂ錋ʂɂȂ邽߁ALbVłȂȂB + + LbV̓₷̓[O{tƂƂB + */ + static $cache = array('name' => array(), 'mail' => array(), 'date' => array(), 'msg' => array()); $this->setup(); $resar = $aThread->explodeDatLine($ares); - $name = $resar[0]; - $mail = $resar[1]; - $date_id = $resar[2]; - $msg = $resar[3]; - + switch ($cont) { case 'name': - $word = $name; + $word = $resar[0]; break; case 'mail': - $word = $mail; + $word = $resar[1]; break; case 'date': - $word = $date_id; + $word = $resar[2]; break; case 'msg': - $word = $msg; + $word = $resar[3]; break; // G[ default: // ̂܂ܕԂ return $word; } + // uݒ肪ꍇ͂̂܂ܕԂ - if (!isset($this->data[$cont])) { + if (!isset($this->data_filtered[$cont])) { return $word; } + // LbV”\ȏꍇ + if (!$this->data_nocache[$cont]) { + // LbV + // sha1gƑȂ邪mŏՓ˂ + // sha1̌vZʎ̂LbVĂȂȂ + $cache_ = &$cache[$cont][sha1($word)]; + // LbV΂Ԃ + if (isset($cache_)) { + return $cache_; + } + } - preg_match('|ID: ?([0-9A-Za-z/.+]{8,11})|',$date_id, $matches); - $id = $matches[1]; - foreach ($this->data[$cont] as $v) { - // gу[hŃf[^PCpȂ΂ - if ($_conf['ktai'] && $v['mode'] == 1) continue; - // PC[hŃf[^gїpȂ΂ - if (!$_conf['ktai'] && $v['mode'] == 2) continue; - + preg_match('|ID: ?([0-9A-Za-z/.+]{8,11})|',$resar[2], $matches); + $replace_pairs = array( + '$ttitle_hd' => $aThread->ttitle_hd, + '$host' => $aThread->host, + '$bbs' => $aThread->bbs, + '$key' => $aThread->key, + '$id' => $matches[1], + '$id_base64' => base64_encode($matches[1]), + '$i' => $i + ); + foreach ($this->data_filtered[$cont] as $v) { /* Matchp̕ϐWJ(prv΂Ȃ̂ŃRgAEg) $v['match'] = str_replace ('$i', $i, $v['match']); $v['match'] = str_replace ('$ttitle', $aThread->ttitle, $v['match']); @@ -169,22 +197,14 @@ public function replace($cont, $aThread, $ares, $i) ꎩ̂ɐK\Ăǂ悤B IɎĝ$i, $host, $bbs, $key, $date_id炢Ȃ낤ǁB */ - $v['replace'] = str_replace ('$ttitle_hd', $aThread->ttitle_hd, $v['replace']); - $v['replace'] = str_replace ('$ttitle', $aThread->ttitle, $v['replace']); - $v['replace'] = str_replace ('$host', $aThread->host, $v['replace']); - $v['replace'] = str_replace ('$bbs', $aThread->bbs, $v['replace']); - $v['replace'] = str_replace ('$key', $aThread->key, $v['replace']); - // $v['replace'] = str_replace ('$name', $name, $v['replace']); - // $v['replace'] = str_replace ('$mail', $mail, $v['replace']); - // $v['replace'] = str_replace ('$date_id', $date_id, $v['replace']); - // $v['replace'] = str_replace ('$msg', $msg, $v['replace']); - $v['replace'] = str_replace ('$id_base64', base64_encode($id), $v['replace']); - $v['replace'] = str_replace ('$id', $id, $v['replace']); - $v['replace'] = str_replace ('$i', $i, $v['replace']); - + $v['replace'] = strtr($v['replace'], $replace_pairs); $word = @preg_replace ('{'.$v['match'].'}', $v['replace'], $word); } + // LbV”\ȂLbV + if (!$this->data_nocache[$cont]) { + $cache_ = $word; + } return $word; } } diff --git a/lib/wiki/Samba.php b/lib/wiki/Samba.php index 398c3da6d..53f41b920 100644 --- a/lib/wiki/Samba.php +++ b/lib/wiki/Samba.php @@ -69,12 +69,12 @@ public function save() public function getSambaTime($host, $bbs) { - if (!P2Util::isHost2chs($host)) { + if (!P2HostMgr::isHost2chs($host)) { return false; } // samba擾 $url = "http://{$host}/{$bbs}/index.html"; - $src = P2Util::getWebPage($url, $errmsg); + $src = P2Commun::getWebPage($url, $errmsg); $match = '{ BBS\.CGI - .*?\+Samba24=(\d+)}'; preg_match($match, $src, $samba); if(!$this->isLoaded) $this->load(); @@ -105,7 +105,7 @@ public function setWriteTime($host, $bbs) // c莞Ԃ擾 public function getSamba($host, $bbs) { - if (!P2Util::isHost2chs($host)) { + if (!P2HostMgr::isHost2chs($host)) { return -1; } diff --git a/lib/wiki/editpref.inc.php b/lib/wiki/editpref.inc.php deleted file mode 100644 index 3fac320ef..000000000 --- a/lib/wiki/editpref.inc.php +++ /dev/null @@ -1,16 +0,0 @@ -\n\n"; -echo << -+Wiki - NvOCҏW b - DAT擾vOCҏW b - u摜URLvOCҏW -\n -EOP; -echo "\n\n"; - -// }}} \ No newline at end of file diff --git a/lib/wiki/read.inc.php b/lib/wiki/read.inc.php index 5eadf5475..379445b5d 100644 --- a/lib/wiki/read.inc.php +++ b/lib/wiki/read.inc.php @@ -1,23 +1,21 @@ = 2)) { + require_once P2_LIB_DIR . '/wiki/ReplaceImageUrlCtl.php'; + $GLOBALS['replaceImageUrlCtl'] = new ReplaceImageUrlCtl(); + +} +// gуr[ȊȌꍇ +if (!$_conf['ktai'] || $_conf['iphone']) { +// NvOC require_once P2_LIB_DIR . '/wiki/LinkPluginCtl.php'; $GLOBALS['linkPluginCtl'] = new LinkPluginCtl(); - // u摜URL(PCImageCache2L̏ꍇ) - if ($_conf['expack.ic2.enabled'] % 2 == 1) { - require_once P2_LIB_DIR . '/wiki/ReplaceImageUrlCtl.php'; - $GLOBALS['replaceImageUrlCtl'] = new ReplaceImageUrlCtl(); - } -} else { - // u摜URL(gтImageCache2L̏ꍇ) - if ($_conf['expack.ic2.enabled'] >= 2) { - require_once P2_LIB_DIR . '/wiki/ReplaceImageUrlCtl.php'; - $GLOBALS['replaceImageUrlCtl'] = new ReplaceImageUrlCtl(); - } } // u[h require_once P2_LIB_DIR . '/wiki/ReplaceWordCtl.php'; diff --git a/lib/wiki/subject.inc.php b/lib/wiki/subject.inc.php deleted file mode 100644 index 6469a806d..000000000 --- a/lib/wiki/subject.inc.php +++ /dev/null @@ -1,5 +0,0 @@ -authorize(); // [UF + +//================================================================ +// ϐ +//================================================================ +global $_conf; +$AppKey = $_conf['2chapi_appkey']; +$AppName = $_conf['2chapi_appname']; +$HMKey = $_conf['2chapi_hmkey']; + +//============================================================== +// 2chOC +//============================================================== +if (isset($_GET['login2chapi'])) { + if ($_GET['login2chapi'] == "in") { + require_once P2_LIB_DIR . '/auth2chapi.inc.php'; + authenticate_2chapi(); + } elseif ($_GET['login2chapi'] == "out") { + if (file_exists($_conf['sid2chapi_php'])) { + unlink($_conf['sid2chapi_php']); + } + } +} + +//================================================================ +// wb_ +//================================================================ +if ($_conf['ktai']) { + $login_st = "۸޲"; + $logout_st = "۸ޱ"; + $password_st = "߽ܰ"; +} else { + $login_st = "OC"; + $logout_st = "OAEg"; + $password_st = "pX[h"; +} + +if (file_exists($_conf['sid2chapi_php'])) { // 2ch + $ptitle = "2ch API F؊Ǘ"; +} else { + $ptitle = "2ch API F؊Ǘ"; +} + +P2Util::header_nocache(); +echo $_conf['doctype']; +echo << + + + + + + {$_conf['extra_headers_ht']} + {$ptitle}\n +EOP; + +if (!$_conf['ktai']) { + echo << + + + \n +EOP; +} + +$body_at = ($_conf['ktai']) ? $_conf['k_colors'] : ' onload="setWinTitle();"'; + +if (!$_conf['ktai']) { + echo <<OCǗ > {$ptitle}

    +EOP; +} + +P2Util::printInfoHtml(); + +//================================================================ +// 2ch API OCtH[ +//================================================================ + +// OCȂ +if (file_exists($_conf['sid2chapi_php'])) { + $idsub_str = "ĔF؂"; + $form_now_log = << + ݁A2˂ API Fؒł + {$_conf['k_input_ht']} + + + \n +EOFORM; + +} else { + $idsub_str = "F؂"; + $form_now_log = "2˂ API F؂Ă܂

    "; +} + +if ($autoLogin2ch) { + $autoLogin2ch_checked = ' checked="checked"'; +} else { + $autoLogin2ch_checked = ''; +} + +$tora3_url = "http://2ch.tora3.net/"; +$tora3_url_r = P2Util::throughIme($tora3_url); + +if (!$_conf['ktai']) { + $id_input_size_at = " size=\"30\""; + $pass_input_size_at = " size=\"24\""; +} + +// vg ================================= +echo "
    "; +echo $form_now_log; +echo "
    "; + +if ($_conf['ktai']) { + echo "
    "; +} + +echo << + {$_conf['k_input_ht']} + AppKey: "{$AppKey}"
    + HMKey: "{$HMKey}"
    + AppName: "{$AppName}"
    + F؏[UݒҏWŕύXł܂B
    + + +\n +EOFORM; + +if ($_conf['ktai']) { + echo "
    "; +} + +//================================================================ +// tb^HTML\ +//================================================================ + +if ($_conf['ktai']) { + echo "
    {$_conf['k_to_index_ht']}
    "; +} + +echo ''; + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/rep2/css/bootstrap.min.css b/rep2/css/bootstrap.min.css new file mode 100644 index 000000000..ed3905e0e --- /dev/null +++ b/rep2/css/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/rep2/css/iphone.css b/rep2/css/iphone.css index 2b2eb7cab..89d8f58e4 100644 --- a/rep2/css/iphone.css +++ b/rep2/css/iphone.css @@ -3,607 +3,703 @@ /* {{{ General */ body { - margin: 0; - padding: 10px; - font-family: sans-serif; - font-size: medium; - line-height: 140%; - color: #000000; - background-color: #fafafa; - -webkit-text-size-adjust: none; + margin: 0; + padding: 10px; + font-size: medium; + line-height: 140%; + color: #000; + background-color: #fafafa; + -webkit-text-size-adjust: none; } body > *:first-child { - margin-top: 0 !important; - padding-top: 0 !important; + margin-top: 0 !important; + padding-top: 0 !important; } body > *:last-child { - margin-bottom: 0 !important; - padding-bottom: 0 !important; + margin-bottom: 0 !important; + padding-bottom: 0 !important; } div, h1, h2, h3, h4, h5, h6, li, p { - word-break: normal; - word-wrap: break-word; + word-break: normal; + word-wrap: break-word; } h1, h2, h3, h4, h5, h6, p, form, fieldset { - margin: 8px 0; + margin: 8px 0; } a { - word-break: break-all; + word-break: break-all; } a:link { - color: #0000ff; + color: #0000ff; +} + +/* TOP{^ */ +a#backButton { + position: absolute; + overflow: hidden; + top: 8px; + margin: 0; + left: 6px; + right: auto; + height: 30px; + padding-right: 0px; + padding-left: 0px; + width: auto; + max-width: 100px; + font-family: Helvetica; + line-height: 30px; + font-size: 12px; + font-weight: bold; + text-shadow: rgba(0, 0, 0, 0.6) 0px -1px 0; + text-overflow: ellipsis; + text-decoration: none; + white-space: nowrap; + color: #FFFFFF; + border-width: 0 8px 0 14px; + /* background: #333; border-radius: 5px; min-width:46px; text-align:center */ + background: none; + -webkit-border-image: url(../iui/backButton.png?14011419) 0 8 0 14; + border-image: url(../iui/backButton.png?14011419) 0 8 0 14 fill; + -webkit-border-image: -webkit-image-set(url(../iui/backButton.png?14011419) 1x, url(../iui/backButton@2x.png?14011419) 2x, url(../iui/backButton@3x.png?14011419) 3x) 0 8 0 14; + border-image: image-set(url(../iui/backButton.png?14011419) 1x, url(../iui/backButton@2x.png?14011419) 2x, url(../iui/backButton@3x.png?14011419) 3x) 0 8 0 14; +} + +div#toolbar_header { + text-align: right; + padding: 6px; + height: 45px; + box-sizing: border-box; + -webkit-box-sizing: border-box; } a:visited { - color: #0080ff; + color: #0080ff; } a img { - vertical-align: middle; + vertical-align: middle; } b.filtering, span.matched { - font-weight: bold; + font-weight: bold; } span.label { - cursor: pointer; + cursor: pointer; } div.left, td.left { - text-align: left; + text-align: left; } div.center, td.center { - text-align: center; + text-align: center; } div.right, td.right { - text-align: right; + text-align: right; } p.empty { - margin: 0; - padding: 7px 11px; - background-color: #fff; - color: #333;; + margin: 0; + padding: 7px 11px; + background-color: #fff; + color: #333;; } /* }}} * -/* {{{ Forms */ - -input, select, textarea { - font-size: medium; -} - -input[type="checkbox"] { - width: 24px; - height: 24px; - -webkit-border-radius: 8px; - border-radius: 8px; - vertical-align: middle; -} - -input[type="checkbox"]:checked { - background-color: #808080; - border-color: #555555; +/* {{{ Res */ +textarea#MESSAGE { + padding: 6px; + line-height: 132%; + width: 100%; + box-sizing: border-box; + -webkit-box-sizing: border-box; } -textarea { - padding-left: 5px; - padding-right: 5px; -} +/* }}} * +/* {{{ Forms */ form.inline { - display: inline; - margin: 0 5px; + display: inline; + margin: 0 5px; } form.inline-block { - display: inline-block; - margin: 0 5px; + display: inline-block; + margin: 0 5px; } /* }}} * /* {{{ Navigations */ div.navi, div.pager, div.toolbar { - margin: 5px 0; + margin: 5px 0; } a.button, div.navi a[href]:not(.nobutton), div.pager a[href]:not(.nobutton), -div.toolbar a[href]:not(.nobutton) -{ - display: inline-block; - min-width: 12px; /* 15 * 2 - (8 + 1) * 2 */ - height: 22px; /* 15 * 2 - (3 + 1) * 2 */ - margin: 4px 2px; - padding: 3px 8px; - text-align: center; - vertical-align: middle; - line-height: 150%; - text-decoration: none; - color: #000000; - background: #ffffff url('../img/iphone/btn-bg.png') repeat-x left bottom; - border: #505050 solid 1px; - -webkit-border-radius: 15px; - border-radius: 15px; +div.toolbar a[href]:not(.nobutton) { + display: inline-block; + min-width: 12px; /* 15 * 2 - (8 + 1) * 2 */ + height: 22px; /* 15 * 2 - (3 + 1) * 2 */ + margin: 4px 2px; + padding: 3px 8px; + text-align: center; + vertical-align: middle; + line-height: 150%; + text-decoration: none; + color: #000000; + background: #ffffff url('../img/iphone/btn-bg.png') repeat-x left bottom; + border: #505050 solid 1px; + -webkit-border-radius: 15px; + border-radius: 15px; } span.autosave-info { - font-size: xx-small; - color:#777; + font-size: xx-small; + color: #777; } /* }}} * /* {{{ SPM */ div#spm { - display: none; - position: absolute; - /*width: 300px;*/ - top: 0; - left: 10px; - z-index: 1000; - margin: 5px 0 0 5px; - padding 0; - color: #ffffff; - background-color: rgba(0, 0, 0, 0.8); - -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; - box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; - -webkit-border-radius: 8px; - border-radius: 8px; + display: none; + position: absolute; + /*width: 300px;*/ + max-width: 300px; + top: 0; + left: 10px; + z-index: 1000; + margin: 5px 0 0 5px; + padding: 2px 4px; + color: #ffffff; + background-color: rgba(0, 0, 0, 0.8); + -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; + box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; + -webkit-border-radius: 8px; + border-radius: 8px; + line-height: 170%; } div#spm span#spm-num { - /*color: #ffffcc;*/ - /*text-decoration: underline;;*/ + /*color: #ffffcc;*/ + /*text-decoration: underline;;*/ } div#spm > div { - margin: 0; - padding: 8px; - line-height: 100%; -} - -div#spm > div#spm-reply { - text-align: center; - font-size: x-large; - font-weight: bold; - border-bottom-color: rgba(255, 255, 255, 0.80); - border-bottom-style: solid; - border-bottom-width: 1px; + margin: 0; + padding: 8px; } -div#spm > div#spm-reply > span#spm-reply-quote { +div#spm > div.spm-section { + white-space: nowrap; + margin: 2px; + padding: 0px; + border-bottom: 1px white solid; + vertical-align: middle; } -div#spm > div#spm-reply > span#spm-reply-noquote { - font-size: large; +div#spm > div#spm-menu > span { + display: block; + white-space: nowrap; + margin: 2px; + padding: 0px 4px; + vertical-align: middle; + text-decoration: none; + color: white; + font-size: large; } div#spm > div#spm-action { - text-align: center; + text-align: center; } div#spm > div#spm-action > select { - background-color: #ffffff; + background-color: #ffffff; } div#spm > img#spm-closer { - cursor: pointer; - position: absolute; - top: -12px; - left: -12px; + cursor: pointer; + position: absolute; + top: -12px; + left: -12px; } /* }}} */ /* {{{ Read */ +span.thread_title { + text-align: left; + font-weight: bold; + font-size: 16px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 100%; + box-sizing: border-box; + display: inline-block; +} + +td#thread_title { + text-align: left; + font-weight: bold; + font-size: 14px; + line-height: 14px; +} + +td#thread_title > div { + padding: 0 0 0 8px; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +span.link_right_button { + position: absolute; + text-align: right; + right: 0; + top: 0; + padding: 3px 0; + display: inline-block; +} + +div.thread_title { + background-color: #808080; + position: relative; + padding: 4px 0px 4px 4px; +} + h3 > font[color], div > font[color] > b { - color: #252525; + color: #252525; } div:not(.res-header) > span.onthefly { - padding: 2px 4px; - border: #00aa00 solid 1px; - color: #00aa00; - font-style: italic; + padding: 2px 4px; + border: #00aa00 solid 1px; + color: #00aa00; + font-style: italic; } div.res:not(.aborned) { - margin: 0; - padding: 0; - border-top: #808080 solid 1px; - background-color: #ffffff; + margin: 0; + padding: 0; + /*border-top: #fff solid 1px;*/ + border-top: #dcdcdc solid 1px; + /*background-color: #FAFAFA;*/ } div.thread > div.res:not(:first-child) { - border-top-width: 4px; + /* border-top-width: 4px;*/ } div.res.aborned { - margin: 0; - padding: 0; - font-size: xx-small; - line-height: 100%; + margin: 0; + padding: 0; + font-size: xx-small; + line-height: 100%; } div.res > div.message { - margin: 0; - padding: 10px; - line-height: 140%; - word-break: break-all; + margin: 0; + padding: 5px 10px; + line-height: 140%; + word-break: break-all; +} + +div.res > div.reslist { + margin: 0; + padding: 5px 10px; + line-height: 140%; + word-break: break-all; } div.res > div.res-header { - margin: 0; - padding: 8px 10px; - line-height: 120%; - border-bottom: #808080 solid 1px; + margin: 0; + padding: 5px; + line-height: 120%; + color: #1144AA; + display: inline-block; + /*border-bottom: #808080 solid 1px;*/ } div.thread > div.res > div.res-header { - background-color: #fafafa; + /*background-color: #fafafa;*/ } div.res-header > span.no { } div.res-header > span.no.newres { - color: #ff6600; + color: #ff6600; } div.res-header > span.no.onthefly { - color: #00aa00; + color: #00aa00; } div.res-header > span.no:before { - content: "["; - color: #000000; + content: "["; + color: #000000; } div.res-header > span.no:after { - content: "]"; - color: #000000; + content: "]"; + color: #000000; } div.res-header > span.name { } div.res-header > span.name:after { - content: ":"; + content: ":"; } div.res-header > span.mail { } div.res-header > span.mail:after { - content: ":"; + content: ":"; } div.res-header > span.date-id { } div.respop { - position: absolute; - top: 0; - left: 0; - margin: 0; - padding: 12px 6px 0 14px; + position: absolute; + top: 0; + left: 0; + margin: 0; + padding: 12px 6px 0 14px; } div.respop > div.res { - margin: 0 0 8px 0 !important; - background-color: rgba(255, 255, 250, 0.95) !important; - border: rgba(108, 108, 108, 0.8) solid 1px !important; - -webkit-border-radius: 8px; - border-radius: 8px; - -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; - box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; + margin: 0 0 8px 0 !important; + background-color: rgba(255, 255, 250, 0.95) !important; + border: rgba(108, 108, 108, 0.8) solid 1px !important; + -webkit-border-radius: 8px; + border-radius: 8px; + -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; + box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; } div.respop > div.res > div.res-header { - border-bottom-color: rgba(108, 108, 108, 0.8) !important; + border-bottom-color: rgba(108, 108, 108, 0.8) !important; } div.respop > img.close-button { - cursor: pointer; - position: absolute; - top: 0; - left: 2px; + cursor: pointer; + position: absolute; + top: 0; + left: 2px; } div.respop > div.res > div.respop-back { - margin: 0; - padding: 0; - border-top: rgba(108, 108, 108, 0.8) solid 1px; - text-align: center; + margin: 0; + padding: 0; + border-top: rgba(108, 108, 108, 0.8) solid 1px; + text-align: center; } div.respop > div.res > div.respop-back > a { - display: block; - margin: 0; - padding: 3px; - font-size: small; - text-decoration: none; - color: #252525; + display: block; + margin: 0; + padding: 3px; + font-size: small; + text-decoration: none; + color: #252525; } a.aas { - display: inline-block; - vertical-align: middle; - margin: 0 5px; - padding: 0; - border: #aaaaaa inset 3px; + display: inline-block; + vertical-align: middle; + margin: 0 5px; + padding: 0; + border: #aaaaaa inset 3px; } /* }}} * /* {{{ Subject */ ul.subject { - display: block; - margin: 0; - padding: 0; + display: block; + margin: 0; + padding: 0; } ul.subject > li { - display: block; - margin: 0; - padding: 0; - border-bottom: #e0e0e0 solid 1px; + display: block; + margin: 0; + padding: 0; + border-bottom: #e0e0e0 solid 1px; } ul.subject > li:first-child { - border-top: #e0e0e0 solid 1px; + border-top: #e0e0e0 solid 1px; } ul.subject > li > a { - display: block; - margin: 0; - padding: 8px 10px; - word-break: normal; - font-size: medium; - text-decoration: none; - color: #000000; - background-color: #ffffff; + display: block; + margin: 0; + padding: 8px 10px; + word-break: normal; + font-size: medium; + text-decoration: none; + color: #000000; + background-color: #ffffff; } ul.subject > li > a:link { - color: #000000; - background-color: #ffffff; + color: #000000; + background-color: #ffffff; } ul.subject > li > a:visited { - color: #666666; - background-color: #ffffff; + color: #666666; + background-color: #ffffff; } ul.subject > li > a:active { - color: #ffffff; - background-color: #194fdb; - -webkit-tap-highlight-color: transparent; } ul.subject > li > a:link > span.new { - color: #ff0000; + color: #8C99B4; } ul.subject > li > a:visited > span.new { - color: #fa5825; + color: #8090B0; } ul.subject > li > a:active > span.new { - color: #ffffff; + color: #ffffff; } ul.subject > li > a > span.info { - display: none; + display: none; } ul.subject > li > a > span.title { - word-break: break-all; - font-size: large; - font-weight: bold; + word-break: break-all; + font-size: 15px; + line-height: 127%; + font-weight: bold; } ul.subject > li > a > span.ita { + white-space: nowrap; + color: #666; + font-size: 12px; } ul.subject > li > a > span.num { + white-space: nowrap; + color: #999999; + font-size: 14px; } ul.subject > li > a > span.unread { - padding: 0 4px; - color: #ffffff !important; - background-color: #666666; - -webkit-border-radius: 8px; - border-radius: 8px; + padding: 0 4px; + color: #ffffff !important; + background-color: #666666; + -webkit-border-radius: 8px; + border-radius: 8px; } ul.subject > li > a > span.unread.new { - font-weight: bold; - background-color: #ff0000; + font-weight: bold; + background-color: #8C99B4; } ul.subject > li > a > span.unread.offline { } ul.subject > li > a > span.count { + white-space: nowrap; + color: #999; + font-size: 14px; } ul.subject > li > a > span.count:before { - content: "("; + content: "("; } ul.subject > li > a > span.count:after { - content: ")"; + content: ")"; } ul.subject > li > a > span.score { + white-space: nowrap; + color: #666; + font-size: 12px; } /* }}} */ /* {{{ Pop-up dialog */ div.popup-dialog { - display: none; - position: absolute; - top: 0; - left: 10px; - z-index: 1001; - margin: 5px 0 0 5px; - padding 0; - max-width: 300px; - color: #ffffff; - background-color: rgba(0, 0, 0, 0.8); - -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; - box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; - -webkit-border-radius: 8px; - border-radius: 8px; + display: none; + position: absolute; + top: 0; + left: 10px; + z-index: 1001; + margin: 5px 0 0 5px; + padding: 0; + max-width: 300px; + color: #ffffff; + background-color: rgba(0, 0, 0, 0.8); + -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; + box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px; + -webkit-border-radius: 8px; + border-radius: 8px; } div.popup-dialog > img.close-button { - cursor: pointer; - position: absolute; - top: -12px; - left: -12px; + cursor: pointer; + position: absolute; + top: -12px; + left: -12px; } div.popup-dialog > div { - margin: 0; - font-weight: normal; + margin: 0; + font-weight: normal; } div.popup-dialog > div.popup-dialog-text { - padding: 8px 12px; - text-align: left; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - font-size: 14px !important; - line-height: 14px !important; + padding: 8px 12px; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px !important; + line-height: 14px !important; } div.popup-dialog > div.popup-dialog-buttons { - padding: 0 12px 8px 12px; - text-align: center; - font-size: 14px !important; - line-height: 14px !important; + padding: 0 12px 8px 12px; + text-align: center; + font-size: 14px !important; + line-height: 14px !important; } div.popup-dialog > div.popup-dialog-buttons > input[type="button"] { - margin: 0; - padding: 0; - width: auto; - height: auto; - font-size: 14px !important; - color: #000000; + margin: 0; + padding: 0; + width: auto; + height: auto; + font-size: 14px !important; + color: #000000; } /* }}} */ /* {{{ Pop-in information */ ul.subject > li.info-pop { - margin: 0; - padding: 10px 5px; - background-color: #333333; - color: #ffffff; - font-size: 16px !important; - font-weight: bold; - line-heihgt: 100%; + margin: 0; + padding: 10px 5px; + background-color: #333; + color: #ffffff; + font-size: 16px !important; + font-weight: bold; + line-heihgt: 100%; } ul.subject > li.info-pop > div.info-pop-buttons { - margin: 0; - padding: 0; - width: auto; - text-align: center; - font-size: 14px !important; - line-height: 14px !important; + margin: 0; + padding: 0; + width: auto; + text-align: center; + font-size: 14px !important; + line-height: 14px !important; } ul.subject > li.info-pop > div.info-pop-buttons:not(:first-child) { - margin-top: 10px; + margin-top: 10px; } ul.subject > li.info-pop > div.info-pop-buttons input[type="button"] { - margin: 0; - padding: 0; - width: auto; - height: auto; - font-size: 14px !important; - font-weight: normal; - color: #000000; + margin: 0; + padding: 0; + width: auto; + height: auto; + font-size: 14px !important; + font-weight: normal; + color: #000000; } ul.subject > li.info-pop > table.info-pop-fav { - margin: 10px auto 0 auto; - padding: 0; - width: auto; + margin: 10px auto 0 auto; + padding: 0; + width: auto; } ul.subject > li.info-pop > table.info-pop-fav tbody, ul.subject > li.info-pop > table.info-pop-fav tr { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } ul.subject > li.info-pop > table.info-pop-fav td { - margin: 0; - padding: 2px; - line-height: 100%; - text-align: left; - vertical-align: middle; + margin: 0; + padding: 2px; + line-height: 100%; + text-align: left; + vertical-align: middle; } ul.subject > li.info-pop > table.info-pop-fav td:first-child { - padding-right: 8px; + padding-right: 8px; } /* }}} */ /* {{{ new layout */ body.nopad { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } div.info { - margin: 0; - padding: 5px 10px; - border-top: #808080 solid 1px; - background-color: #ccf; - color: #000; - font-size: 14px; - line-height: 16px; + margin: 0; + padding: 5px 10px; + border-top: #808080 solid 1px; + background-color: #ccf; + color: #000; + font-size: 14px; + line-height: 16px; } a.hoverable { - -webkit-tap-highlight-color: transparent; + -webkit-tap-highlight-color: transparent; } a > img { - border: none; + border: none; } /* }}} */ /* {{{ new toolbar */ div.ntoolbar { - min-width: 320px; - margin: 0; - padding: 0; - background-color: #000; - color: #fff; + min-width: 320px; + margin: 0; + padding: 0; + background-color: #333; + color: #fff; +} + +div.ntoolbar#pager { + background-color: #808080; + color: #fff; } div.ntoolbar#header { @@ -612,311 +708,357 @@ div.ntoolbar#header { div.ntoolbar#footer { } -div.ntoolbar > h1.ptitle { - margin: 0; - padding: 10px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - text-align: center; - font-weight: bold; - font-size: 16px; - line-height: 16px; +h1.ptitle { + margin: 0; + padding: 10px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + font-weight: bold; + font-size: 16px; + line-height: 16px; } -div.ntoolbar > h1.ptitle > span.thin { - font-weight: noraml; - font-size: 14px; +h1.ptitle > span.thin { + font-weight: normal; + font-size: 14px; } div.ntoolbar > form, div.ntoolbar > div > form { - margin: 0; - padding: 5px 10px; - border-top: #808080 solid 1px; - font-size: 14px; - line-height: 16px; + margin: 0; + padding: 5px 10px; + border-top: #808080 solid 1px; + font-size: 14px; + line-height: 16px; } div.ntoolbar > div { - margin: 0; - padding: 0; - font-size: 14px; - line-height: 16px; + margin: 0; + padding: 0; + font-size: 14px; + line-height: 16px; } div.ntoolbar > div.hits { - padding: 5px 10px; - border-top: #808080 solid 1px; - background-color: #ffc; - color: #000; + padding: 5px 10px; + border-top: #808080 solid 1px; + background-color: #ffc; + color: #000; } div.ntoolbar > div.extra { - display: none; + display: none; } div.ntoolbar table { - width: 100%; - margin: 0; - padding: 0; - border-collapse: collapse; - empty-cells: show; + width: 100%; + margin: 0; + padding: 0; + border-collapse: collapse; + empty-cells: show; + table-layout: fixed; } div.ntoolbar td { - position: relative; - width: 20%; - min-width: 64px; - margin: 0; - padding: 8px 0; - text-align: center; - vertical-align: middle; - border-top: #808080 solid 1px; - font-size: 11px; - line-height: 11px; + position: relative; + width: 20%; + min-width: 64px; + margin: 0; + padding: 4px 0; + text-align: center; + vertical-align: middle; + border-top: #808080 solid 1px; + font-size: 11px; + line-height: 11px; +} + +div.ntoolbar#pager td { + padding: 0; + border-top: none; } div.ntoolbar td[colspan='2'] { - width: 40%; + width: 40%; } div.ntoolbar td[colspan='3'] { - width: 60%; + width: 60%; } div.ntoolbar td[colspan='4'] { - width: 80%; + width: 80%; } div.ntoolbar td[colspan='5'] { - width: 100%; + width: 100%; } div.ntoolbar td > a { - display: inline-block; - position: relative; - width: 60px; - margin: 0 auto; - padding: 0; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - text-align: center; - text-decoration: none; + display: inline-block; + position: relative; + width: 60px; + margin: 0 auto; + padding: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + text-align: center; + text-decoration: none; } div.ntoolbar td[colspan] > a { - width: 120px; + width: 120px; } div.ntoolbar a { - text-decoration: none; + text-decoration: none; } div.ntoolbar a:link, div.ntoolbar a:visited { - color: #fff; + color: #fff; } div.ntoolbar a.inactive { - color: #888; + color: #fff; +} + +div.ntoolbar span.available { + display: inline-block; } div.ntoolbar span.unavailable { - color: #555; + color: #555; + display: inline-block; } div.ntoolbar a.hover, div.ntoolbar a.active, div.ntoolbar a:hover, div.ntoolbar a:active { - color: #9cf; + color: #b4b4b4; } -div.ntoolbar td > a > span.badge { - display: inline-block; - position: absolute; - top: 0; - right: 8px; - width: auto; - height: 12px; - margin: 0; - padding: 2px 5px; - -webkit-border-radius: 8px; - border-radius: 8px; - background-color: #f00; - background-color: rgba(255, 0, 0, 0.95); - color: #fff; - font-weight: bold; - font-size: 12px; - line-height: 12px; +/* obẄʒu߂̂߂ */ +div#matome { + display: inline-block; + position: relative; } -div.ntoolbar td > a > span.badge.l2 { - right: 5px; +a > span.badge { + display: inline-block; + position: absolute; + top: 0; + right: 8px; + width: auto; + height: 12px; + margin: 0; + padding: 2px 5px; + -webkit-border-radius: 8px; + border-radius: 8px; + background-color: #8C99B4; + color: #fff; + font-weight: bold; + font-size: 12px; + line-height: 12px; } -div.ntoolbar td > a > span.badge.l3 { - right: 3px; +a > span.badge.l2 { + right: 5px; } -div.ntoolbar td > a > span.badge.l4 { - right: 0px; +a > span.badge.l3 { + right: 3px; } -div.ntoolbar td > a > span.badge.l0 { - display: none; +a > span.badge.l4 { + right: 0px; } -div.ntoolbar td > a.hover > span.badge, -div.ntoolbar td > a.active > span.badge, -div.ntoolbar td > a:hover > span.badge, -div.ntoolbar td > a:active > span.badge { - background-color: #36f; +a > span.badge.l0 { + display: none; } -div.ntoolbar a:link > img, -div.ntoolbar a:visited > img { - background-color: #fff; +a.hover > span.badge, +a.active > span.badge, +a:hover > span.badge, +a:active > span.badge { + background-color: #36f; } div.ntoolbar a.inactive > img { - background-color: #888; + filter: alpha(opacity=50); + -ms-filter: "alpha(opacity=50)"; + -moz-opacity: 0.5; + opacity: 0.5; } div.ntoolbar span.unavailable > img { - background-color: #555; + filter: alpha(opacity=20); + -ms-filter: "alpha(opacity=20)"; + -moz-opacity: 0.2; + opacity: 0.2; } div.ntoolbar a.hover > img, div.ntoolbar a.active > img, div.ntoolbar a:hover > img, div.ntoolbar a:active > img { - background-color: #9cf; + filter: alpha(opacity=70); + -ms-filter: "alpha(opacity=70)"; + -moz-opacity: 0.7; + opacity: 0.7; } div.ntoolbar td > select { - font-size: 16px; + font-size: 16px; } div.ntoolbar td > span.large { - font-size: 14px; + font-size: 14px; } /* }}} */ /* {{{ new toolbar / matome */ div.mtoolbar { - position: relative; - min-width: 320px; - margin: 0; - padding: 0; - background-color: #000; - color: #fff; + position: relative; + min-width: 320px; + margin: 0; + padding: 0; + background-color: #808080; + color: #fff; } div.mtoolbar > .ttitle { - margin: 0 56px 0 0; - padding: 10px 0 10px 10px; - font-weight: bold; + margin: 0 56px 0 0; + padding: 10px 0 10px 10px; + font-weight: bold; } div.mtoolbar > h2.ttitle { - font-size: 14px; - line-height: 16px; + font-size: 14px; + line-height: 16px; } div.mtoolbar > div.ttitle { - font-size: 12px; - line-height: 14px; + font-size: 12px; + line-height: 14px; } div.mtoolbar_top { - border-top: #808080 solid 2px; + border-top: #808080 solid 2px; } div.mtoolbar_bottom { - border-bottom: #808080 solid 1px; + border-bottom: #808080 solid 1px; } div.mtoolbar_bottom > table { - border-bottom: #808080 solid 1px; + border-bottom: #808080 solid 1px; } div.mtoolbar > div.mover { - position: absolute; - right: 8px; + position: absolute; + right: 8px; } div.mtoolbar_top > div.mover { - top: 0; + top: 0; } div.mtoolbar_bottom > div.mover { - bottom: 2px; + bottom: 2px; } div.mtoolbar > .ttitle a { - text-decoration: underline; + text-decoration: underline; } div.mtoolbar > .ttitle > span.btitle { - display: inline-block; - font-weight: normal; + display: inline-block; + font-weight: normal; } /* }}} */ /* {{{ Media Queries for res-popups */ @media screen and (max-width: 320px) { - div.respop { - padding-right: 0; - } + div.respop { + padding-right: 0; + } - div.respop > div.res { - border-right-width: 0 !important; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -webkit-border-right-left-radius: 0; - border-bottom-right-radius: 0; - } + div.respop > div.res { + border-right-width: 0 !important; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -webkit-border-right-left-radius: 0; + border-bottom-right-radius: 0; + } } /* }}} */ /* {{{ Media Queries for toolbar items */ @media screen and (min-width: 340px) { - div.ntoolbar td > a { - width: 64px; - } + div.ntoolbar td > a { + width: 64px; + } } @media screen and (min-width: 360px) { - div.ntoolbar td > a { - width: 68px; - } - div.ntoolbar td > a > span.badge { - right: 8px !important; - } + div.ntoolbar td > a { + width: 68px; + } + + a > span.badge { + right: 8px !important; + } } @media screen and (min-width: 400px) { - div.ntoolbar td > a { - width: 76px; - } - div.ntoolbar td > a > span.badge { - right: 16px !important; - } + div.ntoolbar td > a { + width: 76px; + } + + a > span.badge { + right: 16px !important; + } } @media screen and (min-width: 480px) { - div.ntoolbar td > a { - width: 92px; - } - div.ntoolbar td > a > span.badge { - right: 24px !important; - } + div.ntoolbar td > a { + width: 92px; + } + + a > span.badge { + right: 24px !important; + } +} + +.btn { + background-color: #999999; +} + +.maxwidth { + width: 98%; +} + +.popup { + background-color: rgba(0, 0, 0, 0.8); +} + +div.ntoolbar .disabled a:visited { + color: #555;!important +} + +.disabled > a > img{ + filter: alpha(opacity=20); + -ms-filter: "alpha(opacity=20)"; + -moz-opacity: 0.2; + opacity: 0.2; } /* }}} */ diff --git a/rep2/css/limelight.css b/rep2/css/limelight.css index e677202c4..9fb99d110 100644 --- a/rep2/css/limelight.css +++ b/rep2/css/limelight.css @@ -105,7 +105,6 @@ table.limelight-toolbar td { span.limelight-button { display: inline-block; width: 45px; - height: 15px; margin: 0; padding: 5px 10px; background-color: rgba(0, 0, 0, 0.5); @@ -114,7 +113,7 @@ span.limelight-button { color: #fff; text-shadow: #000 1px 1px 1px; font-family: sans-serif; - font-size: 15px; + font-size: 13px; font-weight: bold; text-align: center; line-height: 100%; diff --git a/rep2/dig2ch.php b/rep2/dig2ch.php new file mode 100644 index 000000000..555ecd784 --- /dev/null +++ b/rep2/dig2ch.php @@ -0,0 +1,143 @@ +setHeader('User-Agent', $_SERVER['HTTP_USER_AGENT']); MonazillaƂǂ + $req->setHeader('Accept-Charset', 'utf-8'); + $req->setHeader('Cache-Control', 'no-cache'); + $req->setHeader('Accept', 'application/json'); + + $response = P2Commun::getHTTPResponse($req); + + $code = $response->getStatus(); + if ($code != 200) { + p2die("HTTP Error - {$code}"); + } + + $body = $response->getBody(); + } catch (Exception $e) { + p2die($e->getMessage()); + } + + // ̎IʼnQJSONHTML̃Rĝł̑΍ + if (strpos($body,"/", "", $body); + } + + // form^O邱Ƃ̂ŏ + if (strpos($body,"/", "", $body); + } + + $jsontest1 = json_decode($body, true); + + //mb_convert_variables('SHIFT-JIS','UTF-8',$jsontest1); + + if ($jsontest1 === NULL) { + + $jsonerror = ""; + switch (json_last_error()) { + case JSON_ERROR_NONE: + $jsonerror = ' - No errors'; + break; + case JSON_ERROR_DEPTH: + $jsonerror = ' - Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $jsonerror = ' - Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $jsonerror = ' - Unexpected control character found'; + break; + case JSON_ERROR_SYNTAX: + $jsonerror = ' - Syntax error, malformed JSON'; + break; + case JSON_ERROR_UTF8: + $jsonerror = ' - Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $jsonerror = ' - Unknown error'; + break; + } + if (true) { // {conf_admin.phpŐ؂ւ邱Ƃo悤ɂ邪ON + echo "PHP삵ĂOSuname
    ". php_uname() ."
    "; + echo "PHP̃o[W
    ". phpversion() ."
    "; + if ($_conf['proxy_use']) + { + echo '̊‹͋ݒ肳Ă܂(2chƂ̒ʐMɉgpĂꍇ͂܊)
    '; + echo "{$_conf['proxy_host']}:{$_conf['proxy_port']}
    "; + } + echo "dig2chɑMURL(uEUŃANZXĂ݂ĂB)
    {$url}
    "; + // \̂SJIS + $body = mb_convert_encoding($body, "SJIS", "UTF-8"); + echo 'dig2ch̃X|X(http://jsonlint.com/ ŃG[΂܊)

    '; + echo 'HTTP_Requestvar_dump
    '; + var_dump($req); + echo 'HTTP_Responsevar_dump
    '; + var_dump($response); + } + p2die("ʂ̉͂Ɏs܂".$jsonerror); + } else { + unset ($body); + } + + $boards = array(); + $hits = array(); + $names = array(); + foreach ($jsontest1[result] as $jsontest2) { + $result['threads'][$n1] = new stdClass; + $result['threads'][$n1]->title = $jsontest2[subject]; + $result['threads'][$n1]->host = $jsontest2[server]; + $result['threads'][$n1]->bbs = $jsontest2[bbs]; + $result['threads'][$n1]->tkey = $jsontest2[key]; + $result['threads'][$n1]->resnum = $jsontest2[resno]; + $result['threads'][$n1]->ita = $jsontest2[ita]; + $result['threads'][$n1]->dayres = $jsontest2[ikioi]; + $n1++; + $bkey = md5($jsontest2['server'].'-'.$jsontest2['bbs'].'-'.$jsontest2['ita']); + if (! isset($boards[$bkey])) { + $board = new stdClass; + $board->host = $jsontest2['server']; + $board->bbs = $jsontest2['bbs']; + $names[$bkey] = $board->name = $jsontest2['ita']; + $hits[$bkey] = $board->hits = 1; + $boards[$bkey] = $board; + } else { + $hits[$bkey] = ++$boards[$bkey]->hits; + $names[$bkey] = $boards[$bkey]->name; + } + } + $result['modified'] = $response->getHeader('Date'); + $result['profile']['regex'] = '/(' . $jsontest1[query] .')/i'; + $result['profile']['hits'] = $jsontest1[found]; + $result['profile']['cm0'] = str_replace("a href=" , "a target=\"_blank\" href=", $jsontest1[cm0]); + if (strstr($result['profile']['cm0'] , "rounin")) { $result['profile']['cm0'] = str_replace("src=\"" , "src=\"http://dig.2ch.net", $result['profile']['cm0']);} + $result['profile']['cm0'] = str_replace("
    " , "", $result['profile']['cm0']); + + $result['profile']['cm1'] = str_replace("a href=" , "a target=\"_blank\" href=", $jsontest1[cm1]); + if (strstr($result['profile']['cm1'] , "rounin")) { $result['profile']['cm1'] = str_replace("src=\"" , "src=\"http://dig.2ch.net", $result['profile']['cm1']);} + $result['profile']['cm1'] = str_replace("
    " , "", $result['profile']['cm1']); + + $result['profile']['cm2'] = str_replace("a href=" , "a target=\"_blank\" href=", $jsontest1[cm2]); + if (strstr($result['profile']['cm2'] , "rounin")) { $result['profile']['cm2'] = str_replace("src=\"" , "src=\"http://dig.2ch.net", $result['profile']['cm2']);} + $result['profile']['cm2'] = str_replace("
    " , "", $result['profile']['cm2']); + array_multisort($hits, SORT_DESC, $names, $boards); + $result['profile']['boards'] = $boards; + unset($boards,$hits,$names); + + return $result; +} + diff --git a/rep2/edit_aborn_word.php b/rep2/edit_aborn_word.php index 287b30a0f..17f04dc35 100644 --- a/rep2/edit_aborn_word.php +++ b/rep2/edit_aborn_word.php @@ -28,6 +28,10 @@ 'p2_ng_id.txt' => 'NGID', 'p2_aborn_be.txt' => 'ځ[BE', 'p2_ng_be.txt' => 'NGBE', + 'p2_highlight_name.txt' => 'nCCgl[', + 'p2_highlight_mail.txt' => 'nCCg[', + 'p2_highlight_msg.txt' => 'nCCgbZ[W', + 'p2_highlight_id.txt' => 'nCCgID', ); if (!array_key_exists($filename, $writable_files)) { @@ -221,7 +225,7 @@ $usage = <<
  • ~: 폜
  • -
  • [h: NG/ځ[񃏁[h (ɂƓo^)
  • +
  • [h: NG/ځ[/nCCg[h (ɂƓo^)
  • i: 啶𖳎
  • re: K\
  • : newsplus,software (Sv, J}؂)
  • diff --git a/rep2/edit_conf_user.php b/rep2/edit_conf_user.php index 5644bae51..19a0a031e 100644 --- a/rep2/edit_conf_user.php +++ b/rep2/edit_conf_user.php @@ -220,19 +220,18 @@ // {{{ rep2{ݒ // {{{ 'be/p2' -$groupname = 'be/p2'; +$groupname = 'be'; $groups[] = $groupname; $flags = getGroupShowFlags($groupname); if ($flags & P2_EDIT_CONF_USER_SKIPPED) { $keep_old = true; } else { $conflist = array( - array('be_2ch_code', 'be.2ch.net̔F؃R[h(pX[hł͂Ȃ)', P2_EDIT_CONF_USER_LONGTEXT), + 'be', array('be_2ch_mail', 'be.2ch.net̓o^[AhX', P2_EDIT_CONF_USER_LONGTEXT), - array('p2_2ch_host', 'p2 (p2.2ch.net) Ŋ蓖ĂĂT[o[', P2_EDIT_CONF_USER_LONGTEXT), - array('p2_2ch_mail', 'p2̓o^[AhX', P2_EDIT_CONF_USER_LONGTEXT), - array('p2_2ch_pass', 'p2̃OCpX[h', P2_EDIT_CONF_USER_LONGTEXT | P2_EDIT_CONF_USER_PASSWORD), - array('p2_2ch_ignore_cip', ' p2.2ch.net CookieF؎IPAhX̓ꐫ`FbN'), + array('be_2ch_password', 'be.2ch.net̃pX[h(F؃R[h͎gȂȂ܂)', P2_EDIT_CONF_USER_PASSWORD), + array('be_2ch_DMDM', 'be.2ch.netDMDM(蓮ݒ肷ꍇ̂ݓ)', P2_EDIT_CONF_USER_LONGTEXT), + array('be_2ch_MDMD', 'be.2ch.netMDMD(蓮ݒ肷ꍇ̂ݓ)', P2_EDIT_CONF_USER_LONGTEXT), ); printEditConfGroupHtml($groupname, $conflist, $flags); } @@ -282,6 +281,9 @@ array('cmp_dayres_midoku', '\[gɐVX̂XD'), array('cmp_title_norm', '^Cg\[gɑSppE啶𖳎'), array('viewall_kitoku', 'X͕\Ɋւ炸\'), + array('delete_copyright', 'Xbh̃^Cg璘쌠\L폜'), + array('delete_copyright.list', '폜钘쌠\L̕(J}؂)'), + array('birth_format', 'Xbh쐬̕\tH[}bg'), ); printEditConfGroupHtml($groupname, $conflist, $flags); } @@ -304,8 +306,6 @@ array('pre_thumb_limit', '摜URL̐ǂ݃TlCxɕ\鐧 (0Ŗ)'), // array('pre_thumb_height', '摜TlC̏c̑傫w (sNZ)'), // array('pre_thumb_width', '摜TlC̉̑傫w (sNZ)'), - array('link_youtube', 'YouTubẽNvr[\
    (蓮̏ꍇURL̉showNbNĕ\)'), - array('link_niconico', 'jRjR̃Nvr[\
    (蓮̏ꍇURL̉showNbNĕ\)'), array('iframe_popup', 'HTML|bvAbv'), array('iframe_popup_event', 'HTML|bvAbvꍇ̃Cxg'), array('iframe_popup_type', 'HTML|bvAbv̎'), @@ -333,6 +333,7 @@ array('coloredid.click', 'IDoNbNƒFgO(uȂvɂJavascriptł͂ȂPHPŒF)'), array('coloredid.marking.colors', 'IDo_uNbNă}[LO̐FXg(J}؂)'), array('coloredid.coloring.type', 'J[Õ^CvithermonłPHPŒF(coloredid.click=Ȃ)̏ꍇ̂ݗLj'), + array('machibbs.disphost.enable', '܂BBSŃ[gzXg\'), ); printEditConfGroupHtml($groupname, $conflist, $flags); } @@ -352,13 +353,44 @@ array('ngaborn_frequent_num', 'poIDځ[̂l (o񐔂ȏIDځ[)'), array('ngaborn_frequent_dayres', '̑Xł͕poIDځ[񂵂Ȃ
    (X/XĂ̓A0Ȃ疳)'), array('ngaborn_chain', 'ANGځ[
    uvȂ炠ځ[񃌃Xւ̃X͂ځ[ANGXւ̃XNGB
    uׂNGɂv̏ꍇAځ[񃌃Xւ̃XNGɂB'), - array('ngaborn_chain_all', '\͈͊ÕXANGځ[̑Ώۂɂ
    (y邽߁AftHgł͂Ȃ)'), - array('ngaborn_daylimit', '̊ԁANGځ[HITȂ΁Ao^[hIɊO ()'), + array('ngaborn_auto', 'NGځ[̑ΏۂɂȂXIDINGځ[񂷂
    uvȂ炠ځ[񃌃XID͂ځ[ANGXIDNGB'), + array('ngaborn_chain_all', '\͈͊ÕXANG/ځ[/nCCg̑Ώۂɂ
    (y邽߁AftHgł͂Ȃ)'), + array('ngaborn_daylimit', '̊ԁANG/ځ[/nCCgHITȂ΁Ao^[hIɊO ()'), array('ngaborn_purge_aborn', 'ځ[񃌃X͕sŽdivubN`悵Ȃ'), ); printEditConfGroupHtml($groupname, $conflist, $flags); } +// }}} +// {{{ '2ch API' + +$groupname = '2ch API'; +$groups[] = $groupname; +$flags = getGroupShowFlags($groupname); +if ($flags & P2_EDIT_CONF_USER_SKIPPED) { + $keep_old = true; +} else { + $conflist = array( + array('2chapi_use','2ch API gp'), + array('2chapi_interval','2ch API F؂Ԋu(P:)'), + 'APIF؏(SĕK{)', + array('2chapi_appkey','AppKey', P2_EDIT_CONF_USER_LONGTEXT), + array('2chapi_hmkey','HMkey', P2_EDIT_CONF_USER_LONGTEXT), + array('2chapi_appname','AppName APIɑMAvP[V :Hoge/1.00'), + 'User-Agent', + array('2chapi_ua.auth','APIF؂ɎgpUser-Agent'), + array('2chapi_ua.read','DAT擾ɎgpUser-Agent'), + 'SSLʐMݒ', + array('2chapi_ssl.auth','APIF؂SSLgp'), + array('2chapi_ssl.read','DAT擾SSLgp'), + 'fobOp', + array('2chapi_debug_print','fobOp̏o͂'), + 'F؏ύXꍇĔF؂Ă', + array('2chapi_post','QlŏލۂAPISIDgpil@\j'), + ); + printEditConfGroupHtml($groupname, $conflist, $flags); +} + // }}} // {{{ ETC @@ -369,10 +401,12 @@ $keep_old = true; } else { $conflist = array( + '3yC', array('frame_menu_width', 't[ ƒj[ ̕\'), array('frame_subject_width', 't[E Xꗗ ̕\'), array('frame_read_width', 't[E X{ ̕\'), - + array('pane_mode', '3yCʂ̃t[̕ו'), + '', array('my_FROM', 'Xݎ̃ftHg̖O'), array('my_mail', 'Xݎ̃ftHgmail'), @@ -382,23 +416,41 @@ array('rct_rec_num', 'ŋߓǂ񂾃X̋L^'), array('res_hist_rec_num', 'ݗ̋L^'), array('res_write_rec', 'ݓeOL^'), + array('res_popup_reload', '|bvAbv珑ݐXēǂݍ݂'), + 'OURLEuN`FbJ', array('through_ime', 'OURLWvۂɒʂQ[g
    uځvłCookiegȂ[ł gate.php ʂ'), array('through_ime_http_only', ' HTTPSŃANZXĂƂ͊OURLQ[gʂȂ
    (ŋ߂WebuEȖ https http ̑JڂReferer𑗏o܂񂪁A
    uHTTPSł͒vɂꍇ́Ag̃uEU̎dlmFĂ)'), array('ime_manual_ext', 'Q[gŎ]ȂgqiJ}؂ŁAgq̑ÕsIh͕svj'), - array('join_favrank', 'CɃXLɎQ'), + array('brocra_checker_use', 'uN`FbJ (‚, ‚Ȃ)'), + array('brocra_checker_url', 'uN`FbJURL'), + array('brocra_checker_query', 'uN`FbJ̃NG[ (̏ꍇAPATH_INFOURLn)'), + 'ƒj[ECɔ', +// array('join_favrank', 'CɃXLɎQ'), array('merge_favita', 'Cɔ‚̃Xꗗ܂Ƃ߂ĕ\ (Cɔ‚̐ɂĂ͏ɎԂ)'), array('favita_order_dnd', 'hbOhbvłCɔ‚בւ'), array('enable_menu_new', 'ƒj[ɐV\'), array('menu_refresh_time', 'ƒj[̎XVԊu (wB0Ȃ玩XVȂ)'), array('menu_hide_brds', 'ƒJeSꗗ‚Ԃɂ'), - array('brocra_checker_use', 'uN`FbJ (‚, ‚Ȃ)'), - array('brocra_checker_url', 'uN`FbJURL'), - array('brocra_checker_query', 'uN`FbJ̃NG[ (̏ꍇAPATH_INFOURLn)'), - array('proxy_use', 'vLV𗘗p'), - array('proxy_host', 'vLVzXg ex)"127.0.0.1", "p2proxy.example"'), - array('proxy_port', 'vLV|[g ex)"8080"'), - array('precede_openssl', 'OCA܂opensslŎ݂
    (OpenSSLÓIɃNĂKv)'), - array('precede_phpcurl', 'curlgAR}hCłPHP֐łǂD悷邩'), + 'vLV', + array('proxy_use', 'vLV𗘗p'), + array('proxy_host', 'vLVzXg ex)"127.0.0.1", "p2proxy.example"'), + array('proxy_port', 'vLV|[g ex)"8080"'), + array('proxy_user', 'vLV[U[ (gpꍇ̂)'), + array('proxy_password', 'vLVpX[h (gpꍇ̂)'), + array('proxy_mode', 'vLV̎(l)'), + 'Tor f(l)', + array('tor_use', 'Tor f(.onion hC)̃ANZX Tor gp'), + array('tor_proxy_host', 'Tor vLVzXg ex)"127.0.0.1", "p2proxy.example"'), + array('tor_proxy_port', 'Tor vLV|[g ex)"8080"'), + array('tor_proxy_user', 'Tor vLV[U[ (gpꍇ̂)'), + array('tor_proxy_password', 'Tor vLVpX[h (gpꍇ̂)'), + array('tor_proxy_mode', 'Tor vLV̎'), + 'SSLʐMݒ', + array('ssl_capath', 'SSLʐMŐڑ؂邽߂̏ؖfBNg ex)"/etc/ssl/certs"
    ݒȂēꍇ͐ݒsv'), + array('2ch_ssl.subject', '2ch.netsubjec.txtSETTING.TXT̎擾SSLgp'), + array('2ch_ssl.post', '2ch.net݂̏SSLgp'), + 'Qlݒ', + array('disp_ronin_expiration', 'Ql̗L\'), ); printEditConfGroupHtml($groupname, $conflist, $flags); } @@ -570,8 +622,8 @@ $conflist = array( array('expack.spm.kokores', 'ɃX'), array('expack.spm.kokores_orig', 'ɃXŊJtH[ɌX̓e\'), - array('expack.spm.ngaborn', 'ځ[񃏁[hENG[ho^'), - array('expack.spm.ngaborn_confirm', 'ځ[񃏁[hENG[ho^ɊmF'), + array('expack.spm.ngaborn', 'ځ[/NG/nCCg[ho^'), + array('expack.spm.ngaborn_confirm', 'ځ[/NG/nCCg[ho^ɊmF'), array('expack.spm.filter', 'tB^O'), array('expack.spm.filter_target', 'tB^OʂJt[܂̓EChE'), ); @@ -666,6 +718,8 @@ array('expack.ic2.fav_auto_rank', 'CɃXɓo^ĂX̉摜ɎNݒ肷'), array('expack.ic2.fav_auto_rank_setting', 'CɃX̉摜Nݒ肷ꍇ̐ݒl(J}؂)[C0̃Nl,C1̃Nl, , ,]'), array('expack.ic2.fav_auto_rank_override', 'CɃX̉摜Nݒ肷ꍇɁALbVς݉摜ɎN㏑邩'), + array('expack.ic2.getter_conn_timeout', 'T[oɐڑۂɃ^CAEg܂ł̎ԁibj[0 => http_conn_timeout Ɉˑ]'), + array('expack.ic2.getter_read_timeout', '_E[h^CAEg܂ł̎ԁibj[0 => http_read_timeout Ɉˑ]'), ); printEditConfGroupHtml($groupname, $conflist, $flags); } @@ -798,6 +852,9 @@ $keep_old = true; } else { $conflist = array( + 'samba ^C}[', + array('wiki.samba_timer', 'samba ^C}[𗘗p'), + array('wiki.samba_cache', 'samba ̃LbV'), '摜uURL', array('wiki.replaceimageurl.extract_cache', '摜uURLEXTRACTLbV'), 'X}[g|bvAbvj[Oc[', @@ -816,6 +873,83 @@ echo << + +
    +

    +liveݒ

    +
    \n +EOP; +} + +// {{{ +liveݒ +// {{{ +live - \ݒ + +$groupname = '\ݒ'; +$groups[] = $groupname; +$flags = getGroupShowFlags($groupname); +if ($flags & P2_EDIT_CONF_USER_SKIPPED) { + $keep_old = true; +} else { + $conflist = array( + array('live.livebbs_list', '(J}؂)'), + 'p\ւ̃N', + array('live.livelink_subject', 'XbhꗗɎp\ւ̃N\'), + array('live.livelink_thread', 'X\̃wb_ƃtb^[Ɏp\ւ̃N\'), + array('live.livebbs_forcelive', '‚̃XbhɎp\ŊJ'), + 'X\', + array('live.view_type', 'X\̎'), + array('live.id_b', 'ID O (g) P (p2) Q (tuEU) i (iPhone)𑾎'), + array('live.highlight_chain', 'AnCCg (A͈͂ ngaborn_chain_all ɂĐݒ)'), + ); + printEditConfGroupHtml($groupname, $conflist, $flags); +} + +// }}} +// {{{ +live - ݒ + +$groupname = 'ݒ'; +$groups[] = $groupname; +$flags = getGroupShowFlags($groupname); +if ($flags & P2_EDIT_CONF_USER_SKIPPED) { + $keep_old = true; +} else { + $conflist = array( + array('live.before_respointer', '\郌X (100ȉ)'), + array('live.post_width', 't[̍ (px)'), + array('live.bbs_noname', 'ftHg̖̕\'), + array('live.mail_sage', 'sage '), + array('live.msg', 'SẲsƃXy[X̍폜'), + array('live.res_button', '[ɃX] ̕@'), + array('live.write_regulation', 'Kp^C}['), + array('live.ic2_onoff', 'ImageCache2̃TlC쐬'), + ); + printEditConfGroupHtml($groupname, $conflist, $flags); +} + +// }}} +// {{{ +live - [h/XN[ + +$groupname = '[h/XN['; +$groups[] = $groupname; +$flags = getGroupShowFlags($groupname); +if ($flags & P2_EDIT_CONF_USER_SKIPPED) { + $keep_old = true; +} else { + $conflist = array( + array('live.reload_time', 'I[g[h̊Ԋu'), + array('live.scroll_move', 'I[gXN[̊炩 (ł炩 1 AXN[ 0)'), + array('live.scroll_speed', 'I[gXN[̑x
    (ő 1 AXN[̏ꍇ͏̊炩̒l 0 )'), + ); + printEditConfGroupHtml($groupname, $conflist, $flags); +} + +// }}} +// }}} + +// PCp\ +if (empty($_conf['ktai'])) { + echo << +
    \n EOP; // gїp\ @@ -847,6 +981,8 @@ if ($_conf['iphone']) { if ($groupname == 'tGrep') { echo ''; + } elseif ($groupname == '\ݒ') { + echo ''; } elseif ($groupname == 'subject-i') { echo ''; } @@ -929,7 +1065,7 @@ function applyRules() } } -// }}} +// }}} // {{{ tB^֐ // emptyToDef() Ȃǂ̃tB^EditConfFiterNXȂǂɂ܂Ƃ߂\ // {{{ emptyToDef() diff --git a/rep2/edit_ng_thread.php b/rep2/edit_ng_thread.php deleted file mode 100644 index 68065aec3..000000000 --- a/rep2/edit_ng_thread.php +++ /dev/null @@ -1,223 +0,0 @@ -authorize(); // [UF - -if (!empty($_POST['submit_save']) || !empty($_POST['submit_default'])) { - if (!isset($_POST['csrfid']) || $_POST['csrfid'] != P2Util::getCsrfId()) { - die('p2 error: sȃ|Xgł'); - } -} - -$ngThreadCtl = new NgThreadCtl(); - -//===================================================================== -// O -//===================================================================== - -// {{{ ۑ{^ĂAݒۑ - -if (!empty($_POST['submit_save'])) { - - if ($ngThreadCtl->save($POST['nga']) != false) { - $_info_msg_ht .= '

    ݒXVۑ܂

    '; - } else { - $_info_msg_ht .= '

    ~ݒXVۑł܂ł

    '; - } - -// }}} -// {{{ ftHgɖ߂{^Ă - -} elseif (!empty($_POST['submit_default'])) { - if ($ngThreadCtl->clear()) { - $_info_msg_ht .= '

    Xgɂ܂

    '; - } else { - $_info_msg_ht .= '

    ~Xgɂł܂ł

    '; - } -} - -// }}} -// {{{ Xgǂݍ - -$formdata = $ngThreadCtl->load(); - -// }}} - -//===================================================================== -// vgݒ -//===================================================================== -$ptitle_top = 'NGXbhҏW'; -$ptitle = strip_tags($ptitle_top); - -$csrfid = P2Util::getCsrfId(); - -//===================================================================== -// vg -//===================================================================== -// wb_HTMLvg -P2Util::header_nocache(); -echo $_conf['doctype']; -echo << - - {$_conf['meta_charset_ht']} - - - - {$ptitle}\n -EOP; - -if (!$_conf['ktai']) { - echo << - - - \n -EOP; -} - -$body_at = ($_conf['ktai']) ? $_conf['k_colors'] : ' onLoad="top.document.title=self.document.title;"'; -echo << -\n -EOP; - -// PCp\ -if (!$_conf['ktai']) { - echo <<ݒǗ > {$ptitle_top}

    \n -EOP; -} else { - echo basename($path) . "
    "; -} - -// PCp\ -if (!$_conf['ktai']) { - $htm['form_submit'] = << -
    - \n -EOP; -// gїp\ -} else { - $htm['form_submit'] = <<
    \n -EOP; -} - -// 񃁃bZ[W\ -if (!empty($_info_msg_ht)) { - echo $_info_msg_ht; - $_info_msg_ht = ""; -} - -$usage = << -
  • ~: 폜
  • -
  • [h: NG/ځ[񃏁[h (ɂƓo^)
  • -
  • i: 啶𖳎
  • -
  • re: K\
  • -
  • : newsplus,software (Sv, J}؂)
  • - -EOP; -if ($_conf['ktai']) { - $usage = mb_convert_kana($usage, 'k'); -} -echo << - {$_conf['k_input_ht']} - - - \n -EOP; - -// PCp\itablej -if (!$_conf['ktai']) { - echo << -
    - - - - - - - - - - \n -EOP; - $row_format = << - - - - - - - \n -EOP; -// gїp\ -} else { - echo "VKo^
    \n"; - $row_format = <<
    -: -i -re -~
    - -(%6\$d)
    \n -EOP; -} - -printf($row_format, -1, '', '', '', '', '--', 0); - -echo $htm['form_submit']; -if (!empty($formdata)) { - foreach ($formdata as $k => $v) { - printf($row_format, - $k, - p2h($v['word']), - $v['ignorecase'], - $v['regex'], - p2h($v['bbs']), - p2h($v['lasttime']), - p2h($v['hits']) - ); - } - echo $htm['form_submit']; -} - -// PCȂ -if (!$_conf['ktai']) { - echo '
    ', $table); @@ -1587,7 +1313,7 @@ static public function mkTrip($key) //if (strlen($key) > 8) { // return self::mkTrip1(substr($key, 0, 8)); //} else { - return self::mkTrip1($key); + return self::mkTrip1($key); //} } @@ -1636,47 +1362,6 @@ static public function mkTrip2($key) return str_replace('+', '.', substr(base64_encode(sha1($key, true)), 0, 12)); } - // }}} - // {{{ getWebPage - - /** - * Weby[W擾 - * - * 200 OK - * 206 Partial Content - * 304 Not Modified s - * - * @return array|false y[WeԂBsfalseԂB - */ - static public function getWebPage($url, &$error_msg, $timeout = 15) - { - $params = array("timeout" => $timeout); - - if (!empty($_conf['proxy_use'])) { - $params['proxy_host'] = $_conf['proxy_host']; - $params['proxy_port'] = $_conf['proxy_port']; - } - - $req = new HTTP_Request($url, $params); - //$req->addHeader("X-PHP-Version", phpversion()); - - $response = $req->sendRequest(); - - if (PEAR::isError($response)) { - $error_msg = $response->getMessage(); - } else { - $code = $req->getResponseCode(); - if ($code == 200 || $code == 206) { // || $code == 304) { - return $req->getResponseBody(); - } else { - //var_dump($req->getResponseHeader()); - $error_msg = $code; - } - } - - return false; - } - // }}} // {{{ getMyUrl() @@ -1793,23 +1478,6 @@ static public function hasInfoHtml() } } - // }}} - // {{{ isNetFront() - - /** - * isNetFront? - * - * @return boolean - */ - static public function isNetFront() - { - if (preg_match('/(NetFront|AVEFront\/|AVE-Front\/)/', $_SERVER['HTTP_USER_AGENT'])) { - return true; - } else { - return false; - } - } - // }}} // {{{ encodeResponseTextForSafari() @@ -1849,62 +1517,104 @@ static public function detectThread($url = null) // XURL̒ڎw if ($nama_url) { - // 2ch or pink - http://choco.2ch.net/test/read.cgi/event/1027770702/ - if (preg_match('<^http://(\\w+\\.(?:2ch\\.net|bbspink\\.com))/test/read\\.(?:cgi|html) - /(\\w+)/([0-9]+)(?:/([^/]*))?>x', $nama_url, $matches)) - { + $host = null; + $bbs = null; + $key = null; + $ls = null; + + // ܂BBS - http://kanto.machi.to/bbs/read.cgi/kanto/1241815559/ + if (preg_match('<^https?://(\\w+\\.machi(?:bbs\\.com|\\.to))/bbs/read\\.cgi + /(\\w+)/(\\d+)(?:/([^/]*))?>x', $nama_url, $matches)) { $host = $matches[1]; $bbs = $matches[2]; $key = $matches[3]; $ls = (isset($matches[4]) && strlen($matches[4])) ? $matches[4] : ''; - // 2ch or pink ߋOhtml - http://pc.2ch.net/mac/kako/1015/10153/1015358199.html - } elseif (preg_match('<^(http://(\\w+\\.(?:2ch\\.net|bbspink\\.com))(?:/[^/]+)?/(\\w+) - /kako/\\d+(?:/\\d+)?/(\\d+)).html>x', $nama_url, $matches)) - { - $host = $matches[2]; - $bbs = $matches[3]; - $key = $matches[4]; - $ls = ''; - $kakolog_url = $matches[1]; - $_GET['kakolog'] = $kakolog_url; - - // ܂BBS - http://kanto.machi.to/bbs/read.cgi/kanto/1241815559/ - } elseif (preg_match('<^http://(\\w+\\.machi(?:bbs\\.com|\\.to))/bbs/read\\.cgi - /(\\w+)/([0-9]+)(?:/([^/]*))?>x', $nama_url, $matches)) - { + // ܂BBS(hĈ) - http://machi.to/bbs/read.cgi/kanto/1241815559/ + } elseif (preg_match('<^https?://(machi\\.to)/bbs/read\\.cgi + /(\\w+)/(\\d+)(?:/([^/]*))?>x', $nama_url, $matches)) { $host = $matches[1]; $bbs = $matches[2]; $key = $matches[3]; $ls = (isset($matches[4]) && strlen($matches[4])) ? $matches[4] : ''; - // JBBS - http://jbbs.livedoor.com/bbs/read.cgi/computer/2999/1081177036/-100 - } elseif (preg_match('<^http://(jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.com))/bbs/read\\.cgi - /(\\w+)/(\\d+)/(\\d+)/((?:\\d+)?-(?:\\d+)?)?[^"]*>x', $nama_url, $matches)) - { + // JBBS - http://jbbs.livedoor.com/bbs/read.cgi/computer/2999/1081177036/-100 + } elseif (preg_match('<^https?://(jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.(?:net|com)))/(?:bbs|bbs/lite)/read\\.cgi + /(\\w+)/(\\d+)/(\\d+)/((?:\\d+)?-(?:\\d+)?)?[^"]*>x', $nama_url, $matches)) { $host = $matches[1] . '/' . $matches[2]; $bbs = $matches[3]; $key = $matches[4]; $ls = isset($matches[5]) ? $matches[5] : ''; - // ܂JBBS - http://kanto.machibbs.com/bbs/read.pl?BBS=kana&KEY=1034515019 - } elseif (preg_match('<^http://(\\w+\\.machi(?:bbs\\.com|\\.to))/bbs/read\\.(?:pl|cgi)\\?(.+)>' , - $nama_url, $matches)) - { + // ܂JBBS - http://kanto.machibbs.com/bbs/read.pl?BBS=kana&KEY=1034515019 + } elseif (preg_match('<^https?://(\\w+\\.machi(?:bbs\\.com|\\.to))/bbs/read\\.(?:pl|cgi)\\?(.+)>', + $nama_url, $matches)) { $host = $matches[1]; list($bbs, $key, $ls) = self::parseMachiQuery($matches[2]); - } elseif (preg_match('<^http://((jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.com))(?:/(\\w+))?)/bbs/read\\.(?:pl|cgi)\\?(.+)>', - $nama_url, $matches)) - { + } elseif (preg_match('<^https?://((jbbs\\.(?:livedoor\\.(?:jp|com)|shitaraba\\.(?:net|com)))(?:/(\\w+))?)/bbs/read\\.(?:pl|cgi)\\?(.+)>', + $nama_url, $matches)) { $host = $matches[1]; list($bbs, $key, $ls) = self::parseMachiQuery($matches[4]); - } else { - $host = null; - $bbs = null; - $key = null; - $ls = null; + // vip2ch.com - http://ex14.vip2ch.com/test/read.cgi/news4ssnip/1450958506/ + } elseif (preg_match('<^https?://((\\w+)\\.vip2ch\\.com)/(?:test|i)/(?:read\\.(?:cgi|html|so)|mread\\.cgi|read)/(\\w+)/(\\d+)(?:/([^/]*))?>x', $nama_url, $matches)) { + $host = $matches[1]; + $bbs = $matches[3]; + $key = $matches[4]; + $ls = (isset($matches[5]) && strlen($matches[5])) ? $matches[5] : ''; + + // vip2ch.com - http://ex14.vip2ch.com/i/responce.html?bbs=news4ssnip&dat=1450958506 + } elseif (preg_match('<^https?://((\\w+)\\.vip2ch\\.com)/i/(?:responce|responce_r18)\\.html\\?bbs=(\\w+)&dat=(\\d+)(?:/([^/]*))?>x', $nama_url, $matches)) { + $host = $matches[1]; + $bbs = $matches[3]; + $key = $matches[4]; + $ls = (isset($matches[5]) && strlen($matches[5])) ? $matches[5] : ''; + + // itest - https://itest.5ch.net/hayabusa9/test/read.cgi/mnewsplus/1510531889 + } elseif (preg_match('<^https?://(itest\\.(?:[25]ch\\.net|bbspink\\.com))/(\\w+)/test/read\\.cgi/(\\w+)/(\\d+)(?:/(.+$))?>x', $nama_url, $matches)) { + $host = str_replace("itest", $matches[2], $matches[1]); + $bbs = $matches[3]; + $key = $matches[4]; + $ls = (isset($matches[5]) && strlen($matches[5])) ? $matches[5] : ''; + + // 2ch or pink - http://choco.2ch.net/test/read.cgi/event/1027770702/ + } elseif (preg_match('<^https?://(.+)/test/(?:read|r)\\.(?:cgi|html|so|php) + /(\\w+)/([0-9]+)(?:/([^/]*))?>x', $nama_url, $matches)) { + if (P2HostMgr::isRegisteredBbs($matches[1], $matches[2])) { + $host = $matches[1]; + $bbs = $matches[2]; + $key = $matches[3]; + $ls = (isset($matches[4]) && strlen($matches[4])) ? $matches[4] : ''; + } + + // 2ch or pink by ula.cc(bintan / bekkanko) - http://bintan.ula.cc/test/read.cgi/lavender.2ch.net/chakumelo/1509563851/ + } elseif (preg_match('<^https?://(?:(?:bintan|same)\\.ula\\.cc|ula\\.(?:[25]ch\\.net|bbspink\\.com))/test/(?:read\\.(?:cgi|html|so)|r\\.so) + /(.+)/(\\w+)/([0-9]+)(?:/([^/]*))>x', $nama_url, $matches)) { + $host = $matches[1]; + $bbs = $matches[2]; + $key = $matches[3]; + $ls = (isset($matches[4]) && strlen($matches[4])) ? $matches[4] : ''; + + // 2ch or pink by ula.cc(new bintan) - http://bintan.ula.cc/2ch/chakumelo/lavender.2ch.net/1509563851/ + } elseif (preg_match('<^https?://(?:(?:bintan|same)\\.ula\\.cc|ula\\.(?:[25]ch\\.net|bbspink\\.com))/[25]ch + /(\\w+)/(.+)/(\\d+)(?:/([^/]*))>x', $nama_url, $matches)) { + $host = $matches[2]; + $bbs = $matches[1]; + $key = $matches[3]; + $ls = (isset($matches[5]) && strlen($matches[5])) ? $matches[5] : ''; + + // 2ch or pink ߋOhtml - http://pc.2ch.net/mac/kako/1015/10153/1015358199.html + } elseif (preg_match('<^(https?://(.+)(?:/[^/]+)?/(\\w+) + /kako/\\d+(?:/\\d+)?/(\\d+)).html>x', $nama_url, $matches)) { + if (P2HostMgr::isRegisteredBbs($matches[2], $matches[3])) { + $host = $matches[2]; + $bbs = $matches[3]; + $key = $matches[4]; + $ls = ''; + $kakolog_url = $matches[1]; + $_GET['kakolog'] = $kakolog_url; + } } // ␳ @@ -1914,9 +1624,9 @@ static public function detectThread($url = null) } else { $host = isset($_REQUEST['host']) ? $_REQUEST['host'] : null; // "pc.2ch.net" - $bbs = isset($_REQUEST['bbs']) ? $_REQUEST['bbs'] : null; // "php" - $key = isset($_REQUEST['key']) ? $_REQUEST['key'] : null; // "1022999539" - $ls = isset($_REQUEST['ls']) ? $_REQUEST['ls'] : null; // "all" + $bbs = isset($_REQUEST['bbs']) ? $_REQUEST['bbs'] : null; // "php" + $key = isset($_REQUEST['key']) ? $_REQUEST['key'] : null; // "1022999539" + $ls = isset($_REQUEST['ls']) ? $_REQUEST['ls'] : null; // "all" } return array($nama_url, $host, $bbs, $key, $ls); @@ -1928,7 +1638,7 @@ static public function detectThread($url = null) /** * ܂JBBS̃Xbhw肷QUERY_STRING͂ * - * @param string $query + * @param string $query * @return array */ static public function parseMachiQuery($query) @@ -1969,9 +1679,9 @@ static public function parseMachiQuery($query) /** * HTMLDOMDocument𐶐 * - * @param string $html - * @param string $charset - * @param bool $report_error + * @param string $html + * @param string $charset + * @param bool $report_error * @return DOMDocument */ static public function getHtmlDom($html, $charset = null, $report_error = true) @@ -2016,58 +1726,257 @@ static public function getHtmlDom($html, $charset = null, $report_error = true) */ static public function getHostGroupName($host) { - if (self::isHost2chs($host)) { - return '2channel'; - } elseif (self::isHostMachiBbs($host)) { - return 'machibbs'; - } elseif (self::isHostJbbsShitaraba($host)) { - return 'shitaraba'; - } else { - return $host; - } + return P2HostMgr::getHostGroupName($host); } // }}} - // {{{ getP2Client() + // {{{ rawurlencodeCallback() + + /** + * preg_replace_callback()̃R[obN֐Ƃ + * }b`ӏŜrawurlencode() + * + * @param array $m + * @return string + */ + static public function rawurlencodeCallback(array $m) + { + return rawurlencode($m[0]); + } + + // }}} + // {{{ isEnableBe2ch() + /** + * begp”\Ȑݒ肩ׂ + * @access public + * @return boolean + */ + static public function isEnableBe2ch() + { + global $_conf; + + if ( + strlen($_conf['be_2ch_password']) && $_conf['be_2ch_mail'] + || strlen($_conf['be_2ch_DMDM']) && $_conf['be_2ch_MDMD'] + //|| isset($_COOKIE['DMDM']) && isset($_COOKIE['MDMD']) + ) { + return true; + } + return false; + } + // }}} + // {{{ /** - * P2ClientNX̃CX^X𐶐 + * [U[ݒ肵AJEgŁAbe.2ch.netɃOCDMDM, MDMD擾 + * iF؃R[hurlencodeꂽ܂܂̏ԁj * - * @param void - * @return P2Client + * @access public + * @param string $host BeF؂zXg + * @return array|false|null F؃R[hz|F؂łȂ|ݒ肾 */ - static public function getP2Client() + static public function getBe2chCodeWithUserConf($host) { global $_conf; - if (!is_dir($_conf['db_dir'])) { - FileCtl::mkdirRecursive($_conf['db_dir']); + if ($_conf['be_2ch_mail'] && strlen($_conf['be_2ch_password'])) { + $r = self::_getBe2chCodeByMailPass($_conf['be_2ch_mail'], $_conf['be_2ch_password'], $host); + if (is_array($r)) { + return $r; + } + return false; } + return null; + } + + // }}} + // {{{ + /** + * be.2ch.netɃOCDMDM, MDMD擾 + * iF؃R[hurlencodeꂽ܂܂̏ԁj + * + * @access private + * @param string $host BeF؂zXg + * @return array|string |G[bZ[W + */ + static private function _getBe2chCodeByMailPass($mail, $pass, $host) + { + global $_conf; + + $url = http_build_url(array( + "scheme" => $_conf['2ch_ssl.post'] ? "https" : "http", + "host" => P2HostMgr::isHost5ch($host) ? "be.5ch.net" : "be.2ch.net", + "path" => "index.php")); try { - return new P2Client("http://{$_conf['p2_2ch_host']}/p2/", - $_conf['p2_2ch_mail'], - $_conf['p2_2ch_pass'], - $_conf['db_dir'], - (bool)$_conf['p2_2ch_ignore_cip']); - } catch (P2Exception $e) { - p2die($e->getMessage()); + $req = P2Commun::createHTTPRequest($url, HTTP_Request2::METHOD_POST); + + $req->setHeader('User-Agent', P2Commun::getP2UA(true, true)); + + $req->addPostParameter('mail', $mail); + $req->addPostParameter('pass', $pass); + $req->addPostParameter('login', 'OC'); + + $response = P2Commun::getHTTPResponse($req); + + $code = $response->getStatus(); + // Ƃ݂ȂR[h + if ($code == 302) { + //return $req->getResponseBody(); + if ($cookies = $response->getCookies()) { // urlencodeꂽ + $r = array(); + foreach ($cookies as $cookie) { + if (in_array($cookie['name'], array('DMDM', 'MDMD'))) { + $r[$cookie['name']] = $cookie['value']; + } + } + if (!empty($r['DMDM']) && !empty($r['MDMD'])) { + return $r; + } + } + } + + } catch (Exception $e) { + return false; // $error_msg } + + return false; // $error_msg } // }}} - // {{{ rawurlencodeCallback() /** - * preg_replace_callback()̃R[obN֐Ƃ - * }b`ӏŜrawurlencode() + * +Wiki:vtB[IDBEIDvZ * - * @param array $m - * @return string + * @return integer|0 BEIDԂBs0ԂB */ - static public function rawurlencodeCallback(array $m) + public static function calcBeId($prof_id) { - return rawurlencode($m[0]); + for ($y = 2; $y <= 9; $y++) { + for ($x = 2; $x <= 9; $x++) { + $id = (($prof_id - $x * 10.0 - $y) / 100.0 + $x - $y - 5.0) / (3.0 * $x * $y); + if ($id == floor($id)) { + return $id; + } + } + } + return 0; + } + + // }}} + // {{{ checkRoninExpiration() + + /** + * Ql ID ̗LmF + * + * @return boolean Ql ID true + */ + function checkRoninExpiration() + { + global $_conf; + + if($_conf['disp_ronin_expiration'] === "3"){ + return true; + } + + $url = 'https://auth.bbspink.com/auth/timecheck.php'; + + if($_conf['2chapi_use'] == 1) { + if(empty($_conf['2chapi_appname'])) { + self::pushInfoHtml("

    p2 error: 2chƒʐM邽߂ɕKvȏ񂪐ݒ肳Ă܂B

    "); + return false; + } + $agent = sprintf($_conf['2chapi_ua.auth'], $x_2ch_ua); + $x_2ch_ua = $_conf['2chapi_appname']; + } else { + $agent = 'DOLIB/1.00'; + $x_2ch_ua = self::getP2UA(false,false); + } + + // 2chQl<>ID, PWݒǂݍ + if ($array = self::readIdPw2ch()) { + list($login2chID, $login2chPW, $autoLogin2ch) = $array; + + } else { + return false; + } + + try { + $req = P2Commun::createHTTPRequest($url, HTTP_Request2::METHOD_POST); + + $req->setHeader('User-Agent', $agent); + $req->setHeader('X-2ch-UA', $x_2ch_ua); + + $req->addPostParameter('email', $login2chID); + $req->addPostParameter('pass', $login2chPW); + + // POSTf[^̑M + $res = P2Commun::getHTTPResponse($req); + + $code = $res->getStatus(); + if ($code != 200) { + self::pushInfoHtml("

    p2 Error: HTTP Error({$code})

    "); + } else { + $body = $res->getBody(); + } + } catch (Exception $e) { + self::pushInfoHtml("

    p2 Error: Ql<>̔F؊mFT[oɐڑo܂łB({$e->getMessage()})

    "); + } + + // ڑsȂ + if (empty($body)) { + self::pushInfoHtml('

    p2 info: Ql<>IDɊւmFsɂ́APHPcURL֐OpenSSL֐LłKv܂B

    '); + + self::pushInfoHtml("

    p2 error: Ql<>̗LmFɎs܂B{$curl_msg}

    "); + return false; + } + + $body = trim($body); + + // G[o + if (preg_match('/ERROR (\d+): (.*)/', $body, $matches)) { + self::pushInfoHtml("

    p2 error: Ql<>̗LmFɎs܂B{$matches[2]}[{$matches[1]}]

    "); + return false; + } + + // AJEgo^ + if (preg_match('/User does not exists/', $body, $matches)) { + self::pushInfoHtml("

    p2 error: QlAJEgo^Ă܂

    "); + return false; + } + + // L擾 + if (!preg_match('/Date of expiration: (\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)/', $body, $matches)) { + self::pushInfoHtml("

    p2 error: L擾ł܂ł

    "); + return false; + } + + // ^C][ꎞύX + date_default_timezone_set('America/Los_Angeles'); + $expiration = mktime ($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); + + date_default_timezone_set(ini_get('date.timezone')); + $date = date("Y/m/d H:i:s", $expiration); + + // L`FbN + if (time() >= $expiration) { + self::pushInfoHtml("

    p2 error: Ql<>̗L؂ł L:{$date}

    "); + return true; + } + + if( + $_conf['disp_ronin_expiration'] === "1" + || ($_conf['disp_ronin_expiration'] === "2" && basename($_SERVER["SCRIPT_NAME"]) !== $_conf['title_php']) + ){ + return true; + } + + self::pushInfoHtml("

    p2 info: Ql<>̗L {$date} ł

    "); + return true; } // }}} @@ -2078,12 +1987,6 @@ static public function debug() echo PHP_EOL; echo '/', '*', '
    ', PHP_EOL;
             echo p2h(print_r(self::$_hostDirs, true)), PHP_EOL;
    -        echo p2h(print_r(array_map('intval', self::$_hostIs2chs), true)), PHP_EOL;
    -        //echo p2h(print_r(array_map('intval', self::$_hostIsBe2chNet), true)), PHP_EOL;
    -        echo p2h(print_r(array_map('intval', self::$_hostIsBbsPink), true)), PHP_EOL;
    -        echo p2h(print_r(array_map('intval', self::$_hostIsMachiBbs), true)), PHP_EOL;
    -        echo p2h(print_r(array_map('intval', self::$_hostIsMachiBbsNet), true)), PHP_EOL;
    -        echo p2h(print_r(array_map('intval', self::$_hostIsJbbsShitaraba), true)), PHP_EOL;
             echo '
    ', '*', '/', PHP_EOL; } */ diff --git a/lib/ResFilterElement.php b/lib/ResFilterElement.php index c5a505ddd..2e55dd43d 100644 --- a/lib/ResFilterElement.php +++ b/lib/ResFilterElement.php @@ -161,7 +161,7 @@ static private function _getSelectField(array $fields, $default, $key, $name = p2h($name); $id = p2h($id); - $html = ""; foreach ($fields as $value => $label) { if ($value == $default) { if ($xhtml) { diff --git a/lib/SettingTxt.php b/lib/SettingTxt.php index 523a9d371..027131616 100644 --- a/lib/SettingTxt.php +++ b/lib/SettingTxt.php @@ -28,6 +28,7 @@ class SettingTxt */ public function __construct($host, $bbs) { + global $_conf; $this->_cache_interval = 60 * 60 * 12; // LbV12ԗL $this->_host = $host; @@ -37,8 +38,13 @@ public function __construct($host, $bbs) $this->_setting_txt = $dat_host_bbs_dir_s . 'SETTING.TXT'; $this->_setting_srd = $dat_host_bbs_dir_s . 'p2_kb_setting.srd'; - $this->_url = 'http://' . $host . '/' . $bbs . '/SETTING.TXT'; - //$this->_url = P2Util::adjustHostJbbs($this->_url); // ΂livedoorړ]ɑΉBǍlivedoorƂB + // ڑ悪2ch.netȂSSLʐMs(pink͑ΉĂȂ̂łȂ) + if (P2HostMgr::isHost2chs($host) && ! P2HostMgr::isHostBbsPink($host) && $_conf['2ch_ssl.subject']) { + $this->_url = 'https://' . $host . '/' . $bbs . '/SETTING.TXT'; + } else { + $this->_url = 'http://' . $host . '/' . $bbs . '/SETTING.TXT'; + } + //$this->_url = P2HostMgr::adjustHostJbbs($this->_url); // ΂livedoorړ]ɑΉBǍlivedoorƂB $this->setting_array = array(); @@ -74,7 +80,7 @@ public function downloadSettingTxt() global $_conf; // ܂BBSE SETTING.TXT ݂Ȃ̂Ƃ - if (P2Util::isHostMachiBbs($this->_host) || P2Util::isHostJbbsShitaraba($this->_host)) { + if (P2HostMgr::isHostMachiBbs($this->_host) || P2HostMgr::isHostJbbsShitaraba($this->_host)) { return false; } @@ -94,38 +100,46 @@ public function downloadSettingTxt() } // DL - $params = array(); - $params['timeout'] = $_conf['http_conn_timeout']; - $params['readTimeout'] = array($_conf['http_read_timeout'], 0); - if ($_conf['proxy_use']) { - $params['proxy_host'] = $_conf['proxy_host']; - $params['proxy_port'] = $_conf['proxy_port']; - } - $req = new HTTP_Request($this->_url, $params); - $modified && $req->addHeader('If-Modified-Since', $modified); - $req->addHeader('User-Agent', "Monazilla/1.00 ({$_conf['p2ua']})"); - - $response = $req->sendRequest(); + try { + $req = P2Commun::createHTTPRequest($this->_url, HTTP_Request2::METHOD_GET); + $modified && $req->setHeader("If-Modified-Since", $modified); - if (PEAR::isError($response)) { - $error_msg = $response->getMessage(); - } else { - $code = $req->getResponseCode(); + $response = P2Commun::getHTTPResponse($req); + $code = $response->getStatus(); if ($code == 302) { // zXg̈ړ]ǐ - $new_host = BbsMap::getCurrentHost($this->_host, $this->_bbs); - if ($new_host != $this->_host) { + $new_host = P2HostMgr::getCurrentHost($this->host, $this->bbs); + if ($new_host != $this->host) { $aNewSettingTxt = new SettingTxt($new_host, $this->_bbs); - $body = $aNewSettingTxt->downloadSettingTxt(); - return true; + return $aNewSettingTxt->downloadSettingTxt(); } - } - - if (!($code == 200 || $code == 206 || $code == 304)) { + } elseif ($code == 200 || $code == 206) { //var_dump($req->getResponseHeader()); + $body = $response->getBody(); + // or be.2ch.net ȂEUCSJISɕϊ + if (P2HostMgr::isHostJbbsShitaraba($this->host) || P2HostMgr::isHostBe2chs($this->host)) { + $body = mb_convert_encoding($body, 'CP932', 'CP51932'); + } + if (FileCtl::file_write_contents($this->_setting_txt, $body) === false) { + p2die('cannot write file'); + } + // p[XăLbVۑ + if (!$this->cacheParsedSettingTxt()) { + return false; + } + } elseif ($code == 304) { + // touch邱ƂōXVC^[ôŁA΂炭ă`FbNȂȂ + // iύXȂ̂ɏCԂXV̂́ACi܂ȂAł͓ɖȂ낤j + touch($this->_setting_txt); + // ɃLbVtouchȂƁA_setting_txt_setting_srdōXVԂA + // 񂱂܂ŏiT[oւ̃wb_NGXgԁjꍇB + touch($this->_setting_srd); + } else { $error_msg = $code; } + } catch (Exception $e) { + $error_msg = $e->getMessage(); } // DLG[ @@ -139,33 +153,6 @@ public function downloadSettingTxt() } - $body = $req->getResponseBody(); - - // DL XVĂۑ - if ($body && $code != '304') { - - // or be.2ch.net ȂEUCSJISɕϊ - if (P2Util::isHostJbbsShitaraba($this->_host) || P2Util::isHostBe2chNet($this->_host)) { - $body = mb_convert_encoding($body, 'CP932', 'CP51932'); - } - - if (FileCtl::file_write_contents($this->_setting_txt, $body) === false) { - p2die('cannot write file'); - } - - // p[XăLbVۑ - if (!$this->cacheParsedSettingTxt()) { - return false; - } - - } else { - // touch邱ƂōXVC^[ôŁA΂炭ă`FbNȂȂ - touch($this->_setting_txt); - // ɃLbVtouchȂƁA_setting_txt_setting_srdōXVԂA - // 񂱂܂ŏiT[oւ̃wb_NGXgԁjꍇB - touch($this->_setting_srd); - } - return true; } diff --git a/lib/ShowBrdMenuPc.php b/lib/ShowBrdMenuPc.php index 06fb6f628..1c90172d9 100644 --- a/lib/ShowBrdMenuPc.php +++ b/lib/ShowBrdMenuPc.php @@ -86,7 +86,7 @@ public function printFavIta() if ($_conf['merge_favita']) { echo <<{$favset_title} (܂Ƃ)
    \n + {$favset_title} (܂Ƃ)
    \n EOP; } @@ -107,7 +107,10 @@ public function printFavIta() if ($favitas) { // V\ꍇE܂Ƃ߂ăvtFb` if ($_conf['enable_menu_new'] && !empty($_GET['new'])) { - if ($_conf['expack.use_pecl_http'] == 1) { + if ($_conf['expack.use_curl_multi'] == 1) { + P2CurlMulti::fetchSubjectTxt($favitas); + $GLOBALS['expack.subject.multi-threaded-download.done'] = true; + } elseif ($_conf['expack.use_pecl_http'] == 1) { P2HttpExt::activate(); P2HttpRequestPool::fetchSubjectTxt($favitas); $GLOBALS['expack.subject.multi-threaded-download.done'] = true; diff --git a/lib/ShowThread.php b/lib/ShowThread.php index cb60b032d..b73ed9dd1 100644 --- a/lib/ShowThread.php +++ b/lib/ShowThread.php @@ -36,7 +36,7 @@ abstract class ShowThread (?P(ftp|h?t?tps?)://([0-9A-Za-z][\\w;/?:@=&$\\-_.+!*\'(),#%\\[\\]^~]+)) # URL ([^\\s<>]*) # URL̒A^OorzCgXy[X܂ł̕ | - (?PID:[ ]?([0-9A-Za-z/.+]{8,11})(?=[^0-9A-Za-z/.+]|$)) # IDi8,10 +PC/gюʃtOj + (?PID:[ ]?([0-9A-Za-z/.+]{8,14})(?=[^0-9A-Za-z/.+]|$)) # IDi8,10 +PC/gюʃtOj ) }x'; @@ -65,6 +65,14 @@ abstract class ShowThread const NG_CHAIN = 32; const NG_AA = 64; + // +live nCCg[hp + const HIGHLIGHT_NONE = 128; + const HIGHLIGHT_NAME = 256; + const HIGHLIGHT_MAIL = 512; + const HIGHLIGHT_ID = 1024; + const HIGHLIGHT_MSG = 2048; + const HIGHLIGHT_CHAIN = 4096; + // }}} // {{{ static properties @@ -89,6 +97,9 @@ abstract class ShowThread */ static protected $_ngaborns_body_hits = 0; + static protected $_highlight_head_hits = 0; // {ȊOnCCgɃqbg + static protected $_highlight_body_hits = 0; // {nCCgɃqbg + /** * getAnchorRegex() ̃LbV * @@ -103,6 +114,13 @@ abstract class ShowThread */ static private $_anchorRegexParts = null; + /** + * transLinkDo() ̃LbV + * + * @var array + */ + static private $_link_cache = array(); + // }}} // {{{ properties @@ -152,6 +170,9 @@ abstract class ShowThread protected $_aborn_nums; protected $_ng_nums; + protected $_highlight_nums; // nCCgXԍi[z + protected $_highlight_msgs; // nCCgbZ[Wi[z + /** * _CN^̎ * @@ -323,11 +344,14 @@ protected function __construct(ThreadRead $aThread, $matome = false) $this->_aborn_nums = array(); $this->_ng_nums = array(); - if (P2Util::isHostBbsPink($this->thread->host)) { + $this->_highlight_nums = array(); + $this->_highlight_msgs = array(); + + if (P2HostMgr::isHostBbsPink($this->thread->host)) { $this->_redirector = self::REDIRECTOR_PINKTOWER; - } elseif (P2Util::isHost2chs($this->thread->host)) { + } elseif (P2HostMgr::isHost2chs($this->thread->host)) { $this->_redirector = self::REDIRECTOR_IMENU; - } elseif (P2Util::isHostMachiBbs($this->thread->host)) { + } elseif (P2HostMgr::isHostMachiBbs($this->thread->host)) { $this->_redirector = self::REDIRECTOR_MACHIBBS; } else { $this->_redirector = self::REDIRECTOR_NONE; @@ -361,29 +385,10 @@ protected function setBbsNonameName() /** * DatHTMLϊ̂擾 * - * @param bool $is_fragment - * @return bool|string - */ - public function getDatToHtml($is_fragment = false) - { - return $this->datToHtml(true, $is_fragment); - } - public function getDatToHtml_resFrom($is_fragment = false) - { - return $this->datToHtml_resFrom(true, $is_fragment); - } - - // }}} - // {{{ datToHtml() - - /** - * DatHTMLɕϊĕ\ - * - * @param bool $capture trueȂϊʂo͂ɕԂ * @param bool $is_fragment trueȂ
    ň͂܂Ȃ * @return bool|string */ - public function datToHtml($capture = false, $is_fragment = false) + public function getDatToHtml($is_fragment = false) { global $_conf, $filter_hits, $last_hit_resnum; @@ -391,13 +396,8 @@ public function datToHtml($capture = false, $is_fragment = false) // \X͈͂w肳ĂȂ if (!$aThread->resrange) { - $error = '

    p2 error: {$this->resrange} is false at datToHtml()

    '; - if ($capture) { - return $error; - } else { - echo $error; - return false; - } + $error = '

    p2 error: {$this->resrange} is false at getDatToHtml()

    '; + return $error; } $start = $aThread->resrange['start']; @@ -487,14 +487,6 @@ public function datToHtml($capture = false, $is_fragment = false) } else { $buf['body'] .= $res; } - if (!$capture && $n % 10 == 0) { - echo $buf['body']; - if ($do_filtering && !$is_ktai) { - echo "\n"; - } - flush(); - $buf['body'] = ''; - } } if ($this->thread->readnum < $rn) { @@ -509,25 +501,18 @@ public function datToHtml($capture = false, $is_fragment = false) $buf['body'] .= "\n"; } - if ($capture) { - return $buf['body'] . $buf['q']; - } else { - echo $buf['body']; - echo $buf['q']; - flush(); - return true; - } + return $buf['body'] . $buf['q']; + } /** - * w݂̏ւ̃XHTMLɕϊĕ\ + * w݂̏ւ̃XHTMLɕϊ̂擾 * - * @param bool $capture trueȂϊʂo͂ɕԂ * @param bool $is_fragment trueȂ
    ň͂܂Ȃ * @param bool $show_rootres trueȂw݂̏ʂɊ܂߂ * @return bool|string */ - public function datToHtml_resFrom($capture = false, $is_fragment = false, $show_rootres = false) + public function getDatToHtml_resFrom($is_fragment = false, $show_rootres = false) { global $_conf; @@ -537,12 +522,7 @@ public function datToHtml_resFrom($capture = false, $is_fragment = false, $show_ $target = $aThread->resrange['start']; if (!$aThread->resrange || $target != $aThread->resrange['to']) { $error = '

    p2 error: {$this->resrange} is false at datToHtml()

    '; - if ($capture) { - return $error; - } else { - echo $error; - return false; - } + return $error; } $datlines = $aThread->datlines; @@ -595,25 +575,13 @@ public function datToHtml_resFrom($capture = false, $is_fragment = false, $show_ } else { $buf['body'] .= $res; } - if (!$capture && $n % 10 == 0) { - echo $buf['body']; - flush(); - $buf['body'] = ''; - } } if (!$is_fragment) { $buf['body'] .= "\n"; } - if ($capture) { - return $buf['body'] . $buf['q']; - } else { - echo $buf['body']; - echo $buf['q']; - flush(); - return true; - } + return $buf['body'] . $buf['q']; } // }}} @@ -677,6 +645,19 @@ public function replaceBeId($date_id, $i) return $date_id; } + // }}} + // {{{ replaceSsspIcon() + + /** + * BEGACRNϊ + */ + public function replaceSsspIcon($msg) + { + //sssp://img.2ch.net/ico/miyabi.gif + //sssp://img.2ch.net/emoji/2ch-cry.gif + return preg_replace("{sssp(://[-_.!~*()0-9A-Za-z;/:@&=+\$,%]+?\.(?:gif|png|jpe|jpe?g|ico|bmp|tif|mng|j2k)(?:[?#][-_.!~*()0-9A-Za-z;/?:@&=+\$,%#]*|))}", "", $msg); + } + // }}} // {{{ _ngAbornCheck() @@ -695,7 +676,7 @@ public function replaceBeId($date_id, $i) */ protected function _ngAbornCheck($i, $name, $mail, $date_id, $id, $msg, $nong = false, &$info = null) { - global $_conf, $ngaborns_hits; + global $_conf, $ngaborns_hits, $highlight_msgs, $highlight_chain_nums; $info = array(); $type = self::NG_NONE; @@ -752,20 +733,40 @@ protected function _ngAbornCheck($i, $name, $mail, $date_id, $id, $msg, $nong = // }}} // {{{ ځ[`FbN + if ($_conf['ngaborn_auto']) {//ځ[ + // ځ[ID + if ($this->ngAbornCheck('aborn_auto', $date_id) !== false) { + $ngaborns_hits['aborn_auto']++; + return $this->_markNgAborn($i, self::ABORN, false); + } + } + // ځ[񃌃X if ($this->abornResCheck($i) !== false) { + if ($_conf['ngaborn_auto']) { + //ځ[ȂIDlj + NgAbornCtl::ngAbornAdd('aborn_auto', $id); + } $ngaborns_hits['aborn_res']++; return $this->_markNgAborn($i, self::ABORN, false); } // ځ[l[ if ($this->ngAbornCheck('aborn_name', $name) !== false) { + if ($_conf['ngaborn_auto']) { + //ځ[ȂIDlj + NgAbornCtl::ngAbornAdd('aborn_auto', $id); + } $ngaborns_hits['aborn_name']++; return $this->_markNgAborn($i, self::ABORN, false); } // ځ[񃁁[ if ($this->ngAbornCheck('aborn_mail', $mail) !== false) { + if ($_conf['ngaborn_auto']) { + //ځ[ȂIDlj + NgAbornCtl::ngAbornAdd('aborn_auto', $id); + } $ngaborns_hits['aborn_mail']++; return $this->_markNgAborn($i, self::ABORN, false); } @@ -778,6 +779,10 @@ protected function _ngAbornCheck($i, $name, $mail, $date_id, $id, $msg, $nong = // ځ[񃁃bZ[W if ($this->ngAbornCheck('aborn_msg', $msg) !== false) { + if ($_conf['ngaborn_auto']) { + //ځ[ȂIDlj + NgAbornCtl::ngAbornAdd('aborn_auto', $id); + } $ngaborns_hits['aborn_msg']++; return $this->_markNgAborn($i, self::ABORN, true); } @@ -790,14 +795,31 @@ protected function _ngAbornCheck($i, $name, $mail, $date_id, $id, $msg, $nong = // {{{ NG`FbN + if ($_conf['ngaborn_auto']) {//ځ[ + // NGIDNG + if ($this->ngAbornCheck('ng_auto', $date_id) !== false) { + $ngaborns_hits['ng_auto']++; + $type |= $this->_markNgAborn($i, self::NG_ID, false); + $autong_done = true; //NGID̑ΏۂɂȂX͈Ӗ̂NGIDɒljȂ + } + } + // NGl[`FbN if ($this->ngAbornCheck('ng_name', $name) !== false) { + if ($_conf['ngaborn_auto'] && !$autong_done) { + //ځ[ȂIDlj + $add_done = NgAbornCtl::ngAbornAdd('ng_auto', $id); + } $ngaborns_hits['ng_name']++; $type |= $this->_markNgAborn($i, self::NG_NAME, false); } // NG[`FbN if ($this->ngAbornCheck('ng_mail', $mail) !== false) { + if ($_conf['ngaborn_auto'] && !$autong_done && !$add_done) { + //ځ[ȂIDlj + $add_done = NgAbornCtl::ngAbornAdd('ng_auto', $id); + } $ngaborns_hits['ng_mail']++; $type |= $this->_markNgAborn($i, self::NG_MAIL, false); } @@ -811,6 +833,10 @@ protected function _ngAbornCheck($i, $name, $mail, $date_id, $id, $msg, $nong = // NGbZ[W`FbN $a_ng_msg = $this->ngAbornCheck('ng_msg', $msg); if ($a_ng_msg !== false) { + if ($_conf['ngaborn_auto'] && !$autong_done && !$add_done) { + //ځ[ȂIDlj + $add_done = NgAbornCtl::ngAbornAdd('ng_auto', $id); + } $ngaborns_hits['ng_msg']++; $type |= $this->_markNgAborn($i, self::NG_MSG, true); $info[] = sprintf('NG%s:%s', @@ -818,6 +844,9 @@ protected function _ngAbornCheck($i, $name, $mail, $date_id, $id, $msg, $nong = p2h($a_ng_msg)); } + // +live nCCg`FbN + include P2_LIB_DIR . '/live/live_highlight_check.php'; + // }}} return $type; @@ -858,6 +887,28 @@ protected function _markNgAborn($num, $type, $isBody) } // }}} + // {{{ _markHighlight() + + // +live nCCgɃqbgXԍL^ + protected function _markHighlight($num, $type, $isBody) + { + if ($type) { + if ($isBody) { + self::$_highlight_body_hits++; + } else { + self::$_highlight_head_hits++; + } + + $str = (string)$num; + $this->_highlight_nums[$num] = $str; + + $this->_has_ngaborns = true; + } + + return $type; + } + + // }}} // {{{ ngAbornCheck() /** @@ -874,7 +925,7 @@ public function ngAbornCheck($code, $resfield, $ic = false) if ($code == 'aborn_be' || $code == 'ng_be') { // vtB[ID𔲂o if (preg_match('/BE:(\\d+)/', $resfield, $matches)) { - $beId = P2UtilWiki::calcBeId((int)$matches[1]); + $beId = P2Util::calcBeId((int)$matches[1]); if ($beId === 0) { return false; } @@ -1026,6 +1077,7 @@ public function stripLineBreaks($msg, $replacement = '

    ') { if (P2_MBREGEX_AVAILABLE) { $msg = mb_ereg_replace('(?:[\\s@]*
    )+[\\s@]*$', '', $msg); + $msg = mb_ereg_replace('(?:^[\\s@]*
    )+[\\s@]*', '', $msg); $msg = mb_ereg_replace('(?:[\\s@]*
    ){3,}', $replacement, $msg); } else { mb_convert_variables('UTF-8', 'CP932', $msg, $replacement); @@ -1061,6 +1113,29 @@ public function transLink($str) * @return string */ public function transLinkDo(array $s) + { + if ($s['url']) { + // sha1ň͂񂾕Ȃ邪mŏՓ˂ + $key = sha1(serialize($s)); + // LbVĂȂꍇ + if (!isset(self::$_link_cache[$key])) { + // ʂvZ + self::$_link_cache[$key] = self::_transLinkDo($s); + } + return self::$_link_cache[$key]; + } else { + return self::_transLinkDo($s); + } + } + // {{{ _transLinkDo() + + /** + * transLinkDo̎q֐ + * + * @param array $s + * @return string + */ + private function _transLinkDo(array $s) { global $_conf; @@ -1087,13 +1162,13 @@ public function transLinkDo(array $s) return $s[3]; } - // p + // p } elseif ($s['quote']) { return preg_replace_callback( self::getAnchorRegex('/(%prefix%)?(%a_range%)/'), array($this, '_quoteResCallback'), $s['quote']); - // http or ftp URL + // http or ftp URL } elseif ($s['url']) { if ($_conf['ktai'] && $s[9] == 'ftp') { return $orig; @@ -1104,7 +1179,7 @@ public function transLinkDo(array $s) if (strlen($following) > 0) { // EBLyfBA{łURLŁASJIS2oCg̏ʃoCg // (0x81-0x9F,0xE0-0xEF)Ƃ - if (P2Util::isUrlWikipediaJa($url)) { + if (P2HostMgr::isUrlWikipediaJa($url)) { $leading = ord($following); if ((($leading ^ 0x90) < 32 && $leading != 0x80) || ($leading ^ 0xE0) < 16) { $url .= rawurlencode(mb_convert_encoding($following, 'UTF-8', 'CP932')); @@ -1117,11 +1192,11 @@ public function transLinkDo(array $s) } } - // ID + // ID } elseif ($s['id'] && $_conf['flex_idpopup']) { // && $_conf['flex_idlink_k'] return $this->idFilter($s['id'], $s[12]); - // ̑i\j + // ̑i\j } else { return strip_tags($orig); } @@ -1152,9 +1227,7 @@ public function transLinkDo(array $s) if (!$purl || !array_key_exists('host', $purl) || strpos($purl['host'], '.') === false || $purl['host'] == '127.0.0.1' || - //HostCheck::isAddressLocal($purl['host']) || - //HostCheck::isAddressPrivate($purl['host']) || - P2Util::isHostExample($purl['host'])) + P2HostMgr::isHostExample($purl['host'])) { return $orig; } @@ -1557,7 +1630,7 @@ protected function _makeQuotes() // NGځ[`FbN if (($id = $this->thread->ids[$num + 1]) !== null) { - $date_id = str_replace($this->thread->idp[$i] . $id, 'ID:' . $id, $date_id); + $date_id = str_replace($this->thread->idp[$num] . $id, 'ID:' . $id, $date_id); } $ng_type = $this->_ngAbornCheck($num + 1, strip_tags($name), $mail, $date_id, $id, $msg); if ($ng_type == self::ABORN) { @@ -1697,7 +1770,7 @@ public function getQuoteTo() protected function _quotebackListHtml($resnum, $type, $popup=true) { $quote_from = $this->getQuoteFrom(); - if (!array_key_exists($resnum, $quote_from)) return $ret; + if (!array_key_exists($resnum, $quote_from)) return ''; $anchors = $quote_from[$resnum]; sort($anchors); @@ -1907,7 +1980,7 @@ static public function getAnchorRegex($pattern, $unicode = false) // 卷͂Ȃ compileMobile2chUriCallBack() ̂悤 preg_relplace_callback()ĂB } if ($unicode) { - return StrSjis::toUnicodePattern($_anchorRegexes[$pattern]); + return StrSjis::toUnicodePattern(self::$_anchorRegexes[$pattern]); } return self::$_anchorRegexes[$pattern]; } @@ -2023,7 +2096,7 @@ static protected function _buildStrToLinkRegex() . '(ftp|h?ttps?|tps?)://([0-9A-Za-z][\\w!#%&+*,\\-./:;=?@\\[\\]^~]+)' // URL . ')' . '|' - . '(?PID: ?([0-9A-Za-z/.+]{8,11})(?=[^0-9A-Za-z/.+]|$))' // IDi8,10 +PC/gюʃtOj + . '(?PID: ?([0-9A-Za-z/.+]{8,14})(?=[^0-9A-Za-z/.+]|$))' // IDi8,10 +PC/gюʃtOj . ')' . '}'; } diff --git a/lib/ShowThreadI.php b/lib/ShowThreadI.php new file mode 100644 index 000000000..0e505b10b --- /dev/null +++ b/lib/ShowThreadI.php @@ -0,0 +1,1235 @@ +_url_handlers = array( + 'plugin_linkThread', + 'plugin_link2chSubject', + ); + // +Wiki + if (isset($GLOBALS['linkPluginCtl'])) { + $this->_url_handlers[] = 'plugin_linkPlugin'; + } + if (isset($GLOBALS['replaceImageUrlCtl'])) { + $this->_url_handlers[] = 'plugin_replaceImageUrl'; + } elseif ($_conf['mobile.use_picto']) { + $this->_url_handlers[] = 'plugin_viewImage'; + } + $this->_url_handlers[] = 'plugin_linkURL'; + + if (!$_conf['mobile.bbs_noname_name']) { + $this->setBbsNonameName(); + } + + if (P2HostMgr::isHost2chs($aThread->host)) { + $this->_kushiYakiName = ' [\{}@{}@{}-] '; + } + + if ($_conf['mobile.date_zerosuppress']) { + $this->_dateIdPattern = '~^(?:' . date('Y|y') . ')/(?:0(\\d)|(\\d\\d))?(?:(/)0)?~'; + $this->_dateIdReplace = '$1$2$3'; + } else { + $this->_dateIdPattern = '~^(?:' . date('Y|y') . ')/~'; + $this->_dateIdReplace = ''; + } + + // As̒uݒ + /* + if ($_conf['mobile.strip_linebreaks']) { + $ngword_color = $GLOBALS['STYLE']['mobile_read_ngword_color']; + if (strpos($ngword_color, '\\') === false && strpos($ngword_color, '$') === false) { + $this->_lineBreaksReplace = "
    ***
    "; + } else { + $this->_lineBreaksReplace = '
    ***
    '; + } + } else { + $this->_lineBreaksReplace = null; + } + */ + + // TlC\ݒ + if (!isset($GLOBALS['pre_thumb_unlimited']) || !isset($GLOBALS['expack.ic2.pre_thumb_limit_k'])) { + if (isset($_conf['expack.ic2.pre_thumb_limit_k']) && $_conf['expack.ic2.pre_thumb_limit_k'] > 0) { + $GLOBALS['pre_thumb_limit_k'] = $_conf['expack.ic2.pre_thumb_limit_k']; + $GLOBALS['pre_thumb_unlimited'] = false; + } else { + $GLOBALS['pre_thumb_limit_k'] = null; // klisset()falseԂ + $GLOBALS['pre_thumb_unlimited'] = true; + } + } + $GLOBALS['pre_thumb_ignore_limit'] = false; + + // ANeBui[ + if (P2_ACTIVEMONA_AVAILABLE) { + ExpackLoader::initActiveMona($this); + } + + // ImageCache2 + if (P2_IMAGECACHE_AVAILABLE == 2) { + ExpackLoader::initImageCache($this); + } + + // AAS + if (P2_AAS_AVAILABLE) { + ExpackLoader::initAAS($this); + } + + // SPM + //if ($this->_matome) { + // $this->spmObjName = sprintf('t%dspm%u', $this->_matome, crc32($this->thread->keydat)); + //} else { + $this->spmObjName = sprintf('spm%u', crc32($this->thread->keydat)); + //} + } + + // }}} + // {{{ transRes() + + /** + * DatXHTMLXɕϊ + * + * @param string $ares dat1C + * @param int $i Xԍ + * @param string $pattern nCCgpK\ + * @return string + */ + public function transRes($ares, $i, $pattern = null) + { + global $_conf, $STYLE, $mae_msg; + + list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares); + if (($id = $this->thread->ids[$i]) !== null) { + $idstr = 'ID:' . $id; + $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id); + } else { + $idstr = null; + } + + // +Wiki:u[h + if (isset($GLOBALS['replaceWordCtl'])) { + $replaceWordCtl = $GLOBALS['replaceWordCtl']; + $name = $replaceWordCtl->replace('name', $this->thread, $ares, $i); + $mail = $replaceWordCtl->replace('mail', $this->thread, $ares, $i); + $date_id = $replaceWordCtl->replace('date', $this->thread, $ares, $i); + $msg = $replaceWordCtl->replace('msg', $this->thread, $ares, $i); + } + + $tores = ''; + if ($this->_matome) { + $res_id = "t{$this->_matome}r{$i}"; + } else { + $res_id = "r{$i}"; + } + + // NGځ[`FbN + $nong = !empty($_GET['nong']); + $ng_type = $this->_ngAbornCheck($i, strip_tags($name), $mail, $date_id, $id, $msg, $nong, $ng_info); + if ($ng_type == self::ABORN) { + return $this->_abornedRes($res_id); + } + if (!$nong && $this->am_autong && $this->activeMona->detectAA($msg)) { + $is_ng = array_key_exists($i, $this->_ng_nums); + $ng_type |= $this->_markNgAborn($i, self::NG_AA, true); + $ng_info[] = 'AA'; + // AAANGΏۂOꍇ + if (!$is_ng && $_conf['expack.am.autong_k'] == 2) { + unset($this->_ng_nums[$i]); + } + } + if ($ng_type != self::NG_NONE) { + $ngaborns_head_hits = self::$_ngaborns_head_hits; + $ngaborns_body_hits = self::$_ngaborns_body_hits; + } + + // {{{ OƓtEID𒲐 + + // Ă}[NZk + if ($this->_kushiYakiName !== null && strpos($name, $this->_kushiYakiName) === 0) { + $name = substr($name, strlen($this->_kushiYakiName)); + // ftHg̖O͏ȗ + if ($name === $this->_nanashiName) { + $name = '[]'; + } else { + $name = '[]' . $name; + } + // ftHg̖OƓȂȗ + } elseif ($name === $this->_nanashiName) { + $name = ''; + } + + // ݂̔N͏ȗJbgB̐擪0JbgB + $date_id = preg_replace($this->_dateIdPattern, $this->_dateIdReplace, $date_id); + + // jƎԂ̊Ԃl߂ + $date_id = str_replace(') ', ')', $date_id); + + // bJbg + if ($_conf['mobile.clip_time_sec']) { + $date_id = preg_replace('/(\\d\\d:\\d\\d):\\d\\d(?:\\.\\d\\d)?/', '$1', $date_id); + } + + // ID + if ($id !== null) { + $id_suffix = substr($id, -1); + + if ($_conf['mobile.underline_id'] && $id_suffix == 'O' && strlen($id) % 2) { + $do_underline_id_suffix = true; + } else { + $do_underline_id_suffix = false; + } + + if ($this->thread->idcount[$id] > 1) { + if ($_conf['flex_idpopup'] == 1) { + $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id); + } + if ($do_underline_id_suffix) { + $date_id = str_replace($idstr, substr($idstr, 0, -1) . '' . $id_suffix . '', $date_id); + } + } else { + if ($_conf['mobile.clip_unique_id']) { + if ($do_underline_id_suffix) { + $date_id = str_replace($idstr, 'ID:*' . $id_suffix . '', $date_id); + } else { + $date_id = str_replace($idstr, 'ID:*' . $id_suffix, $date_id); + } + } else { + if ($do_underline_id_suffix) { + $date_id = str_replace($idstr, substr($idstr, 0, -1) . '' . $id_suffix . '', $date_id); + } + } + } + } else { + if ($_conf['mobile.clip_unique_id']) { + $date_id = str_replace('ID:???', 'ID:?', $date_id); + } + } + + // }}} + + //============================================================= + // ܂Ƃ߂ďo + //============================================================= + + if ($name) { + $name = $this->transName($name); // OHTMLϊ + } + $msg = $this->transMsg($msg, $i); // bZ[WHTMLϊ + + // BEvt@CNϊ + $date_id = $this->replaceBeId($date_id, $i); + + // NGbZ[Wϊ + if ($ng_type != self::NG_NONE && count($ng_info)) { + $ng_info = implode(', ', $ng_info); + if ($ng_type == self::NG_AA) { + $msg = <<respopup_at}{$this->target_at}>{$ng_info} +EOMSG; + } else { + $msg = <<{$ng_info} respopup_at}{$this->target_at}>{$this->check_st} +EOMSG; + } + + // AAS + if (($ng_type & self::NG_AA) && P2_AAS_AVAILABLE) { + $aas_url = "aas.php?host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&resnum={$i}"; + if (P2_AAS_AVAILABLE == 2) { + $aas_txt = ""; + } else { + $aas_txt = "AAS"; + } + $msg .= " target_at}>{$aas_txt}"; + } + } + + // NGl[ϊ + if ($ng_type & self::NG_NAME) { + $name = <<{$name} +EONAME; + $msg = <<respopup_at}{$this->target_at}>{$this->check_st} +EOMSG; + + // NG[ϊ + } elseif ($ng_type & self::NG_MAIL) { + $mail = <<{$mail} +EOMAIL; + $msg = <<
    [\{}@{}@{}-] '; } @@ -274,15 +265,10 @@ public function transRes($ares, $i, $pattern = null) // NGbZ[Wϊ if ($ng_type != self::NG_NONE && count($ng_info)) { $ng_info = implode(', ', $ng_info); - if ($ng_type == self::NG_AA && $_conf['iphone']) { - $msg = <<respopup_at}{$this->target_at}>{$ng_info} -EOMSG; - } else { - $msg = <<{$ng_info} respopup_at}{$this->target_at}>{$this->check_st} EOMSG; - } // AAS if (($ng_type & self::NG_AA) && P2_AAS_AVAILABLE) { @@ -292,15 +278,10 @@ public function transRes($ares, $i, $pattern = null) } else { $aas_txt = "AAS"; } - if ($_conf['iphone']) { - //$img_title = p2h($this->thread->getMotoThread(true, $i)); - //$img_title = "{$this->thread->bbs}/{$this->thread->key}/{$i}"; - //$img_title = "{$this->thread->ttitle_hd} >>{$i}"; - $msg .= " target_at}>{$aas_txt}"; - } else { - $msg .= " target_at}>{$aas_txt}"; - $msg .= " target_at}>{$this->aas_rotate}"; - } + + $msg .= " target_at}>{$aas_txt}"; + $msg .= " target_at}>{$this->aas_rotate}"; + } } @@ -341,80 +322,41 @@ public function transRes($ares, $i, $pattern = null) } */ - if ($_conf['iphone']) { - $tores .= "
    "; - - $no_class = 'no'; - $no_onclick = ''; - - // IUtC - if ($this->thread->onthefly) { - $GLOBALS['newres_to_show_flag'] = true; - $no_class .= ' onthefly'; - // VX - } elseif ($i > $this->thread->readnum) { - $GLOBALS['newres_to_show_flag'] = true; - $no_class .= ' newres'; - } - - // SPM - if ($_conf['expack.spm.enabled']) { - $no_onclick = " onclick=\"{$this->spmObjName}.show({$i},'{$res_id}',event)\""; - } - - // ԍ - $tores .= "{$i}"; - // O - $tores .= " {$name}"; - // [ - $tores .= " {$mail}"; - // tID - $tores .= " {$date_id}
    \n"; - // e - $tores .= "
    {$msg}
    "; - // 탌XXg - if ($_conf['mobile.backlink_list'] == 1) { - $linkstr = $this->_quotebackListHtml($i, 2); - if (strlen($linkstr)) { - $tores .= '
    ' . $linkstr; - } - } - $tores .= "
    \n"; // e‚ - } else { - // ԍiIUtCj - if ($this->thread->onthefly) { - $GLOBALS['newres_to_show_flag'] = true; - $tores .= "
    [{$i}]"; + // ԍiIUtCj + if ($this->thread->onthefly) { + $GLOBALS['newres_to_show_flag'] = true; + $tores .= "
    [{$i}]"; // ԍiVXj - } elseif ($i > $this->thread->readnum) { - $GLOBALS['newres_to_show_flag'] = true; - $tores .= "
    [{$i}]"; + } elseif ($i > $this->thread->readnum) { + $GLOBALS['newres_to_show_flag'] = true; + $tores .= "
    [{$i}]"; // ԍ - } else { - $tores .= "
    [{$i}]"; - } - - // O - if ($name) { - $tores .= "{$name}: "; } - // [ - if ($mail) { - $tores .= "{$mail}: "; - } - // tID - $tores .= "{$date_id}
    \n"; - // e - $tores .= "{$msg}
    \n"; - // 탌XXg - if ($_conf['mobile.backlink_list'] == 1) { - $linkstr = $this->_quotebackListHtml($i, 2); - if (strlen($linkstr)) { - $tores .= '
    ' . $linkstr; - } - } - $tores .= "
    \n"; + } else { + $tores .= "
    [{$i}]"; } + // O + if ($name) { + $tores .= "{$name}: "; + } + + // [ + if ($mail) { + $tores .= "{$mail}: "; + } + // tID + $tores .= "{$date_id}
    \n"; + // e + $tores .= "{$msg}
    \n"; + // 탌XXg + if ($_conf['mobile.backlink_list'] == 1) { + $linkstr = $this->_quotebackListHtml($i, 2); + if (strlen($linkstr)) { + $tores .= '
    ' . $linkstr; + } + } + $tores .= "
    \n"; + // ܂Ƃ߂ătB^F if ($pattern) { if (is_string($_conf['k_filter_marker'])) { @@ -564,92 +506,6 @@ protected function _abornedRes($res_id) EOP; } - // }}} - // {{{ getSpmObjJs() - - /** - * X}[g|bvAbvj[ɕKvȃXbhi[JavaScriptR[h擾 - */ - public function getSpmObjJs($retry = false) - { - global $_conf; - - if (isset(self::$_spm_objects[$this->spmObjName])) { - return $retry ? self::$_spm_objects[$this->spmObjName] : ''; - } - - $ttitle_en = UrlSafeBase64::encode($this->thread->ttitle); - - $motothre_url = $this->thread->getMotoThread(); - $motothre_url = substr($motothre_url, 0, strlen($this->thread->ls) * -1); - - // GXP[v - $_spm_title = StrCtl::toJavaScript($this->thread->ttitle_hc); - $_spm_url = addslashes($motothre_url); - $_spm_host = addslashes($this->thread->host); - $_spm_bbs = addslashes($this->thread->bbs); - $_spm_key = addslashes($this->thread->key); - $_spm_ls = addslashes($this->thread->ls); - $_spm_b = ($_conf['view_forced_by_query']) ? "&b={$_conf['b']}" : ''; - - $code = << -//spmObjName} = { - 'objName':'{$this->spmObjName}', - 'query':'&host={$_spm_host}&bbs={$_spm_bbs}&key={$_spm_key}&rescount={$this->thread->rescount}&ttitle_en={$ttitle_en}{$_spm_b}', - 'rc':'{$this->thread->rescount}', - 'title':'{$_spm_title}', - 'ttitle_en':'{$ttitle_en}', - 'url':'{$_spm_url}', - 'host':'{$_spm_host}', - 'bbs':'{$_spm_bbs}', - 'key':'{$_spm_key}', - 'ls':'{$_spm_ls}', - 'client':['{$_conf['b']}','{$_conf['client_type']}'] -}; -{$this->spmObjName}.show = (function(no,id,evt){SPM.show({$this->spmObjName},no,id,evt);}); -{$this->spmObjName}.hide = SPM.hide; // (function(evt){SPM.hide(evt);}); -//]]> -\n -EOJS; - - self::$_spm_objects[$this->spmObjName] = $code; - - return $code; - } - - // }}} - // {{{ getSpmElementHtml() - - /** - * X}[g|bvAbvj[pHTML𐶐 - */ - static public function getSpmElementHtml() - { - global $_conf; - - return << -
    - >>???ɃX - [pȂ] -
    -
    - -
    -EOP; - } - // }}} // {{{ idFilter() @@ -895,9 +751,12 @@ public function plugin_link2chSubject($url, $purl, $str) { global $_conf; - if (preg_match('{^http://(\\w+\\.(?:2ch\\.net|bbspink\\.com))/(\\w+)/$}', $purl[0], $m)) { - $subject_url = "{$_conf['subject_php']}?host={$m[1]}&bbs={$m[2]}"; - return "{$str} [‚p2ŊJ]"; + if (preg_match('{^https?://(.+)/(.+)/$}', $purl[0], $m)) { + //rep2ɓo^ÂȂ΃N + if (P2HostMgr::isRegisteredBbs($m[1],$m[2])) { + $subject_url = "{$_conf['subject_php']}?host={$m[1]}&bbs={$m[2]}"; + return "{$str} [‚p2ŊJ]"; + } } return false; } @@ -975,7 +834,7 @@ public function plugin_viewImage($url, $purl, $str) { global $_conf; - if (P2Util::isUrlWikipediaJa($url)) { + if (P2HostMgr::isUrlWikipediaJa($url)) { return false; } @@ -994,192 +853,6 @@ public function plugin_viewImage($url, $purl, $str) return false; } - // }}} - // {{{ plugin_imageCache2() - - /** - * 摜URLImageCache2ϊ - */ - public function plugin_imageCache2($url, $purl, $str) - { - global $_conf; - global $pre_thumb_unlimited, $pre_thumb_ignore_limit, $pre_thumb_limit_k; - - if (P2Util::isUrlWikipediaJa($url)) { - return false; - } - - if (preg_match('{^https?://.+?\\.(jpe?g|gif|png)$}i', $purl[0]) && empty($purl['query'])) { - // CCvr[̗L - if ($pre_thumb_unlimited || $pre_thumb_ignore_limit || $pre_thumb_limit_k > 0) { - $inline_preview_flag = true; - $inline_preview_done = false; - } else { - $inline_preview_flag = false; - $inline_preview_done = false; - } - - $url_ht = $url; - $url = $purl[0]; - $url_en = rawurlencode($url); - $img_str = null; - $img_id = null; - - $icdb = new ImageCache2_DataObject_Images(); - - // r=0:N;r=1:_CNg;r=2:PHPŕ\ - // t=0:IWi;t=1:PCpTlC;t=2:gїpTlC;t=3:ԃC[W - $img_url = 'ic2.php?r=0&t=2&uri=' . $url_en; - $img_url2 = 'ic2.php?r=0&t=2&id='; - $src_url = 'ic2.php?r=1&t=0&uri=' . $url_en; - $src_url2 = 'ic2.php?r=1&t=0&id='; - $src_exists = false; - - // CɃX摜N - $rank = null; - if ($_conf['expack.ic2.fav_auto_rank']) { - $rank = $this->getAutoFavRank(); - } - - // DBɉ摜񂪓o^ĂƂ - if ($icdb->get($url)) { - $img_id = $icdb->id; - - // EBXɊĂt@ĈƂ - if ($icdb->mime == 'clamscan/infected') { - return '[IC2:EBXx]'; - } - // ځ[摜̂Ƃ - if ($icdb->rank < 0) { - return '[IC2:ځ[摜]'; - } - - // IWi̗LmF - $_src_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime); - if (file_exists($_src_url)) { - $src_exists = true; - $img_url = $img_url2 . $icdb->id; - $src_url = $_src_url; - } else { - $img_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime); - $src_url = $src_url2 . $icdb->id; - } - - // CCvr[L̂Ƃ - $prv_url = null; - if ($this->thumbnailer->ini['General']['inline'] == 1) { - // PCread_new_k.phpɃANZXƂ - if (!isset($this->inline_prvw) || !is_object($this->inline_prvw)) { - $this->inline_prvw = $this->thumbnailer; - } - $prv_url = $this->inline_prvw->thumbUrl($icdb->size, $icdb->md5, $icdb->mime); - - // TlC\ȓ̂Ƃ - if ($inline_preview_flag) { - // vr[摜Ă邩ǂimgvf̑ - if (file_exists($prv_url)) { - $prv_size = explode('x', $this->inline_prvw->calc($icdb->width, $icdb->height)); - $img_str = ""; - } else { - $r_type = ($this->thumbnailer->ini['General']['redirect'] == 1) ? 1 : 2; - if ($src_exists) { - $prv_url = "ic2.php?r={$r_type}&t=1&id={$icdb->id}"; - } else { - $prv_url = "ic2.php?r={$r_type}&t=1&uri={$url_en}"; - } - $prv_url .= $this->img_dpr_query; - if ($this->img_dpr === 1.5 || $this->img_dpr === 2.0) { - $prv_onload = sprintf(' onload="autoAdjustImgSize(this, %f);"', $this->img_dpr); - } else { - $prv_onload = ''; - } - $img_str = ""; - } - $inline_preview_done = true; - } else { - $img_str = '[p2:摜(ݸ:' . $icdb->rank . ')]'; - } - } - - // X^C@\ONŃX^CL^ĂȂƂDBXV - if (!is_null($this->img_memo) && strpos($icdb->memo, $this->img_memo) === false) { - $update = new ImageCache2_DataObject_Images(); - if (!is_null($icdb->memo) && strlen($icdb->memo) > 0) { - $update->memo = $this->img_memo . ' ' . $icdb->memo; - } else { - $update->memo = $this->img_memo; - } - $update->whereAddQuoted('uri', '=', $url); - } - - // expack.ic2.fav_auto_rank_override ̐ݒƃNOKȂ - // CɃX摜N㏑XV - if ($rank !== null && self::isAutoFavRankOverride($icdb->rank, $rank)) { - if ($update === null) { - $update = new ImageCache2_DataObject_Images(); - $update->whereAddQuoted('uri', '=', $url); - } - $update->rank = $rank; - } - - if ($update !== null) { - $update->update(); - } - - // 摜LbVĂȂƂ - // X^C@\ONȂNGUTF-8GR[hX^C܂߂ - } else { - // 摜ubNXgorG[Oɂ邩mF - if (false !== ($errcode = $icdb->ic2_isError($url))) { - return "[IC2:װ({$errcode})]"; - } - - // CCvr[LŁATlC\ȓȂ - if ($this->thumbnailer->ini['General']['inline'] == 1 && $inline_preview_flag) { - $rank_str = ($rank !== null) ? '&rank=' . $rank : ''; - $img_str = "img_memo_query}{$rank_str}\">"; - $inline_preview_done = true; - } else { - $img_url .= $this->img_memo_query; - } - } - - // \fNg - if ($inline_preview_flag && $inline_preview_done) { - $pre_thumb_limit_k--; - } - - if (!empty($_SERVER['REQUEST_URI'])) { - $backto = '&from=' . rawurlencode($_SERVER['REQUEST_URI']); - } else { - $backto = ''; - } - - if (is_null($img_str)) { - return sprintf('[IC2:%s:%s]', - $img_url, - $backto, - p2h($purl['host']), - p2h(basename($purl['path'])) - ); - } - - if ($_conf['iphone']) { - $img_title = p2h($purl['host']) - . ' ' - . p2h(basename($purl['path'])); - return "{$img_str}" - //. ' '; - } else { - return "{$img_str}"; - } - } - - return false; - } - // }}} // {{{ plugin_replaceImageUrl() @@ -1188,7 +861,7 @@ public function plugin_replaceImageUrl($url, $purl, $str) global $_conf; global $pre_thumb_unlimited, $pre_thumb_ignore_limit, $pre_thumb_limit_k; - if (P2Util::isUrlWikipediaJa($url)) { + if (P2HostMgr::isUrlWikipediaJa($url)) { return false; } @@ -1250,11 +923,10 @@ public function plugin_replaceImageUrl($url, $purl, $str) } // IWi̗LmF - $_src_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime); - if (file_exists($_src_url)) { + if (file_exists($this->thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime))) { $src_exists = true; $img_url = $img_url2 . $icdb->id; - $src_url = $_src_url; + $src_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime); } else { $img_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime); $src_url = $src_url2 . $icdb->id; @@ -1272,7 +944,7 @@ public function plugin_replaceImageUrl($url, $purl, $str) // TlC\ȓ̂Ƃ if ($inline_preview_flag) { // vr[摜Ă邩ǂimgvf̑ - if (file_exists($prv_url)) { + if (file_exists($this->inline_prvw->thumbPath($icdb->size, $icdb->md5, $icdb->mime))) { $prvw_size = explode('x', $this->inline_prvw->calc($icdb->width, $icdb->height)); $img_str = ""; } else { @@ -1288,7 +960,7 @@ public function plugin_replaceImageUrl($url, $purl, $str) } else { $prv_onload = ''; } - $img_str = ""; + $img_str = ""; } $inline_preview_done = true; } else { @@ -1333,7 +1005,7 @@ public function plugin_replaceImageUrl($url, $purl, $str) // CCvr[LŁATlC\ȓȂ if ($this->thumbnailer->ini['General']['inline'] == 1 && $inline_preview_flag) { $rank_str = ($rank !== null) ? '&rank=' . $rank : ''; - $img_str = "img_memo_query}{$rank_str}{$ref_en}\">"; + $img_str = "img_memo_query}{$rank_str}{$ref_en}\" width=\"{$prvw_size[0]}\" height=\"{$prvw_size[1]}\">"; $inline_preview_done = true; } else { $img_url .= $this->img_memo_query; @@ -1360,17 +1032,7 @@ public function plugin_replaceImageUrl($url, $purl, $str) ); } - if ($_conf['iphone']) { - $img_title = p2h($purl['host']) - . ' ' - . p2h(basename($purl['path'])); - $result .= "{$img_str}" - //. ' '; - } else { - $result .= "{$img_str}"; - } + $result .= "{$img_str}"; } $linkUrlResult = $this->plugin_linkURL($url, $purl, $str); diff --git a/lib/ShowThreadPc.php b/lib/ShowThreadPc.php index 33187a336..bf66e50e6 100644 --- a/lib/ShowThreadPc.php +++ b/lib/ShowThreadPc.php @@ -13,6 +13,8 @@ class ShowThreadPc extends ShowThread { + var $BBS_NONAME_NAME = ''; // +live (live.bbs_noname) p + // {{{ properties static private $_spm_objects = array(); @@ -44,31 +46,31 @@ public function __construct($aThread, $matome = false) 'plugin_linkThread', 'plugin_link2chSubject', ); + + // +live (live.bbs_noname) p + if ($_GET['live']) { + if (empty($_conf['live.bbs_noname'])) { + require_once P2_LIB_DIR . '/SettingTxt.php'; + $st = new SettingTxt($this->thread->host, $this->thread->bbs); + $st->setSettingArray(); + if (!empty($st->setting_array['BBS_NONAME_NAME'])) { + $this->BBS_NONAME_NAME = $st->setting_array['BBS_NONAME_NAME']; + } + } + + } + // +Wiki if (isset($GLOBALS['linkPluginCtl'])) { $this->_url_handlers[] = 'plugin_linkPlugin'; } if (isset($GLOBALS['replaceImageUrlCtl'])) { $this->_url_handlers[] = 'plugin_replaceImageUrl'; - } - if (P2_IMAGECACHE_AVAILABLE == 2) { - $this->_url_handlers[] = 'plugin_imageCache2'; } elseif ($_conf['preview_thumbnail']) { $this->_url_handlers[] = 'plugin_viewImage'; } - if ($_conf['link_youtube']) { - $this->_url_handlers[] = 'plugin_linkYouTube'; - } - if ($_conf['link_niconico']) { - $this->_url_handlers[] = 'plugin_linkNicoNico'; - } $this->_url_handlers[] = 'plugin_linkURL'; - // imepitaURLHImageCache2vOCo^ - if (P2_IMAGECACHE_AVAILABLE == 2) { - $this->addURLHandler(array($this, 'plugin_imepitaToImageCache2')); - } - // TlC\ݒ if (!isset($GLOBALS['pre_thumb_unlimited']) || !isset($GLOBALS['pre_thumb_limit'])) { if (isset($_conf['pre_thumb_limit']) && $_conf['pre_thumb_limit'] > 0) { @@ -118,15 +120,7 @@ public function __construct($aThread, $matome = false) */ public function transRes($ares, $i, $pattern = null) { - global $_conf, $STYLE, $mae_msg; - - list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares); - if (($id = $this->thread->ids[$i]) !== null) { - $idstr = 'ID:' . $id; - $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id); - } else { - $idstr = null; - } + global $_conf, $STYLE, $mae_msg, $highlight_msgs, $highlight_chain_nums; // +Wiki:u[h if (isset($GLOBALS['replaceWordCtl'])) { @@ -135,8 +129,22 @@ public function transRes($ares, $i, $pattern = null) $mail = $replaceWordCtl->replace('mail', $this->thread, $ares, $i); $date_id = $replaceWordCtl->replace('date', $this->thread, $ares, $i); $msg = $replaceWordCtl->replace('msg', $this->thread, $ares, $i); + } else { + list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares); } + if (($id = $this->thread->ids[$i]) !== null) { + $idstr = 'ID:' . $id; + $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id); + } else { + $idstr = null; + } + + // +live (live.bbs_noname) p + if (!empty($this->BBS_NONAME_NAME) and $this->BBS_NONAME_NAME == $name) { + $name = ''; + } + $tores = ''; $rpop = ''; if ($this->_matome) { @@ -158,6 +166,12 @@ public function transRes($ares, $i, $pattern = null) $ngaborns_body_hits = self::$_ngaborns_body_hits; } + // +live nCCg`FbN + if ($ng_type != self::HIGHLIGHT_NONE) { + $highlight_head_hits = self::$_highlight_head_hits; + $highlight_body_hits = self::$_highlight_body_hits; + } + // AA if ($this->am_autodetect && $this->activeMona->detectAA($msg)) { $msg_class .= ' ActiveMona'; @@ -197,6 +211,9 @@ public function transRes($ares, $i, $pattern = null) // BEvt@CNϊ $date_id = $this->replaceBeId($date_id, $i); + // BEGACRNϊ + $msg = $this->replaceSsspIcon($msg); + // HTML|bvAbv if ($_conf['iframe_popup']) { $date_id = preg_replace_callback("{((\?#*)|(Lv\.\d+))}", array($this, 'iframePopupCallback'), $date_id); @@ -240,6 +257,9 @@ public function transRes($ares, $i, $pattern = null) } + // +live nCCg[hϊ + include P2_LIB_DIR . '/live/live_highlight_convert.php'; + /* //uVv摜} if ($i == $this->thread->readnum +1) { @@ -257,75 +277,9 @@ public function transRes($ares, $i, $pattern = null) $spmeh = ''; } - if ($_conf['backlink_block'] > 0) { - // QƃubN\ponclickݒ - $tores .= "
    \n"; - } else { - $tores .= "
    \n"; - } - $tores .= "
    "; - - if ($this->thread->onthefly) { - $GLOBALS['newres_to_show_flag'] = true; - //ԍiIUtCj - $tores .= "{$i} : "; - } elseif ($i > $this->thread->readnum) { - $GLOBALS['newres_to_show_flag'] = true; - // ԍiVXj - $tores .= "{$i} : "; - } elseif ($_conf['expack.spm.enabled']) { - // ԍiSPMj - $tores .= "{$i} : "; - } else { - // ԍ - $tores .= "{$i} : "; - } - // O - $tores .= preg_replace('{[ ]*}i', '', "{$name} : "); - - // [ - if ($mail) { - if (strpos($mail, 'sage') !== false && $STYLE['read_mail_sage_color']) { - $tores .= "{$mail} : "; - } elseif ($STYLE['read_mail_color']) { - $tores .= "{$mail} : "; - } else { - $tores .= $mail . ' : '; - } - } - - // IDtB^ - if ($_conf['flex_idpopup'] == 1 && $id && $this->thread->idcount[$id] > 1) { - $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id); - } + // +live Xbhe\ؑ + include P2_LIB_DIR . '/live/live_view_ctl.inc.php'; - $tores .= $date_id; // tID - if ($this->am_side_of_id) { - $tores .= ' ' . $this->activeMona->getMona($msg_id); - } - $tores .= "
    \n"; // res-header‚ - - // 탌XXg(c`) - if ($_conf['backlink_list'] == 1 || $_conf['backlink_list'] > 2) { - $tores .= $this->_quotebackListHtml($i, 1); - } - - $tores .= "
    {$msg}
    \n"; // e - // 탌XWJpubN - if ($_conf['backlink_block'] > 0) { - $backlinks = $this->_getBacklinkComment($i); - if (strlen($backlinks)) { - $tores .= '
    '; - $tores .= $backlinks; - } - } - // 탌XXg(`) - if ($_conf['backlink_list'] == 2 || $_conf['backlink_list'] > 2) { - $tores .= $this->_quotebackListHtml($i, 2, false); - } - $tores .= "
    \n"; - -// $tores .= $rpop; // X|bvAbvpp /*if ($_conf['expack.am.enabled'] == 2) { $tores .= << @@ -396,17 +350,26 @@ public function qRes($ares, $i) { global $_conf; - $resar = $this->thread->explodeDatLine($ares); - $name = $this->transName($resar[0]); - $mail = $resar[1]; + // +Wiki:u[h + if (isset($GLOBALS['replaceWordCtl'])) { + $replaceWordCtl = $GLOBALS['replaceWordCtl']; + $name = $replaceWordCtl->replace('name', $this->thread, $ares, $i); + $mail = $replaceWordCtl->replace('mail', $this->thread, $ares, $i); + $date_id = $replaceWordCtl->replace('date', $this->thread, $ares, $i); + $msg = $replaceWordCtl->replace('msg', $this->thread, $ares, $i); + } else { + list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares); + } + if (($id = $this->thread->ids[$i]) !== null) { $idstr = 'ID:' . $id; - $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $resar[2]); + $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id); } else { $idstr = null; - $date_id = $resar[2]; } - $msg = $this->transMsg($resar[3], $i); + + $name = $this->transName($name); // OHTMLϊ + $msg = $this->transMsg($msg, $i); // bZ[WHTMLϊ $tores = ''; @@ -424,6 +387,9 @@ public function qRes($ares, $i) // BEvt@CNϊ $date_id = $this->replaceBeId($date_id, $i); + // BEGACRNϊ + $msg = $this->replaceSsspIcon($msg); + // HTML|bvAbv if ($_conf['iframe_popup']) { $date_id = preg_replace_callback("{((\?#*)|(Lv\.\d+))}", array($this, 'iframePopupCallback'), $date_id); @@ -453,9 +419,14 @@ public function qRes($ares, $i) // $toresɂ܂Ƃ߂ďo $tores .= '
    '; $tores .= "{$i} : "; // ԍ - $tores .= preg_replace('{[ ]*}i', '', "{$name} : "); + $tores .= preg_replace('{[ ]*}i', '', "{$name} : "); if ($mail) { - $tores .= $mail . ' : '; // [ + // [ + if (preg_match ("(^[\\s@]*sage[\\s@]*$)", $mail)) { + $tores .= "$mail"." F"; + } else { + $tores .= "$mail"." F"; + } } $tores .= $date_id; // tID if ($this->am_side_of_id) { @@ -655,7 +626,7 @@ public function idFilter($idstr, $id) return $idstr; } - if ($_conf['coloredid.enable'] > 0 && preg_match("|^ID:[ ]?[0-9A-Za-z/.+]{8,11}|",$idstr)) { + if ($_conf['coloredid.enable'] > 0 && preg_match("|^ID: ?[0-9A-Za-z/.+]+|",$idstr)) { if ($this->_ids_for_render === null) { $this->_ids_for_render = array(); } @@ -684,7 +655,7 @@ public function idFilter($idstr, $id) ), '', '&') . $_conf['k_at_a']; if ($_conf['iframe_popup']) { - return $this->iframePopup($filter_url, $idstr, $_conf['bbs_win_target_at']) . $num_ht; + return self::iframePopup($filter_url, $idstr, $_conf['bbs_win_target_at']) . $num_ht; } return "{$idstr}{$num_ht}"; } @@ -788,7 +759,7 @@ public function quoteResRange($full, $qsign, $appointed_num) if ($_conf['iframe_popup']) { $pop_url = $read_url . "&renzokupop=true"; - return $this->iframePopup(array($read_url, $pop_url), $full, $_conf['bbs_win_target_at'], 1); + return self::iframePopup(array($read_url, $pop_url), $full, $_conf['bbs_win_target_at'], 1); } // ʂɃN @@ -818,7 +789,7 @@ public function quoteResRange($full, $qsign, $appointed_num) * @param bool $marker * @return string */ - public function iframePopup($url, $str, $attr = '', $mode = null, $marker = false) + static public function iframePopup($url, $str, $attr = '', $mode = null, $marker = false) { global $_conf; @@ -909,7 +880,7 @@ public function iframePopup($url, $str, $attr = '', $mode = null, $marker = fals */ public function iframePopupCallback($s) { - return $this->iframePopup(p2h($s[1], false), p2h($s[3], false), $s[2]); + return self::iframePopup(p2h($s[1], false), p2h($s[3], false), $s[2]); } // }}} @@ -1068,7 +1039,7 @@ public function imageHtmlPopup($img_url, $img_tag, $link_str) } $pops = ($_conf['iframe_popup'] == 1) ? $img_tag . $link_str : array($link_str, $img_tag); - return $this->iframePopup(array($img_url, $popup_url), $pops, $_conf['ext_win_target_at'], null, true); + return self::iframePopup(array($img_url, $popup_url), $pops, $_conf['ext_win_target_at'], null, true); } // }}} @@ -1229,7 +1200,7 @@ public function plugin_linkURL($url, $purl, $str) } else { $pop_url = $link_url; } - $link = $this->iframePopup(array($link_url, $pop_url), $str, $_conf['ext_win_target_at']); + $link = self::iframePopup(array($link_url, $pop_url), $str, $_conf['ext_win_target_at']); } else { $link = "{$str}"; } @@ -1262,7 +1233,7 @@ public function plugin_linkURL($url, $purl, $str) $check_mark_prefix = ''; $check_mark_suffix = ''; } - $brocra_checker_link = $this->iframePopup(array($brocra_checker_url, $brocra_pop_url), $check_mark, $_conf['ext_win_target_at']); + $brocra_checker_link = self::iframePopup(array($brocra_checker_url, $brocra_pop_url), $check_mark, $_conf['ext_win_target_at']); } else { $brocra_checker_link = "{$check_mark}"; } @@ -1289,9 +1260,12 @@ public function plugin_link2chSubject($url, $purl, $str) { global $_conf; - if (preg_match('{^http://(\\w+\\.(?:2ch\\.net|bbspink\\.com))/(\\w+)/$}', $purl[0], $m)) { - $subject_url = "{$_conf['subject_php']}?host={$m[1]}&bbs={$m[2]}"; - return "{$str} [‚p2ŊJ]"; + if (preg_match('{^https?://(.+)/(.+)/$}', $purl[0], $m)) { + //rep2ɓo^ÂȂ΃N + if (P2HostMgr::isRegisteredBbs($m[1],$m[2])) { + $subject_url = "{$_conf['subject_php']}?host={$m[1]}&bbs={$m[2]}"; + return "{$str} [‚p2ŊJ]"; + } } return false; } @@ -1313,14 +1287,14 @@ public function plugin_linkThread($url, $purl, $str) list($nama_url, $host, $bbs, $key, $ls) = P2Util::detectThread($purl[0]); if ($host && $bbs && $key) { - $read_url = "{$_conf['read_php']}?host={$host}&bbs={$bbs}&key={$key}&ls={$ls}"; + $read_url = "{$_conf['read_php']}?host={$host}&bbs={$bbs}&key={$key}&ls={$ls}{$_conf['k_at_a']}"; if ($_conf['iframe_popup']) { if ($ls && preg_match('/^[0-9\\-n]+$/', $ls)) { $pop_url = $read_url; } else { $pop_url = $read_url . '&one=true'; } - return $this->iframePopup(array($read_url, $pop_url), $str, $_conf['bbs_win_target_at']); + return self::iframePopup(array($read_url, $pop_url), $str, $_conf['bbs_win_target_at']); } return "{$str}"; } @@ -1328,104 +1302,6 @@ public function plugin_linkThread($url, $purl, $str) return false; } - // }}} - // {{{ plugin_linkYouTube() - - /** - * YouTubeNϊvOC - * - * Zend_Gdata_Youtubeg΃TlC̑̏ȒPɎ擾ł邪... - * - * @param string $url - * @param array $purl - * @param string $str - * @return string|false - */ - public function plugin_linkYouTube($url, $purl, $str) - { - global $_conf; - - // http://www.youtube.com/watch?v=Mn8tiFnAUAI - // http://m.youtube.com/watch?v=OhcX0xJsDK8&client=mv-google&gl=JP&hl=ja&guid=ON&warned=True - if (preg_match('{^http://(www|jp|m)\\.youtube\\.com/watch\\?(?:.+&)?v=([0-9a-zA-Z_\\-]+)}', $url, $m)) { - // ime - if ($_conf['through_ime']) { - $link_url = P2Util::throughIme($url); - } else { - $link_url = $url; - } - - // HTML|bvAbv - if ($_conf['iframe_popup']) { - $link = $this->iframePopup($link_url, $str, $_conf['ext_win_target_at']); - } else { - $link = "{$str}"; - } - - $subd = $m[1]; - $id = $m[2]; - - if ($_conf['link_youtube'] == 2) { - return << -EOP; - } else { - return <<
    -EOP; - } - } - return false; - } - - // }}} - // {{{ plugin_linkNicoNico() - - /** - * jRjRϊvOC - * - * @param string $url - * @param array $purl - * @param string $str - * @return string|false - */ - public function plugin_linkNicoNico($url, $purl, $str) - { - global $_conf; - - // http://www.nicovideo.jp/watch?v=utbrYUJt9CSl0 - // http://www.nicovideo.jp/watch/utvWwAM30N0No - // http://m.nicovideo.jp/watch/sm7044684 - if (preg_match('{^http://(?:www|m)\\.nicovideo\\.jp/watch(?:/|(?:\\?v=))([0-9a-zA-Z_-]+)}', $url, $m)) { - // ime - if ($_conf['through_ime']) { - $link_url = P2Util::throughIme($purl[0]); - } else { - $link_url = $url; - } - - // HTML|bvAbv - if ($_conf['iframe_popup']) { - $link = $this->iframePopup($link_url, $str, $_conf['ext_win_target_at']); - } else { - $link = "{$str}"; - } - - $id = $m[1]; - - if ($_conf['link_niconico'] == 2) { - return << -EOP; - } else { - return <<
    -EOP; - } - } - return false; - } - // }}} // {{{ plugin_viewImage() @@ -1442,7 +1318,7 @@ public function plugin_viewImage($url, $purl, $str) global $_conf; global $pre_thumb_unlimited, $pre_thumb_limit; - if (P2Util::isUrlWikipediaJa($url)) { + if (P2HostMgr::isUrlWikipediaJa($url)) { return false; } @@ -1453,7 +1329,7 @@ public function plugin_viewImage($url, $purl, $str) if (preg_match('{^https?://.+?\\.(jpe?g|gif|png)$}i', $purl[0]) && empty($purl['query'])) { $pre_thumb_limit--; // \JE^ - $img_tag = ""; + $img_tag = ""; if ($_conf['iframe_popup']) { $view_img = $this->imageHtmlPopup($url, $img_tag, $str); @@ -1482,182 +1358,6 @@ public function plugin_viewImage($url, $purl, $str) return false; } - // }}} - // {{{ plugin_imageCache2() - - /** - * ImageCache2TlCϊ - * - * @param string $url - * @param array $purl - * @param string $str - * @return string|false - */ - public function plugin_imageCache2($url, $purl, $str, - $force = false, - $referer = null) - { - static $serial = 0; - - global $_conf; - global $pre_thumb_unlimited, $pre_thumb_ignore_limit, $pre_thumb_limit; - - if (P2Util::isUrlWikipediaJa($url)) { - return false; - } - - if ((preg_match('{^https?://.+?\\.(jpe?g|gif|png)$}i', $purl[0]) && empty($purl['query'])) || $force) { - // - $serial++; - $thumb_id = 'thumbs' . $serial . $this->thumb_id_suffix; - $tmp_thumb = './img/ic_load.png'; - $url_ht = $url; - $url = $purl[0]; - $url_en = rawurlencode($url) . - ($referer ? '&ref=' . rawurlencode($referer) : ''); - $img_id = null; - - $icdb = new ImageCache2_DataObject_Images(); - - // r=0:N;r=1:_CNg;r=2:PHPŕ\ - // t=0:IWi;t=1:PCpTlC;t=2:gїpTlC;t=3:ԃC[W - $img_url = 'ic2.php?r=1&uri=' . $url_en; - $thumb_url = 'ic2.php?r=1&t=1&uri=' . $url_en; - // CɃX摜N - $rank = null; - if ($_conf['expack.ic2.fav_auto_rank']) { - $rank = $this->getAutoFavRank(); - if ($rank !== null) { - $thumb_url .= '&rank=' . $rank; - } - } - - // DBɉ摜񂪓o^ĂƂ - if ($icdb->get($url)) { - $img_id = $icdb->id; - - // EBXɊĂt@ĈƂ - if ($icdb->mime == 'clamscan/infected') { - return " {$str}"; - } - // ځ[摜̂Ƃ - if ($icdb->rank < 0) { - return " {$str}"; - } - - // IWiLbVĂƂ͉摜𒼐ړǂݍ - $_img_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime); - if (file_exists($_img_url)) { - $img_url = $_img_url; - $cached = true; - } else { - $cached = false; - } - - // TlC쐬ĂĂƂ͉摜𒼐ړǂݍ - $_thumb_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime); - if (file_exists($_thumb_url)) { - $thumb_url = $_thumb_url; - // X^C@\ONŃX^CL^ĂȂƂDBXV - if (!is_null($this->img_memo) && strpos($icdb->memo, $this->img_memo) === false){ - $update = new ImageCache2_DataObject_Images(); - if (!is_null($icdb->memo) && strlen($icdb->memo) > 0) { - $update->memo = $this->img_memo . ' ' . $icdb->memo; - } else { - $update->memo = $this->img_memo; - } - $update->whereAddQuoted('uri', '=', $url); - } - - // expack.ic2.fav_auto_rank_override ̐ݒƃNOKȂ - // CɃX摜N㏑XV - if ($rank !== null && - self::isAutoFavRankOverride($icdb->rank, $rank)) { - if ($update === null) { - $update = new ImageCache2_DataObject_Images(); - $update->whereAddQuoted('uri', '=', $url); - } - $update->rank = $rank; - } - - if ($update !== null) { - $update->update(); - } - } - - // TlC̉摜TCY - $thumb_size = $this->thumbnailer->calc($icdb->width, $icdb->height); - $thumb_size = preg_replace('/(\d+)x(\d+)/', 'width="$1" height="$2"', $thumb_size); - $tmp_thumb = './img/ic_load1.png'; - - $orig_img_url = $img_url; - $orig_thumb_url = $thumb_url; - - // 摜LbVĂȂƂ - // X^C@\ONȂNGUTF-8GR[hX^C܂߂ - } else { - // 摜ubNXgorG[Oɂ邩mF - if (false !== ($errcode = $icdb->ic2_isError($url))) { - return " {$str}"; - } - - $cached = false; - - $orig_img_url = $img_url; - $orig_thumb_url = $thumb_url; - $img_url .= $this->img_memo_query; - $thumb_url .= $this->img_memo_query; - $thumb_size = ''; - $tmp_thumb = './img/ic_load2.png'; - } - - // LbVĂ炸A\L̂Ƃ - if (!$cached && !$pre_thumb_unlimited && !$pre_thumb_ignore_limit) { - // \𒴂ĂA\Ȃ - // \𒴂ĂȂ΁A\JE^ - if ($pre_thumb_limit <= 0) { - $show_thumb = false; - } else { - $show_thumb = true; - $pre_thumb_limit--; - } - } else { - $show_thumb = true; - } - - // \[h - if ($show_thumb) { - $img_tag = ""; - if ($_conf['iframe_popup']) { - $view_img = $this->imageHtmlPopup($img_url, $img_tag, $str); - } else { - $view_img = "{$img_tag}{$str}"; - } - } else { - $img_tag = ""; - $view_img = "{$img_tag}{$str}"; - } - - // \[Xւ̃Nimetŕ\ - if ($_conf['expack.ic2.enabled'] && $_conf['expack.ic2.through_ime']) { - $ime_url = P2Util::throughIme($url); - if ($_conf['iframe_popup'] == 3) { - $ime_mark = ''; - } else { - $ime_mark = '[ime]'; - } - $view_img .= " {$ime_mark}"; - } - - $view_img .= ''; - - return $view_img; - } - - return false; - } - // }}} // {{{ plugin_replaceImageUrl() @@ -1719,18 +1419,16 @@ public function plugin_replaceImageUrl($url, $purl, $str) } // IWiLbVĂƂ͉摜𒼐ړǂݍ - $_img_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime); - if (file_exists($_img_url)) { - $img_url = $_img_url; + if (file_exists($this->thumbnailer->srcPath($icdb->size, $icdb->md5, $icdb->mime))) { + $img_url = $this->thumbnailer->srcUrl($icdb->size, $icdb->md5, $icdb->mime); $cached = true; } else { $cached = false; } // TlC쐬ĂĂƂ͉摜𒼐ړǂݍ - $_thumb_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime); - if (file_exists($_thumb_url)) { - $thumb_url = $_thumb_url; + if (file_exists($this->thumbnailer->thumbPath($icdb->size, $icdb->md5, $icdb->mime))) { + $thumb_url = $this->thumbnailer->thumbUrl($icdb->size, $icdb->md5, $icdb->mime); // X^C@\ONŃX^CL^ĂȂƂDBXV if (!is_null($this->img_memo) && strpos($icdb->memo, $this->img_memo) === false){ $update = new ImageCache2_DataObject_Images(); @@ -1832,30 +1530,6 @@ public function plugin_linkPlugin($url, $purl, $str) return $GLOBALS['linkPluginCtl']->replaceLinkToHTML($url, $str); } - // }}} - // {{{ plugin_imepitaToImageCache2() - - /** - * imepitaURLHImageCache2vOC - * - * @param string $url - * @param array $purl - * @param string $str - * @return string|false - */ - public function plugin_imepitaToImageCache2($url, $purl, $str) - { - if (preg_match('{^https?://imepita\.jp/(?:image/)?(\d{8}/\d{6})}i', - $purl[0], $m) && empty($purl['query'])) { - $_url = 'http://imepita.jp/image/' . $m[1]; - $_purl = @parse_url($_url); - $_purl[0] = $_url; - return $this->plugin_imageCache2($_url, $_purl, $str, true, $url); - } - return false; - } - - // }}} // }}} // {{{ getQuotebacksJson() diff --git a/lib/SubjectTxt.php b/lib/SubjectTxt.php index 0d207809f..f45edbba1 100644 --- a/lib/SubjectTxt.php +++ b/lib/SubjectTxt.php @@ -24,15 +24,24 @@ class SubjectTxt */ public function __construct($host, $bbs) { + global $_conf; $this->host = $host; $this->bbs = $bbs; $this->storage = 'file'; $this->subject_file = P2Util::datDirOfHostBbs($host, $bbs) . 'subject.txt'; - $this->subject_url = 'http://' . $host . '/' . $bbs . '/subject.txt'; + // ڑ悪2ch.netȂSSLʐMs(pink͑ΉĂȂ̂łȂ) + if (P2HostMgr::isHost2chs($host) && ! P2HostMgr::isHostBbsPink($host) && $_conf['2ch_ssl.subject']) { + $this->subject_url = 'https://' . $host . '/' . $bbs . '/subject.txt'; + } else { + $this->subject_url = 'http://' . $host . '/' . $bbs . '/subject.txt'; + } // ΂livedoorړ]ɑΉBǍlivedoorƂB - $this->subject_url = P2Util::adjustHostJbbs($this->subject_url); + if(P2HostMgr::isHostJbbsShitaraba($host)) + { + $this->subject_url = P2HostMgr::adjustHostJbbs($this->subject_url); + } // subject.txt_E[hZbg $this->dlAndSetSubject(); @@ -86,36 +95,42 @@ public function downloadSubject() } // DL - $params = array(); - $params['timeout'] = $_conf['http_conn_timeout']; - $params['readTimeout'] = array($_conf['http_read_timeout'], 0); - if ($_conf['proxy_use']) { - $params['proxy_host'] = $_conf['proxy_host']; - $params['proxy_port'] = $_conf['proxy_port']; - } - $req = new HTTP_Request($this->subject_url, $params); - $modified && $req->addHeader("If-Modified-Since", $modified); - $req->addHeader('User-Agent', "Monazilla/1.00 ({$_conf['p2ua']})"); + try { + $req = P2Commun::createHTTPRequest($this->subject_url, HTTP_Request2::METHOD_GET); + $modified && $req->setHeader("If-Modified-Since", $modified); - $response = $req->sendRequest(); + $response = P2Commun::getHTTPResponse($req); - if (PEAR::isError($response)) { - $error_msg = $response->getMessage(); - } else { - $code = $req->getResponseCode(); + $code = $response->getStatus(); if ($code == 302) { // zXg̈ړ]ǐ - $new_host = BbsMap::getCurrentHost($this->host, $this->bbs); + $new_host = P2HostMgr::getCurrentHost($this->host, $this->bbs); if ($new_host != $this->host) { $aNewSubjectTxt = new SubjectTxt($new_host, $this->bbs); $body = $aNewSubjectTxt->downloadSubject(); return $body; } - } - if (!($code == 200 || $code == 206 || $code == 304)) { + } elseif ($code == 200 || $code == 206) { //var_dump($req->getResponseHeader()); + $body = $response->getBody(); + // or be.2ch.net ȂEUCSJISɕϊ + if (P2HostMgr::isHostJbbsShitaraba($this->host) || P2HostMgr::isHostBe2chs($this->host)) { + $body = mb_convert_encoding($body, 'CP932', 'CP51932'); + } + if (FileCtl::file_write_contents($this->subject_file, $body) === false) { + p2die('cannot write file'); + } + } elseif ($code == 304) { + // touch邱ƂōXVC^[ôŁA΂炭ă`FbNȂȂ + // iύXȂ̂ɏCԂXV̂́ACi܂ȂAł͓ɖȂ낤j + if ($this->storage === 'file') { + touch($this->subject_file); + } + } else { $error_msg = $code; } + } catch (Exception $e) { + $error_msg = $e->getMessage(); } if (isset($error_msg) && strlen($error_msg) > 0) { @@ -124,27 +139,6 @@ public function downloadSubject() $info_msg_ht .= "rep2 info: {$this->subject_url} ɐڑł܂łB

    "; P2Util::pushInfoHtml($info_msg_ht); $body = ''; - } else { - $body = $req->getResponseBody(); - } - - // DL XVĂ - if ($body && $code != "304") { - - // or be.2ch.net ȂEUCSJISɕϊ - if (P2Util::isHostJbbsShitaraba($this->host) || P2Util::isHostBe2chNet($this->host)) { - $body = mb_convert_encoding($body, 'CP932', 'CP51932'); - } - - if (FileCtl::file_write_contents($this->subject_file, $body) === false) { - p2die('cannot write file'); - } - } else { - // touch邱ƂōXVC^[ôŁA΂炭ă`FbNȂȂ - // iύXȂ̂ɏCԂXV̂́ACi܂ȂAł͓ɖȂ낤j - if ($this->storage === 'file') { - touch($this->subject_file); - } } return $body; @@ -190,7 +184,7 @@ public function setSubjectLines($cont = '') $this->subject_lines = FileCtl::file_read_lines($this->subject_file); // JBBS@΂ȂdX^C폜 - if (P2Util::isHostJbbsShitaraba($this->host)) { + if (P2HostMgr::isHostJbbsShitaraba($this->host)) { $this->subject_lines = array_unique($this->subject_lines); } diff --git a/lib/Thread.php b/lib/Thread.php index 88dcb57b6..41f030b94 100644 --- a/lib/Thread.php +++ b/lib/Thread.php @@ -27,12 +27,15 @@ class Thread */ public $newline; // ̐VK擾Xԍ // idxline[9] p~\B݊̂ߎcĂ͂B + public $lastmodify; // lastmodify(http://info.5ch.net/index.php/Monazilla/develop/lastmodify.txt) + public $extdat; // VIPQ2 !extend(https://info.5ch.net/index.php/%E6%96%B0%E7%94%9FVIPQ2#.21extend:) + // hostƂ͂̂́A2chȌꍇ́Ahostȉ̃fBNg܂Ŋ܂܂Ă肷B public $host; // ex)pc.2ch.net // idxline[10] public $bbs; // ex)mac // idxline[11] public $itaj; // – ex)VEmac - public $datochiok; // DAT擾true(1) // idxline[12] + public $datochiok; // ߋOȂtrue(1) // idxline[12]@// gĂ`Ղ̂ōėp public $torder; // XbhVԍ public $unum; // ǁiVXj @@ -156,6 +159,14 @@ public function __set($name, $value) */ public function setTtitle($ttitle) { + global $_conf; + + //쌠\L + if ($_conf['delete_copyright']==1) { + foreach (explode (',',$_conf['delete_copyright.list']) as $value) { + $ttitle = str_replace($value,'',$ttitle); + } + } $this->ttitle = $ttitle; } @@ -189,6 +200,8 @@ public function getTtitleHd() if ($this->_ttitle_hd === null) { // HTML\p htmlspecialchars() $this->_ttitle_hd = p2h($this->ttitle, false); + // [ua]ȂǂfR[h + $this->_ttitle_hd = str_replace('</mark>', '', str_replace('<mark>', '', $this->_ttitle_hd)); } return $this->_ttitle_hd; } @@ -349,6 +362,7 @@ public function getThreadInfoFromIdx() $this->fav = (int)$lar[6]; // boolłȂ + // ߋO荞ݍσtO if (isset($lar[12])) { $this->datochiok = $lar[12]; } @@ -393,7 +407,25 @@ public function getThreadInfoFromSubjectTxtLine($l) { //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('getThreadInfoFromSubjectTxtLine()'); - if (preg_match('/^([0-9]+)\\.(?:dat|cgi)(?:,|<>)(.+) ?(?:\\(|i)([0-9]+)(?:\\)|j)/', $l, $matches)) { + if (preg_match('/^([0-9]+)\\.(?:dat|cgi)(?:,|<>)(.+) ?(?:\\(|i)([0-9]+)(?:\\)|j)$/', $l, $matches)) { + $this->isonline = true; + $this->key = $matches[1]; + $this->setTtitle(rtrim($matches[2])); + $this->rescount = (int)$matches[3]; + if ($this->readnum) { + $this->unum = $this->rescount - $this->readnum; + // machi bbs sagesubject̍XVsȂȂ̂ŒĂ + if ($this->unum < 0) { + $this->unum = 0; + } + $this->nunum = $this->unum; + } + + //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('getThreadInfoFromSubjectTxtLine()'); + return true; + } + + if (preg_match('/^([0-9]+)\.(?:dat|cgi)<>(.+?)<>(\d+)<>(\d+)<>(\d+)<>(\d+)<>(.+?)<>(.+?)<>/', $l, $matches)) { $this->isonline = true; $this->key = $matches[1]; $this->setTtitle(rtrim($matches[2])); @@ -406,6 +438,8 @@ public function getThreadInfoFromSubjectTxtLine($l) } $this->nunum = $this->unum; } + $this->lastmodify = (int)$matches[6]; + $this->extdat = $matches[8]; //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('getThreadInfoFromSubjectTxtLine()'); return true; @@ -446,7 +480,7 @@ public function setTitleFromLocal() $this->setTtitle($d[4]); // be.2ch.net ȂEUCSJISϊ - if (P2Util::isHostBe2chNet($this->host)) { + if (P2HostMgr::isHostBe2chs($this->host)) { $ttitle = mb_convert_encoding($this->ttitle, 'CP932', 'CP51932'); $this->setTtitle($ttitle); } @@ -487,13 +521,13 @@ public function getMotoThread($force_pc = false, $ls = null) } // 2chn - if (P2Util::isHost2chs($this->host)) { + if (P2HostMgr::isHost2chs($this->host)) { // PC if (!$mobile) { $motothre_url = "http://{$this->host}/test/read.cgi/{$this->bbs}/{$this->key}/{$ls}"; // g } else { - if (P2Util::isHostBbsPink($this->host)) { + if (P2HostMgr::isHostBbsPink($this->host)) { //$motothre_url = "http://{$this->host}/test/r.i/{$this->bbs}/{$this->key}/{$ls}"; $motothre_url = "http://speedo.ula.cc/test/r.so/{$this->host}/{$this->bbs}/{$this->key}/{$ls}"; } else { @@ -505,7 +539,7 @@ public function getMotoThread($force_pc = false, $ls = null) } // ܂BBS - } elseif (P2Util::isHostMachiBbs($this->host)) { + } elseif (P2HostMgr::isHostMachiBbs($this->host)) { if ($mobile) { $motothre_url = "http://{$this->host}/bbs/read.pl?IMODE=TRUE&BBS={$this->bbs}&KEY={$this->key}"; } else { @@ -513,13 +547,13 @@ public function getMotoThread($force_pc = false, $ls = null) } // ܂т˂ - } elseif (P2Util::isHostMachiBbsNet($this->host)) { + } elseif (P2HostMgr::isHostMachiBbsNet($this->host)) { $motothre_url = "http://{$this->host}/test/read.cgi?bbs={$this->bbs}&key={$this->key}"; if ($mobile) { $motothre_url .= '&imode=true'; } // JBBS - } elseif (P2Util::isHostJbbsShitaraba($this->host)) { - list($host, $category) = explode('/', P2Util::adjustHostJbbs($this->host), 2); + } elseif (P2HostMgr::isHostJbbsShitaraba($this->host)) { + list($host, $category) = explode('/', P2HostMgr::adjustHostJbbs($this->host), 2); $bbs_cgi = ($mobile) ? 'i.cgi' : 'read.cgi'; $motothre_url = "http://{$host}/bbs/{$bbs_cgi}/{$category}/{$this->bbs}/{$this->key}/{$ls}"; @@ -623,7 +657,7 @@ public function getFavStatus() $this->_favs = array($this->fav); } else { $this->_favs = array_fill(0, $_conf['expack.misc.favset_num'] + 1, false); - $group = P2Util::getHostGroupName($this->host); + $group = P2HostMgr::getHostGroupName($this->host); foreach ($_conf['favlists'] as $num => $favlist) { foreach ($favlist as $fav) { if ($this->key == $fav['key'] && $this->bbs == $fav['bbs'] && $group == $fav['group']) { diff --git a/lib/ThreadList.php b/lib/ThreadList.php index 8a6c9cd6a..ccac14013 100644 --- a/lib/ThreadList.php +++ b/lib/ThreadList.php @@ -167,7 +167,10 @@ public function readList() } if (empty($_REQUEST['norefresh']) && !(empty($_REQUEST['refresh']) && isset($_REQUEST['word']))) { - if ($_conf['expack.use_pecl_http'] == 1) { + if ($_conf['expack.use_curl_multi'] == 1) { + P2CurlMulti::fetchSubjectTxt($favitas); + $GLOBALS['expack.subject.multi-threaded-download.done'] = true; + } elseif ($_conf['expack.use_pecl_http'] == 1) { P2HttpExt::activate(); P2HttpRequestPool::fetchSubjectTxt($favitas); $GLOBALS['expack.subject.multi-threaded-download.done'] = true; @@ -282,6 +285,38 @@ public function readList() default: if (!$this->spmode) { $aSubjectTxt = new SubjectTxt($this->host, $this->bbs); + if (P2HostMgr::isHost2chs($this->host)) { + // subject.txt lastmodify.txt `ɕϊ‚ƒ}[W + // {subject.txt lastmodify.txt `ɕϊ̂ SubjectTxt NX̒ōsق + // IɂȂƂ肠ł + foreach($aSubjectTxt->subject_lines as $l){ + if (!preg_match('/^(([0-9]+)\\.(?:dat|cgi))(?:,|<>)(.+) ?(?:\\(|i)([0-9]+)(?:\\)|j)/', $l, $matches)) { + continue; + } + + $threads[$matches[2]]['key'] = $matches[1]; // XbhID + $threads[$matches[2]]['title'] = $matches[3]; // title + $threads[$matches[2]]['rc'] = $matches[4]; // rescount + + $threads[$matches[2]]['param'] = implode('<>',array_fill(0, 5, '')); // lastmodify.txt Ɋ܂܂ȂX\ł悤 + } + + $aLastmodify = new LastmodifyTxt($this->host, $this->bbs); + foreach($aLastmodify->lastmodify_lines as $l){ + if (!preg_match('/^(([0-9]+)\.(?:dat|cgi))<>(.+?)<>(\d+)<>(\d+)<>(\d+)<>(\d+)<>(.+?)<>(.+?)<>/', $l, $matches)) { + continue; + } + + $key = $matches[2]; + array_splice($matches, 0, 5); // subject.txt Ɋ܂܂Ăf[^͎̂Ă + $threads[$key]['param'] = implode('<>', $matches); // extend + } + + unset($aSubjectTxt->subject_lines); + foreach($threads as $l){ + $aSubjectTxt->subject_lines[] = implode('<>', $l) . "<>\n"; + } + } $lines = $aSubjectTxt->subject_lines; } } diff --git a/lib/ThreadRead.php b/lib/ThreadRead.php index 1d766263c..0e045addb 100644 --- a/lib/ThreadRead.php +++ b/lib/ThreadRead.php @@ -11,26 +11,18 @@ /** * Xbh[hNX */ -class ThreadRead extends Thread -{ +class ThreadRead extends Thread { // {{{ properties - public $datlines; // datǂݍ񂾃Ci[z - public $resrange; // array('start' => i, 'to' => i, 'nofirst' => bool) - public $onbytes; // T[o擾datTCY public $diedat; // T[odat擾悤ƂĂłȂtrueZbg public $onthefly; // [JdatۑȂIUtCǂݍ݂Ȃtrue - - public $idp; // XԍL[AID̑O̕ ("ID:", " " ) lƂAzz - public $ids; // XԍL[AIDlƂAzz + public $idp; // XԍL[AID̑O̕ ("ID:", " " ) lƂAzz + public $ids; // XԍL[AIDlƂAzz public $idcount; // IDL[Ao񐔂lƂAzz - public $getdat_error_msg_ht; // dat擾Ɏsɕ\郁bZ[WiHTMLj - - public $old_host; // zXgړ]oAړ]ÕzXgێ - + public $old_host; // zXgړ]oAړ]ÕzXgێ private $getdat_error_body; // dat擾Ɏs203Ŏ擾łBODY public $datochi_residuums; // dat擾Ɏs203Ŏ擾łdatline̔ziX=>datlinej @@ -40,9 +32,8 @@ class ThreadRead extends Thread /** * RXgN^ */ - public function __construct() - { - parent::__construct(); + public function __construct() { + parent::__construct (); $this->getdat_error_msg_ht = ""; } @@ -52,91 +43,94 @@ public function __construct() /** * DAT_E[h */ - public function downloadDat() - { + public function downloadDat() { global $_conf; + // ߋȌꍇȂ + if($this->datochiok) { + return true; + } // ܂BBS - if (P2Util::isHostMachiBbs($this->host)) { - DownloadDatMachiBbs::invoke($this); - // JBBS@ - } elseif (P2Util::isHostJbbsShitaraba($this->host)) { - if (!function_exists('shitarabaDownload')) { + if (P2HostMgr::isHostMachiBbs ($this->host)) { + return DownloadDatMachiBbs::invoke ($this); + // JBBS@ + } elseif (P2HostMgr::isHostJbbsShitaraba ($this->host)) { + if (! function_exists ('shitarabaDownload')) { include P2_LIB_DIR . '/read_shitaraba.inc.php'; } - shitarabaDownload($this); + return shitarabaDownload ($this); - // 2chn + // 2chn } else { - $this->getDatBytesFromLocalDat(); // $aThread->length set - - // 2ch bbspinkǂ - if (P2Util::isHost2chs($this->host) && !empty($_GET['maru'])) { - // OCĂȂ or OCA24Ԉȏo߂Ă玩ăOC - if (!file_exists($_conf['sid2ch_php']) || - !empty($_REQUEST['relogin2ch']) || - (filemtime($_conf['sid2ch_php']) < time() - 60*60*24)) - { - if (!function_exists('login2ch')) { - include P2_LIB_DIR . '/login2ch.inc.php'; - } - if (!login2ch()) { - $this->getdat_error_msg_ht .= $this->get2chDatError(); - $this->diedat = true; - return false; - } - } + $this->getDatBytesFromLocalDat (); // $aThread->length set + $pinktest = "/\w+\.bbspink.com/"; - include $_conf['sid2ch_php']; - $this->_downloadDat2chMaru($uaMona, $SID2ch); - - // 2ch bbspink ^|ǂ - } elseif (P2Util::isHost2chs($this->host) && !empty($_GET['moritapodat']) && - $_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass']) - { - if (!array_key_exists('csrfid', $_GET) || - $this->_getCsrfIdForMoritapoDat() != $_GET['csrfid']) - { - p2die('sȃNGXgł'); - } - $this->_downloadDat2chMoritapo(); - - // 2ch̉ߋOqɓǂ - } elseif (!empty($_GET['kakolog']) && !empty($_GET['kakoget'])) { + if (! empty ($_GET['kakolog']) && ! empty ($_GET['kakoget'])) { if ($_GET['kakoget'] == 1) { $ext = '.dat.gz'; } elseif ($_GET['kakoget'] == 2) { $ext = '.dat'; } - $this->_downloadDat2chKako($_GET['kakolog'], $ext); + return $this->_downloadDat2chKako ($_GET['kakolog'], $ext); + + // 2ch APIoRŗƂ + } elseif (P2HostMgr::isHost2chs ($this->host) && !P2HostMgr::isNotUse2chsAPI ($this->host) && $_conf['2chapi_use'] && empty ($_GET['olddat'])) { + + // OCĂȂ or OCAݒ肵Ԍo߂Ă玩ăOC + if (! file_exists ($_conf['sid2chapi_php']) || ! empty ($_REQUEST['relogin2chapi']) || (filemtime ($_conf['sid2chapi_php']) < time () - 60 * 60 * $_conf['2chapi_interval'])) { + if (! function_exists ('authenticate_2chapi')) { + include P2_LIB_DIR . '/auth2chapi.inc.php'; + } + if (! authenticate_2chapi ()) { + $this->getdat_error_msg_ht .= $this->get2chDatError (); + $this->diedat = true; + return false; + } + } - // 2ch or 2ch݊ + include $_conf['sid2chapi_php']; + return $this->_downloadDat2chAPI ($uaMona, $SID2chAPI, $this->length); } else { + + // 2ch ȊO̊O // DATDL - $this->_downloadDat2ch($this->length); + return $this->_downloadDat2ch ($this->length); } - } } // }}} - // {{{ _downloadDat2ch() + // {{{ _downloadDat2chAPI() /** - * W@ 2ch݊ DAT _E[h + * 2chAPI DAT _E[h * * @return mix 擾łAXVȂꍇtrueԂ */ - protected function _downloadDat2ch($from_bytes) - { + protected function _downloadDat2chAPI($uaMona, $SID2ch, $from_bytes) { global $_conf; global $debug; - if (!($this->host && $this->bbs && $this->key)) { + $AppKey = $_conf['2chapi_appkey']; + $AppName = $_conf['2chapi_appname']; + $HMKey = $_conf['2chapi_hmkey']; + $ReadUA = sprintf ($_conf['2chapi_ua.read'], $AppName); + + if (! ($this->host && $this->bbs && $this->key)) { + return false; + } + + // >>1vr[͍̎擾Ȃėǂ̂ŏtrue(V)Ԃ + if (is_readable ($this->keydat) && ! empty ($_GET['one'])) { + return true; + } + + if ($SID2ch == '') { return false; } + $SID2ch = str_replace ("$uaMona:", '', $SID2ch); - $from_bytes = intval($from_bytes); + $from_bytes = intval ($from_bytes); if ($from_bytes == 0) { $zero_read = true; @@ -145,422 +139,426 @@ protected function _downloadDat2ch($from_bytes) $from_bytes = $from_bytes - 1; } - $method = 'GET'; - - $url = "http://{$this->host}/{$this->bbs}/dat/{$this->key}.dat"; - //$url="http://news2.2ch.net/test/read.cgi?bbs=newsplus&key=1038486598"; - - $purl = parse_url($url); // URL - if (isset($purl['query'])) { // NG[ - $purl['query'] = '?' . $purl['query']; - } else { - $purl['query'] = ''; - } - - // vLV - if ($_conf['proxy_use']) { - $send_host = $_conf['proxy_host']; - $send_port = $_conf['proxy_port']; - $send_path = $url; - } else { - $send_host = $purl['host']; - $send_port = isset($purl['port']) ? $purl['port'] : 80; - $send_path = $purl['path'] . $purl['query']; - } + $serverName = explode ('.', $this->host); + // $url = "http://{$this->host}/{$this->bbs}/dat/{$this->key}.dat"; + // $url="http://news2.2ch.net/test/read.cgi?bbs=newsplus&key=1038486598"; - if (!$send_port) { - $send_port = 80; // ftHg80 - } + $url= http_build_url(array( + "scheme" => $_conf['2chapi_ssl.read']?"https":"http", + "host" => "api.5ch.net", + "path" => "v1/".$serverName[0] . '/' . $this->bbs . '/' . $this->key)); - $request = "{$method} {$send_path} HTTP/1.0\r\n"; - $request .= "Host: {$purl['host']}\r\n"; - $request .= "Accept: */*\r\n"; - //$request .= "Accept-Charset: Shift_JIS\r\n"; - //$request .= "Accept-Encoding: gzip, deflate\r\n"; - $request .= "Accept-Language: ja, en\r\n"; - $request .= "User-Agent: Monazilla/1.00 ({$_conf['p2ua']})\r\n"; - if (!$zero_read) { - $request .= "Range: bytes={$from_bytes}-\r\n"; - } - $request .= "Referer: http://{$purl['host']}/{$this->bbs}/\r\n"; + $message = '/v1/' . $serverName[0] . '/' . $this->bbs . '/' . $this->key . $SID2ch . $AppKey; + $HB = hash_hmac ("sha256", $message, $HMKey); - if ($this->modified) { - $request .= "If-Modified-Since: {$this->modified}\r\n"; - } + try { + $req = P2Commun::createHTTPRequest ($url, HTTP_Request2::METHOD_POST); - // BasicFؗp̃wb_ - if (isset($purl['user']) && isset($purl['pass'])) { - $request .= "Authorization: Basic ".base64_encode($purl['user'].":".$purl['pass'])."\r\n"; - } + // wb_ + $req->setHeader ('User-Agent', $ReadUA); - $request .= "Connection: Close\r\n"; + if (! empty ($_GET['one'])) { + // >>1vr[̎̓T[o[ɍŏ̕ + $req->setHeader ('Range', "bytes=0-8192"); + } elseif (! $zero_read) { + $req->setHeader ('Range', sprintf ('bytes=%d-', $from_bytes) ); + } - $request .= "\r\n"; + if ($this->modified) { + $req->setHeader ('If-Modified-Since', $this->modified); + } - // WEBT[o֐ڑ - $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); - if (!$fp) { - self::_pushInfoConnectFailed($url, $errno, $errstr); - $this->diedat = true; - return false; - } - stream_set_timeout($fp, $_conf['http_read_timeout'], 0); + // POSTe + $req->addPostParameter (array ( + 'sid' => $SID2ch, + 'hobo' => $HB, + 'appkey' => $AppKey + )); + + // POSTf[^̑M + $response = P2Commun::getHTTPResponse($req); + + // 2ch API ̏Ԃwb_[ɋLڂĂ̂Ŏ擾B + // User-Status: 0 (sessionID) or 1 (sessionIDL) or + // 2 (sessionIDL^https://2chv.tora3.net/futen.cgiŎ擾) + // 3 (sessionIDL^APIF؎RoninAJEgtĎ擾) + // User-Status: 2,3 ̎dat/ߋO + $apiUserStatus = $response->getHeader('User-Status'); + if(empty($apiUserStatus)){ + // wb_[ɋLڂĂȂꍇ 0 Ƃ݂Ȃ + $apiUserStatus = 0; + } - fputs($fp, $request); + // Thread-Status: 0 (dat擾s) or 1 (sX) or 2 (dat) or 3 (ߋO) or + // 8 (dat擾s^Ronindat/ߋO낤ƂƂ) + $apiThreadStatus = $response->getHeader('Thread-Status'); + if(empty($apiThreadStatus)){ + // wb_[ɋLڂĂȂꍇ 0 Ƃ݂Ȃ + $apiThreadStatus = 0; + } - $body = ''; - $code = null; - $start_here = false; + $code = $response->getStatus (); - while (!p2_stream_eof($fp, $timed_out)) { + if($_conf['2chapi_debug_print']==1) + { + P2Util::pushInfoHtml('

    p2 debug(ThreadRead::API):URL='.$url.' User-Status='.$apiUserStatus.' Thread-Status='.$apiThreadStatus.' HTTP-Status='.$code.'

    '); + } - if ($start_here) { + // dat擾s‚ꍇ + if($apiThreadStatus === 0){ + $this->getdat_error_msg_ht .= "

    rep2 error: sessionID " . ($apiUserStatus === 0 ? '̂':'͗Lł') . "Xbh擾Ɏs܂B

    "; + if($apiUserStatus === 0){ + $this->getdat_error_msg_ht .= " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&relogin2chapi=true\">APIōĎ擾݂]"; + $this->getdat_error_msg_ht .= " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&olddat=true\">datōĎ擾݂]"; + $this->diedat = true; + return false; + } + } - if ($code == '200' || $code == '206') { + // API̕ԓߋO(Ronin)ߋON\ďI + if($apiThreadStatus == '8') { + return $this->_downloadDat2chNotFound ('302'); + } - while (!p2_stream_eof($fp, $timed_out)) { - $body .= fread($fp, 4096); + if ($code == '200' || $code == '206') { // Partial Content + $body = $response->getBody (); + + if (! empty ($_GET['one'])) { + $cut = mb_strrpos ($body, "\n"); + $body = mb_substr ($body, 0, $cut === false ? mb_strlen ($body) : $cut + 1); + $this->onbytes = strlen ($body); + } elseif ($zero_read) { + $this->onbytes = intval ($response->getHeader ('Content-Length')); + if(!$this->onbytes) { + // APĨX|Xwb_[Content-LengthtȂ̂bodỹTCYőp + $this->onbytes = strlen ($body); } - - if ($timed_out) { - self::_pushInfoReadTimedOut($url); - $this->diedat = true; - fclose($fp); - return false; + } else { + if (preg_match ('@^bytes ([^/]+)/([0-9]+)@i', $response->getHeader ('Content-Range'), $matches)) { + $this->onbytes = intval ($matches[2]); } + } - // ̉słځ[`FbN - if (!$zero_read) { - if (substr($body, 0, 1) != "\n") { - //echo "ځ[񌟏o"; - fclose($fp); - $this->onbytes = 0; - $this->modified = null; - return $this->_downloadDat2ch(0); // ځ[񌟏oBS蒼B - } - $body = substr($body, 1); - } + $this->modified = $response->getHeader ('Last-Modified'); - $file_append = ($zero_read) ? 0 : FILE_APPEND; + // DAT f[^̏ꍇ + if(!$this->onbytes){ + return $this->_downloadDat2chNotFound ('404'); + } - if (FileCtl::file_write_contents($this->keydat, $body, $file_append) === false) { - p2die('cannot write file.'); - } + // sɕ + $lines = explode("\n", $body ,3); + + // 1sڂ؂o + $firstmsg = $lines[0]; - //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection("dat_size_check"); - // 擾TCY`FbN - if ($zero_read == false && $this->onbytes) { - $this->getDatBytesFromLocalDat(); // $aThread->length set - if ($this->onbytes != $this->length) { - fclose($fp); - $this->onbytes = 0; - $this->modified = null; - P2Util::pushInfoHtml("

    rep2 info: {$this->onbytes}/{$this->length} t@CTCYςȂ̂ŁAdatĎ擾

    "); - //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection("dat_size_check"); - return $this->_downloadDat2ch(0); //datTCY͕sBS蒼B - - // TCYȂ炻̂܂ - } elseif ($this->onbytes == $this->length) { - fclose($fp); - $this->isonline = true; - //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('dat_size_check'); - return true; + // ngŎn܂ĂapĩG[̉”\ + if (preg_match ("/^ng \((.*)\)$/", $firstmsg)) { + if (strstr ($firstmsg, "not valid")) { + // sidɂȂ”\BF؂邽ߍŏ蒼B + if (empty ($_REQUEST['relogin2chapi'])) { + $_REQUEST['relogin2chapi'] = true; + return $this->downloadDat (); } } - //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('dat_size_check'); - - // XbhȂƔf - } else { - fclose($fp); - return $this->_downloadDat2chNotFound($code); + $this->getdat_error_msg_ht .= "

    rep2 error: APIoRł̃Xbh擾Ɏs܂B" . $firstmsg . "

    "; + $this->getdat_error_msg_ht .= " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&relogin2chapi=true\">APIōĎ擾݂]"; + $this->getdat_error_msg_ht .= " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&olddat=true\">datōĎ擾݂]"; + $this->diedat = true; + return false; + } elseif (mb_strpos ($firstmsg, "Q˂ <><>2015/03/13() 00:00:00.00 ID:????????<> 313Q") === 0) { + return $this->_downloadDat2chNotFound ('404'); + } elseif (mb_strpos ($firstmsg, "5˂ <><>2017/10/01() 00:00:00.00 ID:???<> ql") === 0) { + return $this->_downloadDat2chNotFound ('404'); } + unset ($firstmsg); - } else { - $l = rtrim(fgets($fp, 32800), "\r\n"); - // ex) HTTP/1.1 304 Not Modified - if (preg_match('@^HTTP/1\\.\\d (\\d+) (.+)@i', $l, $matches)) { - $code = $matches[1]; - - if ($code == '200' || $code == '206') { // Partial Content - ; - - } elseif ($code == '302') { // Found - - // zXg̈ړ]ǐ - $new_host = BbsMap::getCurrentHost($this->host, $this->bbs); - if ($new_host != $this->host) { - fclose($fp); - $this->old_host = $this->host; - $this->host = $new_host; - return $this->_downloadDat2ch($from_bytes); - } else { - fclose($fp); - return $this->_downloadDat2chNotFound($code); - } + // 2sڂ؂o + $secondmsg = $lines[1]; + + // 2sڂߋOł邱ƂĂ悤łΉߋON\ + // APĨwb_[Ŕ肵Ă܂ŗȂ悤ɕύXDATjh~̂ߎc + if (mb_strpos ($secondmsg, "Q˂ <><>2015/05/31() 00:00:00.00 ID:????????<> ̃Xbh͉ߋOłB") === 0) { + return $this->_downloadDat2chNotFound ('302'); + } - } elseif ($code == '304') { // Not Modified - fclose($fp); - $this->isonline = true; - return '304 Not Modified'; + unset ($secondmsg); + unset ($lines); - } elseif ($code == '416') { // Requested Range Not Satisfiable - //echo "ځ[񌟏o"; - fclose($fp); + // ̉słځ[`FbN + if (! $zero_read) { + if (substr ($body, 0, 1) != "\n") { + // echo "ځ[񌟏o"; $this->onbytes = 0; $this->modified = null; - return $this->_downloadDat2ch(0); // ځ[񌟏oBS蒼B - - } else { - fclose($fp); - return $this->_downloadDat2chNotFound($code); + return $this->_downloadDat2chAPI ($uaMona, $SID2ch, 0); // ځ[񌟏oBS蒼B } + $body = substr ($body, 1); } - if ($zero_read) { - if (preg_match('/^Content-Length: ([0-9]+)/i', $l, $matches)) { - $this->onbytes = intval($matches[1]); - } - } else { + $file_append = ($zero_read) ? 0 : FILE_APPEND; - if (preg_match('@^Content-Range: bytes ([^/]+)/([0-9]+)@i', $l, $matches)) { - $this->onbytes = intval($matches[2]); - } + if (FileCtl::file_write_contents ($this->keydat, $body, $file_append) === false) { + p2die ('cannot write file.'); + } + // $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection("dat_size_check"); + // 擾TCY`FbN + if ($zero_read == false && $this->onbytes) { + $this->getDatBytesFromLocalDat (); // $aThread->length set + if ($this->onbytes != $this->length) { + $this->onbytes = 0; + $this->modified = null; + P2Util::pushInfoHtml ("

    rep2 info: {$this->onbytes}/{$this->length} t@CTCYςȂ̂ŁAdatĎ擾

    "); + // $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection("dat_size_check"); + return $this->_downloadDat2chAPI ($uaMona, $SID2ch, 0); // datTCY͕sBS蒼B + } } - if (preg_match('/^Last-Modified: (.+)/i', $l, $matches)) { - //echo $matches[1] . '
    '; //debug - $this->modified = $matches[1]; + if ($apiThreadStatus == '1') { + // sX̎Zbg + $this->isonline = true; + } + if ($apiThreadStatus == '3') { + // ߋOtO𗧂Ă (idxline[12]ɕۑ) + $this->datochiok = true; + } - } elseif ($l === '') { - $start_here = true; + return true; + } elseif ($code == '302') { // Found + // zXg̈ړ]ǐ + $new_host = P2HostMgr::getCurrentHost ($this->host, $this->bbs); + if ($new_host != $this->host) { + $this->old_host = $this->host; + $this->host = $new_host; + return $this->_downloadDat2chAPI ($uaMona, $SID2ch, $from_bytes); + } else { + return $this->_downloadDat2chNotFound ($code); + } + } elseif ($code == '304') { + $this->isonline = true; + if ($apiThreadStatus == '3') { + // ߋOtO𗧂Ă (idxline[12]ɕۑ) + $this->datochiok = true; } + return '304 Not Modified'; + } elseif ($code == '403') { + $this->getdat_error_msg_ht .= "

    rep2 error: CloudFlareɐڑۂꂽ߁AXbh擾Ɏs܂Bݒ̕ύXĂB

    "; + $this->getdat_error_msg_ht .= "

    ".p2h($response->getBody ())."

    "; + $this->getdat_error_msg_ht .= " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&relogin2chapi=true\">APIōĎ擾݂]"; + $this->getdat_error_msg_ht .= " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&olddat=true\">datōĎ擾݂]"; + $this->diedat = true; + return false; + } elseif ($code == '416') { // Requested Range Not Satisfiable + // echo "ځ[񌟏o"; + $this->onbytes = 0; + $this->modified = null; + return $this->_downloadDat2chAPI ($uaMona, $SID2ch, 0); // ځ[񌟏oBS蒼B + } elseif ($code == '401' && ($apiUserStatus == '0'||$apiUserStatus == '')) { // 401APIF؎s(ĔF؂) + if (empty ($_REQUEST['relogin2chapi'])) { + $_REQUEST['relogin2chapi'] = true; + return $this->downloadDat (); + } + } elseif ($code == '501' && $apiUserStatus == '1') { // QlŏRangetDATɃANZXꍇ501 + return $this->_downloadDat2chNotFound ('302'); + } else { + if($_conf['2chapi_debug_print']==1) + { + P2Util::pushInfoHtml('

    p2 debug(ThreadRead::API):body='.p2h($response->getBody ()).'

    '); + } + + return $this->_downloadDat2chNotFound ($code); } - } - fclose($fp); - if ($timed_out) { - self::_pushInfoReadTimedOut($url); + } catch (Exception $e) { + $this->getdat_error_msg_ht .= "

    T[oڑG[: " . $e->getMessage (); + $this->getdat_error_msg_ht .= "
    rep2 error: ƒT[oւ̐ڑɎs܂B

    "; $this->diedat = true; return false; - } else { - $this->isonline = true; - return true; - } - } - - // }}} - // {{{ _downloadDat2chNotFound() - - /** - * 2ch DAT_E[hłȂƂɌĂяo - */ - protected function _downloadDat2chNotFound($code = null) - { - // 2ch, bbspink Ȃread.cgiŊmF - if (P2Util::isHost2chs($this->host)) { - $this->getdat_error_msg_ht .= $this->get2chDatError($code); } - $this->diedat = true; - return false; } // }}} - // {{{ _downloadDat2chMaru() + // {{{ _downloadDat2ch() /** - * 2chp DAT_E[h + * W@ 2ch݊ DAT _E[h * - * @param string $uaMona - * @param string $SID2ch - * @return bool - * @see lib/login2ch.inc.php + * @return mix 擾łAXVȂꍇtrueԂ */ - protected function _downloadDat2chMaru($uaMona, $SID2ch) - { + protected function _downloadDat2ch($from_bytes) { global $_conf; + global $debug; - if (!($this->host && $this->bbs && $this->key && $this->keydat)) { + if (! ($this->host && $this->bbs && $this->key)) { return false; } - $method = 'GET'; - - // GET /test/offlaw.cgi?bbs=–&key=Xbhԍ&sid=ZbVID HTTP/1.1 - $url = "http://{$this->host}/test/offlaw.cgi/{$this->bbs}/{$this->key}/?raw=0.0&sid="; - $url .= rawurlencode($SID2ch); - - $purl = parse_url($url); // URL - if (isset($purl['query'])) { // NG[ - $purl['query'] = '?'.$purl['query']; - } else { - $purl['query'] = ''; + // >>1vr[͍̎擾Ȃėǂ̂ŏtrue(V)Ԃ + if (is_readable ($this->keydat) && ! empty ($_GET['one'])) { + return true; } - // vLV - if ($_conf['proxy_use']) { - $send_host = $_conf['proxy_host']; - $send_port = $_conf['proxy_port']; - $send_path = $url; + $from_bytes = intval ($from_bytes); + + if ($from_bytes == 0) { + $zero_read = true; } else { - $send_host = $purl['host']; - $send_port = $purl['port']; - $send_path = $purl['path'].$purl['query']; + $zero_read = false; + $from_bytes = $from_bytes - 1; } - if (!$send_port) { - $send_port = 80; // ftHg80 - } + $url = "http://{$this->host}/{$this->bbs}/dat/{$this->key}.dat"; + // $url="http://news2.2ch.net/test/read.cgi?bbs=newsplus&key=1038486598"; - $request = $method." ".$send_path." HTTP/1.0\r\n"; - $request .= "Host: ".$purl['host']."\r\n"; - $request .= "Accept-Encoding: gzip, deflate\r\n"; - //$request .= "Accept-Language: ja, en\r\n"; - $request .= "User-Agent: {$uaMona} ({$_conf['p2ua']})\r\n"; - //$request .= "X-2ch-UA: {$_conf['p2ua']}\r\n"; - //$request .= "Range: bytes={$from_bytes}-\r\n"; - $request .= "Connection: Close\r\n"; - /* - if ($modified) { - $request .= "If-Modified-Since: $modified\r\n"; - } - */ - $request .= "\r\n"; + $purl = parse_url ($url); // URL + // $request .= "Accept-Charset: Shift_JIS\r\n"; + // $request .= "Accept-Encoding: gzip, deflate\r\n"; - // WEBT[o֐ڑ - $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); - if (!$fp) { - self::_pushInfoConnectFailed($url, $errno, $errstr); - $this->diedat = true; - return false; - } - stream_set_timeout($fp, $_conf['http_read_timeout'], 0); + try { + $req = P2Commun::createHTTPRequest ($url, HTTP_Request2::METHOD_GET); + // wb_ + $req->setHeader ('Referer', "http://{$purl['host']}/{$this->bbs}/"); + + if (! empty ($_GET['one'])) { + // >>1vr[̎̓T[o[ɍŏ̕ + $req->setHeader ('Range', "bytes=0-8192"); + } elseif (! $zero_read) { + $req->setHeader ('Range', sprintf ('bytes=%d-', $from_bytes) ); + } - fputs($fp, $request); + if ($this->modified) { + $req->setHeader ('If-Modified-Since', $this->modified); + } - $body = ''; - $code = null; - $chunked = false; - $is_gzip = false; - $start_here = false; + // BasicFؗp̃wb_ + if (isset ($purl['user']) && isset ($purl['pass'])) { + $req->setAuth ($purl['user'], $purl['pass'], HTTP_Request2::AUTH_BASIC); + } - while (!p2_stream_eof($fp, $timed_out)) { + // Request̑M + $response = P2Commun::getHTTPResponse($req); - if ($start_here) { + $code = $response->getStatus (); - if ($code == '200') { + if ($code == '200' || $code == '206') { // Partial Content + $body = $response->getBody (); - while (!p2_stream_eof($fp, $timed_out)) { - $body .= fread($fp, 4096); + if (! empty ($_GET['one'])) { + $cut = mb_strrpos ($body, "\n"); + $body = mb_substr ($body, 0, $cut === false ? mb_strlen ($body) : $cut + 1); + $this->onbytes = strlen ($body); + } elseif ($zero_read) { + $this->onbytes = intval ($response->getHeader ('Content-Length')); + } else { + if (preg_match ('@^bytes ([^/]+)/([0-9]+)@i', $response->getHeader ('Content-Range'), $matches)) { + $this->onbytes = intval ($matches[2]); } + } - if ($timed_out) { - self::_pushInfoReadTimedOut($url); - //$this->diedat = true; - fclose($fp); + $this->modified = $response->getHeader ('Last-Modified'); + + // zXg2ch̎DAT𗘗płȂ|̃bZ[WoG[ƂiDATj΍j + if (P2HostMgr::isHost2chs ($this->host)) { + // 1sڂ؂o + $posLF = mb_strpos ($body, "\n"); + $firstmsg = mb_substr ($body, 0, $posLF === false ? mb_strlen ($body) : $posLF); + + if (mb_strpos ($firstmsg, "Q˂ <><>2015/03/13() 00:00:00.00 ID:????????<> 313Q") === 0) { + $this->getdat_error_msg_ht .= "

    rep2 error: ƒT[oڑۂ܂
    rep2 info: 2˂DAT񋟂͏I܂

    "; + $this->diedat = true; + return false; + } elseif (mb_strpos ($firstmsg, "5˂ <><>2017/10/01() 00:00:00.00 ID:???<> ql") === 0) { + $this->getdat_error_msg_ht .= "

    rep2 error: ƒT[oڑۂ܂
    rep2 info: 2˂DAT񋟂͏I܂

    "; + $this->diedat = true; return false; } + unset ($firstmsg); + } - // gzipkȂ - if ($is_gzip) { - $body = self::_decodeGzip($body, $url); - if ($body === null) { - //$this->diedat = true; - fclose($fp); - return false; - } + // ̉słځ[`FbN + if (! $zero_read) { + if (substr ($body, 0, 1) != "\n") { + // echo "ځ[񌟏o"; + $this->onbytes = 0; + $this->modified = null; + return $this->_downloadDat2ch (0); // ځ[񌟏oBS蒼B } + $body = substr ($body, 1); + } - if (FileCtl::file_write_contents($this->keydat, $body) === false) { - p2die('cannot write file. downloadDat2chMaru()'); - } + // 2sڂ؂o + $lines = explode("\n", $body); + $secondmsg = $lines[1]; - // N[jO ===== - if ($marudatlines = FileCtl::file_read_lines($this->keydat)) { - $firstline = array_shift($marudatlines); - // `NƂ - if (strpos($firstline, '+OK') === false) { - $secondline = array_shift($marudatlines); - } - $cont = ''; - foreach ($marudatlines as $aline) { - // `NGR[fBO~Ƃ(HTTP 1.0ł̂) - if ($chunked) { - $cont .= $aline; - } else { - $cont .= $aline; - } - } - if (FileCtl::file_write_contents($this->keydat, $cont) === false) { - p2die('cannot write file. downloadDat2chMaru()'); - } - } + // 2sڂߋOł邱ƂĂ悤łΉߋON\ + if (mb_strpos ($secondmsg, "Q˂ <><>2015/05/31() 00:00:00.00 ID:????????<> ̃Xbh͉ߋOłB") === 0) { + return $this->_downloadDat2chNotFound ('302'); + } + unset ($secondmsg); + unset ($lines); - // dat.gz͂ȂƔf - } else { - fclose($fp); - return $this->_downloadDat2chMaruNotFound(); + $file_append = ($zero_read) ? 0 : FILE_APPEND; + + if (FileCtl::file_write_contents ($this->keydat, $body, $file_append) === false) { + p2die ('cannot write file.'); } - // wb_̏ - } else { - $l = rtrim(fgets($fp, 128000), "\r\n"); - //echo $l.'
    ';// for debug - // ex) HTTP/1.1 304 Not Modified - if (preg_match('@^HTTP/1\\.\\d (\\d+) (.+)@', $l, $matches)) { - $code = $matches[1]; - - if ($code == '200') { - ; - } elseif ($code == '304') { - fclose($fp); - //$this->isonline = true; - return '304 Not Modified'; - } else { - fclose($fp); - return $this->_downloadDat2chMaruNotFound(); + // $GLOBALS['debug'] && $GLOBALS['profiler']->enterSection("dat_size_check"); + // 擾TCY`FbN + if ($zero_read == false && $this->onbytes) { + $this->getDatBytesFromLocalDat (); // $aThread->length set + if ($this->onbytes != $this->length) { + $this->onbytes = 0; + $this->modified = null; + P2Util::pushInfoHtml ("

    rep2 info: {$this->onbytes}/{$this->length} t@CTCYςȂ̂ŁAdatĎ擾

    "); + // $GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection("dat_size_check"); + return $this->_downloadDat2ch (0); // datTCY͕sBS蒼B } + } - } elseif (preg_match('/^Content-Encoding: (?:x-)?gzip/i', $l)) { - $is_gzip = true; - } elseif (preg_match('/^Transfer-Encoding: (.+)/i', $l, $matches)) { // Transfer-Encoding: chunked - $t_enco = $matches[1]; - if ($t_enco == 'chunked') { - $chunked = true; - } - } elseif ($l === '') { - $start_here = true; + $this->isonline = true; + return true; + } elseif ($code == '302') { // Found + // zXg̈ړ]ǐ + $new_host = P2HostMgr::getCurrentHost ($this->host, $this->bbs); + if ($new_host != $this->host) { + $this->old_host = $this->host; + $this->host = $new_host; + return $this->_downloadDat2ch ($from_bytes); + } else { + return $this->_downloadDat2chNotFound ($code); } + } elseif ($code == '304') { + $this->isonline = true; + return '304 Not Modified'; + } elseif ($code == '416') { // Requested Range Not Satisfiable + // echo "ځ[񌟏o"; + $this->onbytes = 0; + $this->modified = null; + return $this->_downloadDat2ch (0); // ځ[񌟏oBS蒼B + } else { + return $this->_downloadDat2chNotFound ($code); } - + } catch (Exception $e) { + $this->getdat_error_msg_ht .= "

    T[oڑG[: " . $e->getMessage (); + $this->getdat_error_msg_ht .= "
    rep2 error: ƒT[oւ̐ڑɎs܂B

    "; + $this->diedat = true; + return false; } - fclose($fp); - //$this->isonline = true; - //$this->datochiok = 1; - return !$timed_out; } // }}} - // {{{ _downloadDat2chMaruNotFound() + // {{{ _downloadDat2chNotFound() /** - * IDł̎擾łȂƂɌĂяo + * 2ch DAT_E[hłȂƂɌĂяo */ - protected function _downloadDat2chMaruNotFound() - { - global $_conf; - - // ă`W܂ȂAă`WBSIDύXĂ܂Ăꍇ鎞̂߂̎`WB - if (empty($_REQUEST['relogin2ch'])) { - $_REQUEST['relogin2ch'] = true; - return $this->downloadDat(); - } else { - $remarutori_ht = " [host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true&relogin2ch=true{$_conf['k_at_a']}\">Ď擾݂]"; - $moritori_ht = $this->_generateMoritapoDatLink(); - $this->getdat_error_msg_ht .= "

    rep2 info: IDł̃Xbh擾Ɏs܂B{$remarutori_ht}{$moritori_ht}

    "; - $this->diedat = true; - return false; - } + protected function _downloadDat2chNotFound($code = null) { + // 2ch, bbspink Ȃread.cgiŊmF + $this->getdat_error_msg_ht .= $this->get2chDatError ($code); + $this->diedat = true; + return false; } // }}} @@ -569,128 +567,49 @@ protected function _downloadDat2chMaruNotFound() /** * 2ch̉ߋOqɂdat.gz_E[h𓀂 */ - protected function _downloadDat2chKako($uri, $ext) - { + protected function _downloadDat2chKako($uri, $ext) { global $_conf; - $url = $uri.$ext; - - $method = 'GET'; - - $purl = parse_url($url); // URL - // NG[ - if (isset($purl['query'])) { - $purl['query'] = "?".$purl['query']; - } else { - $purl['query'] = ""; - } - - // vLV - if ($_conf['proxy_use']) { - $send_host = $_conf['proxy_host']; - $send_port = $_conf['proxy_port']; - $send_path = $url; - } else { - $send_host = $purl['host']; - $send_port = $purl['port']; - $send_path = $purl['path'].$purl['query']; - } - // ftHg80 - if (!$send_port) { - $send_port = 80; - } - - $request = "{$method} {$send_path} HTTP/1.0\r\n"; - $request .= "Host: {$purl['host']}\r\n"; - $request .= "User-Agent: Monazilla/1.00 ({$_conf['p2ua']})\r\n"; - $request .= "Connection: Close\r\n"; - //$request .= "Accept-Encoding: gzip\r\n"; - /* - if ($modified) { - $request .= "If-Modified-Since: $modified\r\n"; - } - */ - $request .= "\r\n"; - - // WEBT[o֐ڑ - $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); - if (!$fp) { - self::_pushInfoConnectFailed($url, $errno, $errstr); - return false; - } - stream_set_timeout($fp, $_conf['http_read_timeout'], 0); - - fputs($fp, $request); - - $body = ''; - $code = null; - $is_gzip = false; - $start_here = false; + $url = $uri . $ext; - while (!p2_stream_eof($fp, $timed_out)) { - - if ($start_here) { + try { + $req = P2Commun::createHTTPRequest ($url, HTTP_Request2::METHOD_GET); - if ($code == '200') { + if ($this->modified) { + $req->setHeader ('If-Modified-Since', $this->modified); + } - while (!p2_stream_eof($fp, $timed_out)) { - $body .= fread($fp, 4096); - } + // Request̑M + $response = P2Commun::getHTTPResponse($req); - if ($timed_out) { - self::_pushInfoReadTimedOut($url); - $this->diedat = true; - fclose($fp); - return false; - } + $code = $response->getStatus (); - if ($is_gzip) { - $body = self::_decodeGzip($body, $url); - if ($body === null) { - $this->diedat = true; - fclose($fp); - return false; - } - } + if ($code == '200' || $code == '206') { // Partial Content + $body = $response->getBody (); - if (FileCtl::file_write_contents($this->keydat, $body) === false) { - p2die('cannot write file. downloadDat2chKako()'); - } + $this->onbytes = intval ($response->getHeader ('Content-Length')); - // ȂƔf - } else { - fclose($fp); - return $this->_downloadDat2chKakoNotFound($uri, $ext); + $this->modified = $response->getHeader ('Last-Modified'); + if (FileCtl::file_write_contents ($this->keydat, $body, 0) === false) { + p2die ('cannot write file. downloadDat2chMaru()'); } - } else { - $l = rtrim(fgets($fp, 128000), "\r\n"); - if (preg_match('@^HTTP/1\\.\\d (\\d+) (.+)@', $l, $matches)) { // ex) HTTP/1.1 304 Not Modified - $code = $matches[1]; - - if ($code == '200') { - ; - } elseif ($code == '304') { - fclose($fp); - //$this->isonline = true; - return '304 Not Modified'; - } else { - fclose($fp); - return $this->_downloadDat2chKakoNotFound($uri, $ext); - } + // ߋOtO𗧂Ă (idxline[12]ɕۑ) + $this->datochiok = true; - } elseif (preg_match('/^Content-Encoding: (?:x-)?gzip/i', $l)) { - $is_gzip = true; - } elseif ($l === '') { - $start_here = true; - } + return true; + } elseif ($code == '304') { + return '304 Not Modified'; + } else { + return $this->_downloadDat2chKakoNotFound ($uri, $ext); } - + } catch (Exception $e) { + $this->getdat_error_msg_ht .= "

    T[oڑG[: " . $e->getMessage (); + $this->getdat_error_msg_ht .= "
    rep2 error: ƒT[oւ̐ڑɎs܂B

    "; + $this->diedat = true; + return false; } - fclose($fp); - //$this->isonline = true; - return !$timed_out; } // }}} @@ -699,16 +618,15 @@ protected function _downloadDat2chKako($uri, $ext) /** * ߋO擾łȂƂɌĂяo */ - protected function _downloadDat2chKakoNotFound($uri, $ext) - { + protected function _downloadDat2chKakoNotFound($uri, $ext) { global $_conf; if ($ext == ".dat.gz") { - //.dat.gzȂ.datłx - return $this->_downloadDat2chKako($uri, ".dat"); + // .dat.gzȂ.datłx + return $this->_downloadDat2chKako ($uri, ".dat"); } - if (!empty($_GET['kakolog'])) { - $kako_html_url = p2h($_GET['kakolog'] . '.html'); + if (! empty ($_GET['kakolog'])) { + $kako_html_url = p2h ($_GET['kakolog'] . '.html'); $kakolog_ht = "

    {$kako_html_url}

    "; } $this->getdat_error_msg_ht = "

    rep2 info: 2˂ߋOqɂ̃Xbh荞݂Ɏs܂B

    "; @@ -723,28 +641,29 @@ protected function _downloadDat2chKakoNotFound($uri, $ext) /** * 2chdat擾łȂԂ * - * @return string G[bZ[Wi킩Ȃꍇ͋ŕԂj + * @return string G[bZ[Wi킩Ȃꍇ͋ŕԂj */ - public function get2chDatError($code = null) - { + public function get2chDatError($code = null) { global $_conf; // zXgړ]oŕύXzXgɖ߂ - if (!empty($this->old_host)) { + if (! empty ($this->old_host)) { $this->host = $this->old_host; $this->old_host = null; } $reason = null; - if ($code == '302') { - $body203 = $this->_get2ch203Body(); - if ($body203 !== false && preg_match('/ߋO /', $body203)) { - $this->getdat_error_body = $body203; - if (preg_match('/̃Xbh͉ߋOqɂɊi.{1,2}Ă܂/', $body203)) { - $reason = 'datochi'; - $this->setDatochiResiduums(); - } elseif (preg_match('{http://[^/]+/[^/]+/kako/\\d+(/\\d+)?/(\\d+)\\.html}', $body203, $matches)) { - $reason = 'kakohtml'; + if (P2HostMgr::isHost2chs ($this->host) || P2HostMgr::isHostVip2ch ($this->host)) { + if ($code == '302') { + $body203 = $this->_get2ch203Body(); + if ($body203 !== false && preg_match('/ߋO /', $body203)) { + $this->getdat_error_body = $body203; + if (preg_match('/̃Xbh͉ߋOqɂɊi.{1,2}Ă܂/', $body203)) { + $reason = 'datochi'; + $this->setDatochiResiduums(); + } elseif (preg_match('{http://[^/]+/[^/]+/kako/\\d+(/\\d+)?/(\\d+)\\.html}', $body203, $matches)) { + $reason = 'kakohtml'; + } } } } @@ -754,26 +673,8 @@ public function get2chDatError($code = null) // {{{ read.cgi HTML擾 $read_response_html = ''; - if (!$reason) { - $wap_ua = new WapUserAgent(); - $wap_ua->setAgent($_conf['p2ua']); // ́A"Monazilla/" ‚NG - $wap_ua->setTimeout($_conf['http_conn_timeout'], $_conf['http_read_timeout']); - $wap_req = new WapRequest(); - $wap_req->setUrl($read_url); - if ($_conf['proxy_use']) { - $wap_req->setProxy($_conf['proxy_host'], $_conf['proxy_port']); - } - $wap_res = $wap_ua->request($wap_req); - - if ($wap_res->isError()) { - $url_t = P2Util::throughIme($wap_req->url); - $info_msg_ht = "

    Error: {$wap_res->code} {$wap_res->message}
    "; - $info_msg_ht .= "rep2 info: {$wap_req->url} ɐڑł܂łB

    "; - P2Util::pushInfoHtml($info_msg_ht); - } else { - $read_response_html = $wap_res->content; - } - unset($wap_ua, $wap_req, $wap_res); + if (! $reason) { + $read_response_html = $this->getReadCGIHtml($read_url); } // }}} @@ -782,93 +683,91 @@ public function get2chDatError($code = null) $dat_response_status = ''; $dat_response_msg = ''; + $vip2ch_kakosoko_match = "/i.{1,2}Ă܂B݂ł܂BB/"; $kakosoko_match = "/̃Xbh͉ߋOqɂɊi.{1,2}Ă܂/"; + $kakosoko_match2 = "/http:\/\/turing1000\.nttec\.com\/?(403|404|500)\.dat/"; + + $naidesu_str = "ȔorXbhȂłB"; + + // 0˂XNvgɔ悤 + $soukoni_str = "IߋOqɂ"; + + $error3001_str = "Q˂ error 3001"; // ߋOqɂhtml̎iɂ邩A悭mȂj + $error3939_str = "Q˂ error 3939"; // ߋOqɂhtml̎iɂ邩A悭mȂj + $error4002_str = "Q˂ error 4002"; // ߋOqɂhtml̎iɂ邩A悭mȂj + + $sw2_str = "Something went wrong"; - $naidesu_match = "/ȔorXbhȂłB<\/title>/"; - $error3939_match = "{<title>Q˂ error 3939}"; // ߋOqɂhtml̎iɂ邩A悭mȂj + $vip2ch_ssr_str = "IV݂ꂽSSR‚ɂăX𔭌łI"; - // - // - //$kakohtml_match = "{}"; + // + // + // $kakohtml_match = "{}"; $kakohtml_match = "{/([^/]+/kako/\d+(/\d+)?/(\d+)).html\">}"; $waithtml_match = "/html̂҂Ă悤łB/"; + $vip2ch_kakodat_match = "{/([^/]+/kako/\d+(/\d+)?/(\d+)).dat\">}"; // vip2ch.comp - // // ̃Xbh͉ߋOqɂ - // - if ($reason === 'datochi' || preg_match($kakosoko_match, $read_response_html, $matches)) { + if ($reason === 'datochi' || preg_match ($kakosoko_match, $read_response_html, $matches) || preg_match ($kakosoko_match2, $read_response_html, $matches)) { $dat_response_status = "̃Xbh͉ߋOqɂɊi[Ă܂B"; - //if (file_exists($_conf['idpw2ch_php']) || file_exists($_conf['sid2ch_php'])) { - $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true{$_conf['k_at_a']}\">IDrep2Ɏ荞</a>]"; - //} else { - // $marutori_ht = " [<a href=\"login2ch.php\" target=\"subject\">IDOC</a>]"; - //} - - // +Wiki - if ($_GET['plugin']) { - $datPlugin = new DatPluginCtl(); - $datPlugin->load(); - foreach ($datPlugin->getData() as $v){ - if (preg_match('{'. $v['match'] . '}', $read_url)) { - $replace = @preg_replace('{'. $v['match'] . '}', $v['replace'], $read_url); - $code = P2UtilWiki::getResponseCode($replace); - if($code == 200) { - $code = '' . $code; - } else { - $code = '~' . $code; - } - $plugin_ht .= " <option value=\"{$replace}\">{$code}:{$v['title']}</option>\n"; - } - } - if ($plugin_ht) { - $plugin_ht = '<select size=1 name="kakolog">'. $plugin_ht . '</select>'; - } else { - $plugin_ht = '<input type="text" name="kakolog" size="64">'; - } - $plugin_ht .= '<input type="submit" name="kakoget" value="擾">'; - } else { - $plugin_ht = '<input type="submit" name="plugin" value="DATT">'; - } - $plugin_ht = <<<EOP -<form method="get" action="{$_conf['read_php']}"> - <input type="hidden" name="host" value="{$this->host}"> - <input type="hidden" name="bbs" value="{$this->bbs}"> - <input type="hidden" name="key" value="{$this->key}"> - <input type="hidden" name="ls" value="{$this->ls}"> - <input type="hidden" name="kakoget" value="2"> - {$_conf['k_input_ht']} -{$plugin_ht} -</form> -EOP; - $moritori_ht = $this->_generateMoritapoDatLink(); - $dat_response_msg = "<p>2ch info - ̃Xbh͉ߋOqɂɊi[Ă܂B{$marutori_ht}{$moritori_ht}{$plugin_ht}</p>"; + //$marutori_ht = $this->_generateMarutoriLink (); + $plugin_ht = $this->_generateWikiDatLink ($read_url); + $dat_response_msg = "<p>2ch info - ̃Xbh͉ߋOqɂɊi[Ă܂BQlOCƎ擾o邩܂B{$plugin_ht}</p>"; - // // <title>ȔorXbhȂłBor error 3939 - // - } elseif ($reason === 'kakohtml' or preg_match($naidesu_match, $read_response_html, $matches) || preg_match($error3939_match, $read_response_html, $matches)) { - - if ($reason === 'kakohtml' or preg_match($kakohtml_match, $read_response_html, $matches)) { + } elseif ($reason === 'kakohtml' || + preg_match ($vip2ch_kakosoko_match, $read_response_html, $matches) || + mb_strpos ($read_response_html, $naidesu_str) !== false || + mb_strpos ($read_response_html, $error3001_str) !== false || + mb_strpos ($read_response_html, $error3939_str) !== false || + mb_strpos ($read_response_html, $error4002_str) !== false || + mb_strpos ($read_response_html, $sw2_str) !== false || + mb_strpos ($read_response_html, $vip2ch_ssr_str) !== false || + mb_strpos ($read_response_html, $soukoni_str) !== false) { + + if ($reason === 'kakohtml' or preg_match ($kakohtml_match, $read_response_html, $matches)) { if ($reason === 'kakohtml') { - preg_match('{/([^/]+/kako/\d+(/\d+)?/(\d+)).html}', $this->getdat_error_body, $matches); + preg_match ('{/([^/]+/kako/\d+(/\d+)?/(\d+)).html}', $this->getdat_error_body, $matches); } $dat_response_status = "! ߋOqɂŁAhtmlꂽXbh𔭌܂B"; $kakolog_uri = "http://{$this->host}/{$matches[1]}"; - $kakolog_url_en = rawurlencode($kakolog_uri); + $kakolog_url_en = rawurlencode ($kakolog_uri); $read_kako_url = "{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$kakolog_url_en}&kakoget=1"; $dat_response_msg = "<p>2ch info - ! ߋOqɂŁA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>Xbh {$matches[3]}.html</a> 𔭌܂B [<a href=\"{$read_kako_url}\">rep2Ɏ荞œǂ</a>]</p>"; - - } elseif (preg_match($waithtml_match, $read_response_html, $matches)) { + } elseif (mb_strpos ($read_response_html, $error3001_str) !== false || + mb_strpos ($read_response_html, $error3939_str) !== false || + mb_strpos ($read_response_html, $error4002_str) !== false) { + $dat_response_status = "! ߋOqɂŁAhtmlꂽXbh𔭌܂B"; + $key4 = substr($this->key, 0, 4); + $key5 = substr($this->key, 0, 5); + $kakolog_uri = "http://{$this->host}/{$this->bbs}/kako/{$key4}/{$key5}/{$this->key}"; + $kakolog_url_en = rawurlencode ($kakolog_uri); + $read_kako_url = "{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$kakolog_url_en}&kakoget=1"; + $dat_response_msg = "<p>2ch info - ! ߋOqɂŁA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>Xbh {$this->key}.html</a> 𔭌܂B [<a href=\"{$read_kako_url}\">rep2Ɏ荞œǂ</a>]</p>"; + } elseif (mb_strpos ($read_response_html, $sw2_str) !== false) { + $dat_response_msg = "<p>2ch info - datłB[$read_response_html]</p>"; + } elseif (preg_match ($waithtml_match, $read_response_html, $matches)) { $dat_response_status = "! Xbhhtml̂҂Ă悤łB"; - $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true{$_conf['k_at_a']}\">IDrep2Ɏ荞</a>]"; - $moritori_ht = $this->_generateMoritapoDatLink(); - $dat_response_msg = "<p>2ch info - ! Xbhhtml̂҂Ă悤łB{$marutori_ht}{$moritori_ht}</p>"; - + //$marutori_ht = $this->_generateMarutoriLink (); + $plugin_ht = $this->_generateWikiDatLink ($read_url); + $dat_response_msg = "<p>2ch info - ! Xbhhtml̂҂Ă悤łBQlOCƎ擾o邩܂B{$plugin_ht}</p>"; + } elseif (preg_match ($vip2ch_kakodat_match, $read_response_html, $matches)) { + $dat_response_status = "! ߋOqɂŁAdat𔭌܂B"; + $kakolog_uri = "http://{$this->host}/{$matches[1]}"; + $kakolog_url_en = rawurlencode ($kakolog_uri); + $read_kako_url = "{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$kakolog_url_en}&kakoget=1"; + $dat_response_msg = "<p>2ch info - ! ߋOqɂŁA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>Xbh {$this->key}.html</a> 𔭌܂B [<a href=\"{$read_kako_url}\">rep2Ɏ荞œǂ</a>]</p>"; + } elseif (mb_strpos ($read_response_html, $vip2ch_ssr_str) !== false) { + $dat_response_status = "! V݂ꂽSSR‚ɂăX𔭌ł!"; + $movelog_uri = str_replace("news4ssnip", "news4ssr", $read_url); + $movelog_url_en = rawurlencode ($movelog_uri); + $read_kako_url = "{$_conf['read_php']}?host={$this->host}&bbs=news4ssr&key={$this->key}&ls={$this->ls}"; + $dat_response_msg = "<p>2ch info - ! V݂ꂽSSR‚ɂāA<a href=\"{$movelog_uri}\"{$_conf['bbs_win_target_at']}>Xbh</a> 𔭌܂B [<a href=\"{$read_kako_url}\">rep2Ɏ荞œǂ</a>]</p>"; } else { - if (!empty($_GET['kakolog'])) { + if (! empty ($_GET['kakolog'])) { $dat_response_status = 'ȔorXbhȂłB'; - $kako_html_url = p2h($_GET['kakolog'] . '.html'); - $kakolog_query = rawurlencode($_GET['kakolog']); + $kako_html_url = p2h ($_GET['kakolog'] . '.html'); + $kakolog_query = rawurlencode ($_GET['kakolog']); $read_kako_url = "{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$kakolog_query}&kakoget=1"; $dat_response_msg = '<p>2ch info - ȔorXbhȂłB</p>'; $dat_response_msg .= "<p><a href=\"{$kako_html_url}\"{$_conf['bbs_win_target_at']}>{$kako_html_url}</a> [<a href=\"{$read_kako_url}\">rep2ɃO荞œǂ</a>]</p>"; @@ -879,13 +778,12 @@ public function get2chDatError($code = null) } // ȂꍇłAƂ肠ߋO荞݂̃NێĂBƎvB܂oĂȂ 2005/2/27 aki - } elseif (!empty($_GET['kakolog'])) { + } elseif (! empty ($_GET['kakolog'])) { $dat_response_status = ''; - $kako_html_url = p2h($_GET['kakolog'] . '.html'); - $kakolog_query = rawurlencode($_GET['kakolog']); + $kako_html_url = p2h ($_GET['kakolog'] . '.html'); + $kakolog_query = rawurlencode ($_GET['kakolog']); $read_kako_url = "{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$kakolog_query}&kakoget=1"; $dat_response_msg = "<p><a href=\"{$kako_html_url}\"{$_conf['bbs_win_target_at']}>{$kako_html_url}</a> [<a href=\"{$read_kako_url}\">rep2ɃO荞œǂ</a>]</p>"; - } // }}} @@ -899,189 +797,150 @@ public function get2chDatError($code = null) /** * >>1݂̂vr[ */ - public function previewOne() - { + public function previewOne() { global $_conf; - if (!($this->host && $this->bbs && $this->key)) { return false; } + if (! ($this->host && $this->bbs && $this->key)) { + return false; + } + + // ʏƓ悤DAT̎擾݂B$_GET['one']ZbgĂ2ch݊>>1Ƃ + $this->downloadDat (); // [Jdat擾 - if (is_readable($this->keydat)) { - $fd = fopen($this->keydat, 'rb'); - $first_line = fgets($fd, 32800); + if (is_readable ($this->keydat)) { + $fd = fopen ($this->keydat, 'rb'); + $first_line = fgets ($fd, 32800); fclose ($fd); // be.2ch.net ȂEUCSJISϊ - if (P2Util::isHostBe2chNet($this->host)) { - $first_line = mb_convert_encoding($first_line, 'CP932', 'CP51932'); + if (P2HostMgr::isHostBe2chNet ($this->host)) { + $first_line = mb_convert_encoding ($first_line, 'CP932', 'CP51932'); } - $first_datline = rtrim($first_line); - if (strpos($first_datline, '<>') !== false) { + $first_datline = rtrim ($first_line); + if (strpos ($first_datline, '<>') !== false) { $datline_sepa = "<>"; } else { $datline_sepa = ','; $this->dat_type = '2ch_old'; } - $d = explode($datline_sepa, $first_datline); - $this->setTtitle($d[4]); + $d = explode ($datline_sepa, $first_datline); + $this->setTtitle ($d[4]); } - // [JdatȂ΃IC - if (!$first_line) { - - $method = 'GET'; - $url = "http://{$this->host}/{$this->bbs}/dat/{$this->key}.dat"; - - $purl = parse_url($url); // URL - if (isset($purl['query'])) { // NG[ - $purl['query'] = '?' . $purl['query']; - } else { - $purl['query'] = ''; - } + if (! $this->readnum) { + $this->readnum = 1; + } - // vLV - if ($_conf['proxy_use']) { - $send_host = $_conf['proxy_host']; - $send_port = $_conf['proxy_port']; - $send_path = $url; + if ($_conf['ktai']) { + if ($_conf['iphone']) { + $aShowThread = new ShowThreadI($this); } else { - $send_host = $purl['host']; - $send_port = $purl['port']; - $send_path = $purl['path'] . $purl['query']; - } - - if (!$send_port) {$send_port = 80;} // ftHg80 - - $request = "{$method} {$send_path} HTTP/1.0\r\n"; - $request .= "Host: {$purl['host']}\r\n"; - $request .= "User-Agent: Monazilla/1.00 ({$_conf['p2ua']})\r\n"; - // $request .= "Range: bytes={$from_bytes}-\r\n"; - - // BasicFؗp̃wb_ - if (isset($purl['user']) && isset($purl['pass'])) { - $request .= "Authorization: Basic ".base64_encode($purl['user'].":".$purl['pass'])."\r\n"; - } - - $request .= "Connection: Close\r\n"; - $request .= "\r\n"; - - // WEBT[o֐ڑ - $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); - if (!$fp) { - self::_pushInfoConnectFailed($url, $errno, $errstr); - $this->diedat = true; - return false; + $aShowThread = new ShowThreadK($this); } - stream_set_timeout($fp, $_conf['http_read_timeout'], 0); - - fputs($fp, $request); - - $code = null; - $start_here = false; + $aShowThread->am_autong = false; + } else { + $aShowThread = new ShowThreadPc ($this); + } - while (!p2_stream_eof($fp, $timed_out)) { + $body = ''; + $body .= "<div class=\"thread\">\n"; + $res = $aShowThread->transRes ($first_line, 1); // 1\ + $body .= is_array ($res) ? $res['body'] . $res['q'] : $res; + $body .= "</div>\n"; - if ($start_here) { + return $body; + } - if ($code == '200') { - $first_line = fgets($fp, 32800); - break; - } else { - fclose($fp); - return $this->previewOneNotFound($code); - } - } else { - $l = rtrim(fgets($fp, 32800), "\r\n"); - //echo $l."<br>";// for debug - if (preg_match('@^HTTP/1\\.\\d (\\d+) (.+)@i', $l, $matches)) { // ex) HTTP/1.1 304 Not Modified - $code = $matches[1]; - - if ($code == '200') { - ; - } else { - fclose($fp); - return $this->previewOneNotFound($code); - } + // }}} + // {{{ getReadCGIResponse() + /** + * read.cgi ̃X|X擾 + */ + public function getReadCGIHtml($read_url) { + global $_conf; - } elseif ($l === '') { - $start_here = true; - } - } + $test403 = "/403\.dat/"; + $testsw2 = "/Something went wrong/"; - } - fclose($fp); + $cache_file = P2Util::cacheFileForDL($read_url); + // j[10{LbV + $cache_time = $_conf['menu_dl_interval'] * 36000; - // be.2ch.net ȂEUCSJISϊ - if (P2Util::isHostBe2chNet($this->host)) { - $first_line = mb_convert_encoding($first_line, 'CP932', 'CP51932'); + if (file_exists($cache_file)) { + // LbVLԂȂ_E[hȂ + if (filemtime($cache_file) > time() - $cache_time) { + return FileCtl::file_read_contents($cache_file); } + } - $first_datline = rtrim($first_line); - - if (strpos($first_datline, '<>') !== false) { - $datline_sepa = '<>'; + try { + $req = P2Commun::createHTTPRequest ($read_url.'1', HTTP_Request2::METHOD_GET); + // wb_ + // $req->setHeader ('User-Agent', P2Commun::getP2UA(false,P2HostMgr::isHost2chs($this->host))); // ́A"Monazilla/" ‚NG + // read.cgirep2UAŃANZXƒeTCĝőΏ + $req->setHeader ('User-Agent', $_SERVER['HTTP_USER_AGENT']); + + // Request̑M + $response = P2Commun::getHTTPResponse($req); + + $res_code = $response->getStatus (); + + if ($res_code == '200' || $res_code == '206') { // Partial Content + $read_response_html = $response->getBody (); + } elseif (!empty($response->getHeader ("Location")) && P2HostMgr::isHost2ch ($this->host)) { + $read_response_html = $this->getReadCGIHtml($response->getHeader ("Location")); + } elseif ($res_code == '302' || preg_match ($test403, $response->getBody (), $test403)) { + $read_response_html = $response->getBody (); + } elseif ($res_code == '500' || preg_match ($testsw2, $response->getBody (), $testsw2)) { + $read_response_html = $response->getBody (); } else { - $datline_sepa = ','; - $this->dat_type = '2ch_old'; + $url_t = P2Util::throughIme ($read_url); + $info_msg_ht = "<p class=\"info-msg\">Error: {$res_code}<br>"; + $info_msg_ht .= "rep2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$read_url}</a> HTML擾o܂łB</p>"; + P2Util::pushInfoHtml ($info_msg_ht); } - $d = explode($datline_sepa, $first_datline); - $this->setTtitle($d[4]); - $this->onthefly = true; - - } else { - // ֋X - if (!$this->readnum) { - $this->readnum = 1; + if(isset($read_response_html)) { + if (FileCtl::file_write_contents($cache_file, $read_response_html) === false) { + p2die('cannot write file.'.$cache_file); + } } + } catch (Exception $e) { + $this->getdat_error_msg_ht .= "<p>T[oڑG[: " . $e->getMessage (); + $this->getdat_error_msg_ht .= "<br>rep2 error: ƒT[oւ̐ڑɎs܂B</p>"; + $this->diedat = true; } - - if ($_conf['ktai']) { - $aShowThread = new ShowThreadK($this); - $aShowThread->am_autong = false; - } else { - $aShowThread = new ShowThreadPc($this); - } - - $body = ''; - if ($this->onthefly) { - $body .= "<div><span class=\"onthefly\">on the fly</span></div>\n"; - } - $body .= "<div class=\"thread\">\n"; - $res = $aShowThread->transRes($first_line, 1); // 1\ - $body .= is_array($res) ? $res['body'] . $res['q'] : $res; - $body .= "</div>\n"; - - return $body; + unset ($req, $response); + + return $read_response_html; } - // }}} // {{{ previewOneNotFound() /** * >>1vr[ŃXbhf[^‚ȂƂɌĂяo */ - public function previewOneNotFound($code = null) - { + public function previewOneNotFound($code = null) { global $_conf; $this->diedat = true; - // 2ch, bbspink Ȃread.cgiŊmF - if (P2Util::isHost2chs($this->host)) { - $this->getdat_error_msg_ht = $this->get2chDatError($code); - if (count($this->datochi_residuums)) { + // 2ch, bbspink, vip2ch Ȃread.cgiŊmF + if (P2HostMgr::isHost2chs ($this->host) || P2HostMgr::isHostVip2ch ($this->host)) { + $this->getdat_error_msg_ht = $this->get2chDatError ($code); + if (count ($this->datochi_residuums)) { if ($_conf['ktai']) { - $aShowThread = new ShowThreadK($this); + $aShowThread = new ShowThreadK ($this); $aShowThread->am_autong = false; } else { - $aShowThread = new ShowThreadPc($this); + $aShowThread = new ShowThreadPc ($this); } $this->onthefly = true; $body = "<div><span class=\"onthefly\">on the fly</span></div>\n"; $body .= "<div class=\"thread\">\n"; - $res = $aShowThread->transRes($this->datochi_residuums[1], 1); - $body .= is_array($res) ? $res['body'] . $res['q'] : $res; + $res = $aShowThread->transRes ($this->datochi_residuums[1], 1); + $body .= is_array ($res) ? $res['body'] . $res['q'] : $res; $body .= "</div>\n"; return $body; } @@ -1095,8 +954,7 @@ public function previewOneNotFound($code = null) /** * $ls𕪉starttonofirst߂ */ - public function lsToPoint() - { + public function lsToPoint() { global $_conf; $start = 1; @@ -1104,18 +962,18 @@ public function lsToPoint() $nofirst = false; // n܂łꍇ́A>>1\Ȃi$nofirstj - if (strpos($this->ls, 'n') !== false) { + if (strpos ($this->ls, 'n') !== false) { $nofirst = true; - $this->ls = str_replace('n', '', $this->ls); + $this->ls = str_replace ('n', '', $this->ls); } // ͈͎wŕ - $n = explode('-', $this->ls); + $n = explode ('-', $this->ls); // ͈͎w肪Ȃ - if (sizeof($n) == 1) { + if (sizeof ($n) == 1) { // lw肪 - if (substr($n[0], 0, 1) === 'l') { - $ln = intval(substr($n[0], 1)); + if (substr ($n[0], 0, 1) === 'l') { + $ln = intval (substr ($n[0], 1)); if ($_conf['ktai']) { if ($ln > $_conf['mobile.rnum_range']) { $ln = $_conf['mobile.rnum_range']; @@ -1130,84 +988,82 @@ public function lsToPoint() } elseif ($this->ls === 'all') { $start = 1; $to = $this->rescount; - } else { // XԎw - if (intval($this->ls) > 0) { - $this->ls = intval($this->ls); + if (intval ($this->ls) > 0) { + $this->ls = intval ($this->ls); $start = $this->ls; $to = $this->ls; $nofirst = true; - // w肪Ȃ or sȏꍇ́AallƓ\ɂ + // w肪Ȃ or sȏꍇ́AallƓ\ɂ } else { $start = 1; $to = $this->rescount; } } - // ͈͎w肪 + // ͈͎w肪 } else { - if (!$start = intval($n[0])) { + if (! $start = intval ($n[0])) { $start = 1; } - if (!$to = intval($n[1])) { + if (! $to = intval ($n[1])) { $to = $this->rescount; } } // V܂Ƃߓǂ݂̕\ - if (isset($GLOBALS['rnum_all_range']) and $GLOBALS['rnum_all_range'] > 0) { + if (isset ($GLOBALS['rnum_all_range']) and $GLOBALS['rnum_all_range'] > 0) { /* - gт̐V܂Ƃߓǂ݂AŏIɁÁuorXVv - - ~bg < X̕\͈ - ~bǵ@0 - X̕\͈͂IOɃ~bg - - - ~bg > X̕\͈ - ~bg + - ~bgcĂԂɁAX̕\͈͂I - XV - - ~bg = X̕\͈ - ~bg 0 - X̕\͈͒xŃ~bg - ? XV? - ̏ꍇXV̏ꍇB̂߁A - ̃X̎cV邩ǂsŔłȂB - */ + * gт̐V܂Ƃߓǂ݂AŏIɁÁuorXVv + * + * ~bg < X̕\͈ + * ~bǵ@0 + * X̕\͈͂IOɃ~bg + * + * + * ~bg > X̕\͈ + * ~bg + + * ~bgcĂԂɁAX̕\͈͂I + * XV + * + * ~bg = X̕\͈ + * ~bg 0 + * X̕\͈͒xŃ~bg + * ? XV? + * ̏ꍇXV̏ꍇB̂߁A + * ̃X̎cV邩ǂsŔłȂB + */ // ~bgX̕\͈͂菬ꍇ́AX̕\͈͂~bgɍ킹 - $limit_to = $start + $GLOBALS['rnum_all_range'] -1; + $limit_to = $start + $GLOBALS['rnum_all_range'] - 1; if ($limit_to < $to) { $to = $limit_to; - // X̕\͈͒xŃ~bgꍇ + // X̕\͈͒xŃ~bgꍇ } elseif ($limit_to == $to) { $GLOBALS['limit_to_eq_to'] = true; } // ̃~bǵÃX̕\͈͕炵 - $GLOBALS['rnum_all_range'] = $GLOBALS['rnum_all_range'] - ($to - $start) -1; - - //print_r("$start, $to, {$GLOBALS['rnum_all_range']}"); + $GLOBALS['rnum_all_range'] = $GLOBALS['rnum_all_range'] - ($to - $start) - 1; + // print_r("$start, $to, {$GLOBALS['rnum_all_range']}"); } else { // gїp if ($_conf['ktai']) { // \ /* - if ($start + $_conf['mobile.rnum_range'] -1 <= $to) { - $to = $start + $_conf['mobile.rnum_range'] -1; - } - */ + * if ($start + $_conf['mobile.rnum_range'] -1 <= $to) { + * $to = $start + $_conf['mobile.rnum_range'] -1; + * } + */ // Xł́AO‚܂݁A+1ƂȂ̂ŁA1‚܂ if ($start + $_conf['mobile.rnum_range'] <= $to) { $to = $start + $_conf['mobile.rnum_range']; } - if (ResFilter::getWord() !== null) { + if (ResFilter::getWord () !== null) { $start = 1; $to = $this->rescount; $nofirst = false; @@ -1215,7 +1071,7 @@ public function lsToPoint() } } - $this->resrange = compact('start', 'to', 'nofirst'); + $this->resrange = compact ('start', 'to', 'nofirst'); return $this->resrange; } @@ -1226,22 +1082,21 @@ public function lsToPoint() * Datǂݍ * $this->datlines set */ - public function readDat() - { + public function readDat() { global $_conf; - if (file_exists($this->keydat)) { - if ($this->datlines = FileCtl::file_read_lines($this->keydat)) { + if (file_exists ($this->keydat)) { + if ($this->datlines = FileCtl::file_read_lines ($this->keydat)) { // be.2ch.net ȂEUCSJISϊ // ÔSJISUTF-8R[ȟɓĂ // EEEA^Cg̃XbhŌ딻肪̂ŁAw肵Ă - if (P2Util::isHostBe2chNet($this->host)) { - //mb_convert_variables('CP932', 'CP51932,CP932,UTF-8', $this->datlines); - mb_convert_variables('CP932', 'CP51932', $this->datlines); + if (P2HostMgr::isHostBe2chNet ($this->host)) { + // mb_convert_variables('CP932', 'CP51932,CP932,UTF-8', $this->datlines); + mb_convert_variables ('CP932', 'CP51932', $this->datlines); } - if (strpos($this->datlines[0], '<>') === false) { + if (strpos ($this->datlines[0], '<>') === false) { $this->dat_type = '2ch_old'; } } @@ -1249,12 +1104,10 @@ public function readDat() return false; } - $this->rescount = sizeof($this->datlines); + $this->rescount = sizeof ($this->datlines); - if ($_conf['flex_idpopup'] || $_conf['ngaborn_chain'] || $_conf['ngaborn_frequent'] || - ($_conf['ktai'] && ($_conf['mobile.clip_unique_id'] || $_conf['mobile.underline_id']))) - { - $this->_setIdCount(); + if ($_conf['flex_idpopup'] || $_conf['ngaborn_chain'] || $_conf['ngaborn_frequent'] || ($_conf['ktai'] && ($_conf['mobile.clip_unique_id'] || $_conf['mobile.underline_id']))) { + $this->_setIdCount (); } return true; @@ -1266,20 +1119,19 @@ public function readDat() /** * ‚̃XłIDoZbg */ - protected function _setIdCount() - { - if (!$this->datlines) { + protected function _setIdCount() { + if (! $this->datlines) { return; } $i = 0; - $idp = array_fill(1, $this->rescount, null); - $ids = array_fill(1, $this->rescount, null); + $idp = array_fill (1, $this->rescount, null); + $ids = array_fill (1, $this->rescount, null); foreach ($this->datlines as $l) { - $lar = explode('<>', $l); - $i++; - if (preg_match('<(ID: ?| )([0-9A-Za-z/.+]{8,11})(?=[^0-9A-Za-z/.+]|$)>', $lar[2], $m)) { + $lar = explode ('<>', $l); + $i ++; + if (preg_match ('<(ID: ?)([0-9A-Za-z/.+]+)(?=[^0-9A-Za-z/.+]|$)>', $lar[2], $m)) { $idp[$i] = $m[1]; $ids[$i] = $m[2]; } @@ -1287,7 +1139,7 @@ protected function _setIdCount() $this->idp = $idp; $this->ids = $ids; - $this->idcount = array_count_values(array_filter($ids, 'is_string')); + $this->idcount = array_count_values (array_filter ($ids, 'is_string')); } // }}} @@ -1296,18 +1148,17 @@ protected function _setIdCount() /** * datlineexplode */ - public function explodeDatLine($aline) - { - $aline = rtrim($aline); + public function explodeDatLine($aline) { + $aline = rtrim ($aline); if ($this->dat_type === '2ch_old') { - $parts = explode(',', $aline); + $parts = explode (',', $aline); } else { - $parts = explode('<>', $aline); + $parts = explode ('<>', $aline); } // iframe 폜B2ch퉻ĕKvȂȂ炱̃R[h͊OB2005/05/19 - $parts[3] = preg_replace('{<(iframe|script)( .*?)?>.*?</\\1>}i', '', $parts[3]); + $parts[3] = preg_replace ('{<(iframe|script)( .*?)?>.*?</\\1>}i', '', $parts[3]); return $parts; } @@ -1318,29 +1169,26 @@ public function explodeDatLine($aline) /** * dat𑖍ăXĎ̃zXgo * - * @param void + * @param + * void * @return array */ - public function scanOriginalHosts() - { - if (P2Util::isHost2chs($this->host) && - file_exists($this->keydat) && - ($dat = file_get_contents($this->keydat))) - { - $bbs_re = preg_quote($this->bbs, '@'); + public function scanOriginalHosts() { + if (P2HostMgr::isHost2chs ($this->host) && file_exists ($this->keydat) && ($dat = file_get_contents ($this->keydat))) { + $bbs_re = preg_quote ($this->bbs, '@'); $pattern = "@/(\\w+\\.(?:2ch\\.net|bbspink\\.com))(?:/test/read\\.cgi)?/{$bbs_re}\\b@"; - if (preg_match_all($pattern, $dat, $matches, PREG_PATTERN_ORDER)) { - $hosts = array_unique($matches[1]); - $arKey = array_search($this->host, $hosts); - if ($arKey !== false && array_key_exists($arKey, $hosts)) { - unset($hosts[$arKey]); + if (preg_match_all ($pattern, $dat, $matches, PREG_PATTERN_ORDER)) { + $hosts = array_unique ($matches[1]); + $arKey = array_search ($this->host, $hosts); + if ($arKey !== false && array_key_exists ($arKey, $hosts)) { + unset ($hosts[$arKey]); } return $hosts; } } - return array(); + return array (); } // }}} @@ -1349,18 +1197,16 @@ public function scanOriginalHosts() /** * ftHgdat擾sG[bZ[WHTML擾 * - * @param void + * @param + * void * @return string */ - public function getDefaultGetDatErrorMessageHTML() - { + public function getDefaultGetDatErrorMessageHTML() { global $_conf; $diedat_msg = '<p><b>rep2 info: ƒT[oŐṼXbh擾ł܂łB</b>'; - if ($hosts = $this->scanOriginalHosts()) { - $common_q = '&bbs=' . rawurldecode($this->bbs) - . '&key=' . rawurldecode($this->key) - . '&ls=' . rawurldecode($this->ls); + if ($hosts = $this->scanOriginalHosts ()) { + $common_q = '&bbs=' . rawurldecode ($this->bbs) . '&key=' . rawurldecode ($this->key) . '&ls=' . rawurldecode ($this->ls); $diedat_msg .= '<br>dat瑼̃zXgo܂B'; foreach ($hosts as $host) { $diedat_msg .= " [<a href=\"{$_conf['read_php']}?host={$host}{$common_q}{$_conf['k_at_a']}\">{$host}</a>]"; @@ -1371,272 +1217,51 @@ public function getDefaultGetDatErrorMessageHTML() return $diedat_msg; } - // }}} - // {{{ _generateMoritapoDatLink() - - /** - * p2(dat擾Ȃꍇ̓^|)dat擾邽߂̃N𐶐B - * - * @param void - * @return string - */ - protected function _generateMoritapoDatLink() - { - global $_conf; - - if ($_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass']) { - $csrfid = $this->_getCsrfIdForMoritapoDat(); - $query = p2h('host=' . rawurlencode($this->host) - . '&bbs=' . rawurlencode($this->bbs) - . '&key=' . rawurlencode($this->key) - . '&ls=' . rawurlencode($this->ls) - . '&moritapodat=true' - . '&csrfid=' . rawurlencode($csrfid)); - return " [<a href=\"{$_conf['read_php']}?{$query}{$_conf['k_at_a']}\">^|rep2Ɏ荞</a>]"; - } else { - return ''; - } - } - - // }}} - // {{{ _downloadDat2chMoritapo() - - /** - * p2(dat擾Ȃꍇ̓^|)dat擾 - * - * @param void - * @return bool - */ - protected function _downloadDat2chMoritapo() - { - global $_conf; - - // dat_E[h - try { - $client = P2Util::getP2Client(); - $body = $client->downloadDat($this->host, $this->bbs, $this->key, $response); - // DEBUG - /* - $GLOBALS['_downloadDat2chMoritapo_response_dump'] = '<pre>' . p2h(print_r($response, true)) . '</pre>'; - register_shutdown_function(create_function('', 'echo $GLOBALS[\'_downloadDat2chMoritapo_response_dump\'];')); - */ - } catch (P2Exception $e) { - p2die($e->getMessage()); - } - - // f[^؂1 - if (!$body || (strpos($body, '<>') === false && strpos($body, ',') === false)) { - return $this->_downloadDat2chMoritapoNotFound(); - } - - // sʒuo - $posCR = strpos($body, "\r"); - $posLF = strpos($body, "\n"); - if ($posCR === false && $posLF === false) { - $pos = strlen($body); - } elseif ($posCR === false) { - $pos = $posLF; - } elseif ($posLF === false) { - $pos = $posCR; - } else { - $pos = min($posLF, $posCR); - } - - // 1sڂ̎擾ƃf[^؂2 - $firstLine = rtrim(substr($body, 0, $pos)); - if (strpos($firstLine, '<>') !== false) { - $this->dat_type = '2ch'; - } elseif (strpos($firstLine, ',') !== false) { - $this->dat_type = '2ch_old'; - } else { - return $this->_downloadDat2chMoritapoNotFound(); - } - - // f[^؂3 (^Cg = $ar[4]) - $ar = $this->explodeDatLine($firstLine); - if (count($ar) < 5) { - return $this->_downloadDat2chMoritapoNotFound(); - } - - // [Jdatɏ - if (FileCtl::file_write_contents($this->keydat, $body) === false) { - p2die('cannot write file. downloadDat2chMoritapo()'); - } - - return true; - } - - // }}} - // {{{ _downloadDat2chMoritapoNotFound() - - /** - * ^|ł̎擾łȂƂɌĂяo - * - * @param void - * @return bool - */ - protected function _downloadDat2chMoritapoNotFound() - { - global $_conf; - - $csrfid = $this->_getCsrfIdForMoritapoDat(); - - $host_en = rawurlencode($this->host); - $bbs_en = rawurlencode($this->bbs); - $key_en = rawurlencode($this->key); - $ls_en = rawurlencode($this->ls); - - $host_ht = p2h($this->host); - $bbs_ht = p2h($this->bbs); - $key_ht = p2h($this->key); - $ls_ht = p2h($this->ls); - - $query_ht = p2h("host={$host_en}&bbs={$bbs_en}&key={$key_en}&ls={$ls_en}&maru=true"); - $marutori_ht = " [<a href=\"{$_conf['read_php']}?{$query_ht}{$_conf['k_at_a']}\">IDrep2Ɏ荞</a>]"; - - if ($hosts = $this->scanOriginalHosts()) { - $hostlist_ht = '<br>dat瑼̃zXgo܂B'; - foreach ($hosts as $host) { - $hostlist_ht .= " [<a href=\"#\" onclick=\"this.parentNode.elements['host'].value='{$host}';return false;\">{$host}</a>]"; - } - } else { - $hostlist_ht = ''; - } - - $this->getdat_error_msg_ht .= <<<EOF -<p>rep2 info: ^|ł̃Xbh擾Ɏs܂B{$marutori_ht}</p> -<form action="{$_conf['read_php']}" method="get"> - zXg - <input type="text" name="host" value="{$host_ht}" size="12"> - <input type="hidden" name="bbs" value="{$bbs_ht}"> - <input type="hidden" name="key" value="{$key_ht}"> - <input type="hidden" name="ls" value="{$ls_ht}"> - ɕς - <input type="submit" name="moritapodat" value="^|rep2Ɏ荞ł݂"> - <input type="hidden" name="csrfid" value="{$csrfid}"> - {$hostlist_ht} - {$_conf['k_input_ht']} -</form>\n -EOF; - $this->diedat = true; - - return false; - } - - // }}} - // {{{ _getCsrfIdForMoritapoDat() - - /** - * p2dat擾ۂɎgCSRFh~g[N𐶐 - * - * @param void - * @return string - */ - protected function _getCsrfIdForMoritapoDat() - { - return P2Util::getCsrfId('moritapodat' . $this->host . $this->bbs . $this->key); - } - - // }}} - // {{{ _decodeGzip() - - /** - * GzipkꂽX|X{fBfR[h - * - * @param string $body - * @param string $caller - * @return string - */ - static protected function _decodeGzip($body, $url) - { - global $_conf; - - if (function_exists('http_inflate')) { - // pecl_http http_inflate() œWJ - $body = http_inflate($body); - } else { - // gzip tempt@CɕۑEPHPʼn𓀓ǂݍ - if (!is_dir($_conf['tmp_dir'])) { - FileCtl::mkdirRecursive($_conf['tmp_dir']); - } - - $gztempfile = tempnam($_conf['tmp_dir'], 'gz_'); - if (false === $gztempfile) { - p2die('ꎞt@C쐬ł܂łB'); - } - - if (false === file_put_contents($gztempfile, $body)) { - unlink($gztempfile); - p2die('ꎞt@Cɏ߂܂łB'); - } - - $body = file_get_contents('compress.zlib://' . $gztempfile); - if (false === $body) { - $body = null; - } - - unlink($gztempfile); - } - - if (is_null($body)) { - $summary = 'gzipWJG['; - $description = self::_urlToAnchor($url) . ' gzipfR[hł܂łB'; - self::_pushInfoMessage($summary, $description); - } - - return $body; - } - // }}} // {{{ _pushInfoMessage() /** * 񃁃bZ[WvbV * - * @param string $summary - * @param string $description - * @return void + * @param string $summary + * @param string $description + * @return void */ - static protected function _pushInfoMessage($summary, $description) - { + static protected function _pushInfoMessage($summary, $description) { $message = '<p class="info-msg">' . $summary . '<br>rep2 info: ' . $description . '</p>'; - P2Util::pushInfoHtml($message); + P2Util::pushInfoHtml ($message); } - // }}} // {{{ _pushInfoConnectFailed() /** * ڑɎs|̃bZ[WvbV * - * @param string $url - * @param int $errno - * @param string $errstr - * @return void + * @param string $url + * @param int $errno + * @param string $errstr + * @return void */ - static protected function _pushInfoConnectFailed($url, $errno, $errstr) - { - $summary = sprintf('HTTPڑG[ (%d) %s', $errno, $errstr); - $description = self::_urlToAnchor($url) . ' ɐڑł܂łB'; - self::_pushInfoMessage($summary, $description); + static protected function _pushInfoConnectFailed($url, $errno, $errstr) { + $summary = sprintf ('HTTPڑG[ (%d) %s', $errno, $errstr); + $description = self::_urlToAnchor ($url) . ' ɐڑł܂łB'; + self::_pushInfoMessage ($summary, $description); } - // }}} // {{{ _pushInfoReadTimedOut() /** * ǂݍ݂^CAEg|̃bZ[WvbV * - * @param string $url - * @return void + * @param string $url + * @return void */ - static protected function _pushInfoReadTimedOut($url) - { + static protected function _pushInfoReadTimedOut($url) { $summary = 'HTTPڑ^CAEg'; - $description = self::_urlToAnchor($url) . ' ǂݍ݊ł܂łB'; - self::_pushInfoMessage($summary, $description); + $description = self::_urlToAnchor ($url) . ' ǂݍ݊ł܂łB'; + self::_pushInfoMessage ($summary, $description); } // }}} @@ -1645,16 +1270,15 @@ static protected function _pushInfoReadTimedOut($url) /** * HTTPG[̃bZ[WvbV * - * @param string $url - * @param int $errno - * @param string $errstr + * @param string $url + * @param int $errno + * @param string $errstr * @return void */ - static protected function _pushInfoHttpError($url, $errno, $errstr) - { - $summary = sprintf('HTTP %d %s', $errno, $errstr); - $description = self::_urlToAnchor($url) . ' ǂݍ߂܂łB'; - self::_pushInfoMessage($summary, $description); + static protected function _pushInfoHttpError($url, $errno, $errstr) { + $summary = sprintf ('HTTP %d %s', $errno, $errstr); + $description = self::_urlToAnchor ($url) . ' ǂݍ߂܂łB'; + self::_pushInfoMessage ($summary, $description); } // }}} @@ -1663,17 +1287,13 @@ static protected function _pushInfoHttpError($url, $errno, $errstr) /** * _pushInfon\bhpURLAJ[ɕϊ * - * @param string $url - * @return string + * @param string $url + * @return string */ - static protected function _urlToAnchor($url) - { + static protected function _urlToAnchor($url) { global $_conf; - return sprintf('<a href="%s"%s>%s</a>', - P2Util::throughIme($url), - $_conf['ext_win_target_at'], - p2h($url)); + return sprintf ('<a href="%s"%s>%s</a>', P2Util::throughIme ($url), $_conf['ext_win_target_at'], p2h ($url)); } // }}} @@ -1690,30 +1310,27 @@ private function _get2ch203Body() { // dl̊m؂ĂȂ̂ŁÂ悤Ȕfł悢̂͂肵ȂB // 203 Non-Authoritative Information // ߋO - /* - WBBB<><>2007/06/10() 13:29:51.68 0<> http://mlb.yahoo.co.jp/headlines/?a=2279 <br> 큄 <>탁W[i c_14001 - 1001, 131428 (X, TCY)<><>1181480550000000 (ŏIXV)<><div style="color:navy;font-size:smaller;">|<br />| <br />|</div><> - POOP<><>Over 1000 Thread<> ̃Xbh͂POOO𒴂܂B <br> Ȃ̂ŁAVXbh𗧂ĂĂłBBB <> - ߋO <><>[ߋO]<><div style="color:red;text-align:center;"> ̃Xbh͉ߋOqɂɊi[Ă܂</div><hr /><br />IEʂ̃uEUŌꍇ http://tubo.80.kg/tubo_and_maru.html<br />p̃uEUŌꍇ http://www.monazilla.org/<br /><br />Q˂ Viewer gƁAɓǂ߂܂B http://2ch.tora3.net/<br /><div style="color:navy;"> Viewer(ʏ́) ̔ŁAQ˂͐ݔ𑝋Ă܂B<br />ꂽAVT[o𓊓łƂłB</div><br />悭킩Ȃꍇ̓\tgEFA‚Go http://pc11.2ch.net/software/<br /><br />^| ( http://find.2ch.net/faq/faq2.php#c1 ) Ă΁A50^|ŕ\ł܂B<br />@@@@炩 http://find.2ch.net/index.php?STR=dat:http://ex23.2ch.net/test/read.cgi/morningcoffee/1181449791/<br /><br /><hr /><> - */ - $params = array(); - $params['timeout'] = $_conf['fsockopen_time_limit']; - if ($_conf['proxy_use']) { - $params['proxy_host'] = $_conf['proxy_host']; - $params['proxy_port'] = $_conf['proxy_port']; - } - $url = "http://{$this->host}/{$this->bbs}/dat/{$this->key}.dat"; - $req = new HTTP_Request($url, $params); - $req->setMethod('GET'); - $err = $req->sendRequest(true); + /* + * WBBB<><>2007/06/10() 13:29:51.68 0<> http://mlb.yahoo.co.jp/headlines/?a=2279 <br> 큄 <>탁W[i c_14001 + * 1001, 131428 (X, TCY)<><>1181480550000000 (ŏIXV)<><div style="color:navy;font-size:smaller;">|<br />| <br />|</div><> + * POOP<><>Over 1000 Thread<> ̃Xbh͂POOO𒴂܂B <br> Ȃ̂ŁAVXbh𗧂ĂĂłBBB <> + * ߋO <><>[ߋO]<><div style="color:red;text-align:center;"> ̃Xbh͉ߋOqɂɊi[Ă܂</div><hr /><br />IEʂ̃uEUŌꍇ http://tubo.80.kg/tubo_and_maru.html<br />p̃uEUŌꍇ http://www.monazilla.org/<br /><br />Q˂ Viewer gƁAɓǂ߂܂B http://2ch.tora3.net/<br /><div style="color:navy;"> Viewer(ʏ́) ̔ŁAQ˂͐ݔ𑝋Ă܂B<br />ꂽAVT[o𓊓łƂłB</div><br />悭킩Ȃꍇ̓\tgEFA‚Go http://pc11.2ch.net/software/<br /><br />^| ( http://find.2ch.net/faq/faq2.php#c1 ) Ă΁A50^|ŕ\ł܂B<br />@@@@炩 http://find.2ch.net/index.php?STR=dat:http://ex23.2ch.net/test/read.cgi/morningcoffee/1181449791/<br /><br /><hr /><> + */ + try { + $url = "http://{$this->host}/{$this->bbs}/dat/{$this->key}.dat"; + $req = P2Commun::createHTTPRequest ($url,HTTP_Request2::METHOD_GET); + + $res = P2Commun::getHTTPResponse($req); - if (!PEAR::isError($err)) { // X|XR[h - if ('203' == $req->getResponseCode()) { - return $req->getResponseBody(); + if ('203' == $res->getStatus ()) { + return $res->getBody (); } + + return false; + } catch (Exception $exp) { + return false; } - return false; } // }}} @@ -1724,43 +1341,42 @@ private function _get2ch203Body() { * ۑiX => datline ̔zj * $this->getdat_error_body̓e\z. * - * @return boolean ɏIꍇtrue + * @return boolean ɏIꍇtrue */ - private function setDatochiResiduums() - { - $this->datochi_residuums = array(); - if (!$this->getdat_error_body || strlen($this->getdat_error_body) === 0) { + private function setDatochiResiduums() { + $this->datochi_residuums = array (); + if (! $this->getdat_error_body || strlen ($this->getdat_error_body) === 0) { return false; } - $lines = explode("\n", $this->getdat_error_body); - if (count($lines) < 3) { + $lines = explode ("\n", $this->getdat_error_body); + if (count ($lines) < 3) { return false; } $first_line = $lines[0]; - $first_datline = rtrim($first_line); - if (strpos($first_datline, '<>') !== false) { + $first_datline = rtrim ($first_line); + if (strpos ($first_datline, '<>') !== false) { $datline_sepa = '<>'; } else { $datline_sepa = ','; $this->dat_type = '2ch_old'; } - $d = explode($datline_sepa, $first_datline); - $this->setTtitle($d[4]); + $d = explode ($datline_sepa, $first_datline); + $this->setTtitle ($d[4]); $this->datochi_residuums[1] = $first_line; $second_line = $lines[1]; - if (strpos($second_line, '<>') === false) { + if (strpos ($second_line, '<>') === false) { return false; } - $d = explode('<>', $second_line); - if (count($d) < 1) { + $d = explode ('<>', $second_line); + if (count ($d) < 1) { return false; } - list($lastn, $size) = explode(',', $d[0]); - $lastn = intval(trim($lastn)); - if (!$lastn) { + list ($lastn, $size) = explode (',', $d[0]); + $lastn = intval (trim ($lastn)); + if (! $lastn) { return false; } @@ -1768,6 +1384,61 @@ private function setDatochiResiduums() return true; } + // }}} + // {{{ _generateWikiDatLink() + + /** + * +WikiDAT擾vOCdat擾邽߂̃N𐶐B + * + * @param + * void + * @return string + */ + protected function _generateWikiDatLink($read_url) { + global $_conf; + + $plugin_ht = ''; + + // +Wiki + if ($_GET['plugin']) { + $datPlugin = new DatPluginCtl (); + $datPlugin->load (); + foreach ($datPlugin->getData () as $v) { + if (preg_match ('{' . $v['match'] . '}', $read_url)) { + $replace = @preg_replace ('{' . $v['match'] . '}', $v['replace'], $read_url); + $code = P2Commun::getResponseCode ($replace); + if ($code == 200) { + $code = '' . $code; + } else { + $code = '~' . $code; + } + $plugin_ht .= " <option value=\"{$replace}\">{$code}:{$v['title']}</option>\n"; + } + } + if ($plugin_ht) { + $plugin_ht = '<select size=1 name="kakolog">' . $plugin_ht . '</select>'; + } else { + $plugin_ht = '<input type="text" name="kakolog" size="64">'; + } + $plugin_ht .= '<input type="submit" name="kakoget" value="擾">'; + } else { + $plugin_ht = '<input type="submit" name="plugin" value="DATT">'; + } + $plugin_ht = <<<EOP +<form method="get" action="{$_conf['read_php']}"> + <input type="hidden" name="host" value="{$this->host}"> + <input type="hidden" name="bbs" value="{$this->bbs}"> + <input type="hidden" name="key" value="{$this->key}"> + <input type="hidden" name="ls" value="{$this->ls}"> + <input type="hidden" name="kakoget" value="2"> + {$_conf['k_input_ht']} +{$plugin_ht} +</form> +EOP; + + return $plugin_ht; + } + // }}} } diff --git a/lib/UA.php b/lib/UA.php index eeda61522..e098c8cff 100644 --- a/lib/UA.php +++ b/lib/UA.php @@ -1,24 +1,6 @@ <?php // Ⴆ΁ANG[ b=k Ȃ isK() trueƂȂ̂ŁAgь\ɂ肷 -// {{{ ̃NXł̂ݗpO[oϐi_UA_*j -// over PHP5ɌłȂvCx[gȃNXϐɂƂ̂ - -// @see getQueryKey() -$GLOBALS['_UA_query_key'] = 'b'; - -// @see setPCQuery() // b=pc -$GLOBALS['_UA_PC_query'] = 'pc'; - -// @see setMobileQuery() // b=k -$GLOBALS['_UA_mobile_query'] = 'k'; - -// @see setIPhoneGroupQuery() // b=i -$GLOBALS['_UA_iphonegroup_query'] = 'i'; - -$GLOBALS['_UA_force_mode'] = null; - -// }}} // {{{ UA // [todo] enableJS() enableAjax() ~ @@ -28,6 +10,20 @@ */ class UA { + // @see getQueryKey() + static private $_query_key = 'b'; + + // @see setPCQuery() // b=pc + static private $_pc_query = 'pc'; + + // @see setMobileQuery() // b=k + static private $_mobile_query = 'k'; + + // @see setIPhoneGroupQuery() // b=i + static private $_iphonegroup_query = 'i'; + + static private $_force_mode = null; + // {{{ setForceMode() /** @@ -36,7 +32,7 @@ class UA */ static public function setForceMode($v) { - $GLOBALS['_UA_force_mode'] = $v; + self::$_force_mode = $v; } // }}} @@ -86,9 +82,9 @@ static public function isMobile($ua = null) static $cache_ = null; // w肪 - if (isset($GLOBALS['_UA_force_mode'])) { + if (isset(self::$_force_mode)) { // ̓LbVȂ - return ($GLOBALS['_UA_force_mode'] == $GLOBALS['_UA_mobile_query']); + return (self::$_force_mode == self::$_mobile_query); } // UAwȂANG[wQ @@ -144,10 +140,10 @@ static public function isIPhoneGroup($aua = null) static $cache_ = null; // w肪΃`FbN - if (isset($GLOBALS['_UA_force_mode'])) { + if (isset(self::$_force_mode)) { // ڍs̕֋XA͂߂Ă // return ($GLOBALS['_UA_force_mode'] == $GLOBALS['_UA_iphonegroup_query']); - if ($GLOBALS['_UA_force_mode'] == $GLOBALS['_UA_iphonegroup_query']) { + if (self::$_force_mode == self::$_iphonegroup_query) { return true; } } @@ -183,7 +179,7 @@ static public function isIPhoneGroup($aua = null) // iPod touch // Mozilla/5.0 (iPod; U; CPU like Mac OS X; ja-jp) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3 - if (preg_match('/iP(?:hone|[ao]d)/', $ua) || self::isAndroidWebKit($ua)) { + if (preg_match('/iP(?:hone|[ao]d)/', $ua) || self::isAndroid($ua)) { $isiPhoneGroup = true; } @@ -275,7 +271,7 @@ static public function getQueryValue($key = null) */ static public function getQueryKey() { - return $GLOBALS['_UA_query_key']; + return self::$_query_key; } // }}} @@ -287,7 +283,7 @@ static public function getQueryKey() */ static public function setPCQuery($pc) { - $GLOBALS['_UA_PC_query'] = $pc; + self::$_pc_query = $pc; } // }}} @@ -298,7 +294,7 @@ static public function setPCQuery($pc) */ static public function getPCQuery() { - return $GLOBALS['_UA_PC_query']; + return self::$_pc_query; } // }}} @@ -310,7 +306,7 @@ static public function getPCQuery() */ static public function setMobileQuery($k) { - $GLOBALS['_UA_mobile_query'] = $k; + self::$_mobile_query = $k; } // }}} @@ -321,7 +317,7 @@ static public function setMobileQuery($k) */ static public function getMobileQuery() { - return $GLOBALS['_UA_mobile_query']; + return self::$_mobile_query; } // }}} @@ -333,7 +329,7 @@ static public function getMobileQuery() */ static public function setIPhoneGroupQuery($i) { - $GLOBALS['_UA_iphonegroup_query'] = $i; + self::$_iphonegroup_query = $i; } // }}} @@ -344,7 +340,7 @@ static public function setIPhoneGroupQuery($i) */ static public function getIPhoneGroupQuery() { - return $GLOBALS['_UA_iphonegroup_query']; + return self::$_iphonegroup_query; } // }}} @@ -457,6 +453,34 @@ static public function isNintendoDS($ua = null) return false; } + // }}} + // {{{ isAndroid() + + /** + * UAAndroidȂtrueԂB + * + * @param string $ua UAw肷Ȃ + * @return boolean + */ + static public function isAndroid($ua = null) + { + if (is_null($ua) and isset($_SERVER['HTTP_USER_AGENT'])) { + $ua = $_SERVER['HTTP_USER_AGENT']; + } + if (!$ua) { + return false; + } + // V~[^ + // Mozilla/5.0 (Linux; U; Android 1.0; en-us; generic) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2 + // T-mobile G1 + // Mozilla/5.0 (Linux; U; Android 1.0; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2 + // genericdreamقȂ + if (false !== strpos($ua, 'Android')) { + return true; + } + return false; + } + // }}} // {{{ isAndroidWebKit() @@ -485,6 +509,29 @@ static public function isAndroidWebKit($ua = null) return false; } + // }}} + // {{{ isAndroidWebKit() + + /** + * UAAndroidiFirefoxjȂtrueԂB + * + * @param string $ua UAw肷Ȃ + * @return boolean + */ + static public function isAndroidFirefox($ua = null) + { + if (is_null($ua) and isset($_SERVER['HTTP_USER_AGENT'])) { + $ua = $_SERVER['HTTP_USER_AGENT']; + } + if (!$ua) { + return false; + } + if (false !== strpos($ua, 'Android') && false !== strpos($ua, 'Firefox')) { + return true; + } + return false; + } + // }}} // {{{ isSafariGroup() @@ -528,6 +575,17 @@ static public function isIModeBrowser2($ua = null) return false; } + // }}} + // {{{ isClientOSWindowsCE() + + /** + * uEUWindows CEœ삷̂ȂtrueԂ + */ + static public function isClientOSWindowsCE() + { + return (strpos($_SERVER['HTTP_USER_AGENT'], 'Windows CE') !== false); + } + // }}} } diff --git a/lib/Wap.php b/lib/Wap.php deleted file mode 100644 index 77206a660..000000000 --- a/lib/Wap.php +++ /dev/null @@ -1,689 +0,0 @@ -<?php -/** - * WWW Access on PHP - * http://member.nifty.ne.jp/hippo2000/perltips/LWP.html Qlɂ‚Ž悤ȊȈՂ̂̂ - * - * @author aki - */ - -// 2005/04/20 aki ̃NX͖IɂāAPEARpɈڍsiHTTP_ClientȂǁj - -// {{{ WapUserAgent - -/** - * UserAgent NX - */ -class WapUserAgent -{ - // {{{ constants - - const CRLF = "\r\n"; - - // }}} - // {{{ properties - - /** - * User-Agent - * - * @var string - */ - private $_agent = null; - - /** - * fsockopen() ̃^CAEgb - * - * @var int - */ - private $_timeout = -1; - - /** - * fread() ̃^CAEgb - * - * @var int - */ - private $_readTimeout = -1; - - /** - * fsockopen() @ZqtāAG[}Ȃtrue - * - * @var bool - */ - private $_atFsockopen = false; - - /** - * @var int - */ - private $_maxRedirect = 3; - - /** - * @var int - */ - private $_redirectCount = 0; - - /** - * @var array - */ - private $_redirectCache = array(); - - // }}} - // {{{ constructor - - /** - * RXgN^ - * - * @param string $agent_name - */ - public function __construct($agent_name = null) - { - if ($agent_name !== null) { - $this->setAgent($agent_name); - } - } - - // }}} - // {{{ setAgent() - - /** - * setAgent - * - * @param string $agent_name - * @return void - */ - public function setAgent($agent_name) - { - $this->_agent = $agent_name; - } - - // }}} - // {{{ setTimeout() - - /** - * set timeout - * - * @param int $timeout - * @param int $readTimeout - * @return void - */ - public function setTimeout($timeout, $readTimeout) - { - $this->_timeout = $timeout; - $this->_readTimeout = $readTimeout; - } - - // }}} - // {{{ setAtFsockopen() - - /** - * set atFsockopen - * - * @param bool $atFsockopen - * @return void - */ - public function setAtFsockopen($atFsockopen) - { - $this->_atFsockopen = $atFsockopen; - } - - // }}} - // {{{ header() - - /** - * HTTPNGXgT[oɑMāAwb_X|XiWapResponseIuWFNgj擾 - * - * @param WapRequest $req - * @return WapResponse - * @see WapUserAgent::request() - */ - public function header(WapRequest $req) - { - return $this->request($req, array('onlyHeader' => true)); - } - - // }}} - // {{{ request() - - /** - * HTTPNGXgT[oɑMāAX|XiWapResponseIuWFNgj擾 - * - * @thanks http://www.spencernetwork.org/memo/tips-3.php - * - * @param WapRequest $req - * @param array $options - * @return WapResponse - */ - public function request(WapRequest $req, array $options = array()) - { - if (!empty($options['onlyHeader'])) { - $req->setOnlyHeader($options['onlyHeader']); - } - - if (!$purl = parse_url($req->url)) { - $res = new WapResponse(); - $res->message = 'parse_url() failed'; - return $res; - } - - if (isset($purl['query'])) { - $purl['query'] = '?' . $purl['query']; - } else { - $purl['query'] = ''; - } - $default_port = ($purl['scheme'] == 'https') ? 443 : 80; - - // vLV - if ($req->proxy) { - $send_host = $req->proxy['host']; - $send_port = isset($req->proxy['port']) ? $req->proxy['port'] : $default_port; - $send_path = $req->url; - } else { - $send_host = $purl['host']; - $send_port = isset($purl['port']) ? $purl['port'] : $default_port; - $send_path = $purl['path'] . $purl['query']; - } - - // SSL - if ($purl['scheme'] == 'https') { - $send_host = 'ssl://' . $send_host; - } - - $request = $req->method . ' ' . $send_path . ' HTTP/1.0' . self::CRLF; - $request .= 'Host: ' . $purl['host'] . self::CRLF; - if ($this->_agent) { - $request .= 'User-Agent: '. $this->_agent . self::CRLF; - } - $request .= 'Connection: Close' . self::CRLF; - //$request .= 'Accept-Encoding: gzip' . self::CRLF; - - if ($req->modified) { - $request .= 'If-Modified-Since: ' . $req->modified . self::CRLF; - } - - // BasicFؗp̃wb_ - if (isset($purl['user']) && isset($purl['pass'])) { - $request .= 'Authorization: Basic ' . base64_encode($purl['user'] . ':' . $purl['pass']) . self::CRLF; - } - - // ljwb_ - if ($req->headers) { - $request .= $req->headers; - } - - // POST̎̓wb_ljĖURLGR[hf[^Yt - if (strtoupper($req->method) == 'POST') { - // ʏURLGR[h - if (empty($req->noUrlencodePost)) { - foreach ($req->post as $name => $value) { - $POST[] = $name . '=' . rawurlencode($value); - } - $postdata_content_type = 'application/x-www-form-urlencoded'; - - // OĈƂȂǂURLGR[hȂ - } else { - foreach ($req->post as $name => $value) { - $POST[] = $name . '=' . $value; - } - $postdata_content_type = 'text/plain'; - } - $postdata = implode('&', $POST); - $request .= 'Content-Type: ' . $postdata_content_type . self::CRLF; - $request .= 'Content-Length: ' . strlen($postdata) . self::CRLF; - $request .= self::CRLF; - $request .= $postdata; - } else { - $request .= self::CRLF; - } - - $res = new WapResponse(); - - // WEBT[o֐ڑ - if ($this->_timeout > 0) { - if ($this->_atFsockopen) { - $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $this->_timeout); - } else { - $fp = fsockopen($send_host, $send_port, $errno, $errstr, $this->_timeout); - } - } else { - if ($this->_atFsockopen) { - $fp = @fsockopen($send_host, $send_port, $errno, $errstr); - } else { - $fp = fsockopen($send_host, $send_port, $errno, $errstr); - } - } - - if (!$fp) { - $res->code = $errno; // ex) 602 - $res->message = $errstr; // ex) "Connection Failed" - return $res; - } - - if ($this->_readTimeout > 0) { - stream_set_timeout($fp, $this->_readTimeout, 0); - } - - fputs($fp, $request); - $body = ''; - - // header response - while (!p2_stream_eof($fp, $timed_out)) { - $l = fgets($fp,128000); - //echo $l."<br>"; // - // ex) HTTP/1.1 304 Not Modified - if (preg_match('/^(.+?): (.+)\\r\\n/', $l, $matches)) { - $res->headers[$matches[1]] = $matches[2]; - } elseif (preg_match('/HTTP\\/1\\.\\d (\\d+) (.+)\\r\\n/', $l, $matches)) { - $res->code = (int)$matches[1]; - $res->message = $matches[2]; - $res->headers['HTTP'] = rtrim($l); - } elseif ($l == self::CRLF) { - break; - } - } - - // body response - if (!$req->onlyHeader) { - while (!p2_stream_eof($fp, $timed_out)) { - $body .= fread($fp, 4096); - } - $res->setContent($body); - } - - fclose($fp); - - // _CNg(301 Moved, 302 Found)ǐ - // RFC2616 - Section 10.3 - /*if ($GLOBALS['trace_http_redirect']) { - if ($res->code == 301 || ($res->code == 302 && $req->isSafeMethod())) { - if (!$this->_redirectCache) { - $this->_maxRedirect = 5; - $this->_redirectCount = 0; - $this->_redirectCache = array(); - } - while ($res->isRedirect() && isset($res->headers['Location']) && $this->_redirectCount < $this->_maxRedirect) { - $this->_redirectCache[] = $res; - $req->setUrl($res->headers['Location']); - $res = $this->request($req); - $this->_redirectCount++; - } - } - } elseif ($res->isRedirect() && isset($res->headers['Location'])) { - $res->message .= " (Location: <a href=\"{$res->headers['Location']}\">{$res->headers['Location']}</a>)"; - }*/ - - return $res; - } - - // }}} -} - -// }}} -// {{{ WapRequest - -/** - * Request NX - */ -class WapRequest -{ - // {{{ constants - - const CRLF = "\r\n"; - - // }}} - // {{{ properties - - /** - * GET, POST, HEAD̂ꂩ(ftHgGETAPUT,DELETE͂Ȃ) - * - * @var string - */ - public $method = 'GET'; - - /** - * http://n܂URL( http://user:pass@host:port/path?query ) - * - * @var string - */ - public $url = null; - - /** - * Cӂ̒ljwb_ - * - * @var string - */ - public $headers = null; - - /** - * POST̎ɑMf[^i[z("ϐ"=>"l") - * - * @var array - */ - public $post = array(); - - /** - * ('host'=>"", 'port'=>"") - * - * @var array - */ - public $proxy = array(); - - /** - * If-Modified-Since - * - * @var string - */ - public $modified = null; - - /** - * wb_擾Ȃtrue - * - * @var bool - */ - public $onlyHeader = false; - - /** - * POSTf[^urlencodeȂȂtrueBʏurlencodêfalse - * - * @var bool - */ - public $noUrlencodePost = false; - - // }}} - // {{{ constructor - - /** - * RXgN^ - * - * @param string $url - * @param string $method - * @param array $options - */ - public function __construct($url = null, $method = null, array $options = null) - { - if ($url) { - $this->setUrl($url); - } - if ($method) { - $this->setMethod($method); - } - if (!$options) { - return; - } - if (array_key_exists('headers', $options)) { - $this->setHeaders($options['headers']); - } - if (array_key_exists('proxy', $options)) { - $this->setProxy($options['proxy']); - } - if (array_key_exists('modified', $options)) { - $this->setModified($options['modified']); - } - if (array_key_exists('onlyHeader', $options)) { - $this->setOnlyHeader($options['onlyHeader']); - } - if (array_key_exists('noUrlencodePost', $options)) { - $this->setNoUrlencodePost($options['noUrlencodePost']); - } - } - - // }}} - // {{{ setProxy() - - /** - * set proxy - * - * @param string $host - * @param string $port - * @return void - */ - public function setProxy($host, $port) - { - $this->proxy['host'] = $host; - $this->proxy['port'] = $port; - } - - // }}} - // {{{ setMethod() - - /** - * set method - * - * @param string $method - * @return void - */ - public function setMethod($method) - { - $this->method = $method; - } - - // }}} - // {{{ setUrl() - - /** - * set url - * - * @param string $url - * @return void - */ - public function setUrl($url) - { - $this->url = $url; - } - - // }}} - // {{{ setModified() - - /** - * set modified - * - * @param string|int $modified - * @return void - */ - public function setModified($modified) - { - if (is_numeric($modified)) { - $this->modified = http_date((int)$modified); - } else { - $this->modified = $modified; - } - } - - // }}} - // {{{ setOnlyHeader() - - /** - * set onlyHeader - * - * @param bool $onlyHeader - * @return void - */ - public function setOnlyHeader($onlyHeader) - { - $this->onlyHeader = $onlyHeader; - } - - // }}} - // {{{ setHeaders() - - /** - * set noUrlencodePost - * - * @param bool $noUrlencodePost - * @return void - */ - public function setNoUrlencodePost($noUrlencodePost) - { - $this->noUrlencodePost = $noUrlencodePost; - } - - // }}} - // {{{ setHeaders() - - /** - * set headers - * - * @param string $headers - * @return void - */ - public function setHeaders($headers) - { - $this->headers = $headers; - } - - // }}} - // {{{ isSafeMethod() - - /** - * is safe method? - * - * @return bool - */ - public function isSafeMethod() - { - $method = strtoupper($this->method); - // RFC2616 - Section 9 - if ($method == 'GET' || $method == 'HEAD'){ - return true; - } else { - return false; - } - } - - // }}} -} - -// }}} -// {{{ WapResponse - -/** - * Response NX - */ -class WapResponse -{ - // {{{ properties - - /** - * NGXǧʂl - * - * @var int - */ - public $code = false; - - /** - * codeɑΉlԂǂ߂Z - * - * @var string - */ - public $message = ''; - - /** - * z - * - * @var array - */ - public $headers = array(); - - /** - * eBCӂ̃f[^̌ł܂ - * - * @var string - */ - public $content = null; - - // }}} - // {{{ setContent() - - /** - * set content - * - * @param string $content - * @return void - */ - public function setContent($content) - { - $this->content = $content; - } - - // }}} - // {{{ isSuccess() - - /** - * is success? - * - * @return bool - */ - public function isSuccess() - { - return in_array($this->code, array(200, 206, 304)); - } - - // }}} - // {{{ isError() - - /** - * is error ? - * - * @return bool - */ - public function isError() - { - if (!$this->code) { - return true; - } - return !$this->isSuccess(); - } - - // }}} - // {{{ isRedirect() - - /** - * is redirect? - * - * @return bool - */ - public function isRedirect() - { - return in_array($this->code, array(301, 302)); - } - - // }}} - // {{{ HTTP Status Codes (note) -/* - 000, 'Unknown Error', - 200, 'OK', - 201, 'CREATED', - 202, 'Accepted', - 203, 'Partial Information', - 204, 'No Response', - 206, 'Partial Content', - 301, 'Moved', - 302, 'Found', - 303, 'Method', - 304, 'Not Modified', - 400, 'Bad Request', - 401, 'Unauthorized', - 402, 'Payment Required', - 403, 'Forbidden', - 404, 'Not Found', - 500, 'Internal Error', - 501, 'Not Implemented', - 502, 'Bad Response', - 503, 'Too Busy', - 600, 'Bad Request in Client', - 601, 'Not Implemented in Client', - 602, 'Connection Failed', - 603, 'Timed Out', -*/ - // }}} -} - -// }}} - -/* - * Local Variables: - * mode: php - * coding: cp932 - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: nil - * End: - */ -// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/auth2chapi.inc.php b/lib/auth2chapi.inc.php new file mode 100644 index 000000000..dab45871d --- /dev/null +++ b/lib/auth2chapi.inc.php @@ -0,0 +1,119 @@ +<?php +/** + * rep2 - 2chOC + */ + +// {{{ authenticate_2chapi() + + +/** +* 2chAPI SID 擾 +* +* @return mix 擾łꍇSIDԂ +*/ + function authenticate_2chapi() + { + global $_conf; + + $url= http_build_url(array( + "scheme" => $_conf['2chapi_ssl.auth']?"https":"http", + "host" => "api.5ch.net", + "path" => "v1/auth/")); + + $CT = time(); + $AppKey = $_conf['2chapi_appkey']; + $AppName = $_conf['2chapi_appname']; + $HMKey = $_conf['2chapi_hmkey']; + $AuthUA = sprintf($_conf['2chapi_ua.auth'],$AppName); + $login2chID = ""; + $login2chPW = ""; + $message = $AppKey.$CT; + $HB = hash_hmac("sha256", $message, $HMKey); + + if(empty($AppKey) || empty($AppName) || empty($HMKey)) { + P2Util::pushInfoHtml("<p>p2 Error: 2ch API ̔F؂ɕKvȏ񂪐ݒ肳Ă܂B</p>"); + return ''; + } + + if ($array = P2Util::readIdPw2ch()) { + list($login2chID, $login2chPW, $autoLogin2ch) = $array; + } + + // Ql̗LmF(v ID / PW) + if (!empty($login2chID) && !empty($login2chPW)) { + P2Util::checkRoninExpiration(); + } + + try { + $req = P2Commun::createHTTPRequest($url,HTTP_Request2::METHOD_POST); + + $req->setHeader('User-Agent', $AuthUA); + $req->setHeader('X-2ch-UA', $AppName); + + $req->addPostParameter('ID', $login2chID); + $req->addPostParameter('PW', $login2chPW); + $req->addPostParameter('KY', $AppKey); + $req->addPostParameter('CT', $CT); + $req->addPostParameter('HB', $HB); + + // POSTf[^̑M + $res = P2Commun::getHTTPResponse($req); + + $code = $res->getStatus(); + if ($code =! 200) { + P2Util::pushInfoHtml("<p>p2 Error: HTTP Error({$code})</p>"); + } else { + $body = $res->getBody(); + } + } catch (Exception $e) { + P2Util::pushInfoHtml("<p>p2 Error: 2ch API ̔F؃T[oɐڑo܂łB({$e->getMessage()})</p>"); + } + + if(file_exists($_conf['sid2chapi_php'])) { + unlink($_conf['sid2chapi_php']); + } + + // ڑsȂ + if (empty($body)) { + P2Util::pushInfoHtml('<p>p2 info: 2˂APIgpɂ́APHP<a href="'. + P2Util::throughIme("http://www.php.net/manual/ja/ref.curl.php"). + '">cURL֐</a><a href="'. + P2Util::throughIme("http://www.php.net/manual/ja/ref.openssl.php"). + '">OpenSSL֐</a>LłKv܂B</p>'); + + P2Util::pushInfoHtml("<p>p2 error: 2ch APIF؂Ɏs܂B{$curl_msg}</p>"); + return false; + } + + $body = rtrim($body); + + // + if (!preg_match('/SESSION-ID=(.+?):(.+)/', $body, $matches)) { + if (file_exists($_conf['sid2chapi_php'])) { unlink($_conf['sid2chapi_php']); } + P2Util::pushInfoHtml("<p>p2 error: 2ch API ̃X|XSessionID擾o܂łB</p>"); + return false; + } + $uaMona = $matches[1]; + $SID2chAPI = $matches[1] . ':' . $matches[2]; + + // SID ̋L^ێ + $cont = sprintf('<?php $uaMona = %s; $SID2chAPI = %s;', var_export($uaMona, true), var_export($SID2chAPI, true)); + if (false === file_put_contents($_conf['sid2chapi_php'], $cont, LOCK_EX)) { + P2Util::pushInfoHtml("<p>p2 Error: {$_conf['sid2chapi_php']} ۑł܂łBOCo^sB</p>"); + return false; + } + + return $SID2chAPI; + } +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/bootstrap.php b/lib/bootstrap.php index ea88eae8c..2e44b29b0 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -49,6 +49,15 @@ $save_conf_user = false; } } else { + // ݒt@CۑfBNgȂꍇ͐VKō쐬 + if(!file_exists($_conf['pref_dir'])){ + FileCtl::mkdirFor($_conf['conf_user_file']); + } + if(!is_writable($_conf['pref_dir'])){ + // ݌𓾂Ȃꍇ̓p[~bV̒ӊN + p2die("efBNg̃p[~bVĉB"); + } + // ftHgݒǂݍ݁A}[W include P2_CONFIG_DIR . '/conf_user_def.inc.php'; $_conf = array_merge($_conf, $conf_user_def); @@ -164,7 +173,7 @@ $_conf['accept_charset'] = 'UTF-8'; // Windows Mobile - } elseif (P2Util::isClientOSWindowsCE()) { + } elseif (UA::isClientOSWindowsCE()) { $_conf['ktai'] = true; // gуQ[@ @@ -429,7 +438,10 @@ <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=yes"> <meta name="format-detection" content="telephone=no"> {$_conf['touch_icon_ht']} +<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css?{$_conf['p2_version_id']}"> <link rel="stylesheet" type="text/css" media="screen" href="css/iphone.css?{$_conf['p2_version_id']}"> +<script type="text/javascript" src="js/jquery-{$_conf['jquery_version']}.min.js"></script> +<script type="text/javascript" src="js/bootstrap.min.js?{$_conf['p2_version_id']}"></script> <script type="text/javascript" src="js/iphone.js?{$_conf['p2_version_id']}"></script> EOS; @@ -438,11 +450,14 @@ // iPhoner[ } elseif ($_conf['iphone']) { $_conf['extra_headers_ht'] .= <<<EOS +<link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.min.css?{$_conf['p2_version_id']}"> <link rel="stylesheet" type="text/css" media="screen" href="css/iphone.css?{$_conf['p2_version_id']}"> +<script type="text/javascript" src="js/jquery-{$_conf['jquery_version']}.min.js"></script> +<script type="text/javascript" src="js/bootstrap.min.js?{$_conf['p2_version_id']}"></script> <script type="text/javascript" src="js/iphone.js?{$_conf['p2_version_id']}"></script> EOS; } - +/* // AndroidłJavaScript-XPathg if ($_conf['iphone'] && UA::isAndroidWebKit()) { $_conf['extra_headers_ht'] .= <<<EOS @@ -450,7 +465,7 @@ <script type="text/javascript" src="js/javascript-xpath.js?{$_conf['p2_version_id']}"></script> EOS; } - +*/ // iPhonepXL if ($_conf['iphone'] && isset($_conf['expack.iphone.skin'])) { if (strpos($_conf['expack.iphone.skin'], DIRECTORY_SEPARATOR) === false) { diff --git a/lib/expack/Console/Command/Check.php b/lib/expack/Console/Command/Check.php index c14cd2ab4..bad8061c2 100644 --- a/lib/expack/Console/Command/Check.php +++ b/lib/expack/Console/Command/Check.php @@ -30,10 +30,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $php_version = phpversion(); - if (version_compare($php_version, '5.4.0-dev', '>=')) { - $required_version = $p2_required_version_5_4; + if (version_compare($php_version, '7.0.0-dev', '>=')) { + $required_version = $p2_required_version_7_x; } else { - $required_version = $p2_required_version_5_3; + $required_version = $p2_required_version_5_x; } // PHP̃o[W diff --git a/lib/expack/ImageCache2/QuickForm/Rules.php b/lib/expack/ImageCache2/QuickForm/Rules.php index 944a30ea6..651a0b750 100644 --- a/lib/expack/ImageCache2/QuickForm/Rules.php +++ b/lib/expack/ImageCache2/QuickForm/Rules.php @@ -15,7 +15,7 @@ class ImageCache2_QuickForm_Rule_NumberInRange extends HTML_QuickForm_Rule /** * @return bool */ - public function validate($value, $options) + public function validate($value, $options = NULL) { if (isset($options['min']) && floatval($value) < $options['min']) { return false; @@ -60,7 +60,7 @@ class ImageCache2_QuickForm_Rule_InArray extends HTML_QuickForm_Rule /** * @return bool */ - public function validate($value, $options) + public function validate($value, $options = NULL) { return in_array($value, $options); } @@ -81,7 +81,7 @@ class ImageCache2_QuickForm_ArrayKeyExists extends HTML_QuickForm_Rule /** * @return bool */ - public function validate($value, $options) + public function validate($value, $options = NULL) { return array_key_exists($value, $options); } diff --git a/lib/expack/ImageCache2/Thumbnailer.php b/lib/expack/ImageCache2/Thumbnailer.php index 7d401482c..2e3ca186c 100644 --- a/lib/expack/ImageCache2/Thumbnailer.php +++ b/lib/expack/ImageCache2/Thumbnailer.php @@ -275,7 +275,7 @@ public function convert($size, $md5, $mime, $width, $height, return $thumbUrl; } $thumbDir = dirname($thumbPath); - if (!is_dir($thumbDir) && !mkdir($thumbDir)) { + if (!is_dir($thumbDir) && !FileCtl::mkdirRecursive($thumbDir)) { $error = PEAR::raiseError("fBNg쐬ł܂łB({$thumbDir})"); return $error; } @@ -563,7 +563,7 @@ public function getSubDir($basedir, $size, $md5, $mime, $fullPath = false) $dirID = $this->dirID($size, $md5, $mime); if ($fullPath) { if (!is_dir($basedir)) { - if (!mkdir($basedir)) { + if (!FileCtl::mkdirRecursive($basedir)) { return false; } } diff --git a/lib/expack/rss/common.inc.php b/lib/expack/rss/common.inc.php index bbd435077..ae53a253a 100644 --- a/lib/expack/rss/common.inc.php +++ b/lib/expack/rss/common.inc.php @@ -20,7 +20,7 @@ function rss_get_save_path($remotefile) } $pURL = @parse_url($remotefile); - if (!$pURL || !isset($pURL['scheme']) || $pURL['scheme'] != 'http' || !isset($pURL['host'])) { + if (!$pURL || !isset($pURL['scheme']) || !isset($pURL['host'])) { $errmsg = 'p2 error: sRSSURL (' . p2h($remotefile) . ')'; $error = PEAR::raiseError($errmsg); return ($finished[$remotefile] = $error); diff --git a/lib/expack/rss/parser.inc.php b/lib/expack/rss/parser.inc.php index f7198faad..46a7a7444 100644 --- a/lib/expack/rss/parser.inc.php +++ b/lib/expack/rss/parser.inc.php @@ -50,16 +50,13 @@ function p2GetRSS($remotefile, $atom = 0) } // If-Modified-Since‚Ń_E[hit@CAÂA[ĥƂj - if (!file_exists($localpath) || $refresh || - filemtime($localpath) < (time() - $_conf['expack.rss.check_interval'] * 60) - ) { - $dl = P2Util::fileDownload($remotefile, $localpath, true, 301); - } + $cache_time = ($refresh) ? 0 : ($_conf['expack.rss.check_interval'] * 60); + $dl = P2Commun::fileDownload($remotefile, $localpath,$cache_time, true, true); // LbVXVȂA_E[hȂRSSp[X - if (file_exists($localpath) && (!isset($dl) || $dl->isSuccess())) { + if (file_exists($localpath) && (!isset($dl))) { if ($atom) { - $atom = (isset($dl) && $dl->code == 200) ? 2 : 1; + $atom = (isset($dl) && $dl->getStatus() == 200) ? 2 : 1; } $rss = p2ParseRSS($localpath, $atom); return $rss; @@ -442,7 +439,7 @@ function rss_url_rel_to_abs($url) { // URL p[X $p = @parse_url($GLOBALS['channel']['link']); - if (!$p || !isset($p['scheme']) || $p['scheme'] != 'http' || !isset($p['host'])) { + if (!$p || !isset($p['scheme']) || !isset($p['host'])) { return $url; } diff --git a/lib/expack/tgrep/view.inc.php b/lib/expack/tgrep/view.inc.php index a1657d35a..1a3081950 100644 --- a/lib/expack/tgrep/view.inc.php +++ b/lib/expack/tgrep/view.inc.php @@ -49,6 +49,12 @@ function setWinTitle() { function sf() { <?php if (strlen($htm['query']) == 0) { echo 'document.getElementById("Q").focus();'; } ?> } + function moveSubject(href, serachWord, query) { + if(query == ""){ + return ; + } + location.href = href + '?word=' + serachWord + query; + } //]]> </script> </head> @@ -61,6 +67,10 @@ function sf() { <td class="toolbar-filter"> <form id="searchForm" name="searchForm" action="<?php echo $htm['php_self']; ?>" method="get" accept-charset="<?php echo $_conf['accept_charset']; ?>"> <input id="Q" name="Q" <?php echo $htm['search_attr']; ?> /> + <input type="hidden" name="maxResult" value="<?php echo $_GET['maxResult']; ?>"> + <input type="hidden" name="AndOr" value="<?php echo $_GET['AndOr']; ?>"> + <input type="hidden" name="Sort" value="<?php echo $_GET['Sort']; ?>"> + <input type="hidden" name="924" value="<?php echo $_GET['924']; ?>"> <input type="submit" value="" /> <?php echo $_conf['detect_hint_input_xht'], $_conf['k_input_ht']; ?> </form> @@ -91,6 +101,7 @@ function sf() { <?php } ?> <?php if (!$errors && $profile) { ?> + <!-- Result and Filter --> <div class="tgrep_result"> <?php if ($htm['category'] && isset($profile['categories'][$htm['category']])) { ?> @@ -105,10 +116,10 @@ function sf() { | JeSōi荞: <select onchange="location.href=document.getElementById('h_php_self').value+'?Q='+document.getElementById('h_query_en').value+this.options[this.selectedIndex].value"> <option value="">-</option> -<?php foreach ($profile['categories'] as $c) { ?><option value="&C=<?php echo $c->id; ?>"<?php if ($c->id == $htm['category']) { echo ' selected="selected"'; } ?>><?php echo p2h($c->name); ?> (<?php echo $c->hits; ?>)</option><?php } ?> +<?php if(isset($profile['categories'])){ foreach ($profile['categories'] as $c) { ?><option value="&C=<?php echo $c->id; ?>"<?php if ($c->id == $htm['category']) { echo ' selected="selected"'; } ?>><?php echo p2h($c->name); ?> (<?php echo $c->hits; ?>)</option><?php } } ?> </select> | ‚ōi荞: -<select onchange="location.href=document.getElementById('h_subject_php').value+'?word='+document.getElementById('h_query_en').value+this.options[this.selectedIndex].value"> +<select onchange="moveSubject(document.getElementById('h_subject_php').value, document.getElementById('h_query_en').value, this.options[this.selectedIndex].value);"> <option value="">-</option> <?php $m = ($htm['category'] && isset($profile['categories'][$htm['category']])) ? $profile['categories'][$htm['category']]->member : null; ?> <?php foreach ($profile['boards'] as $n => $b) { if (!$m || in_array($n, $m)) { ?><option value="<?php printf('&host=%s&bbs=%s&itaj_en=%s', $b->host, $b->bbs, UrlSafeBase64::encode($b->name)); ?>"><?php echo p2h($b->name); ?> (<?php echo $b->hits; ?>)</option><?php } } ?> @@ -137,7 +148,7 @@ function sf() { $new = ''; $turl = sprintf('%s?host=%s&bbs=%s&key=%d', $_conf['read_php'], $t->host, $t->bbs, $t->tkey); $burl = sprintf('%s?host=%s&bbs=%s&itaj_en=%s&word=%s', $_conf['subject_php'], $t->host, $t->bbs, UrlSafeBase64::encode($t->ita), $htm['query_en']); - if (P2Util::isHostMachiBbs($t->host)) { + if (P2HostMgr::isHostMachiBbs($t->host)) { $ourl = sprintf('http://%s/bbs/read.cgi/%s/%s/', $t->host, $t->bbs, $t->tkey); } else { $ourl = sprintf('http://%s/test/read.cgi/%s/%s/', $t->host, $t->bbs, $t->tkey); @@ -156,7 +167,7 @@ function sf() { <tr class="<?php echo $R ? 'r1 r_odd' : 'r2 r_even'; $R = !$R; ?>"> <td class="ti"><?php echo $nnum; ?></td> <td class="ti"><?php echo $rnum; ?></td> - <td class="ti"><?php echo $o; ?></td> + <td class="ti"><?php echo (int)$o+1; ?></td> <td class="tl"><a href="<?php echo $ourl; ?>" class="moto_thre" onmouseover="showMotoLsPopUp(event, this, this.nextSibling.innerText)" onmouseout="hideMotoLsPopUp()" target="read">E</a><a href="<?php echo $turl; ?>" target="read"><?php echo $t->title; ?></a></td> <td class="t"><a href="<?php echo $burl; ?>"><?php echo $t->ita; ?></a></td> <td class="t"><?php echo date('y/m/d', $t->tkey); ?></td> @@ -172,6 +183,14 @@ function sf() { </tfoot> <?php } ?> </table> +<table> +<tr> + <!--dig2ch̎gp̂ߕ\--> + <td><?php if ($_conf['test.search_dig2ch']) { echo $profile['cm0'];}?></td> + <td><?php if ($_conf['test.search_dig2ch']) { echo $profile['cm1'];}?></td> + <td><?php if ($_conf['test.search_dig2ch']) { echo $profile['cm2'];}?></td> +</tr> +</table> <?php } ?> <?php if ($threads) { ?> @@ -182,6 +201,10 @@ function sf() { <td class="toolbar-filter"> <form id="searchForm2" name="searchForm2" action="<?php echo $htm['php_self']; ?>" method="get" accept-charset="<?php echo $_conf['accept_charset']; ?>"> <input id="Q2" name="Q" <?php echo $htm['search_attr']; ?> /> + <input type="hidden" name="maxResult" value="<?php echo $_GET['maxResult']; ?>"> + <input type="hidden" name="AndOr" value="<?php echo $_GET['AndOr']; ?>"> + <input type="hidden" name="Sort" value="<?php echo $_GET['Sort']; ?>"> + <input type="hidden" name="924" value="<?php echo $_GET['924']; ?>"> <input type="submit" value="" /> <?php echo $_conf['detect_hint_input_xht'], $_conf['k_input_ht']; ?> </form> diff --git a/lib/expack/tgrep/view_k.inc.php b/lib/expack/tgrep/view_k.inc.php index c2e1087e2..4334c7d18 100644 --- a/lib/expack/tgrep/view_k.inc.php +++ b/lib/expack/tgrep/view_k.inc.php @@ -17,7 +17,28 @@ <!-- Search Form --> <form action="<?php echo $htm['php_self']; ?>" method="get"> <input name="Q" <?php echo $htm['search_attr']; ?>> -<input type="submit" value=""> +<input type="submit" value=""><br> +<select name="AndOr"> +<option value="0" selected>AND</option> +<option value="1" >OR</option> +</select><br> +ő<select name="maxResult"> +<option value="10" >10</option> +<option value="20" selected>20</option> +<option value="30" >30</option> +</select>\<br> +<select name="Sort"> +<option value="0" >lC</option> +<option value="1" ></option> +<option value="2" >X</option> +<option value="4" >ŐVX</option> +<option value="3" >ŌÃX</option> +<option value="5" selected>ŐVe</option> +</select><br> +924<select name="924"> +<option value="1" selected>o</option> +<option value="0" ></option> +</select> <?php echo $_conf['detect_hint_input_ht'], $_conf['k_input_ht']; ?> </form> <hr> @@ -70,6 +91,7 @@ <?php } ?> <?php if ($threads) { ?> +<?php if ($_conf['test.search_dig2ch']) { echo $profile['cm0'];echo $profile['cm1'];echo $profile['cm2'];}?> <!-- ThreadList and Pager --> <div><a href="#bottom" align="right" title=""<?php echo $_conf['k_accesskey_at']['bottom']; ?>><?php echo $_conf['k_accesskey_st']['bottom']; ?></a></div> <?php @@ -94,7 +116,7 @@ $itaj = $t->ita; } ?> -<p><?php echo $o; ?>.<a href="<?php echo $turl; ?>"><?php echo $ttitle; ?></a><br> +<p><?php echo $o+1; ?>.<a href=\"<?php echo $turl; ?>\"><?php echo $ttitle; ?></a><br> <small><?php echo date('y/m/d ', $t->tkey); ?><a href="<?php echo $burl; ?>"><?php echo $itaj; ?>(<?php echo $profile['boards'][$t->bid]->hits; ?>)</a></small></p> <?php } ?> <div><a href="#top" align="right" title=""<?php echo $_conf['k_accesskey_at']['above']; ?>><?php echo $_conf['k_accesskey_st']['above']; ?></a></div> diff --git a/lib/expack/tgrep/view_x.inc.php b/lib/expack/tgrep/view_x.inc.php index 5fa7c7520..800642748 100644 --- a/lib/expack/tgrep/view_x.inc.php +++ b/lib/expack/tgrep/view_x.inc.php @@ -105,6 +105,8 @@ // \͈ echo $disp_range; + //if ($_conf['test.search_dig2ch']) { echo "<li>{$profile['cm0']}</li>";} + if ($_conf['test.search_dig2ch']) { echo "<li>"; echo $profile['cm0'];echo $profile['cm1'];echo $profile['cm2'];echo "</li>";} foreach ($threads as $o => $t) { $ttitle_ht = strip_tags($t->title); diff --git a/lib/get_info.inc.php b/lib/get_info.inc.php index 99c158d1a..3da39cced 100644 --- a/lib/get_info.inc.php +++ b/lib/get_info.inc.php @@ -16,7 +16,7 @@ function get_board_info($host, $bbs) { global $_conf; - $group = P2Util::getHostGroupName($host); + $group = P2HostMgr::getHostGroupName($host); $info = new stdClass(); $info->type = 'board'; @@ -59,7 +59,7 @@ function get_board_info($host, $bbs) foreach ($favlines as $l) { $lar = explode("\t", $l); $favitas[0][] = array( - 'group' => P2Util::getHostGroupName($lar[1]), + 'group' => P2HostMgr::getHostGroupName($lar[1]), 'host' => $lar[1], 'bbs' => $lar[2], 'itaj' => $lar[3] @@ -97,7 +97,7 @@ function get_thread_info($host, $bbs, $key) { global $_conf; - $group = P2Util::getHostGroupName($host); + $group = P2HostMgr::getHostGroupName($host); $info = new stdClass(); $info->type = 'thread'; @@ -163,7 +163,7 @@ function get_thread_info($host, $bbs, $key) foreach ($pallines as $l) { $palarray = explode('<>', $l); if ($aThread->key == $palarray[1] && $aThread->bbs == $palarray[11]) { - if (P2Util::getHostGroupName($palarray[10]) == $group) { + if (P2HostMgr::getHostGroupName($palarray[10]) == $group) { $info->palace = true; break; } diff --git a/lib/global.funcs.php b/lib/global.funcs.php index 9179dd6f3..54dbc0eb5 100644 --- a/lib/global.funcs.php +++ b/lib/global.funcs.php @@ -705,7 +705,32 @@ function p2_stream_eof($fp, &$timed_out = false) } // }}} +// {{{ p2_json_encode() +/** + * Shift_JIS̒lUTF-8ɕϊĂJSONGR[h + * + * @param mixed $values + * @return string JSON + */ +function p2_json_encode($values) +{ + // mb_convert_variables͖{zł̓ۏ؂ĂȂ̂ + // array_walk_recursiveʼn񂷁B + // array_walk_recursivezΉĂȂ͂ǂƂ肠BBB + // https://bugs.php.net/bug.php?id=66964 + if(is_array($values) || is_object($values)){ + array_walk_recursive($values, function(&$value) { + mb_convert_variables('UTF-8', 'CP932', $value); + }); + } else { + mb_convert_variables('UTF-8', 'CP932', $values); + } + + return json_encode($values); +} + +// }}} /* * Local Variables: * mode: php diff --git a/lib/index_print_k.inc.php b/lib/index_print_k.inc.php index 70e6bffef..62590e2f9 100644 --- a/lib/index_print_k.inc.php +++ b/lib/index_print_k.inc.php @@ -68,7 +68,7 @@ function index_print_k() <a href="menu_k.php?view=favita{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][3]}>{$_conf['k_accesskey_st'][3]}Cɔ</a><br> <a href="menu_k.php?view=cate{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][4]}>{$_conf['k_accesskey_st'][4]}ؽ</a><br> <a href="subject.php?spmode=recent&sb_view=shinchaku{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][5]}>{$_conf['k_accesskey_st'][5]}ŋߓǂ񂾽ڂ̐V</a><br> -<a href="subject.php?spmode=recent{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][6]}>{$_conf['k_accesskey_st'][6]}ŋߓǂ񂾽ڂ̑S</a><br> +<a href="subject.php?spmode=recent&norefresh=true{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][6]}>{$_conf['k_accesskey_st'][6]}ŋߓǂ񂾽ڂ̑S</a><br> <a href="subject.php?spmode=res_hist{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][7]}>{$_conf['k_accesskey_st'][7]}</a> <a href="read_res_hist.php?nt={$newtime}{$_conf['k_at_a']}">۸</a><br> <a href="subject.php?spmode=palace&norefresh=1{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][8]}>{$_conf['k_accesskey_st'][8]}ڂ̓a</a><br> <a href="setting.php?nt={$newtime}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][9]}>{$_conf['k_accesskey_st'][9]}۸޲݊Ǘ</a><br> diff --git a/lib/live/default_view.inc.php b/lib/live/default_view.inc.php new file mode 100755 index 000000000..b102be925 --- /dev/null +++ b/lib/live/default_view.inc.php @@ -0,0 +1,76 @@ +<?php +/* + +live - ftHgXbh\ ../ShowThreadPc.php ǂݍ܂ +*/ + if ($_conf['backlink_block'] > 0) { + // QƃubN\ponclickݒ + $tores .= "<div id=\"{$res_id}\" class=\"res\" onclick=\"toggleResBlk(event, this, " . $_conf['backlink_block_readmark'] . ")\">\n"; + } else { + $tores .= "<div id=\"{$res_id}\" class=\"res\">\n"; + } + $tores .= "<div class=\"res-header\">"; + + if ($this->thread->onthefly) { + $GLOBALS['newres_to_show_flag'] = true; + //ԍiIUtCj + $tores .= "<span class=\"ontheflyresorder spmSW\"{$spmeh}>{$i}</span> : "; + } elseif ($i > $this->thread->readnum) { + $GLOBALS['newres_to_show_flag'] = true; + // ԍiVXj + $tores .= "<span style=\"color:{$STYLE['read_newres_color']}\" class=\"spmSW\"{$spmeh}>{$i}</span> : "; + } elseif ($_conf['expack.spm.enabled']) { + // ԍiSPMj + $tores .= "<span class=\"spmSW\"{$spmeh}>{$i}</span> : "; + } else { + // ԍ + $tores .= "{$i} : "; + } + +// X{^ +if ($_GET['live']) { + $tores .= "$res_button"; +} + + // O + $tores .= preg_replace('{<b>[ ]*</b>}i', '', "<span class=\"name\"><b>{$name}</b></span> : "); + + // [ + if ($mail) { + if (strpos($mail, 'sage') !== false && $STYLE['read_mail_sage_color']) { + $tores .= "<span class=\"sage\">{$mail}</span> : "; + } elseif ($STYLE['read_mail_color']) { + $tores .= "<span class=\"mail\">{$mail}</span> : "; + } else { + $tores .= $mail . ' : '; + } + } + + $tores .= $date_id; // tID + if ($this->am_side_of_id) { + $tores .= ' ' . $this->activeMona->getMona($msg_id); + } + $tores .= "</div>\n"; // res-header‚ + + // 탌XXg(c`) + if ($_conf['backlink_list'] == 1 || $_conf['backlink_list'] > 2) { + $tores .= $this->_quotebackListHtml($i, 1); + } + + $tores .= "<div id=\"{$msg_id}\" class=\"{$msg_class}\">{$msg}</div>\n"; // e + // 탌XWJpubN + if ($_conf['backlink_block'] > 0) { + $backlinks = $this->_getBacklinkComment($i); + if (strlen($backlinks)) { + $tores .= '<div class="resblock"><img src="img/btn_plus.gif" width="15" height="15" align="left"></div>'; + $tores .= $backlinks; + } + } + // 탌XXg(`) + if ($_conf['backlink_list'] == 2 || $_conf['backlink_list'] > 2) { + $tores .= $this->_quotebackListHtml($i, 2, false); + } + $tores .= "</div>\n"; + +// $tores .= $rpop; // X|bvAbvpp + +?> \ No newline at end of file diff --git a/lib/live/live_ShowThreadLive.php b/lib/live/live_ShowThreadLive.php new file mode 100644 index 000000000..248369e1b --- /dev/null +++ b/lib/live/live_ShowThreadLive.php @@ -0,0 +1,189 @@ +<?php +/** + * rep2 - Xbh\ȂSPMƂ̃R[h쐬 NX live_read.phpp + */ + +// {{{ ShowThreadLive + +class ShowThreadLive extends ShowThreadPc +{ + // {{{ constructor + + /** + * RXgN^ + */ + public function __construct($aThread, $matome = false) + { + parent::__construct($aThread, $matome); + } + + // }}} + // {{{ transRes() + + /** + * DatXHTMLXɕϊi\łȂj + * 폜live_ShowThreadPc.phpq + * + * @param string $ares dat1C + * @param int $i Xԍ + * @param string $pattern nCCgpK\ + * @return string + */ + public function transRes($ares, $i, $pattern = null) + { + global $_conf, $STYLE, $mae_msg; + + // +Wiki:u[h + if (isset($GLOBALS['replaceWordCtl'])) { + $replaceWordCtl = $GLOBALS['replaceWordCtl']; + $name = $replaceWordCtl->replace('name', $this->thread, $ares, $i); + $mail = $replaceWordCtl->replace('mail', $this->thread, $ares, $i); + $date_id = $replaceWordCtl->replace('date', $this->thread, $ares, $i); + $msg = $replaceWordCtl->replace('msg', $this->thread, $ares, $i); + } else { + list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($ares); + } + + if (($id = $this->thread->ids[$i]) !== null) { + $idstr = 'ID:' . $id; + $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id); + } else { + $idstr = null; + } + + $tores = ''; + $rpop = ''; + if ($this->_matome) { + $res_id = "t{$this->_matome}r{$i}"; + $msg_id = "t{$this->_matome}m{$i}"; + } else { + $res_id = "r{$i}"; + $msg_id = "m{$i}"; + } + $msg_class = 'message'; + + // NGځ[`FbN + $ng_type = $this->_ngAbornCheck($i, strip_tags($name), $mail, $date_id, $id, $msg, false, $ng_info); + if ($ng_type == self::ABORN) { + return $this->_abornedRes($res_id); + } + if ($ng_type != self::NG_NONE) { + $ngaborns_head_hits = self::$_ngaborns_head_hits; + $ngaborns_body_hits = self::$_ngaborns_body_hits; + } + + // AA + if ($this->am_autodetect && $this->activeMona->detectAA($msg)) { + $msg_class .= ' ActiveMona'; + } + + //============================================================= + // ܂Ƃ߂ďo + //============================================================= + + $name = $this->transName($name); // OHTMLϊ + $msg = $this->transMsg($msg, $i); // bZ[WHTMLϊ + + // BEvt@CNϊ + $date_id = $this->replaceBeId($date_id, $i); + + // IDtB^ + if ($_conf['flex_idpopup'] == 1 && $id && $this->thread->idcount[$id] > 1) { + $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id); + } + + // HTML|bvAbv + if ($_conf['iframe_popup']) { + $date_id = preg_replace_callback("{<a href=\"(http://[-_.!~*()0-9A-Za-z;/?:@&=+\$,%#]+)\"({$_conf['ext_win_target_at']})>((\?#*)|(Lv\.\d+))</a>}", array($this, 'iframePopupCallback'), $date_id); + } + + // NGbZ[Wϊ + if ($ng_type != self::NG_NONE && count($ng_info)) { + $ng_info = implode(', ', $ng_info); + $msg = <<<EOMSG +<span class="ngword" onclick="show_ng_message('ngm{$ngaborns_body_hits}', this);">{$ng_info}</span> +<div id="ngm{$ngaborns_body_hits}" class="ngmsg ngmsg-by-msg">{$msg}</div> +EOMSG; + } + + // NGl[ϊ + if ($ng_type & self::NG_NAME) { + $name = <<<EONAME +<span class="ngword" onclick="show_ng_message('ngn{$ngaborns_head_hits}', this);">{$name}</span> +EONAME; + $msg = <<<EOMSG +<div id="ngn{$ngaborns_head_hits}" class="ngmsg ngmsg-by-name">{$msg}</div> +EOMSG; + + // NG[ϊ + } elseif ($ng_type & self::NG_MAIL) { + $mail = <<<EOMAIL +<span class="ngword" onclick="show_ng_message('ngn{$ngaborns_head_hits}', this);">{$mail}</span> +EOMAIL; + $msg = <<<EOMSG +<div id="ngn{$ngaborns_head_hits}" class="ngmsg ngmsg-by-mail">{$msg}</div> +EOMSG; + + // NGIDϊ + } elseif ($ng_type & self::NG_ID) { + $date_id = <<<EOID +<span class="ngword" onclick="show_ng_message('ngn{$ngaborns_head_hits}', this);">{$date_id}</span> +EOID; + $msg = <<<EOMSG +<div id="ngn{$ngaborns_head_hits}" class="ngmsg ngmsg-by-id">{$msg}</div> +EOMSG; + + } + + /* + //uVv摜} + if ($i == $this->thread->readnum +1) { + $tores .= <<<EOP + <div><img src="img/image.png" alt="VX" border="0" vspace="4"></div> +EOP; + } + */ + + // SPM + if ($_conf['expack.spm.enabled']) { + $spmeh = " onmouseover=\"{$this->spmObjName}.show({$i},'{$msg_id}',event)\""; + $spmeh .= " onmouseout=\"{$this->spmObjName}.hide(event)\""; + } else { + $spmeh = ''; + } + + // +live Xe\폜 + + /*if ($_conf['expack.am.enabled'] == 2) { + $tores .= <<<EOJS +<script type="text/javascript"> +//<![CDATA[ +detectAA("{$msg_id}"); +//]]> +</script>\n +EOJS; + }*/ + + // ܂Ƃ߂ătB^F + if ($pattern) { + $tores = StrCtl::filterMarking($pattern, $tores); + } + + return array('body' => $tores, 'q' => $rpop); + } + + // }}} +} + +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/live/live_header.inc.php b/lib/live/live_header.inc.php new file mode 100755 index 000000000..7da5bcf21 --- /dev/null +++ b/lib/live/live_header.inc.php @@ -0,0 +1,84 @@ +<?php +/* + +live - pXNvg ../read_header.inc.php ǂݍ܂ +*/ + +// [hԐݒ +//if ($_GET['lastres'] == $aThread->rescount) { +// $reload_time = $_GET['reltime'] + 5000; +//} else { + if ($_conf['live.reload_time'] == 4 ) { + $reload_time = 20 * 1000; + } else if ($_conf['live.reload_time'] == 3 ) { + $reload_time = 15 * 1000; + } else if ($_conf['live.reload_time'] == 2 ) { + $reload_time = 10 * 1000; + } else if ($_conf['live.reload_time'] == 1 ) { + $reload_time = 5 * 1000; + } else { + $reload_time = 0 * 1000; + } +//} + +if ($_GET['live']) { + echo <<<xmht + <script type="text/javascript"> + <!-- + + // XMLHttpRequest + function getIndex(getFile) { + xmlhttp = new XMLHttpRequest(); + if (xmlhttp) { + xmlhttp.onreadystatechange = check; + xmlhttp.open('GET', getFile, true); + xmlhttp.send(null); + } + } + + function check() { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + document.getElementById("live_view").innerHTML = xmlhttp.responseText; + } + } + + // I[gXN[ + var speed = {$_conf['live.scroll_speed']}; // ximax 1j + var move = {$_conf['live.scroll_move']}; // 炩on-offimax 1j + + var ascr; + + function ascroll() { + window.scrollBy(0, move); // XN[ + ascr = setTimeout("ascroll()", speed); + } + + // I[g[h + var arel; + + function areload() { + arel = setInterval("getIndex('./read.php?host={$aThread->host}&bbs={$aThread->bbs}&key={$aThread->key}&live=1')", {$reload_time}); + } + + // Jn + function startlive() { + if (ascr) clearTimeout(ascr); + if (arel) clearInterval(arel); + getIndex('./read.php?host={$aThread->host}&bbs={$aThread->bbs}&key={$aThread->key}&live=1'); + ascroll(); + areload(); + } + + // ~ + function stoplive() { + if (ascr) clearTimeout(ascr); + if (arel) clearInterval(arel); + } + + // --> + </script>\n +xmht; +} else { + echo ""; +} + +?> \ No newline at end of file diff --git a/lib/live/live_highlight_check.php b/lib/live/live_highlight_check.php new file mode 100755 index 000000000..ddc64c840 --- /dev/null +++ b/lib/live/live_highlight_check.php @@ -0,0 +1,48 @@ +<?php +/* + +live - nCCg[h̃`FbN ../ShowThread.php ǂݍ܂ +*/ + +// AnCCg +if ($_conf['live.highlight_chain'] && $this->_has_ngaborns && + preg_match_all('/(?:>|)([1-9][0-9\\-,]*)/', $msg, $highlight_matches) +) { + $highlight_chain_nums = array_unique(preg_split('/[-,]+/', + trim(implode(',', $highlight_matches[1]), '-,'), + -1, + PREG_SPLIT_NO_EMPTY)); + + if (array_intersect($highlight_chain_nums, $this->_highlight_nums)) { + $ngaborns_hits['highlight_chain']++; + $type |= $this->_markHighlight($i, self::HIGHLIGHT_CHAIN, true); + } +} + +// nCCgl[`FbN +if ($this->ngAbornCheck('highlight_name', $name) !== false) { + $ngaborns_hits['highlight_name']++; + $type |= $this->_markHighlight($i, self::HIGHLIGHT_NAME, false); +} + +// nCCg[`FbN +if ($this->ngAbornCheck('highlight_mail', $mail) !== false) { + $ngaborns_hits['highlight_mail']++; + $type |= $this->_markHighlight($i, self::HIGHLIGHT_MAIL, false); +} + +// nCCgID`FbN +if ($this->ngAbornCheck('highlight_id', $date_id) !== false) { + $ngaborns_hits['highlight_id']++; + $type |= $this->_markHighlight($i, self::HIGHLIGHT_ID, false); +} + +// nCCgbZ[W`FbN +$a_highlight_msg = $this->ngAbornCheck('highlight_msg', $msg); +if ($a_highlight_msg !== false) { + $ngaborns_hits['highlight_msg']++; + $type |= $this->_markHighlight($i, self::HIGHLIGHT_MSG, true); + $this->_highlight_msgs[] = $a_highlight_msg; + $highlight_msgs = array_unique($this->_highlight_msgs); +} + +?> \ No newline at end of file diff --git a/lib/live/live_highlight_convert.php b/lib/live/live_highlight_convert.php new file mode 100755 index 000000000..ac8f96e2c --- /dev/null +++ b/lib/live/live_highlight_convert.php @@ -0,0 +1,45 @@ +<?php +/* + +live - nCCg[h̕ϊ ../ShowThreadPc.php ǂݍ܂ +*/ + +$live_highlight_style = "background-color: {$STYLE['live_highlight']}; font-weight: {$STYLE['live_highlight_word_weight']}; border-bottom: {$STYLE['live_highlight_word_border']};"; +$live_highlight_chain_style = "background-color: {$STYLE['live_highlight_chain']}; font-weight: {$STYLE['live_highlight_word_weight']}; border-bottom: {$STYLE['live_highlight_word_border']};"; + +// AnCCgϊ +if ($ng_type & self::HIGHLIGHT_CHAIN) { + $highlight_chain_nums = implode('|', array_intersect($highlight_chain_nums, $this->_highlight_nums)); + $highlight_chain_nums = "(" . $highlight_chain_nums . ")(?!\d)(?![^<]*>)"; // ꕔĂ܂AJ[HTML^OɃ}b`Ȃ + $msg = preg_replace("(((?:>||-)+)($highlight_chain_nums))", "<span style=\"{$live_highlight_chain_style}\">$1$2</span>", $msg); +} + +// nCCgbZ[Wϊ +if ($ng_type & self::HIGHLIGHT_MSG) { + $highlight_msgs = quotemeta(implode('|', $highlight_msgs)); + $highlight_msgs = "(" . $highlight_msgs . ")(?![^<]*>)"; // HTML^OɃ}b`Ȃ + if (preg_match("(<(regex:i|i)>)", $highlight_msgs)) { + $highlight_msgs = preg_replace("(<(regex|regex:i|i)>)", "", $highlight_msgs); + $msg = mb_eregi_replace("($highlight_msgs)", "<span style=\"{$live_highlight_style}\">\\1</span>", $msg); + } else { + $highlight_msgs = preg_replace("(<(regex|regex:i|i)>)", "", $highlight_msgs); + $msg = mb_ereg_replace("($highlight_msgs)", "<span style=\"{$live_highlight_style}\">\\1</span>", $msg); + } +} + +// nCCgl[ϊ +if ($ng_type & self::HIGHLIGHT_NAME) { + $name = preg_replace("(<b>|</b>)", "", $name); + $name = "</b><span style=\"{$live_highlight_style}\">$name</span><b>"; +} + +// nCCg[ϊ +if ($ng_type & self::HIGHLIGHT_MAIL) { + $mail = "<span style=\"{$live_highlight_style}\">$mail</span>"; +} + +// nCCgIDϊ +if ($ng_type & self::HIGHLIGHT_ID) { + $date_id = preg_replace("((ID:))", "<span style=\"{$live_highlight_style}\">$1", $date_id ."</span>"); +} + +?> \ No newline at end of file diff --git a/lib/live/live_post_form.inc.php b/lib/live/live_post_form.inc.php new file mode 100755 index 000000000..68b917bba --- /dev/null +++ b/lib/live/live_post_form.inc.php @@ -0,0 +1,117 @@ +<?php +/** + * rep2 - ݃tH[ + */ + +if (!isset($popup)) { + $popup = 0; +} +if (!isset($newthread_hidden_ht)) { + $newthread_hidden_ht = ''; +} +if (!isset($readnew_hidden_ht)) { + $readnew_hidden_ht = ''; +} + +// p2gXĂ͖ (P2Client.php) +if ($newthread_hidden_ht !== '') { + $htm['p2res'] = ''; +} + +// XAJ[ +if ($q_resnum) { + $hd['MESSAGE'] = ">>" . $q_resnum . "\r\n"; +} else { + $htm['k_br'] = ''; + if ($_conf['expack.editor.dpreview']) { + $htm['kaiko_on_js_fmt'] = ' onfocus="%1$s" onkeyup="if(%2$s){%1$s}DPSetMsg()"'; + } else { + $htm['kaiko_on_js_fmt'] = ' onfocus="%1$s" onkeyup="if(%2$s){%1$s}"'; + } + $htm['name_label'] = '<label for="FROM">O</label>F'; + $htm['mail_label'] = '<label for="mail">E-mail</label>F'; + $htm['name_extra_at'] = ' tabindex="1"'; + $htm['mail_extra_at'] = ' tabindex="2"'; + $htm['msg_extra_at'] = ' tabindex="3"'; + $htm['submit_extra_at'] = ' tabindex="4"'; + $hd['MESSAGE'] = ""; +} + +$ttitle_len = mb_strlen("$ttitle"); +$ttitle = htmlspecialchars_decode($ttitle, ENT_QUOTES); +$ttitle = mb_convert_kana($ttitle, 'rnas'); + +if ($ttitle_len > 15) { // X^C15ȏ̏ꍇ͒Zk + $ttitle_pfi = mb_substr($ttitle, 0, 14) ."c"; +} else { + $ttitle_pfi = "$ttitle"; +} + +// +Wiki:samba^C}[ +if ($_conf['wiki.samba_timer']) { + require_once P2_LIB_DIR . '/wiki/Samba.php'; + $samba = new Samba(); + $htm['samba'] .= $samba->createTimer($samba->getSamba($host, $bbs)); +} + +// ۑ +$savedraft = ''; +if ((!$_conf['ktai'] && $_conf['expack.editor.savedraft'] != 0) || + ($_conf['iphone'] && $_conf['expack.editor.mobile.savedraft'] != 0)) { + $savedraft = <<<EOP +<input id="post_draft_button" type="button" value="ۑ" onclick="DraftKakiko.saveDraftForm(this.form)"> +<span id="post_draft_msg" class="autosave-info"></span> +EOP; +} elseif ($_conf['ktai'] && $_conf['expack.editor.mobile.savedraft']) { + $savedraft = <<<EOP +<input type="submit" name="savedraft" value="ۑ"> +EOP; +} + +// R[hp擪ɎdނƂmb_convert_variables()̎ +$htm['post_form'] = <<<EOP +<form id="resform" method="POST" action="./post.php" accept-charset="{$_conf['accept_charset']}"{$onsubmit_at}> +<b class="thre_title" title="{$ttitle}"> {$ttitle_pfi} </b> +{$htm['maru_post']} +{$htm['name_label']}<input id="FROM" name="FROM" type="text" value="{$hd['FROM']}"{$name_size_at}{$htm['name_extra_at']}> +{$htm['mail_label']}<input id="mail" name="mail" type="text" value="{$hd['mail']}" size ="10" {$on_check_sage}{$htm['mail_extra_at']}> +{$htm['sage_cb']} +{$htm['options']} +{$htm['src_fix']} +{$htm['block_submit']} +<span id="write_reg_ato"></span> +<b class="thre_title" id="write_regulation"></b> +<span id="write_reg_byou"></span> +{$htm['beres']} +{$htm['p2res']} +{$htm['samba']} +{$htm['k_br']}{$savedraft} +{$upload_form} +<br> +<textarea id="MESSAGE" name="MESSAGE" style="width: 95%; height: 55%;" wrap="{$wrap_at}"{$htm['kaiko_on_js']}{$htm['msg_extra_at']}>{$hd['MESSAGE']}</textarea> + +<input type="hidden" name="bbs" value="{$bbs}"> +<input type="hidden" name="key" value="{$key}"> +<input type="hidden" name="time" value="{$time}"> + +<input type="hidden" name="host" value="{$host}"> +<input type="hidden" name="popup" value="{$popup}"> +<input type="hidden" name="rescount" value="{$rescount}"> +<input type="hidden" name="ttitle_en" value="{$ttitle_en}"> +<input type="hidden" name="csrfid" value="{$csrfid}"> +<input type="hidden" name="live" value="1"> +{$newthread_hidden_ht}{$readnew_hidden_ht} +{$_conf['detect_hint_input_ht']} +</form> +EOP; + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/lib/live/live_view.inc.php b/lib/live/live_view.inc.php new file mode 100755 index 000000000..d2c69dc9b --- /dev/null +++ b/lib/live/live_view.inc.php @@ -0,0 +1,106 @@ +<?php +/* + +live - pXbh\ ../ShowThreadPc.php ǂݍ܂ +*/ + +// I[g[h̔‚ŐVX擪ɖڈ󃉃C} +$live_newline = "<table id=\"{$res_id}\" class=\"res\" cellspacing=\"2\" cellpadding=\"0\" style=\"border-top: {$STYLE['live_b_n']};\" width=\"100%\"><tr class=\"res-header\">"; +$live_oldline = "<table id=\"{$res_id}\" class=\"res\" cellspacing=\"2\" cellpadding=\"0\" style=\"border-top: {$STYLE['live_b_l']};\" width=\"100%\"><tr class=\"res-header\">"; +// +$live_td = "<td class=\"live_res\" style=\"color:{$STYLE['read_color']}; font-size:{$STYLE['live_font-size']}; word-wrap: break-word;\" width=\"250px\" valign=\"top\">"; +// VX̔ԍF +$live_newnum = "<span class=\"spmSW\"{$spmeh}><b style=\"color:{$STYLE['read_newres_color']};\">{$i}</b></span>"; +$live_oldnum = "<span class=\"spmSW\"{$spmeh}>{$i}</span>"; + +if ($this->thread->onthefly) { + $GLOBALS['newres_to_show_flag'] = true; + // ԍ (IUtC) + $tores .= "{$live_oldline}{$live_td}<span class=\"ontheflyresorder spmSW\"{$spmeh}>{$i}</span>"; +} elseif ($i == 1) { + // ԍ (1) + if ($this->thread->readnum > 1) { + $tores .= "{$live_oldline}{$live_td}{$live_oldnum}"; + } else { + $tores .= "{$live_oldline}{$live_td}{$live_newnum}"; + } +} elseif ($i == $this->thread->readnum +1) { + $GLOBALS['newres_to_show_flag'] = true; + // ԍ (VX 擪) + if ($_GET['live']) { + $tores .= "{$live_newline}{$live_td}{$live_newnum}"; + } else { + $tores .= "{$live_oldline}{$live_td}{$live_newnum}"; + } +} elseif ($i > $this->thread->readnum) { + // ԍ (VX 㑱) + $tores .= "{$live_oldline}{$live_td}{$live_newnum}"; +} elseif ($_conf['expack.spm.enabled']) { + // ԍ (SPM) + $tores .= "{$live_oldline}{$live_td}{$live_oldnum}"; +} else { + // ԍ + $tores .= "{$live_oldline}{$live_td}{$i}"; +} + +// O +$tores .= preg_replace('{<b>[ ]*</b>}i', '', " <span class=\"name\"><b>{$name}</b></span> : "); + +// ID +$tores .= "{$date_id}"; + +if ($this->am_side_of_id) { + $tores .= ' ' . $this->activeMona->getMona($res_id); +} + +// [ +$tores .= " {$mail}"; + +// 탌XXg(c`) +if ($_conf['backlink_list'] == 1 || $_conf['backlink_list'] > 2) { + $tores .= $this->_quotebackListHtml($i, 1); +} + +$tores .= "</td>"; + +// d & X{^ +$stall_05 = "<td width=\"5px\" style=\"border-left: {$STYLE['live_b_s']};\"> </td>"; +$stall_30 = "<td width=\"32px\" style=\"border-left: {$STYLE['live_b_s']};\"> {$res_button}</td>"; +if ($_GET['live']) { + $tores .= "$stall_30"; +} else { + $tores .= "$stall_05"; +} + +// e +$tores .= "<td class=\"live_res\" id=\"{$msg_id}\" class=\"{$msg_class}\"{$res_dblclc} width=\"\" style=\"color:{$STYLE['read_color']}; font-size: {$STYLE['read_fontsize']}; word-wrap: break-word;\">{$msg}@"; + +if ($_conf['backlink_block'] > 0) { + // QƃubN\ponclickݒ + $tores .= "<div onclick=\"toggleResBlk(event, this, " . $_conf['backlink_block_readmark'] . ")\">\n"; +} else { + $tores .= "<div>\n"; +} + +// 탌XWJpubN +if ($_conf['backlink_block'] > 0) { + $backlinks = $this->_getBacklinkComment($i); + if (strlen($backlinks)) { + $tores .= '<div class="resblock"><img src="img/btn_plus.gif" width="15" height="15" align="left"></div>'; + $tores .= $backlinks; + } +} +// 탌XXg(`) +if ($_conf['backlink_list'] == 2 || $_conf['backlink_list'] > 2) { + $tores .= $this->_quotebackListHtml($i, 2, false); +} + +$tores .= "</div>"; +$tores .= "</td>"; + +// e[uI +$tores .= "</tr></table>\n"; + +// X|bvAbvpp +//$tores .= $rpop; + +?> \ No newline at end of file diff --git a/lib/live/live_view_ctl.inc.php b/lib/live/live_view_ctl.inc.php new file mode 100755 index 000000000..4ec2b3189 --- /dev/null +++ b/lib/live/live_view_ctl.inc.php @@ -0,0 +1,109 @@ +<?php +/* + +live - Xbh\Ɋւ鋤ʏ ../ShowThreadPc.php ǂݍ܂ +*/ + +// O +// ftHg̖̕\ +// showthreadpc.class.phpɂ + +// tID +// IDtB^ +if ($_conf['flex_idpopup'] == 1 && $id && $this->thread->idcount[$id] > 1) { + $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id); +} +// ID (O,P,Q,I ) ̋ +if ($_conf['live.id_b']) { + if (!preg_match("(ID:)", $date_id)) { // IDŖ\̂ݗL̔ (T) + $date_id = preg_replace('((\s([a-zA-Z])$)(?![^<]*>))', '<b class="mail">$1</b>', $date_id); + } else { + $date_id = preg_replace('((ID: ?)([0-9A-Za-z/.+]{10}|[0-9A-Za-z/.+]{8}|\\?\\?\\?)?([a-zA-Z])(?=[^0-9A-Za-z/.+]|$)(?![^<]*>))', '$1$2<b class="mail"> $3</b>', $date_id); + } +} +// t̒Zk +if (preg_match("([0-2][0-9]{3}/[0-1][0-9]/[0-3][0-9])", $date_id)) { + if ($_GET['live']) { // ͓tS폜 + $date_id = preg_replace("([0-2][0-9]{3}/[0-1][0-9]/[0-3][0-9]\(..\))", "", $date_id); + } else { // LȊO͔N2 + if (preg_match("(class=\"ngword)", $date_id)) { // NGID̎ + $date_id = preg_replace("(([0-2][0-9])([0-9]{2}/[0-1][0-9]/[0-3][0-9]\(..\)))", "$2", $date_id); + } else { + $date_id = preg_replace("(([0-2][0-9])([0-9]{2}/[0-1][0-9]/[0-3][0-9]\(..\)))", "$2", $date_id); + } + } +} + +// [ +if ($mail) { + // ̏ꍇ + if ($_conf['live.mail_sage'] + && ($_GET['live'])) { + // sage + if (preg_match("(^[\\s@]*sage[\\s@]*$)", $mail)) { + if ($STYLE['read_mail_sage_color']) { + $mail = "<span class=\"sage\" title=\"{$mail}\"></span>"; + } elseif ($STYLE['read_mail_color']) { + $mail = "<span class=\"mail\" title=\"{$mail}\"></span>"; + } else { + $mail = "<span title=\"{$mail}\"></span>"; + } + // sage ȊO + } else { + $mail = "<span class=\"mail\" title=\"{$mail}\"></span>"; + } + // m[} + } elseif (preg_match("(^[\\s@]*sage[\\s@]*$)", $mail) + && $STYLE['read_mail_sage_color']) { + $mail = "<span class=\"sage\">{$mail}</span>"; + } elseif ($STYLE['read_mail_color']) { + $mail = "<span class=\"mail\">{$mail}</span>"; + } else { + $mail = "{$mail}"; + } +} + +// [ɃX] ̕@ +if ($_GET['live']) { + $ttitle_en_q ="&ttitle_en=".UrlSafeBase64::encode($this->thread->ttitle); + // e_uNbN + if ($_conf['live.res_button'] >= 1) { + $res_dblclc = "ondblclick=\"window.parent.livepost.location.href='live_post_form.php?host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&resnum={$i}{$ttitle_en_q}&inyou=1'\" title=\"{$i} ɃX (double click)\""; + } + // X{^ + if ($_conf['live.res_button'] <= 1) { + if ($_conf['iframe_popup'] == 3) { + $res_button = "<a href=\"live_post_form.php?host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&resnum={$i}{$ttitle_en_q}&inyou=1\" target=\"livepost\" title=\"{$i} ɃX\"><img src =\"./img/re.png\" alt=\"Re:\" width=\"22\" height=\"12\"></a>"; + } else { + $res_button = "(<a href=\"live_post_form.php?host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&resnum={$i}{$ttitle_en_q}&inyou=1\" target=\"livepost\" title=\"{$i} ɃX\">re:</a>)"; + } + } +} + +// e + +// ̕\؋lߏ +if ($_conf['live.msg'] +&& ($_GET['live'])) { + $msg = mb_convert_kana($msg, 'rnas'); // Sp̉pALAXy[X𔼊p + if (!preg_match ("(tp:/|ps:/|res/)", $msg)) { + $msg = mb_ereg_replace("([\\s@]*<br>[\\s@]*)", " ", $msg); // SspXy[XɁBeɊON•ʐꗗ܂ޏꍇ͑ΏۊO + } + $msg = mb_ereg_replace("(\s{2,})", " ", $msg); // AXy[X1‚ +} + +// +live Xbhe\ؑ +if ($_GET['live']) { + if ($_conf['live.view_type'] == 0 ) { + include P2_LIB_DIR . '/live/default_view.inc.php'; + } else { + include P2_LIB_DIR . '/live/live_view.inc.php'; + } +} else { + if ($_conf['live.view_type'] > 1 ) { + include P2_LIB_DIR . '/live/live_view.inc.php'; + } else { + include P2_LIB_DIR . '/live/default_view.inc.php'; + } +} + +?> \ No newline at end of file diff --git a/lib/login2ch.inc.php b/lib/login2ch.inc.php index ea3a806f1..b1407cdd7 100644 --- a/lib/login2ch.inc.php +++ b/lib/login2ch.inc.php @@ -23,79 +23,73 @@ function login2ch() return false; } - $auth2ch_url = 'https://2chv.tora3.net/futen.cgi'; - $postf = 'ID=' . $login2chID . '&PW=' . $login2chPW; - $x_2ch_ua = 'X-2ch-UA: ' . $_conf['p2ua']; - $dolib2ch = 'DOLIB/1.00'; - $tempfile = $_conf['tmp_dir'] . '/p2temp.php'; - - // Ô߂炩tempt@CĂ - if (file_exists($tempfile)) { - unlink($tempfile); + // Ql̗LmF(v ID / PW) + if (!empty($login2chID) && !empty($login2chPW)) { + P2Util::checkRoninExpiration(); } - $curl_msg = ''; + $auth2ch_url= http_build_url(array( + "scheme" => 'https', + "host" => "2chv.tora3.net", + "path" => "futen.cgi")); + + $dolib2ch = 'DOLIB/1.00'; - // ܂fsockopenSSLڑ - // PHPRpCOpenSSLT|[gLɂȂĂȂƗpłA - // DSOŁiopenssl.{so,dll}jł̓G[oB - // @see http://jp.php.net/manual/ja/function.fsockopen.php - if ($_conf['precede_openssl']) { - if (!extension_loaded('openssl')) { - $curl_msg .= "uPHPopensslv͎gȂ悤ł"; - } elseif (!$r = getAuth2chWithOpenSSL($login2chID, $login2chPW, $auth2ch_url, $x_2ch_ua, $dolib2ch)) { - $curl_msg .= "uPHPopensslvŎssB"; + if($_conf['2chapi_use'] == 1) { + if($_conf['2chapi_appname'] != "") { + $x_2ch_ua = 'X-2ch-UA: ' . $_conf['2chapi_appname']; + } else { + P2Util::pushInfoHtml("<p>p2 error: 2chƒʐM邽߂ɕKvȏ񂪐ݒ肳Ă܂B</p>"); + return false; } + } else { + $x_2ch_ua = 'X-2ch-UA: ' . P2Commun::getP2UA(false,false); } - if (empty($r)) { + try { + $req = P2Commun::createHTTPRequest($auth2ch_url,HTTP_Request2::METHOD_POST); - // R}hCURLD - if (empty($_conf['precede_phpcurl'])) { - if (!$r = getAuth2chWithCommandCurl($login2chID, $login2chPW, $tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch)) { - $curl_msg .= "usystemcurlR}hvŎssB"; - if (!extension_loaded('curl')) { - $curl_msg .= "uPHPcurlv͎gȂ悤ł"; - } elseif (!$r = getAuth2chWithPhpCurl($tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch, $postf)) { - $curl_msg .= "uPHPcurlvŎssB"; - } - } + // wb_[ + $req->setHeader('User-Agent', $dolib2ch); + $req->setHeader('X-2ch-UA', $x_2ch_ua); - // PHP CURLD - } else { - if (!extension_loaded('curl')) { - $curl_msg .= "uPHPcurlv͎gȂ悤ł"; - } elseif (!$r = getAuth2chWithPhpCurl($tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch, $postf)) { - $curl_msg .= "uPHPcurlvŎssB"; - } + // POSTf[^ + $req->addPostParameter('ID', $login2chID); + $req->addPostParameter('PW', $login2chPW); - if (empty($r)) { - if (!$r = getAuth2chWithCommandCurl($login2chID, $login2chPW, $tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch)) { - $curl_msg .= "usystemcurlR}hvŎssB"; - } - } + // POSTf[^̑M + $res = P2Commun::getHTTPResponse($req); + + $code = $res->getStatus(); + if ($code =! 200) { + P2Util::pushInfoHtml("<p>p2 Error: HTTP Error({$code})</p>"); + } else { + $body = $res->getBody(); } + } catch (Exception $e) { + P2Util::pushInfoHtml("<p>p2 Error: ̔F؃T[oɐڑo܂łB({$e->getMessage()})</p>"); } // ڑsȂ - if (empty($r)) { + if (empty($body)) { if (file_exists($_conf['idpw2ch_php'])) { unlink($_conf['idpw2ch_php']); } if (file_exists($_conf['sid2ch_php'])) { unlink($_conf['sid2ch_php']); } - P2Util::pushInfoHtml("<p>p2 info: 2˂ւ́IDOCsɂ́AsystemcurlR}hgp”\ł邩APHP<a href=\"http://www.php.net/manual/ja/ref.curl.php\">CURL֐</a>LłKv܂B</p>"); + P2Util::pushInfoHtml('<p>p2 info: 2˂ւ́IDOCsɂ́APHP<a href="'. + P2Util::throughIme("http://www.php.net/manual/ja/ref.curl.php"). + '">cURL֐</a><a href="'. + P2Util::throughIme("http://www.php.net/manual/ja/ref.openssl.php"). + '">OpenSSL֐</a>LłKv܂B</p>'); P2Util::pushInfoHtml("<p>p2 error: 2chOCɎs܂B{$curl_msg}</p>"); return false; } - // tempt@C͂Ɏ̂Ă - if (file_exists($tempfile)) { unlink($tempfile); } - - $r = rtrim($r); + $body = rtrim($body); // - if (preg_match('/SESSION-ID=(.+?):(.+)/', $r, $matches)) { + if (preg_match('/SESSION-ID=(.+?):(.+)/', $body, $matches)) { $uaMona = $matches[1]; $SID2ch = $matches[1] . ':' . $matches[2]; } else { @@ -112,8 +106,6 @@ function login2ch() return false; } - //echo $r;// - // SID̋L^ێ $cont = sprintf('<?php $uaMona = %s; $SID2ch = %s;', var_export($uaMona, true), var_export($SID2ch, true)); if (false === file_put_contents($_conf['sid2ch_php'], $cont, LOCK_EX)) { @@ -124,159 +116,6 @@ function login2ch() return $SID2ch; } -// }}} -// {{{ getAuth2chWithCommandCurl() - -/** - * systemR}hcurlsāA2chOCSID𓾂 - * - * @return string|false - */ -function getAuth2chWithCommandCurl($login2chID, $login2chPW, $tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch) -{ - global $_conf; - - $curlrtn = 1; - - // proxy̐ݒ - if ($_conf['proxy_use']) { - $with_proxy = " -x ".$_conf['proxy_host'].":".$_conf['proxy_port']; - } else { - $with_proxy = ''; - } - - // usystemR}hcurlviؖ؂js - $curlcmd = "curl -H \"{$x_2ch_ua}\" -A {$dolib2ch} -d ID={$login2chID} -d PW={$login2chPW} -o {$tempfile}{$with_proxy} {$auth2ch_url}"; - system($curlcmd, $curlrtn); - - // usystemR}hcurlviؖ؂jŖȂAiؖ؂Ȃjōă`W - if ($curlrtn != 0) { - $curlcmd = "curl -H \"{$x_2ch_ua}\" -A {$dolib2ch} -d ID={$login2chID} -d PW={$login2chPW} -o {$tempfile}{$with_proxy} -k {$auth2ch_url}"; - system($curlcmd, $curlrtn); - } - - if ($curlrtn == 0) { - if ($r = file_get_contents($tempfile)) { - return $r; - } - } - - return false; -} - -// }}} -// {{{ getAuth2chWithPhpCurl() - -/** - * PHPcurl2chOCSID𓾂 - * - * @return string|false - */ -function getAuth2chWithPhpCurl($tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch, $postf) -{ - global $_conf; - - // PHPCURLgȂAŃ`W - if (extension_loaded('curl')) { - // uPHPcurlviؖ؂jŎs - execAuth2chWithPhpCurl($tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch, $postf, true); - // uPHPcurlviؖ؂jŖȂAuPHPcurlviؖ؂Ȃjōă`W - clearstatcache(); - if (!file_exists($tempfile) || !filesize($tempfile)) { - execAuth2chWithPhpCurl($tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch, $postf, false); - } - if ($r = file_get_contents($tempfile)) { - return $r; - } - - } - - return false; -} - -// }}} -// {{{ execAuth2chWithPhpCurl() - -/** - * PHPcurlsāAt@CɃf[^ۑ - * - * @return boolean - */ -function execAuth2chWithPhpCurl($tempfile, $auth2ch_url, $x_2ch_ua, $dolib2ch, $postf, $withk = false) -{ - global $_conf; - - if (!$ch = curl_init()) { - return false; - } - if (!$fp = fopen($tempfile, 'wb')) { - return false; - } - @flock($fp, LOCK_EX); - curl_setopt($ch, CURLOPT_FILE, $fp); - curl_setopt($ch, CURLOPT_URL, $auth2ch_url); - curl_setopt($ch, CURLOPT_HEADER, 0); - curl_setopt($ch, CURLOPT_HTTPHEADER, array($x_2ch_ua)); - curl_setopt($ch, CURLOPT_USERAGENT, $dolib2ch); - curl_setopt($ch, CURLOPT_POST, 1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $postf); - // ؖ̌؂ȂȂ - if ($withk) { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); - } - // vLV̐ݒ - if ($_conf['proxy_use']) { - curl_setopt($ch, CURLOPT_PROXY, $_conf['proxy_host'] . ':' . $_conf['proxy_port']); - } - curl_exec($ch); - curl_close($ch); - @flock($fp, LOCK_UN); - fclose($fp); - - return true; -} - -// }}} -// {{{ getAuth2chWithOpenSSL() - -/** - * fsockopenSSLڑ2chOCSID𓾂iؖ؂Ȃj - * - * @return string|false - */ -function getAuth2chWithOpenSSL($login2chID, $login2chPW, $auth2ch_url, $x_2ch_ua, $dolib2ch) -{ - global $_conf; - - $wap_ua = new WapUserAgent(); - $wap_ua->setAgent($dolib2ch); - $wap_ua->setTimeout($_conf['http_conn_timeout'], $_conf['http_read_timeout']); - - $wap_req = new WapRequest(); - $wap_req->setMethod('POST'); - $wap_req->post['ID'] = $login2chID; - $wap_req->post['PW'] = $login2chPW; - $wap_req->setHeaders($x_2ch_ua . "\r\n"); - $wap_req->setUrl($auth2ch_url); - if ($_conf['proxy_use']) { - $wap_req->setProxy($_conf['proxy_host'], $_conf['proxy_port']); - } - - // futen.cgi̎dlAƂeXg‹PHP̂A - // ƂɂOCłPOST镶URLGR[hĂƎs - $wap_req->setNoUrlencodePost(true); - - $wap_res = $wap_ua->request($wap_req); - - //P2Util::pushInfoHtml(Var_Dump::display(array($wap_ua, $wap_req, $wap_res), true)); - - if (!$wap_res || $wap_res->isError()) { - return false; - } - - return $wap_res->content; -} - // }}} /* diff --git a/lib/login_first.inc.php b/lib/login_first.inc.php index 17d8b3729..dcd439722 100644 --- a/lib/login_first.inc.php +++ b/lib/login_first.inc.php @@ -205,6 +205,7 @@ function printLoginFirst(Login $_login) //========================================================= // HTMLvg //========================================================= + http_response_code (401); P2Util::header_nocache(); echo $_conf['doctype']; echo <<<EOP diff --git a/lib/menu.inc.php b/lib/menu.inc.php index d40f85599..0878ac119 100644 --- a/lib/menu.inc.php +++ b/lib/menu.inc.php @@ -166,7 +166,29 @@ function chMenuColor(idnum){ // X^C echo <<<EOP <form method="GET" action="tgrepc.php" accept-charset="{$_conf['accept_charset']}" target="subject" class="inline-form"> - <input type="search" name="Q" value="" size="16" autosave="rep2.expack.search.thread" results="{$_conf['expack.tgrep.recent2_num']}" placeholder="X^C"> + <input type="search" name="Q" value="" size="16" autosave="rep2.expack.search.thread" results="{$_conf['expack.tgrep.recent2_num']}" placeholder="X^C"><br> + <select name="AndOr"> + <option value="0" selected>AND</option> + <option value="1" >OR</option> + </select><br> + ő<select name="maxResult"> + <option value="50" selected>50</option> + <option value="100" >100</option> + <option value="200" >200</option> + </select>\<br> + <select name="Sort"> + <option value="0" >lC</option> + <option value="1" ></option> + <option value="2" >X</option> + <option value="4" >ŐVX</option> + <option value="3" >ŌÃX</option> + <option value="5" selected>ŐVe</option> + </select><br> + 924<select name="924"> + <option value="1" selected>o</option> + <option value="0" ></option> + </select> + <input type="hidden" name="_hint" value=""> {$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']} </form><br>\n EOP; @@ -185,7 +207,28 @@ function chMenuColor(idnum){ // X^C echo <<<EOP <form method="GET" action="tgrepc.php" accept-charset="{$_conf['accept_charset']}" target="subject" class="inline-form" style="white-space:nowrap"> - <input type="text" name="Q" value="" size="12"><input type="submit" value=""> + <input type="text" name="Q" value="" size="12"><input type="submit" value=""><br> + <select name="AndOr"> + <option value="0" selected>AND</option> + <option value="1" >OR</option> + </select><br> + ő<select name="maxResult"> + <option value="50" selected>50</option> + <option value="100" >100</option> + <option value="200" >200</option> + </select>\<br> + <select name="Sort"> + <option value="0" >lC</option> + <option value="1" ></option> + <option value="2" >X</option> + <option value="4" >ŐVX</option> + <option value="3" >ŌÃX</option> + <option value="5" selected>ŐVe</option> + </select><br> + 924<select name="924"> + <option value="1" selected>o</option> + <option value="0" ></option> + </select> {$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']} </form><br>\n EOP; @@ -247,17 +290,19 @@ function chMenuColor(idnum){ // V\ꍇ if ($_conf['enable_menu_new'] == 1 && $_GET['new']) { // _E[h̐ݒ - if ($_conf['expack.use_pecl_http'] == 1) { - P2HttpExt::activate(); - $GLOBALS['expack.subject.multi-threaded-download.done'] = true; - } elseif ($_conf['expack.use_pecl_http'] == 2) { + if ($_conf['expack.use_curl_multi'] != 0 || $_conf['expack.use_pecl_http'] != 0) { + if ($_conf['expack.use_pecl_http'] == 1) { + P2HttpExt::activate(); + } $GLOBALS['expack.subject.multi-threaded-download.done'] = true; } // {{{ CɃX // _E[h - if ($_conf['expack.use_pecl_http'] == 1) { + if ($_conf['expack.use_curl_multi'] == 1) { + P2CurlMulti::fetchSubjectTxt($_conf['favlist_idx']); + } elseif ($_conf['expack.use_pecl_http'] == 1) { P2HttpRequestPool::fetchSubjectTxt($_conf['favlist_idx']); } elseif ($_conf['expack.use_pecl_http'] == 2) { P2CommandRunner::fetchSubjectTxt('fav', $_conf); @@ -274,7 +319,9 @@ function chMenuColor(idnum){ // {{{ ŋߓǂ񂾃X // _E[h - if ($_conf['expack.use_pecl_http'] == 1) { + if ($_conf['expack.use_curl_multi'] == 1) { + P2CurlMulti::fetchSubjectTxt($_conf['recent_idx']); + } elseif ($_conf['expack.use_pecl_http'] == 1) { P2HttpRequestPool::fetchSubjectTxt($_conf['recent_idx']); } elseif ($_conf['expack.use_pecl_http'] == 2) { P2CommandRunner::fetchSubjectTxt('recent', $_conf); @@ -291,7 +338,9 @@ function chMenuColor(idnum){ // {{{ ݗ // _E[h - if ($_conf['expack.use_pecl_http'] == 1) { + if ($_conf['expack.use_curl_multi'] == 1) { + P2CurlMulti::fetchSubjectTxt($_conf['res_hist_idx']); + } elseif ($_conf['expack.use_pecl_http'] == 1) { P2HttpRequestPool::fetchSubjectTxt($_conf['res_hist_idx']); } elseif ($_conf['expack.use_pecl_http'] == 2) { P2CommandRunner::fetchSubjectTxt('res_hist', $_conf); diff --git a/lib/plugins/hissi/Hissi.php b/lib/plugins/hissi/Hissi.php index efb1ac6e8..29abac77f 100644 --- a/lib/plugins/hissi/Hissi.php +++ b/lib/plugins/hissi/Hissi.php @@ -65,7 +65,7 @@ public function load() $path = P2Util::cacheFileForDL($this->menuUrl); // j[̃LbVԂ10{LbV - P2UtilWiki::cacheDownload($this->menuUrl, $path, $_conf['menu_dl_interval'] * 36000); + P2Commun::fileDownload($this->menuUrl, $path, $_conf['menu_dl_interval'] * 36000); $this->boards = array(); $file = @file_get_contents($path); @@ -83,7 +83,7 @@ public function load() public function isEnabled() { if ($this->host) { - if (!P2Util::isHost2chs($this->host)) { + if (!P2HostMgr::isHost2chs($this->host)) { return false; } } diff --git a/lib/plugins/mimizun/Mimizun.php b/lib/plugins/mimizun/Mimizun.php index e36b3f223..bf97c6338 100644 --- a/lib/plugins/mimizun/Mimizun.php +++ b/lib/plugins/mimizun/Mimizun.php @@ -51,7 +51,7 @@ public function load($type) // LbVpfBNg΍쐬 FileCtl::mkdir_for($path); // j[̃LbVԂ10{LbV - P2UtilWiki::cacheDownload($url, $path, $_conf['menu_dl_interval'] * 36000); + P2Commun::fileDownload($url, $path, $_conf['menu_dl_interval'] * 36000); $file = @file_get_contents($path); preg_match_all($match, $file, $boards); return $boards[1]; @@ -91,11 +91,11 @@ public function isEnabled() // (ZbgĂȂ2chƂ݂Ȃ) if ($this->host) { // ܂BBSȂfalse - if (P2Util::isHostMachiBbs($this->host)) { + if (P2HostMgr::isHostMachiBbs($this->host)) { return false; } // 2chłȂfalse - if (!P2Util::isHost2chs($this->host)) { + if (!P2HostMgr::isHost2chs($this->host)) { return false; } } diff --git a/lib/plugins/stalker/Stalker.php b/lib/plugins/stalker/Stalker.php index b101af913..bb93a5828 100644 --- a/lib/plugins/stalker/Stalker.php +++ b/lib/plugins/stalker/Stalker.php @@ -24,7 +24,7 @@ class Stalker public function isEnabled() { if ($this->host) { - if (!P2Util::isHost2chs($this->host)) { + if (!P2HostMgr::isHost2chs($this->host)) { return false; } } diff --git a/lib/post_form.inc.php b/lib/post_form.inc.php index 22351c8d2..e47ebce8a 100644 --- a/lib/post_form.inc.php +++ b/lib/post_form.inc.php @@ -27,22 +27,23 @@ $htm['table_break2'] = ''; $htm['table_end'] = '<br>'; if ($_conf['iphone']) { - $htm['options'] .= <<<EOP -<div style="text-align:right;"> -<!-- <input type="checkbox" id="autocorrect" onclick="iutil.toggleAutocorrect('MESSAGE', this.checked);"><label for="autocorrect">autocorrect</label> --> -<input type="button" onclick="iutil.shrinkTextarea('MESSAGE');iutil.shrinkTextarea('MESSAGE');" value="|"> -<input type="button" onclick="iutil.expandTextarea('MESSAGE');" value="{"> -</div> -EOP; - $htm['name_label'] = '<span style="display:inline-block;width:3em;text-align:right;">O</span>F'; - $htm['mail_label'] = '<span style="display:inline-block;width:3em;text-align:right;">E-mail</span>F'; - $htm['name_extra_at'] = ' autocorrect="off" autocapitalize="off"'; - $htm['mail_extra_at'] = ' autocorrect="off" autocapitalize="off"'; - $htm['msg_extra_at'] = ' autocorrect="off" autocapitalize="off"'; - $htm['submit_extra_at'] = ''; + $htm['k_br'] = ''; + $htm['name_label'] = ''; + $htm['mail_label'] = ''; + $htm['name_extra_at'] = ' class="form-control form-group" placeholder="O(ȗ)" autocorrect="off" autocapitalize="off"'; + $htm['mail_extra_at'] = ' class="form-control form-group" placeholder="[(ȗ)" autocorrect="off" autocapitalize="off"'; + $htm['msg_extra_at'] = ' class="form-control form-group" placeholder="{" autocorrect="off" autocapitalize="off"'; + + $htm['kaiko_on_js_fmt'] = ' onfocus="%1$s" onkeyup="if(%2$s){%1$s}"'; + $htm['kaiko_on_js_func'] = sprintf("adjustTextareaRows(this,%d,2); ", $STYLE['post_msg_rows']); + + $htm['submit_extra_at'] = 'class="btn form-group"'; if ($_conf['expack.editor.mobile.savedraft'] != '0' && $_conf['expack.editor.mobile.savedraft.interval'] > 0) { - $htm['kaiko_on_js'] = ' onfocus="DraftKakiko.startAutoSave(this.form, ' . ($_conf['expack.editor.mobile.savedraft.interval'] * 1000) . ')"'; + $htm['kaiko_on_js_func'] = 'DraftKakiko.startAutoSave(this.form, ' . ($_conf['expack.editor.mobile.savedraft.interval'] * 1000) . '); '.$htm['kaiko_on_js_func']; } + + $htm['kaiko_on_js_cond'] = '!event||((event.keyCode&&(event.keyCode==8||event.keyCode==13))||event.ctrlKey||event.metaKey||event.altKey)'; + $htm['kaiko_on_js'] = sprintf($htm['kaiko_on_js_fmt'], $htm['kaiko_on_js_func'], p2h($htm['kaiko_on_js_cond'])); } else { $htm['name_label'] = 'OF'; $htm['mail_label'] = 'E-mailF'; @@ -90,7 +91,7 @@ if ((!$_conf['ktai'] && $_conf['expack.editor.savedraft'] != 0) || ($_conf['iphone'] && $_conf['expack.editor.mobile.savedraft'] != 0)) { $savedraft = <<<EOP -<input id="post_draft_button" type="button" value="ۑ" onclick="DraftKakiko.saveDraftForm(this.form)"> +<input id="post_draft_button" type="button" value="ۑ" class="btn" onclick="DraftKakiko.saveDraftForm(this.form)"> <span id="post_draft_msg" class="autosave-info"></span> EOP; } elseif ($_conf['ktai'] && $_conf['expack.editor.mobile.savedraft']) { diff --git a/lib/post_form_options.inc.php b/lib/post_form_options.inc.php index b8b66e76f..de5649ef9 100644 --- a/lib/post_form_options.inc.php +++ b/lib/post_form_options.inc.php @@ -113,14 +113,6 @@ function setHiddenValue(button) { // }}} // {{{ Oƃ[̍ŏI -// 󔒂̓[Uݒlɕϊ -if ($hd['FROM'] === '') { - $hd['FROM'] = p2h($_conf['my_FROM']); -} -if ($hd['mail'] === '') { - $hd['mail'] = p2h($_conf['my_mail']); -} - // P2NULL͋󔒂ɕϊ if ($hd['FROM'] === 'P2NULL') { $hd['FROM'] = ''; @@ -129,6 +121,14 @@ function setHiddenValue(button) { $hd['mail'] = ''; } +// 󔒂̓[Uݒlɕϊ +if ($hd['FROM'] === '') { + $hd['FROM'] = p2h($_conf['my_FROM']); +} +if ($hd['mail'] === '') { + $hd['mail'] = p2h($_conf['my_mail']); +} + // }}} // {{{ textareȃ @@ -165,28 +165,20 @@ function setHiddenValue(button) { } // }}} -// {{{ /Be/p2 `FbN{bNX +// {{{ /Be `FbN{bNX // 2ch -if (P2Util::isHost2chs($host) and file_exists($_conf['sid2ch_php'])) { +if (P2HostMgr::isHost2chs($host) and file_exists($_conf['sid2ch_php'])) { $htm['maru_post'] = '<span title="2chID̎gp"><input type="checkbox" id="maru" name="maru" value="1">' . '<label for="maru"></label></span>'; } // Be -if (P2Util::isHost2chs($host) and $_conf['be_2ch_code'] && $_conf['be_2ch_mail']) { +if (P2HostMgr::isHost2chs($host) and P2Util::isEnableBe2ch()) { $htm['beres'] = '<input type="checkbox" id="beres" name="beres" value="1"'. $hd['beres_checked'] . '>' . '<label for="beres">Beŏ</label>'; } -// p2 -if ((P2Util::isHost2chs($host) || P2Util::isHostMachiBbs($host)) && - $_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass']) -{ - $htm['p2res'] = '<input type="checkbox" id="p2res" name="p2res" value="1"'. $hd['p2res_checked'] . '>' - . '<label for="p2res">p2ŏ</label>'; -} - // }}} // {{{ ݃ubNp`FbN{bNX @@ -216,17 +208,18 @@ function setHiddenValue(button) { $htm['dpreview2'] = ''; if (!$_conf['ktai'] && $_conf['expack.editor.dpreview']) { $_dpreview_noname = 'null'; - if (P2Util::isHost2chs($host)) { + if (P2HostMgr::isHost2chs($host)) { $_dpreview_st = new SettingTxt($host, $bbs); $_dpreview_st->setSettingArray(); if (!empty($_dpreview_st->setting_array['BBS_NONAME_NAME'])) { $_dpreview_noname = $_dpreview_st->setting_array['BBS_NONAME_NAME']; $_dpreview_noname = '"' . StrCtl::toJavaScript($_dpreview_noname) . '"'; } + unset($_dpreview_st); } $_dpreview_hide = 'false'; if ($_conf['expack.editor.dpreview'] == 2) { - if (P2Util::isBrowserSafariGroup() && basename($_SERVER['SCRIPT_NAME']) != 'post_form.php') { + if (UA::isSafariGroup() && basename($_SERVER['SCRIPT_NAME']) != 'post_form.php') { $_dpreview_hide = 'true'; } $_dpreview_pos = 'dpreview2'; @@ -315,11 +308,25 @@ function setHiddenValue(button) { $onsubmit_at = ''; -if (!$_conf['ktai']) { +if (!$_conf['ktai'] || $_conf['iphone']) { if (!preg_match('{NetFront|AVE-?Front/}', $_SERVER['HTTP_USER_AGENT'])) { - $onsubmit_at = sprintf(' onsubmit="if (validateAll(%s,%s)) { switchBlockSubmit(true); return true; } else { return false }"', + + // ŏƐߌɂȂ‚`FbNČxoB + $_st = new SettingTxt($host, $bbs); + $_st->setSettingArray(); + + // ߌ + $confirmNanashi = ( (strpos($_st->setting_array['BBS_NONAME_NAME'], "fusianasan") !== false)); + + // ŏȂ + $blockNanashi = ($_st->setting_array['BBS_NANASHI_CHECK'] == '1' || $_st->setting_array['NANASHI_CHECK'] == '1'); + + unset($_st); + + $onsubmit_at = sprintf(' onsubmit="if (validateAll(%s,%s) && confirmNanashi(%s) && blockNanashi(%s)) { switchBlockSubmit(true); return true; } else { return false }"', (($_conf['expack.editor.check_message']) ? 'true' : 'false'), - (($_conf['expack.editor.check_sage']) ? 'true' : 'false')); + (($_conf['expack.editor.check_sage']) ? 'true' : 'false'), + ($confirmNanashi ? 'true' : 'false'), ($blockNanashi ? 'true' : 'false')); } } @@ -329,11 +336,15 @@ function setHiddenValue(button) { $upload_form = ''; $upload_mode = null; +/* if (!$_conf['ktai'] || $_conf['iphone']) { if (file_exists($_conf['dropbox_auth_json'])) { $upload_mode = 'dropbox'; } } +*/ + +$upload_mode = 'imgur'; if ($upload_mode !== null) { if ($_conf['ktai'] || $_conf['iphone']) { @@ -343,11 +354,10 @@ function setHiddenValue(button) { $upload_multiple = 'multiple'; $upload_name = 'upload[]'; } - $upload_token = sha1($_conf['p2ua'] . microtime()); + $upload_token = sha1(P2Commun::getP2UA(false,false) . microtime()); $_SESSION['upload_token'] = $upload_token; $upload_form = <<<EOP <input id="fileupload" type="file" name="{$upload_name}" data-url="upload.php?mode={$upload_mode}&token={$upload_token}" {$upload_multiple}> -<script type="text/javascript" src="js/jquery-{$_conf['jquery_version']}.min.js"></script> <script src="js/jquery.ui.widget.js"></script> <script src="js/jquery.iframe-transport.js"></script> <script src="js/jquery.fileupload.js"></script> diff --git a/lib/read_footer.inc.php b/lib/read_footer.inc.php index cfc6e1d73..daeaa3527 100644 --- a/lib/read_footer.inc.php +++ b/lib/read_footer.inc.php @@ -61,9 +61,16 @@ <a href="{$motothre_url}" target="_blank">{$dores_st}</a> EOP; } else { + // +live Nؑ + if ($_GET['live']) { + $htm['dores'] = <<<LIVE + <a href="live_post_form.php?{$host_bbs_key_q}{$ttitle_en_q}" target='livepost'>{$dores_st}</a> +LIVE; + } else { $htm['dores'] = <<<EOP <a href="post_form.php?{$host_bbs_key_q}&rescount={$aThread->rescount}{$ttitle_en_q}" target="_self" onclick="return OpenSubWin('post_form.php?{$host_bbs_key_q}&rescount={$aThread->rescount}{$ttitle_en_q}&popup=1',{$STYLE['post_pop_size']},1,0)"{$onmouse_showform_ht}>{$dores_st}</a> EOP; + } } $res_form_ht_pb = $res_form_ht; @@ -171,6 +178,23 @@ if ($_conf['expack.ic2.enabled']) { include P2EX_LIB_DIR . '/ImageCache2/templates/info.tpl.html'; } + +// +live \ؑփXNvg +if ($_GET['live']) { + echo ""; +} else { + echo <<<LIVE + <script type="text/javascript"> + <!-- + function startlive() { + window.location.replace("./live_read.php?host={$aThread->host}&bbs={$aThread->bbs}&key={$aThread->key}&live=1"); + } + + parent.livecontrol.liveoff(); + //--> + </script>\n +LIVE; +} // ==== echo '</body></html>'; diff --git a/lib/read_footer_i.inc.php b/lib/read_footer_i.inc.php index 6213a3586..229cb6a60 100644 --- a/lib/read_footer_i.inc.php +++ b/lib/read_footer_i.inc.php @@ -18,7 +18,7 @@ // }}} // {{{ c[o[\ -echo '<div class="ntoolbar" id="footer">'; +echo '<div class="ntoolbar" id="footer"><div class="ntoolbar" id="pager">'; echo '<table><tbody><tr>'; // {{{ y[W @@ -26,40 +26,70 @@ // Õy[W echo '<td>'; if ($read_navi_previous_url) { - echo toolbar_i_standard_button('img/gp3-prev.png', 'O', $read_navi_previous_url); + echo toolbar_i_standard_button('img/gp3-prev.png', null, $read_navi_previous_url); } else { - echo toolbar_i_disabled_button('img/gp3-prev.png', 'O'); + echo toolbar_i_disabled_button('img/gp3-prev.png', null); } echo '</td>'; +// y[Wԍ𒼐ڎw +echo '<td colspan="2">'; +echo get_read_jump($aThread, '', true); +echo '</td>'; + // ̃y[W echo '<td>'; if ($read_navi_next_url) { - echo toolbar_i_standard_button('img/gp4-next.png', '', $read_navi_next_url); + echo toolbar_i_standard_button('img/gp4-next.png', null, $read_navi_next_url); } else { - echo toolbar_i_disabled_button('img/gp4-next.png', ''); -} -echo '</td>'; - -// y[Wԍ𒼐ڎw -echo '<td colspan="2">'; -echo get_read_jump($aThread, '', true); -if (empty($_conf['expack.iphone.toolbars.no_label'])) { - echo "<br>{$rescount_st}"; + echo toolbar_i_disabled_button('img/gp4-next.png', null); } echo '</td>'; // echo '<td>'; -echo toolbar_i_standard_button('img/gp1-up.png', '', '#header'); +echo toolbar_i_standard_button('img/gp1-up.png', null, '#header'); echo '</td>'; // }}} -echo '</tr><tr>'; +echo '</tr></tbody></table></div>'; + +// {{{݃tH[ +if ($_conf['bottom_res_form']) { + $bbs = $aThread->bbs; + $key = $aThread->key; + $host = $aThread->host; + $rescount = $aThread->rescount; + $ttitle_en = UrlSafeBase64::encode($aThread->ttitle); + + $submit_value = ''; + + $key_idx = $aThread->keyidx; + + // tH[̃IvVǂݍ + require_once P2_LIB_DIR . '/post_form_options.inc.php'; + + $htm['resform_ttitle'] = <<<EOP +<p><b class="thre_title">{$aThread->ttitle_hd}</b></p> +EOP; + + require_once P2_LIB_DIR . '/post_form.inc.php'; + + echo <<<EOP +<div id="kakiko" class="extra"> +{$htm['dpreview']} +{$htm['post_form']} +{$htm['dpreview2']} +</div>\n +EOP; +} +// }}} // {{{ ̑{^ +echo '<table><tbody><tr>'; + // V echo '<td>'; if (!$aThread->diedat) { @@ -90,8 +120,12 @@ echo '<td>'; if (!$aThread->diedat) { if (empty($_conf['disable_res'])) { - $escaped_url = "post_form.php?{$host_bbs_key_q}&rescount={$aThread->rescount}{$ttitle_en_q}{$_conf['k_at_a']}"; - echo toolbar_i_standard_button('img/glyphish/icons2/08-chat.png', '', $escaped_url); + if ($_conf['bottom_res_form']) { + echo toolbar_i_showhide_button('img/glyphish/icons2/08-chat.png', '', 'kakiko'); + } else { + $escaped_url = "post_form.php?{$host_bbs_key_q}&rescount={$aThread->rescount}{$ttitle_en_q}{$_conf['k_at_a']}"; + echo toolbar_i_standard_button('img/glyphish/icons2/08-chat.png', '', $escaped_url); + } } else { echo toolbar_i_opentab_button('img/glyphish/icons2/08-chat.png', 'X', $motothre_url); } @@ -122,7 +156,7 @@ // SPM if ($_conf['expack.spm.enabled']) { - echo ShowThreadK::getSpmElementHtml(); + echo ShowThreadI::getSpmElementHtml(); } // ŏIXԍXV diff --git a/lib/read_header.inc.php b/lib/read_header.inc.php old mode 100644 new mode 100755 index 0bbdb0e10..17ac2f8d0 --- a/lib/read_header.inc.php +++ b/lib/read_header.inc.php @@ -104,7 +104,12 @@ // $read_footer_navi_new ǂ VX̕\ if ($aThread->resrange['to'] == $aThread->rescount) { + // +live Nؑ + if ($_GET['live']) { + $read_footer_navi_new = "<a href=\"javascript:getIndex('./read.php?{$host_bbs_key_q}&live=1');\" accesskey=\"r\">{$shinchaku_st}</a>"; + } else { $read_footer_navi_new = "<a href=\"{$_conf['read_php']}?{$host_bbs_key_q}&ls={$aThread->rescount}-&nt={$newtime}#r{$aThread->rescount}\" accesskey=\"r\">{$shinchaku_st}</a>"; + } } else { $read_footer_navi_new = "<a href=\"{$_conf['read_php']}?{$host_bbs_key_q}&ls={$aThread->resrange['to']}-{$offline_q}\" accesskey=\"r\">{$tuduki_st}</a>"; } @@ -175,6 +180,28 @@ <a href="{$_conf['subject_php']}?{$host_bbs_key_q}{$similar_q}" target="subject" title="^CgĂXbh">{$siml_thre_st}</a> EOTOOLBAR; +// +live N\ + +// \ł͖Ƃ̂ݕ\ +if(empty($_GET['live'])) { + $livebbs_bool = false; + // ‚̂ݔmF + if($_conf['live.livelink_thread']==1) { + foreach (explode (',',$_conf['live.livebbs_list']) as $value) { + if(strpos($aThread->bbs, $value) !== false) { + $livebbs_bool = true; + break; + } + } + } + //orSĂ̔‚ŕ\ݒɂȂĂ\ + if($_conf['live.livelink_thread']==2||$livebbs_bool) + { + $toolbar_right_ht .= <<<EOTOOLBAR + <a href="live_frame.php?{$host_bbs_key_q}{$ttitle_en_q}"></a> +EOTOOLBAR; + } +} //===================================== echo $_conf['doctype']; echo <<<EOP @@ -187,32 +214,34 @@ {$_conf['extra_headers_ht']} <title>{$ptitle_ht} + + \n EOP; +// +live \ html popup ؊ +if ($_conf['live.view_type'] > 1 ) { + $live_view_popup = live_; +} + if ($_conf['iframe_popup_type'] == 1) { echo << - + \n EOP; } else { echo << + \n EOP; } -if ($_conf['link_youtube'] == 2 || $_conf['link_niconico'] == 2) { - echo <<\n -EOP; -} if ($_conf['expack.am.enabled']) { echo <<\n @@ -268,11 +297,6 @@ EOP; } -if ($_conf['expack.editor.savedraft'] != '0') { - echo << -EOP; -} if ($_conf['wiki.idsearch.spm.mimizun.enabled'] || $_conf['wiki.idsearch.spm.hissi.enabled'] || $_conf['wiki.idsearch.spm.stalker.enabled']) { @@ -288,6 +312,11 @@ if ($_conf['expack.editor.dpreview']) { echo "\t\n"; } + if ($_conf['expack.editor.savedraft'] != '0') { + echo << +EOP; + } echo "\t\n"; $onload_script .= 'checkSage();'; } @@ -296,6 +325,14 @@ $onload_script .= 'setWinTitle();'; } +// +live y[WǍXNvg +if ($_GET['live']) { + $onload_script .= "startlive();"; + $onUnload_script = "onUnload=\"stoplive();\""; +} else { + $onload_script .= ""; +} + if ($_conf['iframe_popup_type'] == 1) { $fade = empty($_GET['fade']) ? 'false' : 'true'; $onload_script .= "gFade = {$fade};"; @@ -354,9 +391,12 @@ function filterCount(n) EOP; } +// +live I[g[h+XN[ +include_once P2_LIB_DIR . '/live/live_header.inc.php'; + echo << -
    \n +
    \n EOP; P2Util::printInfoHtml(); @@ -369,14 +409,15 @@ function filterCount(n) } else { $diedat_msg = $aThread->getDefaultGetDatErrorMessageHTML(); } + $motothre_url_t = P2Util::throughIme ($motothre_url); - $motothre_popup = " onmouseover=\"showHtmlPopUp('{$motothre_url}',event,{$_conf['iframe_popup_delay']})\" onmouseout=\"offHtmlPopUp()\""; + $motothre_popup = " onmouseover=\"showHtmlPopUp('{$motothre_url_t}',event,{$_conf['iframe_popup_delay']})\" onmouseout=\"offHtmlPopUp()\""; if ($_conf['iframe_popup'] == 1) { - $motothre_ht = "
    {$motothre_url}"; + $motothre_ht = "{$motothre_url}"; } elseif ($_conf['iframe_popup'] == 2) { - $motothre_ht = "(p){$motothre_url}"; + $motothre_ht = "(p){$motothre_url}"; } else { - $motothre_ht = "{$motothre_url}"; + $motothre_ht = "{$motothre_url}"; } echo $diedat_msg; @@ -428,6 +469,18 @@ function filterCount(n) EOP; } +// +live t[ 2yCŊJ +if ($_GET['live']) { +$htm['p2frame'] = << +//t[ 2yCŊJ<' + '/a> |'); +} +//]]> +\n +live; +} else { // {{{ p2t[ 3yCŊJ $htm['p2frame'] = << \n EOP; +} // }}} diff --git a/lib/read_header_i.inc.php b/lib/read_header_i.inc.php index e87c9142d..1953ccedb 100644 --- a/lib/read_header_i.inc.php +++ b/lib/read_header_i.inc.php @@ -68,7 +68,9 @@ // {{{ wb_vf $_conf['extra_headers_ht'] .= << + EOS; // ImageCache2 if ($_conf['expack.ic2.enabled']) { @@ -88,7 +90,6 @@ if ($_conf['expack.aas.enabled'] || $_conf['expack.ic2.enabled']) { $_conf['extra_headers_ht'] .= << - EOS; } - +// ݗ +if ($_conf['bottom_res_form']) { + $_conf['extra_headers_ht'] .= "\n"; + if ($_conf['expack.editor.savedraft'] != '0') { + $_conf['extra_headers_ht'] .= << +EOP; + } +} // }}} // }}} // {{{ HTMLvg @@ -122,132 +131,56 @@
    '; - // ‚ɖ߂ -echo ''; +echo toolbar_i_back_button($itaj_hd, $escaped_url); + +echo '
    '; // X -echo '
    '; +echo toolbar_i_showhide_button('img/glyphish/icons2/06-magnifying-glass.png', null, 'read_toolbar_filter'); + // CɃX -echo ''; - -// ̑ -echo ''; -// -echo ''; - -echo '
    '; $escaped_url = "{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}"; -echo toolbar_i_standard_button('img/glyphish/icons2/104-index-cards.png', $itaj_hd, $escaped_url); -echo ''; -echo toolbar_i_showhide_button('img/glyphish/icons2/06-magnifying-glass.png', '', 'read_toolbar_filter'); -echo ''; if ($thread_info) { - echo toolbar_i_fav_button('img/glyphish/icons2/28-star.png', 'CɃX', $thread_info); -} else { - echo toolbar_i_disabled_button('img/glyphish/icons2/28-star.png', 'CɃX'); + echo toolbar_i_fav_button('img/glyphish/icons2/28-star.png', null, $thread_info); } -echo ''; -echo toolbar_i_showhide_button('img/gp0-more.png', '̑', 'read_toolbar_extra'); -echo ''; -echo toolbar_i_standard_button('img/gp2-down.png', '', '#footer'); -echo '
    '; - -// }}} -// {{{ ̑̃c[ - -echo '
    '; -echo ''; - -// {{{ ̑ - CɓZbg - -if ($thread_info && $_conf['expack.misc.multi_favs']) { - echo ''; - for ($i = 1; $i <= $_conf['expack.misc.favset_num']; $i++) { - echo ''; - if ($i % 5 === 0 && $i != $_conf['expack.misc.favset_num']) { - echo ''; - } - } - $mod_cells = $_conf['expack.misc.favset_num'] % 5; - if ($mod_cells) { - $mod_cells = 5 - $mod_cells; - for ($i = 0; $i < $mod_cells; $i++) { - echo ''; - } - } - echo ''; -} - -// }}} -// {{{ ̑ - {^ - -echo ''; +// ̑{^ƃhbv_Ej[ +$icon = "img/gp0-more.png"; +$srcset = _toolbar_i_srcset($icon); +echo ' '; +//echo toolbar_i_dropdown_button('img/gp0-more.png', null); +echo << + '; +echo toolbar_i_menuItem('img/glyphish/icons2/63-runner.png', '>>1Ɉړ', $escaped_url); // ގX -echo ''; +echo toolbar_i_menuItem('img/glyphish/icons2/06-magnifying-glass.png', 'ގX', $escaped_url); // a -echo ''; - -// Xbhځ[ -echo ''; - -// O폜 -echo ''; - -echo ''; - -// }}} - -echo '
    '; - echo toolbar_i_fav_button('img/glyphish/icons2/28-star.png', '-', $thread_info, $i); - echo '
     
    '; +// >>1Ɉړ $escaped_url = "{$_conf['read_php']}?{$host_bbs_key_q}&ls=1-{$rnum_range}{$offline_q}{$_conf['k_at_a']}"; -echo toolbar_i_standard_button('img/glyphish/icons2/63-runner.png', '>>1', $escaped_url); -echo ''; $escaped_url = "{$_conf['subject_php']}?{$host_bbs_key_q}&itaj_en=" . UrlSafeBase64::encode($aThread->itaj) . '&method=similar&word=' . rawurlencode($aThread->ttitle_hc) . "&refresh=1{$_conf['k_at_a']}"; -echo toolbar_i_standard_button('img/glyphish/icons2/06-magnifying-glass.png', 'ގX', $escaped_url); -echo ''; -echo toolbar_i_palace_button('img/glyphish/icons2/108-badge.png', 'a', $thread_info); -echo ''; -echo toolbar_i_aborn_button('img/glyphish/icons2/128-bone.png', 'ځ[', $thread_info); -echo ''; -if (file_exists($aThread->keydat)) { - $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}&dele=1{$_conf['k_at_a']}"; - echo toolbar_i_standard_button('img/glyphish/icons2/64-zap.png', 'O폜', $escaped_url); -} else { - echo toolbar_i_disabled_button('img/glyphish/icons2/64-zap.png', 'O폜'); -} -echo '
    '; - -// {{{ ̑ - SPMtH[ +echo toolbar_i_palace_menuItem('img/glyphish/icons2/108-badge.png', 'a', $thread_info); // IC2NA if ($_conf['expack.ic2.enabled'] && $_conf['expack.ic2.thread_imagelink']) { - echo ''; - echo ''; $escaped_url = 'iv2.php?field=memo&keyword=' . rawurlencode($aThread->ttitle) . "&session_no_close=1{$_conf['k_at_a']}"; - echo '
    '; - echo kspform($aThread); - echo ''; + if ($_conf['expack.ic2.thread_imagecount']) { require_once P2EX_LIB_DIR . '/ic2_getcount.inc.php'; $cnt = 0; @@ -258,25 +191,76 @@ $cnt = -1; } if ($cnt == 0) { - echo toolbar_i_disabled_button('img/glyphish/icons2/42-photos.png', - '摜'); + echo toolbar_i_disabled_menuItem('img/glyphish/icons2/42-photos.png', + '摜ꗗ'); } else { - echo toolbar_i_opentab_button('img/glyphish/icons2/42-photos.png', - '摜' . ($cnt < 0 ? '(?)' : "({$cnt})"), $escaped_url); + echo toolbar_i_menuItem('img/glyphish/icons2/42-photos.png', + '摜ꗗ' . ($cnt < 0 ? '(?)' : "({$cnt})"), $escaped_url, ' target="_blank"'); } } else { - echo toolbar_i_opentab_button('img/glyphish/icons2/42-photos.png', - '摜', $escaped_url); + echo toolbar_i_menuItem('img/glyphish/icons2/42-photos.png', + '摜ꗗ', $escaped_url, ' target="_blank"'); } - echo '
    '; +} + +// CɓZbg +if ($thread_info && $_conf['expack.misc.multi_favs']) { + echo toolbar_i_menuItem('img/glyphish/icons2/28-star.png', 'CɓZbgɓo^', '#' ,'data-toggle="modal" data-target="#favsetModal"'); +} + +echo '
  • '; //d؂ + +// Xbhځ[ +echo toolbar_i_aborn_menuItem('img/glyphish/icons2/128-bone.png', 'Xځ[', $thread_info); + +// O폜 +if (file_exists($aThread->keydat)) { + $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}&dele=1{$_conf['k_at_a']}"; + echo toolbar_i_menuItem('img/glyphish/icons2/64-zap.png', 'O폜', $escaped_url); } else { - echo kspform($aThread); + echo toolbar_i_disabled_menuItem('img/glyphish/icons2/64-zap.png', 'O폜'); } +echo '
    '; +unset($icon,$srcset); // }}} +// {{{ CɃZbg_CAO +if ($thread_info && $_conf['expack.misc.multi_favs']) { + $favset_body = ''; + for ($i = 1; $i <= $_conf['expack.misc.favset_num']; $i++) { + $favset_body .= ''; + if ($i % 5 === 0 && $i != $_conf['expack.misc.favset_num']) { + $favset_body .= ''; + } + } + $mod_cells = $_conf['expack.misc.favset_num'] % 5; + if ($mod_cells) { + $mod_cells = 5 - $mod_cells; + for ($i = 0; $i < $mod_cells; $i++) { + $favset_body .= ''; + } + } + $favset_body .= '
    '; + $favset_body .= toolbar_i_fav_button('img/glyphish/icons2/28-star.png', '-', $thread_info, $i); + $favset_body .= '
     
    '; -echo ''; +echo << + + +EOP; +} // }}} // {{{ XtH[ @@ -285,6 +269,7 @@ $htm['rf_word_field'] = ResFilterElement::getWordField(array( 'autocorrect' => 'off', 'autocapitalize' => 'off', + 'class' => 'form-control', )); $htm['rf_field_field'] = ResFilterElement::getFieldField(); $htm['rf_method_field'] = ResFilterElement::getMethodField(); @@ -294,13 +279,34 @@ echo <<
    -{$htm['rf_hidden_fields']}{$htm['rf_word_field']} -
    +{$htm['rf_hidden_fields']} +
    +{$htm['rf_word_field']} + + + +
    +
    {$htm['rf_field_field']}{$htm['rf_method_field']}{$htm['rf_match_field']} {$htm['rf_include_field']} +
    {$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']}
    +
    + + +
    +{$aThread->ttitle_hd} +
    +EOP; + +// +echo toolbar_i_standard_button('img/gp2-down.png', null, '#footer'); + +echo << +
    EOP; // }}} @@ -327,7 +333,7 @@ if ($do_filtering) { $htm['rf_field_names'] = array( ResFilter::FIELD_NUMBER => 'Xԍ', - ResFilter::FIELD_HOLE => 'S', + ResFilter::FIELD_HOLE => 'S', ResFilter::FIELD_MESSAGE => '{', ResFilter::FIELD_NAME => 'O', ResFilter::FIELD_MAIL => '[', @@ -352,7 +358,11 @@ echo '
    ' . p2h($aThread->resrange['start']) . 'ւڽ
    '; } -echo ''; // end toolbar +echo << + +EOP; +// end toolbar // }}} diff --git a/lib/read_jump_k.inc.php b/lib/read_jump_k.inc.php index cd7914d14..a6ac08369 100644 --- a/lib/read_jump_k.inc.php +++ b/lib/read_jump_k.inc.php @@ -219,7 +219,7 @@ function _get_read_jump_js(ThreadRead $aThread, $options) global $_conf; return <<{$options} + EOP; } @@ -234,7 +234,7 @@ function _get_read_jump_filter_js(ThreadRead $aThread, $options) global $_conf; return <<{$options} + EOP; } diff --git a/lib/read_shitaraba.inc.php b/lib/read_shitaraba.inc.php index 093b4c55e..b8d54a8e3 100644 --- a/lib/read_shitaraba.inc.php +++ b/lib/read_shitaraba.inc.php @@ -36,9 +36,9 @@ function shitarabaDownload(ThreadRead $aThread) } // JBBS@ - if (P2Util::isHostJbbsShitaraba($aThread->host)) { + if (P2HostMgr::isHostJbbsShitaraba($aThread->host)) { // ΂livedoorړ]ɑΉBǍlivedoorƂB - $host = P2Util::adjustHostJbbs($aThread->host); + $host = P2HostMgr::adjustHostJbbs($aThread->host); list($host, $category, ) = explode('/', $host); $machiurl = "http://{$host}/bbs/rawmode.cgi/{$category}/{$aThread->bbs}/{$aThread->key}/{$START}-"; } @@ -46,15 +46,16 @@ function shitarabaDownload(ThreadRead $aThread) $tempfile = $aThread->keydat.'.dat.temp'; FileCtl::mkdirFor($tempfile); - $machiurl_res = P2Util::fileDownload($machiurl, $tempfile); + $machiurl_res = P2Commun::fileDownload($machiurl, $tempfile); - if ($machiurl_res->isError()) { + if (empty($machiurl_res)) { $aThread->diedat = true; return false; } + unset($machiurl_res); // {{{ ΂ȂEUCSJISɕϊ - if (P2Util::isHostJbbsShitaraba($aThread->host)) { + if (P2HostMgr::isHostJbbsShitaraba($aThread->host)) { $temp_data = FileCtl::file_read_contents($tempfile); $temp_data = mb_convert_encoding($temp_data, 'CP932', 'CP51932'); if (FileCtl::file_write_contents($tempfile, $temp_data) === false) { @@ -116,7 +117,7 @@ function shitarabaDatTo2chDatLines($mlines) $retval = false; return $retval; } - $mdatlines = ""; + $mdatlines = array(); foreach ($mlines as $ml) { $ml = rtrim($ml); diff --git a/lib/sb_footer.inc.php b/lib/sb_footer.inc.php index ed383accd..7418c2573 100644 --- a/lib/sb_footer.inc.php +++ b/lib/sb_footer.inc.php @@ -82,11 +82,11 @@ // XyV[hłȂ΃tH[͕⊮======================== $ini_url_text = ''; if (!$aThreadList->spmode) { - if (P2Util::isHostJbbsShitaraba($aThreadList->host)) { // + if (P2HostMgr::isHostJbbsShitaraba($aThreadList->host)) { // $ini_url_text = "http://{$aThreadList->host}/bbs/read.cgi?BBS={$aThreadList->bbs}&KEY="; - } elseif (P2Util::isHostMachiBbs($aThreadList->host)) { // ܂BBS + } elseif (P2HostMgr::isHostMachiBbs($aThreadList->host)) { // ܂BBS $ini_url_text = "http://{$aThreadList->host}/bbs/read.pl?BBS={$aThreadList->bbs}&KEY="; - } elseif (P2Util::isHostMachiBbsNet($aThreadList->host)) { // ܂r˂ + } elseif (P2HostMgr::isHostMachiBbsNet($aThreadList->host)) { // ܂r˂ $ini_url_text = "http://{$aThreadList->host}/test/read.cgi?bbs={$aThreadList->bbs}&key="; } else { $ini_url_text = "http://{$aThreadList->host}/test/read.cgi/{$aThreadList->bbs}/"; diff --git a/lib/sb_footer_i.inc.php b/lib/sb_footer_i.inc.php index 6e81edcf4..b9d37c8a3 100644 --- a/lib/sb_footer_i.inc.php +++ b/lib/sb_footer_i.inc.php @@ -7,9 +7,7 @@ //================================================= //tb^vg //================================================= -$bbs_q = '&bbs=' . $aThreadList->bbs; -$host_bbs_q = 'host=' . $aThreadList->host . $bbs_q; -$paging_q = $host_bbs_q . '&spmode=' . $aThreadList->spmode . $norefresh_q; + if (!empty($GLOBALS['wakati_words'])) { $paging_q .= '&method=similar&word=' . rawurlencode($GLOBALS['wakati_word']); @@ -125,12 +123,12 @@ }*/ } - $k_sb_navi_ht = ""; + $k_sb_navi_ht = ""; } if ($sb_all_pages < 2) { $sb_all_pages = 1; - $k_sb_navi_ht = ''; + $k_sb_navi_ht = ''; } // }}} @@ -147,7 +145,7 @@ // }}} // {{{ c[o[\ -echo ''; echo $htm['change_sort']; @@ -265,24 +260,41 @@ // }}} // {{{ XtH[ +if (array_key_exists('method', $sb_filter) && $sb_filter['method'] == 'or') { + $hd['method_checked_at'] = ' checked'; +} else { + $hd['method_checked_at'] = ''; +} -if (!$spmode_without_palace_or_favita) { - if (array_key_exists('method', $sb_filter) && $sb_filter['method'] == 'or') { - $hd['method_checked_at'] = ' checked'; - } else { - $hd['method_checked_at'] = ''; - } - - echo <<
    -{$sb_form_hidden_ht} - - +
    +{$sb_form_hidden_ht} + + + + + + +
    +
    + + +
    +{$ptitle_hd} +
    +EOP; + +// +echo toolbar_i_standard_button('img/gp2-down.png', null, '#footer'); + +echo << +
    EOP; -} // }}} // {{{ eʒm diff --git a/lib/sb_header_k.inc.php b/lib/sb_header_k.inc.php index 79f856d38..df20a1431 100644 --- a/lib/sb_header_k.inc.php +++ b/lib/sb_header_k.inc.php @@ -21,8 +21,8 @@ $ptitle_url = $p2_subject_url; // 2chn - } elseif (P2Util::isHost2chs($aThreadList->host)) { - if (P2Util::isHostBbsPink($aThreadList->host)) { + } elseif (P2HostMgr::isHost2chs($aThreadList->host)) { + if (P2HostMgr::isHostBbsPink($aThreadList->host)) { //$ptitle_url = "http://{$aThreadList->host}/{$aThreadList->bbs}/i/"; $ptitle_url = "http://speedo.ula.cc/test/p.so/{$aThreadList->host}/{$aThreadList->bbs}/"; } else { diff --git a/lib/sb_print.inc.php b/lib/sb_print.inc.php index f1847a7dd..90c0ad617 100644 --- a/lib/sb_print.inc.php +++ b/lib/sb_print.inc.php @@ -45,6 +45,17 @@ function sb_print($aThreadList) $ita_name_bool = false; } + // ł̂ݔ@\ON͔̎‚‚ǂf + $livebbs_bool = false; + if($_conf['live.livelink_subject']==1||$_conf['live.livebbs_forcelive']==1) { + foreach (explode (',',$_conf['live.livebbs_list']) as $value) { + if(strpos($aThreadList->bbs, $value) !== false) { + $livebbs_bool = true; + break; + } + } + } + $norefresh_q = '&norefresh=true'; $td = array('edit' => '', 'offrec' => '', 'unum' => '', 'rescount' => '', @@ -107,7 +118,7 @@ function sb_print($aThreadList) $sortq_ita = "&bbs={$aThreadList->bbs}"; } - $sortq_common = $sortq_spmode . $sortq_host . $sortq_ita; + $sortq_common = $sortq_spmode . $sortq_host . $sortq_ita . $_conf['k_at_a']; if (!empty($_REQUEST['find_cont']) && strlen($GLOBALS['word_fm']) > 0) { $word_q = '&word=' . rawurlencode($GLOBALS['word']) . '&method=' . rawurlencode($GLOBALS['sb_filter']['method']); @@ -149,7 +160,7 @@ function sb_print($aThreadList) // `FbN{bNX if ($checkbox_bool) { echo <<\n +\n EOP; } // No. @@ -179,9 +190,9 @@ function sb_print($aThreadList) \n EOP; } - // Birthday + // Birth echo <<Birthday\n +since\n EOP; // Cɓ if ($_conf['sb_show_fav'] && $aThreadList->spmode != 'taborn') { @@ -215,7 +226,7 @@ function sb_print($aThreadList) $midoku_ari = false; $anum_ht = ''; // #r1 - $host_bbs_key_q = "host={$aThread->host}&bbs={$aThread->bbs}&key={$aThread->key}"; + $host_bbs_key_q = "host={$aThread->host}&bbs={$aThread->bbs}&key={$aThread->key}{$_conf['k_at_a']}"; if ($aThreadList->spmode != 'taborn') { if (!$aThread->torder) { $aThread->torder = $i; } @@ -245,7 +256,7 @@ function sb_print($aThreadList) $row_class .= ' r_offline'; // JavaScriptł̊mF_CAO $unum_ht_c = <<- +- EOP; $row_class = ' nosubject'; @@ -254,13 +265,13 @@ function sb_print($aThreadList) $row_class .= ' r_new'; $midoku_ari = true; $unum_ht_c = <<{$aThread->unum} +{$aThread->unum} EOP; // subject.txtɂ͂邪AVȂ } else { $unum_ht_c = <<{$aThread->unum} +{$aThread->unum} EOP; } } @@ -274,7 +285,7 @@ function sb_print($aThreadList) if ($ita_name_bool) { $ita_name_ht = p2h($aThread->itaj ? $aThread->itaj : $aThread->bbs); $td['ita'] = <<{$ita_name_ht}
    - -
    -
    ~[hireŏIqbgƉ
    VKo^
    - %6\$s - (%7\$d) -
    '."\n"; -} - -echo ''."\n"; - -// gтȂ -if ($_conf['ktai']) { - echo << -{$_conf['k_accesskey']['up']}.ݒҏW -{$_conf['k_to_index_ht']} -EOP; -} - -echo ''; - -// ܂ -exit; diff --git a/rep2/editfavita.php b/rep2/editfavita.php index d1e6d5b0b..25e6104e2 100644 --- a/rep2/editfavita.php +++ b/rep2/editfavita.php @@ -18,7 +18,7 @@ } // Cɔ‚̃zXg𓯊 if (isset($_GET['syncfavita']) || isset($_POST['syncfavita'])) { - BbsMap::syncBrd($_conf['favita_brd']); + P2HostMgr::syncBrd($_conf['favita_brd']); } @@ -223,7 +223,7 @@ function submitApply() echo '
    '; // PCiNetFrontOj -if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !P2Util::isNetFront()) { +if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !UA::isNetFront()) { if ($lines) { $script_enable_html .= <<'; } echo 'Cɔ‚̕ёւ'; @@ -306,7 +306,7 @@ function submitApply() echo ""; // PCiNetFrontOj - if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !P2Util::isNetFront()) { + if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !UA::isNetFront()) { echo ''; } } diff --git a/rep2/editpref.php b/rep2/editpref.php index a346d1adf..e5449971e 100644 --- a/rep2/editpref.php +++ b/rep2/editpref.php @@ -7,6 +7,15 @@ $_login->authorize(); // [UF +$deltitles = array( + 'cookie' => 'Cookie', + 'matome' => 'V܂Ƃߓǂ', + 'recent' => 'ŋߓǂ񂾃X', + 'reshist' => 'ݗ', + 'autong' => ' NGEځ[', + 'boardlist' => 'ˆꗗ (Online)', +); + // {{{ zXg̓pݒ $synctitles = array( @@ -75,19 +84,66 @@ foreach ($sync_boards as $brd) { if (file_exists($brd)) { - BbsMap::syncBrd($brd); + P2HostMgr::syncBrd($brd); } } foreach ($sync_indexes as $idx) { if (file_exists($idx)) { - BbsMap::syncIdx($idx); + P2HostMgr::syncIdx($idx); } } // CɓZbgύX΁Aݒt@C } elseif ($_conf['expack.misc.multi_favs'] && isset($_POST['favsetlist'])) { updateFavSetList(); + +} elseif (isset($_POST['delete']) && isset($_POST['submit'])) { // ̍폜 + switch ($_POST['delete']) { + case cookie: + // cookie + $delflag = CookieDataStore::clear() === flase ? false : true; + break; + case matome: + // V܂Ƃߓǂ + $delflag = MatomeCacheList::trim(0) === flase ? false : true; + break; + case recent: + // ŋߓǂ񂾃X + $delflag = deleteFile($_conf['recent_idx']); + break; + case reshist: + // + if(deleteFile($_conf['res_hist_idx']) && + deleteFile($_conf['res_hist_dat']) && + deleteFile($_conf['res_hist_dat_php']) ) { + $delflag = true; + } + break; + case autong: + if(deleteFile($_conf['pref_dir'] . '/p2_aborn_auto.txt') && + deleteFile($_conf['pref_dir'] . '/p2_ng_auto.txt') ) { + $delflag = true; + } + break; + case boardlist: + $cachefile = P2Util::cacheFileForDL($_conf['brdfile_online']); + if(deleteFile($_conf['cache_dir'] . '/host_bbs_map.txt') && + deleteFile($cachefile) && + deleteFile($cachefile . '.p2.brd') ) { + $delflag = true; + } + break; + default: + $delflag = false; + P2Util::pushInfoHtml("

    p2 error: {$_POST['delete']} słB "); + break; + } + if ($delflag) { + P2Util::pushInfoHtml("

    p2 info: {$deltitles[$_POST['delete']]}폜܂B"); + } else { + P2Util::pushInfoHtml("

    p2 error: {$deltitles[$_POST['delete']]}̍폜Ɏs܂B"); + } } // }}} @@ -135,7 +191,8 @@ echo << - \n + + @@ -174,6 +231,11 @@ // +Wiki $aborn_be_txt = 'p2_aborn_be.txt'; $ng_be_txt = 'p2_ng_be.txt'; +// +live nCCg[hp +$highlight_name_txt = 'p2_highlight_name.txt'; +$highlight_mail_txt = 'p2_highlight_mail.txt'; +$highlight_msg_txt = 'p2_highlight_msg.txt'; +$highlight_id_txt = 'p2_highlight_id.txt'; echo '

    '; echo <<"; + // }}} + // {{{ PC - +live nCCg[hҏW + + echo "\n\n"; + + echo << +nCCg[hҏW\n +EOP; + printEditFileForm($highlight_name_txt, 'O'); + printEditFileForm($highlight_mail_txt, '['); + printEditFileForm($highlight_msg_txt, '{'); + printEditFileForm($highlight_id_txt, 'ID'); + echo <<\n +EOP; + + echo ""; + + // }}} + // {{{ PC - 2ch774 ELbV̍폜 + + echo "\n\n"; + + echo << +ELbV̍폜\n +EOP; + echo getDeleteHistoryFormHt(); + echo <<\n +EOP; + + echo ""; + // }}} // {{{ PC - zXg̓ HTML̃Zbg @@ -311,7 +408,20 @@ echo "\n\n"; } - include_once P2_LIB_DIR . '/wiki/editpref.inc.php'; + // }}} + // +Wiki + // {{{ PC - +Wiki + echo "\n\n"; + echo << ++Wiki + NvOCҏW b + DAT擾vOCҏW b + u摜URLvOCҏW +\n +EOP; + echo "\n\n"; + // }}} } @@ -508,7 +618,7 @@ function printEditFileForm($filename, $submit_value) // +Wiki if ($filename == 'p2_aborn_thread.txt' || - preg_match('/^p2_(aborn|ng)_(name|mail|id|msg|be)\\.txt$/', $filename)) + preg_match('/^p2_(aborn|ng|highlight)_(name|mail|id|msg)\\.txt$/', $filename)) { $edit_php = 'edit_aborn_word.php'; $target = '_self'; @@ -563,6 +673,35 @@ function getSyncFavoritesFormHt($path_value, $submit_value) return $ht; } +// }}} +// {{{ getDeleteHistoryFormHt() + +/** + * 폜ptH[HTML擾 + * + * @return string + */ +function getDeleteHistoryFormHt() +{ + global $_conf, $deltitles; + + $ht = << + {$_conf['k_input_ht']} + +EOFORM; + $ht .= "\n"; + + if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { + $ht = ' ' . preg_replace('/>\s+<', $ht); + } + return $ht; +} + // }}} // {{{ getFavSetListFormHt() @@ -716,6 +855,20 @@ function compareSkinNames($a, $b) return strcmp($a, $b); } +// }}} +// {{{ deleteFile() + +/** + * t@C폜B + * + * @param string t@C + * @return boolean ɖ폜ɐtrue + */ +function deleteFile($filename) +{ + return file_exists($filename) ? unlink($filename) : true; +} + // }}} /* diff --git a/rep2/editrss.php b/rep2/editrss.php index 188ff5d63..a74422213 100644 --- a/rep2/editrss.php +++ b/rep2/editrss.php @@ -231,7 +231,7 @@ function submitApply() echo "
    \n"; // PCiNetFrontOj -if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !P2Util::isNetFront()) { +if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !UA::isNetFront()) { if ($lines) { $script_enable_html .= <<'; } echo 'RSS̕ёւ'; @@ -326,7 +326,7 @@ function submitApply() } echo "\n"; // PCiNetFrontOj - if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !P2Util::isNetFront()) { + if (!$_conf['ktai'] && $_conf['favita_order_dnd'] && !UA::isNetFront()) { echo ''; } } diff --git a/rep2/first_cont.php b/rep2/first_cont.php index 2ee3955c6..ba7133daa 100644 --- a/rep2/first_cont.php +++ b/rep2/first_cont.php @@ -32,6 +32,8 @@ \n EOP; +$bookmarkletUrl = "javascript:location='" . rtrim(dirname(P2Util::getMyUrl()), '/') . "/" . $_conf['read_php'] . "?url='+escape(location);"; + // }}} // {{{ HTMLvg @@ -46,30 +48,15 @@ rep2 -
    {$htm['urlform']}
    -

    rep2

    +
    diff --git a/rep2/httpcmd.php b/rep2/httpcmd.php index 063249951..f3d0a4296 100644 --- a/rep2/httpcmd.php +++ b/rep2/httpcmd.php @@ -178,44 +178,6 @@ } break; -// }}} -// {{{ ubN}[N - -case 'bookmark': - if (isset($host) && isset($bbs) && isset($key) && isset($_REQUEST['resnum']) && isset($_REQUEST['bookmark'])) { - - if (!function_exists('setbookmark')) { - include P2_LIB_DIR . '/setbookmark.inc.php'; - } - - if (is_numeric($_REQUEST['resnum'])) { - $resnum = intval($_REQUEST['resnum']); - } else { - $resnum = null; - } - $set = (bool)$_REQUEST['bookmark']; - if (isset($_REQUEST['ttitle_en'])) { - $ttitle = UrlSafeBase64::decode($_REQUEST['ttitle_en']); - } elseif (isset($_REQUEST['ttitle'])) { - $ttitle = $_REQUEST['ttitle']; - } else { - $ttitle = null; - } - if (isset($_REQUEST['memo'])) { - $memo = $_REQUEST['memo']; - } else { - $memo = null; - } - - $r = setbookmark($host, $bbs, $key, $resnum, $set, $ttitle, $memo); - if (empty($r)) { - $r_msg = '0'; // s - } elseif ($r == 1) { - $r_msg = '1'; // - } - } - break; - // }}} // {{{ ItCwǗpJSONGR[h diff --git a/rep2/ic2.php b/rep2/ic2.php index 1dc843b7c..c950ee9a1 100644 --- a/rep2/ic2.php +++ b/rep2/ic2.php @@ -45,10 +45,20 @@ /*if (!isset($uri) && false !== ($url = getenv('PATH_INFO'))) { $uri = 'http:/' . $url; }*/ + if (empty($id) && empty($uri) && empty($file)) { ic2_error('x06', 'URL܂̓t@C܂B', false); } +// ۑfBNgȂꍇ͐VKō쐬 +if(!file_exists($ini['General']['cachedir'])){ + FileCtl::mkdirRecursive($ini['General']['cachedir'], 0777); +} +if(!is_writable($ini['General']['cachedir'])){ + // ݌𓾂Ȃꍇ̓p[~bV̒ӊN + p2die("efBNg̃p[~bVĉB"); +} + if (!is_dir($_conf['tmp_dir'])) { FileCtl::mkdirRecursive($_conf['tmp_dir']); } @@ -286,109 +296,105 @@ public function __destruct() // {{{ init http-client // ݒmF -$conn_timeout = (isset($ini['Getter']['conn_timeout']) && $ini['Getter']['conn_timeout'] > 0) - ? (float) $ini['Getter']['conn_timeout'] : 60.0; -$read_timeout = (isset($ini['Getter']['read_timeout']) && $ini['Getter']['read_timeout'] > 0) - ? (int) $ini['Getter']['read_timeout'] : 60; +$conn_timeout = (isset($_conf['expack.ic2.getter_conn_timeout']) && $_conf['expack.ic2.getter_conn_timeout'] > 0) + ? $_conf['expack.ic2.getter_conn_timeout'] : $_conf['http_conn_timeout']; +$read_timeout = (isset($_conf['expack.ic2.getter_read_timeout']) && $_conf['expack.ic2.getter_read_timeout'] > 0) + ? $_conf['expack.ic2.getter_read_timeout'] : $_conf['http_read_timeout']; $ic2_ua = (!empty($_conf['expack.user_agent'])) ? $_conf['expack.user_agent'] : $_SERVER['HTTP_USER_AGENT']; // LbVĂȂ΁A擾݂ -$client = new HTTP_Client(); -$client->setRequestParameter('timeout', $conn_timeout); -$client->setRequestParameter('readTimeout', array($read_timeout, 0)); -$client->setMaxRedirects(3); -$client->setDefaultHeader('User-Agent', $ic2_ua); -if ($mtime > 0) { - $client->setDefaultHeader('If-Modified-Since', http_date($mtime)); -} - -// vLVݒ -if ($ini['Proxy']['enabled'] && $ini['Proxy']['host'] && $ini['Proxy']['port']) { - $client->setRequestParameter('proxy_host', $ini['Proxy']['host']); - $client->setRequestParameter('proxy_port', $ini['Proxy']['port']); - if ($ini['Proxy']['user']) { - $client->setRequestParameter('proxy_user', $ini['Proxy']['user']); - $client->setRequestParameter('proxy_pass', $ini['Proxy']['pass']); - $proxy_auth_data = base64_encode($ini['Proxy']['user'] . ':' . $ini['Proxy']['pass']); - $client->setDefaultHeader('Proxy-Authorization', 'Basic ' . $proxy_auth_data); +try { + $req = P2Commun::createHTTPRequest($uri, HTTP_Request2::METHOD_GET); + $req->setConfig(array('follow_redirects' => true)); + $req->setHeader('User-Agent', $ic2_ua); + if ($mtime > 0) { + $req->setHeader('If-Modified-Since', http_date($mtime)); } -} + + // ^CAEg̐ݒ + $req->setConfig (array ( + 'connect_timeout' => $conn_timeout, + 'timeout' => $read_timeout, + )); // t@ݒ -if (is_null($referer)) { - $send_referer = (boolean)$ini['Getter']['sendreferer']; - if ($send_referer) { - if ($ini['Getter']['norefhosts']) { - $pattern = preg_quote($ini['Getter']['norefhosts'], '/'); + if (is_null($referer)) { + $send_referer = (boolean)$ini['Getter']['sendreferer']; + if ($send_referer) { + if ($ini['Getter']['norefhosts']) { + $pattern = preg_quote($ini['Getter']['norefhosts'], '/'); + $pattern = str_replace(',', '|', $pattern); + $pattern = '/' . $pattern . '/i'; + if (preg_match($pattern, $pURL['host'])) { + $send_referer = false; + } + } + } elseif ($ini['Getter']['refhosts']) { + $pattern = preg_quote($ini['Getter']['refhosts'], '/'); $pattern = str_replace(',', '|', $pattern); $pattern = '/' . $pattern . '/i'; if (preg_match($pattern, $pURL['host'])) { - $send_referer = false; + $send_referer = true; } } - } elseif ($ini['Getter']['refhosts']) { - $pattern = preg_quote($ini['Getter']['refhosts'], '/'); - $pattern = str_replace(',', '|', $pattern); - $pattern = '/' . $pattern . '/i'; - if (preg_match($pattern, $pURL['host'])) { - $send_referer = true; + if ($send_referer) { + $referer = $uri . '.html'; } } - if ($send_referer) { - $referer = $uri . '.html'; - } -} -if (is_string($referer)) { - $client->setDefaultHeader('Referer', $referer); -} + if (is_string($referer)) { + $req->setHeader('Referer', $referer); + } // }}} // {{{ get // _E[h -if ($ini['Getter']['retry_regex'] && - strlen(trim($ini['Getter']['retry_regex'])) > 0 && - intval($ini['Getter']['retry_max']) > 0 && - preg_match($ini['Getter']['retry_regex'], $uri)) -{ - $retryCount = 0; - do { - $code = $client->get($uri); - if ($code != 403) { - break; - } - $retryCount++; - sleep($ini['Getter']['retry_interval']); - } while ($retryCount < intval($ini['Getter']['retry_max'])); -} else { - $code = $client->get($uri); -} + if ($ini['Getter']['retry_regex'] && + strlen(trim($ini['Getter']['retry_regex'])) > 0 && + intval($ini['Getter']['retry_max']) > 0 && + preg_match($ini['Getter']['retry_regex'], $uri) + ) { + $retryCount = 0; + do { + $response = P2Commun::getHTTPResponse($req); + $code = $response->getStatus(); + if ($code != 403) { + break; + } + $retryCount++; + sleep($ini['Getter']['retry_interval']); + } while ($retryCount < intval($ini['Getter']['retry_max'])); + } else { + $response = P2Commun::getHTTPResponse($req); + $code = $response->getStatus(); + } -if (PEAR::isError($code)) { - ic2_error('x02', $code->getMessage()); -} elseif ($fileurl && $mtime > 0 && $code == 304) { - // 304 Not Modified ̂Ƃ - ic2_finish($fileurl, $thumb, $params, false); -} elseif ($code != 200) { - ic2_error($code); -} + if ($fileurl && $mtime > 0 && $code == 304) { + // 304 Not Modified ̂Ƃ + ic2_finish($fileurl, $thumb, $params, false); + } elseif ($code != 200) { + ic2_error($code); + } -$response = $client->currentResponse(); -if (isset($response['headers']['content-type'])) { - $serv_mime = $response['headers']['content-type']; -} + if ($response->getHeader('content-type')) { + $serv_mime = $response->getHeader('content-type'); + } + + // ꎞt@Cɕۑ + $tmpfile = tempnam($_conf['tmp_dir'], 'ic2_get_'); + $tmpobj = new IC2TempFile($tmpfile); + $fp = fopen($tmpfile, 'wb'); + if (!$fp) { + ic2_error('x02', "fopensB($tmpfile)"); + } + fwrite($fp, $response->getBody()); + fclose($fp); -// ꎞt@Cɕۑ -$tmpfile = tempnam($_conf['tmp_dir'], 'ic2_get_'); -$tmpobj = new IC2TempFile($tmpfile); -$fp = fopen($tmpfile, 'wb'); -if (!$fp) { - ic2_error('x02', "fopensB($tmpfile)"); +} catch (Exception $e) { + ic2_error('x02', $e->getMessage ()); } -fwrite($fp, $response['body']); -fclose($fp); // }}} // {{{ check @@ -466,7 +472,7 @@ public function __destruct() $newfile = $thumbnailer->srcPath($size, $md5, $mime); $newurl = $thumbnailer->srcUrl($size, $md5, $mime); $newdir = dirname($newfile); -if (!is_dir($newdir) && !@mkdir($newdir)) { +if (!is_dir($newdir) && !FileCtl::mkdirRecursive($newdir)) { ic2_error('x02', "fBNg쐬ł܂łB({$newdir})"); } if (($force || !file_exists($newfile)) && !@rename($tmpfile, $newfile)) { diff --git a/rep2/ic2_getter.php b/rep2/ic2_getter.php index b862010e6..d77364374 100644 --- a/rep2/ic2_getter.php +++ b/rep2/ic2_getter.php @@ -27,7 +27,7 @@ $autoClose = -1; } else { $isPopUp = 1; - if (array_key_exists('close', $_GET) && is_numeric($_GET['close'])) { + if (array_key_exists('autoclose', $_GET) && is_numeric($_GET['autoclose'])) { $autoClose = (float)$_GET['close'] * 1000.0; if ($autoClose > 0.0) { $autoClose = (int)$autoClose; @@ -58,7 +58,7 @@ 'to' => 'to', 'padding' => '', 'popup' => $isPopUp, - 'close' => $autoClose, + 'autoclose' => $autoClose, ); // tH[̌Œl @@ -107,7 +107,7 @@ // Bvf $qfe['detect_hint'] = $qf->addElement('hidden', '_hint'); $qfe['popup'] = $qf->addElement('hidden', 'popup'); -$qfe['close'] = $qf->addElement('hidden', 'close'); +$qfe['autoclose'] = $qf->addElement('hidden', 'autoclose'); // URLƘAԐݒ $qfe['uri'] = $qf->addElement('text', 'uri', 'URL', $_attr_uri); @@ -123,7 +123,7 @@ // vr[̑傫 $preview_size = array(); foreach ($_preview_size as $value => $lavel) { - $preview_size[$value] = HTML_QuickForm::createElement('radio', null, null, $lavel, $value); + $preview_size[$value] = $qf->createElement('radio', null, null, $lavel, $value); } $qf->addGroup($preview_size, 'preview_size', 'vr[', ' '); if (!isset($_GET['preview_size'])) { diff --git a/rep2/ic2_setter.php b/rep2/ic2_setter.php index 83f48a86f..e07d3baa8 100644 --- a/rep2/ic2_setter.php +++ b/rep2/ic2_setter.php @@ -353,7 +353,7 @@ function ic2_register_uploaded_file($file) // o^̉摜Ƃ } else { $newdir = dirname($file['img_src']); - if (!is_dir($newdir) && !@mkdir($newdir)) { + if (!is_dir($newdir) && !FileCtl::mkdirRecursive($newdir)) { return sprintf($err_fmt['dir'], $file['path'], $newdir); } if (!@move_uploaded_file($file['tmp_name'], $file['img_src'])) { diff --git a/rep2/img/glyphish/icons2/01-refresh.png b/rep2/img/glyphish/icons2/01-refresh.png index f6f4da9b2..a17882c9f 100644 Binary files a/rep2/img/glyphish/icons2/01-refresh.png and b/rep2/img/glyphish/icons2/01-refresh.png differ diff --git a/rep2/img/glyphish/icons2/01-refresh@2x.png b/rep2/img/glyphish/icons2/01-refresh@2x.png new file mode 100644 index 000000000..48a508741 Binary files /dev/null and b/rep2/img/glyphish/icons2/01-refresh@2x.png differ diff --git a/rep2/img/glyphish/icons2/01-refresh@3x.png b/rep2/img/glyphish/icons2/01-refresh@3x.png new file mode 100644 index 000000000..610888280 Binary files /dev/null and b/rep2/img/glyphish/icons2/01-refresh@3x.png differ diff --git a/rep2/img/glyphish/icons2/02-redo.png b/rep2/img/glyphish/icons2/02-redo.png index 4becb66ab..5ddfc4954 100644 Binary files a/rep2/img/glyphish/icons2/02-redo.png and b/rep2/img/glyphish/icons2/02-redo.png differ diff --git a/rep2/img/glyphish/icons2/03-loopback.png b/rep2/img/glyphish/icons2/03-loopback.png index 5a55416a7..ef8f920a5 100644 Binary files a/rep2/img/glyphish/icons2/03-loopback.png and b/rep2/img/glyphish/icons2/03-loopback.png differ diff --git a/rep2/img/glyphish/icons2/04-squiggle.png b/rep2/img/glyphish/icons2/04-squiggle.png index 11c71058a..db8989183 100644 Binary files a/rep2/img/glyphish/icons2/04-squiggle.png and b/rep2/img/glyphish/icons2/04-squiggle.png differ diff --git a/rep2/img/glyphish/icons2/05-shuffle.png b/rep2/img/glyphish/icons2/05-shuffle.png index b27263749..00fb6b952 100644 Binary files a/rep2/img/glyphish/icons2/05-shuffle.png and b/rep2/img/glyphish/icons2/05-shuffle.png differ diff --git a/rep2/img/glyphish/icons2/06-magnifying-glass.png b/rep2/img/glyphish/icons2/06-magnifying-glass.png index 95be7e129..854cc6705 100644 Binary files a/rep2/img/glyphish/icons2/06-magnifying-glass.png and b/rep2/img/glyphish/icons2/06-magnifying-glass.png differ diff --git a/rep2/img/glyphish/icons2/06-magnifying-glass@2x.png b/rep2/img/glyphish/icons2/06-magnifying-glass@2x.png new file mode 100644 index 000000000..2cabce910 Binary files /dev/null and b/rep2/img/glyphish/icons2/06-magnifying-glass@2x.png differ diff --git a/rep2/img/glyphish/icons2/06-magnifying-glass@3x.png b/rep2/img/glyphish/icons2/06-magnifying-glass@3x.png new file mode 100644 index 000000000..ed0dfb336 Binary files /dev/null and b/rep2/img/glyphish/icons2/06-magnifying-glass@3x.png differ diff --git a/rep2/img/glyphish/icons2/07-map-marker.png b/rep2/img/glyphish/icons2/07-map-marker.png index 6016ccb0a..eeca7e430 100644 Binary files a/rep2/img/glyphish/icons2/07-map-marker.png and b/rep2/img/glyphish/icons2/07-map-marker.png differ diff --git a/rep2/img/glyphish/icons2/08-chat.png b/rep2/img/glyphish/icons2/08-chat.png index e50edf255..6f20159fc 100644 Binary files a/rep2/img/glyphish/icons2/08-chat.png and b/rep2/img/glyphish/icons2/08-chat.png differ diff --git a/rep2/img/glyphish/icons2/08-chat@2x.png b/rep2/img/glyphish/icons2/08-chat@2x.png new file mode 100644 index 000000000..3f8ea8ad9 Binary files /dev/null and b/rep2/img/glyphish/icons2/08-chat@2x.png differ diff --git a/rep2/img/glyphish/icons2/08-chat@3x.png b/rep2/img/glyphish/icons2/08-chat@3x.png new file mode 100644 index 000000000..68be0d973 Binary files /dev/null and b/rep2/img/glyphish/icons2/08-chat@3x.png differ diff --git a/rep2/img/glyphish/icons2/09-chat2.png b/rep2/img/glyphish/icons2/09-chat2.png index bdc631010..d659a04be 100644 Binary files a/rep2/img/glyphish/icons2/09-chat2.png and b/rep2/img/glyphish/icons2/09-chat2.png differ diff --git a/rep2/img/glyphish/icons2/10-medical.png b/rep2/img/glyphish/icons2/10-medical.png index d8bd7ab83..0fad9fb42 100644 Binary files a/rep2/img/glyphish/icons2/10-medical.png and b/rep2/img/glyphish/icons2/10-medical.png differ diff --git a/rep2/img/glyphish/icons2/100-coffee.png b/rep2/img/glyphish/icons2/100-coffee.png index 91f208649..f0c4e8c21 100644 Binary files a/rep2/img/glyphish/icons2/100-coffee.png and b/rep2/img/glyphish/icons2/100-coffee.png differ diff --git a/rep2/img/glyphish/icons2/101-gameplan.png b/rep2/img/glyphish/icons2/101-gameplan.png index a4fe28668..0e0bc143d 100644 Binary files a/rep2/img/glyphish/icons2/101-gameplan.png and b/rep2/img/glyphish/icons2/101-gameplan.png differ diff --git a/rep2/img/glyphish/icons2/102-walk.png b/rep2/img/glyphish/icons2/102-walk.png index 9efaee999..585acf91c 100644 Binary files a/rep2/img/glyphish/icons2/102-walk.png and b/rep2/img/glyphish/icons2/102-walk.png differ diff --git a/rep2/img/glyphish/icons2/103-map.png b/rep2/img/glyphish/icons2/103-map.png index a9e0ca015..4832e481a 100644 Binary files a/rep2/img/glyphish/icons2/103-map.png and b/rep2/img/glyphish/icons2/103-map.png differ diff --git a/rep2/img/glyphish/icons2/104-index-cards.png b/rep2/img/glyphish/icons2/104-index-cards.png index 2a493aca3..305eb951a 100644 Binary files a/rep2/img/glyphish/icons2/104-index-cards.png and b/rep2/img/glyphish/icons2/104-index-cards.png differ diff --git a/rep2/img/glyphish/icons2/104-index-cards@2x.png b/rep2/img/glyphish/icons2/104-index-cards@2x.png new file mode 100644 index 000000000..f0183371b Binary files /dev/null and b/rep2/img/glyphish/icons2/104-index-cards@2x.png differ diff --git a/rep2/img/glyphish/icons2/104-index-cards@3x.png b/rep2/img/glyphish/icons2/104-index-cards@3x.png new file mode 100644 index 000000000..1e8924542 Binary files /dev/null and b/rep2/img/glyphish/icons2/104-index-cards@3x.png differ diff --git a/rep2/img/glyphish/icons2/105-piano.png b/rep2/img/glyphish/icons2/105-piano.png index f51de595a..15ab990a5 100644 Binary files a/rep2/img/glyphish/icons2/105-piano.png and b/rep2/img/glyphish/icons2/105-piano.png differ diff --git a/rep2/img/glyphish/icons2/106-sliders.png b/rep2/img/glyphish/icons2/106-sliders.png index 77daa2795..7e91a3bf7 100644 Binary files a/rep2/img/glyphish/icons2/106-sliders.png and b/rep2/img/glyphish/icons2/106-sliders.png differ diff --git a/rep2/img/glyphish/icons2/107-widescreen.png b/rep2/img/glyphish/icons2/107-widescreen.png index 94de81b12..76f5a5f0b 100644 Binary files a/rep2/img/glyphish/icons2/107-widescreen.png and b/rep2/img/glyphish/icons2/107-widescreen.png differ diff --git a/rep2/img/glyphish/icons2/108-badge.png b/rep2/img/glyphish/icons2/108-badge.png index f8b66a6f7..7ca2febb4 100644 Binary files a/rep2/img/glyphish/icons2/108-badge.png and b/rep2/img/glyphish/icons2/108-badge.png differ diff --git a/rep2/img/glyphish/icons2/108-badge@2x.png b/rep2/img/glyphish/icons2/108-badge@2x.png new file mode 100644 index 000000000..e29429684 Binary files /dev/null and b/rep2/img/glyphish/icons2/108-badge@2x.png differ diff --git a/rep2/img/glyphish/icons2/108-badge@3x.png b/rep2/img/glyphish/icons2/108-badge@3x.png new file mode 100644 index 000000000..5df5b584f Binary files /dev/null and b/rep2/img/glyphish/icons2/108-badge@3x.png differ diff --git a/rep2/img/glyphish/icons2/109-chicken.png b/rep2/img/glyphish/icons2/109-chicken.png index 6bee72b1e..6eb593821 100644 Binary files a/rep2/img/glyphish/icons2/109-chicken.png and b/rep2/img/glyphish/icons2/109-chicken.png differ diff --git a/rep2/img/glyphish/icons2/11-clock.png b/rep2/img/glyphish/icons2/11-clock.png index 0249da6f6..b05dc319c 100644 Binary files a/rep2/img/glyphish/icons2/11-clock.png and b/rep2/img/glyphish/icons2/11-clock.png differ diff --git a/rep2/img/glyphish/icons2/110-bug.png b/rep2/img/glyphish/icons2/110-bug.png index 4a0c9c2ea..c2e1bbf1e 100644 Binary files a/rep2/img/glyphish/icons2/110-bug.png and b/rep2/img/glyphish/icons2/110-bug.png differ diff --git a/rep2/img/glyphish/icons2/111-user.png b/rep2/img/glyphish/icons2/111-user.png index 42b2d8eab..cbee7cc21 100644 Binary files a/rep2/img/glyphish/icons2/111-user.png and b/rep2/img/glyphish/icons2/111-user.png differ diff --git a/rep2/img/glyphish/icons2/112-group.png b/rep2/img/glyphish/icons2/112-group.png index fe9b31325..b47ce23ce 100644 Binary files a/rep2/img/glyphish/icons2/112-group.png and b/rep2/img/glyphish/icons2/112-group.png differ diff --git a/rep2/img/glyphish/icons2/113-navigation.png b/rep2/img/glyphish/icons2/113-navigation.png index 9009d681d..e2e9ee8d3 100644 Binary files a/rep2/img/glyphish/icons2/113-navigation.png and b/rep2/img/glyphish/icons2/113-navigation.png differ diff --git a/rep2/img/glyphish/icons2/114-balloon.png b/rep2/img/glyphish/icons2/114-balloon.png index f8d594e3c..344dedab8 100644 Binary files a/rep2/img/glyphish/icons2/114-balloon.png and b/rep2/img/glyphish/icons2/114-balloon.png differ diff --git a/rep2/img/glyphish/icons2/115-bow-and-arrow.png b/rep2/img/glyphish/icons2/115-bow-and-arrow.png index 7f96d186d..25971c753 100644 Binary files a/rep2/img/glyphish/icons2/115-bow-and-arrow.png and b/rep2/img/glyphish/icons2/115-bow-and-arrow.png differ diff --git a/rep2/img/glyphish/icons2/116-controller.png b/rep2/img/glyphish/icons2/116-controller.png index 0b8a11702..189b0bbfe 100644 Binary files a/rep2/img/glyphish/icons2/116-controller.png and b/rep2/img/glyphish/icons2/116-controller.png differ diff --git a/rep2/img/glyphish/icons2/117-todo.png b/rep2/img/glyphish/icons2/117-todo.png index 634182b58..beb63a696 100644 Binary files a/rep2/img/glyphish/icons2/117-todo.png and b/rep2/img/glyphish/icons2/117-todo.png differ diff --git a/rep2/img/glyphish/icons2/118-coathanger.png b/rep2/img/glyphish/icons2/118-coathanger.png index 5bdc2f3b2..3f783fcde 100644 Binary files a/rep2/img/glyphish/icons2/118-coathanger.png and b/rep2/img/glyphish/icons2/118-coathanger.png differ diff --git a/rep2/img/glyphish/icons2/119-piggybank.png b/rep2/img/glyphish/icons2/119-piggybank.png index 3e1fc746d..4209a2a0d 100644 Binary files a/rep2/img/glyphish/icons2/119-piggybank.png and b/rep2/img/glyphish/icons2/119-piggybank.png differ diff --git a/rep2/img/glyphish/icons2/12-eye.png b/rep2/img/glyphish/icons2/12-eye.png index b99d2f6d2..7949ddc7f 100644 Binary files a/rep2/img/glyphish/icons2/12-eye.png and b/rep2/img/glyphish/icons2/12-eye.png differ diff --git a/rep2/img/glyphish/icons2/12-eye@2x.png b/rep2/img/glyphish/icons2/12-eye@2x.png new file mode 100644 index 000000000..f1220ea25 Binary files /dev/null and b/rep2/img/glyphish/icons2/12-eye@2x.png differ diff --git a/rep2/img/glyphish/icons2/12-eye@3x.png b/rep2/img/glyphish/icons2/12-eye@3x.png new file mode 100644 index 000000000..475868725 Binary files /dev/null and b/rep2/img/glyphish/icons2/12-eye@3x.png differ diff --git a/rep2/img/glyphish/icons2/120-headphones.png b/rep2/img/glyphish/icons2/120-headphones.png index cd80c75c2..9e57fb262 100644 Binary files a/rep2/img/glyphish/icons2/120-headphones.png and b/rep2/img/glyphish/icons2/120-headphones.png differ diff --git a/rep2/img/glyphish/icons2/121-landscape.png b/rep2/img/glyphish/icons2/121-landscape.png index df91c4598..2e7f30030 100644 Binary files a/rep2/img/glyphish/icons2/121-landscape.png and b/rep2/img/glyphish/icons2/121-landscape.png differ diff --git a/rep2/img/glyphish/icons2/122-stats.png b/rep2/img/glyphish/icons2/122-stats.png index 73ecde83a..c85420e13 100644 Binary files a/rep2/img/glyphish/icons2/122-stats.png and b/rep2/img/glyphish/icons2/122-stats.png differ diff --git a/rep2/img/glyphish/icons2/123-id-card.png b/rep2/img/glyphish/icons2/123-id-card.png index c7a79f5cc..aa1da7672 100644 Binary files a/rep2/img/glyphish/icons2/123-id-card.png and b/rep2/img/glyphish/icons2/123-id-card.png differ diff --git a/rep2/img/glyphish/icons2/124-bullhorn.png b/rep2/img/glyphish/icons2/124-bullhorn.png index f5229085f..415d23daf 100644 Binary files a/rep2/img/glyphish/icons2/124-bullhorn.png and b/rep2/img/glyphish/icons2/124-bullhorn.png differ diff --git a/rep2/img/glyphish/icons2/125-food.png b/rep2/img/glyphish/icons2/125-food.png index e78d8484c..35f583278 100644 Binary files a/rep2/img/glyphish/icons2/125-food.png and b/rep2/img/glyphish/icons2/125-food.png differ diff --git a/rep2/img/glyphish/icons2/126-moon.png b/rep2/img/glyphish/icons2/126-moon.png index a6ca51538..d38d8df5f 100644 Binary files a/rep2/img/glyphish/icons2/126-moon.png and b/rep2/img/glyphish/icons2/126-moon.png differ diff --git a/rep2/img/glyphish/icons2/127-sock.png b/rep2/img/glyphish/icons2/127-sock.png index 0acfbf0c1..f4a2a67bd 100644 Binary files a/rep2/img/glyphish/icons2/127-sock.png and b/rep2/img/glyphish/icons2/127-sock.png differ diff --git a/rep2/img/glyphish/icons2/128-bone.png b/rep2/img/glyphish/icons2/128-bone.png index 2014a9c28..f8b84e25b 100644 Binary files a/rep2/img/glyphish/icons2/128-bone.png and b/rep2/img/glyphish/icons2/128-bone.png differ diff --git a/rep2/img/glyphish/icons2/128-bone@2x.png b/rep2/img/glyphish/icons2/128-bone@2x.png new file mode 100644 index 000000000..fe4f179c6 Binary files /dev/null and b/rep2/img/glyphish/icons2/128-bone@2x.png differ diff --git a/rep2/img/glyphish/icons2/128-bone@3x.png b/rep2/img/glyphish/icons2/128-bone@3x.png new file mode 100644 index 000000000..160f37717 Binary files /dev/null and b/rep2/img/glyphish/icons2/128-bone@3x.png differ diff --git a/rep2/img/glyphish/icons2/129-golf.png b/rep2/img/glyphish/icons2/129-golf.png index c013d3b8f..ef49e97a1 100644 Binary files a/rep2/img/glyphish/icons2/129-golf.png and b/rep2/img/glyphish/icons2/129-golf.png differ diff --git a/rep2/img/glyphish/icons2/13-target.png b/rep2/img/glyphish/icons2/13-target.png index 1734687cb..f74c0d8c9 100644 Binary files a/rep2/img/glyphish/icons2/13-target.png and b/rep2/img/glyphish/icons2/13-target.png differ diff --git a/rep2/img/glyphish/icons2/130-dice.png b/rep2/img/glyphish/icons2/130-dice.png index 2981a6c99..0bff01116 100644 Binary files a/rep2/img/glyphish/icons2/130-dice.png and b/rep2/img/glyphish/icons2/130-dice.png differ diff --git a/rep2/img/glyphish/icons2/14-tag.png b/rep2/img/glyphish/icons2/14-tag.png index a3a6ab1a3..4a48c5d78 100644 Binary files a/rep2/img/glyphish/icons2/14-tag.png and b/rep2/img/glyphish/icons2/14-tag.png differ diff --git a/rep2/img/glyphish/icons2/15-tags.png b/rep2/img/glyphish/icons2/15-tags.png index b924dca81..ba55b843b 100644 Binary files a/rep2/img/glyphish/icons2/15-tags.png and b/rep2/img/glyphish/icons2/15-tags.png differ diff --git a/rep2/img/glyphish/icons2/16-line-chart.png b/rep2/img/glyphish/icons2/16-line-chart.png index e828d1e65..d4865e351 100644 Binary files a/rep2/img/glyphish/icons2/16-line-chart.png and b/rep2/img/glyphish/icons2/16-line-chart.png differ diff --git a/rep2/img/glyphish/icons2/17-bar-chart.png b/rep2/img/glyphish/icons2/17-bar-chart.png index ce72952f8..1b69f4543 100644 Binary files a/rep2/img/glyphish/icons2/17-bar-chart.png and b/rep2/img/glyphish/icons2/17-bar-chart.png differ diff --git a/rep2/img/glyphish/icons2/18-envelope.png b/rep2/img/glyphish/icons2/18-envelope.png index f99067781..4964e8114 100644 Binary files a/rep2/img/glyphish/icons2/18-envelope.png and b/rep2/img/glyphish/icons2/18-envelope.png differ diff --git a/rep2/img/glyphish/icons2/19-gear.png b/rep2/img/glyphish/icons2/19-gear.png index 2985e4fcf..3dc03ca9f 100644 Binary files a/rep2/img/glyphish/icons2/19-gear.png and b/rep2/img/glyphish/icons2/19-gear.png differ diff --git a/rep2/img/glyphish/icons2/20-gear2.png b/rep2/img/glyphish/icons2/20-gear2.png index bcd50966c..38d1a1331 100644 Binary files a/rep2/img/glyphish/icons2/20-gear2.png and b/rep2/img/glyphish/icons2/20-gear2.png differ diff --git a/rep2/img/glyphish/icons2/21-skull.png b/rep2/img/glyphish/icons2/21-skull.png index 68fe470fb..003b7a17f 100644 Binary files a/rep2/img/glyphish/icons2/21-skull.png and b/rep2/img/glyphish/icons2/21-skull.png differ diff --git a/rep2/img/glyphish/icons2/22-skull-n-crossbones.png b/rep2/img/glyphish/icons2/22-skull-n-crossbones.png index d11ac2d66..b3c941566 100644 Binary files a/rep2/img/glyphish/icons2/22-skull-n-crossbones.png and b/rep2/img/glyphish/icons2/22-skull-n-crossbones.png differ diff --git a/rep2/img/glyphish/icons2/23-bird.png b/rep2/img/glyphish/icons2/23-bird.png index 7ee4536cd..f006a3827 100644 Binary files a/rep2/img/glyphish/icons2/23-bird.png and b/rep2/img/glyphish/icons2/23-bird.png differ diff --git a/rep2/img/glyphish/icons2/24-gift.png b/rep2/img/glyphish/icons2/24-gift.png index 51da03051..2d49d2df3 100644 Binary files a/rep2/img/glyphish/icons2/24-gift.png and b/rep2/img/glyphish/icons2/24-gift.png differ diff --git a/rep2/img/glyphish/icons2/25-weather.png b/rep2/img/glyphish/icons2/25-weather.png index 3dc64297e..d62d22698 100644 Binary files a/rep2/img/glyphish/icons2/25-weather.png and b/rep2/img/glyphish/icons2/25-weather.png differ diff --git a/rep2/img/glyphish/icons2/26-bandaid.png b/rep2/img/glyphish/icons2/26-bandaid.png index 8cd2eb67c..008790dd6 100644 Binary files a/rep2/img/glyphish/icons2/26-bandaid.png and b/rep2/img/glyphish/icons2/26-bandaid.png differ diff --git a/rep2/img/glyphish/icons2/27-planet.png b/rep2/img/glyphish/icons2/27-planet.png index 8628818f1..74eed819b 100644 Binary files a/rep2/img/glyphish/icons2/27-planet.png and b/rep2/img/glyphish/icons2/27-planet.png differ diff --git a/rep2/img/glyphish/icons2/28-star.png b/rep2/img/glyphish/icons2/28-star.png index ad4c868ba..17758b0f5 100644 Binary files a/rep2/img/glyphish/icons2/28-star.png and b/rep2/img/glyphish/icons2/28-star.png differ diff --git a/rep2/img/glyphish/icons2/28-star@2x.png b/rep2/img/glyphish/icons2/28-star@2x.png new file mode 100644 index 000000000..0e395bf1b Binary files /dev/null and b/rep2/img/glyphish/icons2/28-star@2x.png differ diff --git a/rep2/img/glyphish/icons2/28-star@3x.png b/rep2/img/glyphish/icons2/28-star@3x.png new file mode 100644 index 000000000..b4d3a7d5c Binary files /dev/null and b/rep2/img/glyphish/icons2/28-star@3x.png differ diff --git a/rep2/img/glyphish/icons2/29-heart.png b/rep2/img/glyphish/icons2/29-heart.png index 18ec259d8..27b5c3fa1 100644 Binary files a/rep2/img/glyphish/icons2/29-heart.png and b/rep2/img/glyphish/icons2/29-heart.png differ diff --git a/rep2/img/glyphish/icons2/30-key.png b/rep2/img/glyphish/icons2/30-key.png index 83bd3662e..98497d043 100644 Binary files a/rep2/img/glyphish/icons2/30-key.png and b/rep2/img/glyphish/icons2/30-key.png differ diff --git a/rep2/img/glyphish/icons2/31-ipod.png b/rep2/img/glyphish/icons2/31-ipod.png index 222319ee5..41c68bcfe 100644 Binary files a/rep2/img/glyphish/icons2/31-ipod.png and b/rep2/img/glyphish/icons2/31-ipod.png differ diff --git a/rep2/img/glyphish/icons2/32-iphone.png b/rep2/img/glyphish/icons2/32-iphone.png index 829ed422f..f237e9dae 100644 Binary files a/rep2/img/glyphish/icons2/32-iphone.png and b/rep2/img/glyphish/icons2/32-iphone.png differ diff --git a/rep2/img/glyphish/icons2/33-cabinet.png b/rep2/img/glyphish/icons2/33-cabinet.png index 2b008594a..cdc93de94 100644 Binary files a/rep2/img/glyphish/icons2/33-cabinet.png and b/rep2/img/glyphish/icons2/33-cabinet.png differ diff --git a/rep2/img/glyphish/icons2/33-cabinet@2x.png b/rep2/img/glyphish/icons2/33-cabinet@2x.png new file mode 100644 index 000000000..80322c8a5 Binary files /dev/null and b/rep2/img/glyphish/icons2/33-cabinet@2x.png differ diff --git a/rep2/img/glyphish/icons2/33-cabinet@3x.png b/rep2/img/glyphish/icons2/33-cabinet@3x.png new file mode 100644 index 000000000..aafb7a677 Binary files /dev/null and b/rep2/img/glyphish/icons2/33-cabinet@3x.png differ diff --git a/rep2/img/glyphish/icons2/34-coffee.png b/rep2/img/glyphish/icons2/34-coffee.png index 56f338f53..6d50d49f4 100644 Binary files a/rep2/img/glyphish/icons2/34-coffee.png and b/rep2/img/glyphish/icons2/34-coffee.png differ diff --git a/rep2/img/glyphish/icons2/35-shopping-bag.png b/rep2/img/glyphish/icons2/35-shopping-bag.png index dd2fb5e67..61763b7c6 100644 Binary files a/rep2/img/glyphish/icons2/35-shopping-bag.png and b/rep2/img/glyphish/icons2/35-shopping-bag.png differ diff --git a/rep2/img/glyphish/icons2/36-toolbox.png b/rep2/img/glyphish/icons2/36-toolbox.png index cc25f11e0..186815d34 100644 Binary files a/rep2/img/glyphish/icons2/36-toolbox.png and b/rep2/img/glyphish/icons2/36-toolbox.png differ diff --git a/rep2/img/glyphish/icons2/37-suitcase.png b/rep2/img/glyphish/icons2/37-suitcase.png index a3e94776d..124703b70 100644 Binary files a/rep2/img/glyphish/icons2/37-suitcase.png and b/rep2/img/glyphish/icons2/37-suitcase.png differ diff --git a/rep2/img/glyphish/icons2/38-airplane.png b/rep2/img/glyphish/icons2/38-airplane.png index 09cbee24c..5d593670e 100644 Binary files a/rep2/img/glyphish/icons2/38-airplane.png and b/rep2/img/glyphish/icons2/38-airplane.png differ diff --git a/rep2/img/glyphish/icons2/39-spraycan.png b/rep2/img/glyphish/icons2/39-spraycan.png index 819fcd83e..f9b8645cc 100644 Binary files a/rep2/img/glyphish/icons2/39-spraycan.png and b/rep2/img/glyphish/icons2/39-spraycan.png differ diff --git a/rep2/img/glyphish/icons2/40-inbox.png b/rep2/img/glyphish/icons2/40-inbox.png index a089f06dd..5cf46ee7e 100644 Binary files a/rep2/img/glyphish/icons2/40-inbox.png and b/rep2/img/glyphish/icons2/40-inbox.png differ diff --git a/rep2/img/glyphish/icons2/41-picture-frame.png b/rep2/img/glyphish/icons2/41-picture-frame.png index cee8bf06e..983a79855 100644 Binary files a/rep2/img/glyphish/icons2/41-picture-frame.png and b/rep2/img/glyphish/icons2/41-picture-frame.png differ diff --git a/rep2/img/glyphish/icons2/42-photos.png b/rep2/img/glyphish/icons2/42-photos.png index 827d9a1bb..23a9be7b7 100644 Binary files a/rep2/img/glyphish/icons2/42-photos.png and b/rep2/img/glyphish/icons2/42-photos.png differ diff --git a/rep2/img/glyphish/icons2/42-photos@2x.png b/rep2/img/glyphish/icons2/42-photos@2x.png new file mode 100644 index 000000000..847196cb6 Binary files /dev/null and b/rep2/img/glyphish/icons2/42-photos@2x.png differ diff --git a/rep2/img/glyphish/icons2/42-photos@3x.png b/rep2/img/glyphish/icons2/42-photos@3x.png new file mode 100644 index 000000000..21a710d12 Binary files /dev/null and b/rep2/img/glyphish/icons2/42-photos@3x.png differ diff --git a/rep2/img/glyphish/icons2/43-film-roll.png b/rep2/img/glyphish/icons2/43-film-roll.png index 07c11055c..62734e8cb 100644 Binary files a/rep2/img/glyphish/icons2/43-film-roll.png and b/rep2/img/glyphish/icons2/43-film-roll.png differ diff --git a/rep2/img/glyphish/icons2/44-shoebox.png b/rep2/img/glyphish/icons2/44-shoebox.png index 6e2053c33..d3ef328e7 100644 Binary files a/rep2/img/glyphish/icons2/44-shoebox.png and b/rep2/img/glyphish/icons2/44-shoebox.png differ diff --git a/rep2/img/glyphish/icons2/45-movie1.png b/rep2/img/glyphish/icons2/45-movie1.png index 2817f5987..d1ea25ea8 100644 Binary files a/rep2/img/glyphish/icons2/45-movie1.png and b/rep2/img/glyphish/icons2/45-movie1.png differ diff --git a/rep2/img/glyphish/icons2/46-movie2.png b/rep2/img/glyphish/icons2/46-movie2.png index 7cf8b575d..b8a73545c 100644 Binary files a/rep2/img/glyphish/icons2/46-movie2.png and b/rep2/img/glyphish/icons2/46-movie2.png differ diff --git a/rep2/img/glyphish/icons2/47-fuel.png b/rep2/img/glyphish/icons2/47-fuel.png index 6af5342b4..350bb08a8 100644 Binary files a/rep2/img/glyphish/icons2/47-fuel.png and b/rep2/img/glyphish/icons2/47-fuel.png differ diff --git a/rep2/img/glyphish/icons2/48-fork-and-knife.png b/rep2/img/glyphish/icons2/48-fork-and-knife.png index 78fce5943..5ab6afe7a 100644 Binary files a/rep2/img/glyphish/icons2/48-fork-and-knife.png and b/rep2/img/glyphish/icons2/48-fork-and-knife.png differ diff --git a/rep2/img/glyphish/icons2/49-battery.png b/rep2/img/glyphish/icons2/49-battery.png index 707d6f55f..eae0d9ed8 100644 Binary files a/rep2/img/glyphish/icons2/49-battery.png and b/rep2/img/glyphish/icons2/49-battery.png differ diff --git a/rep2/img/glyphish/icons2/50-beaker.png b/rep2/img/glyphish/icons2/50-beaker.png index 14b3853d5..bf061087e 100644 Binary files a/rep2/img/glyphish/icons2/50-beaker.png and b/rep2/img/glyphish/icons2/50-beaker.png differ diff --git a/rep2/img/glyphish/icons2/51-outlet.png b/rep2/img/glyphish/icons2/51-outlet.png index 8a257ecfc..5801076b6 100644 Binary files a/rep2/img/glyphish/icons2/51-outlet.png and b/rep2/img/glyphish/icons2/51-outlet.png differ diff --git a/rep2/img/glyphish/icons2/52-pinetree.png b/rep2/img/glyphish/icons2/52-pinetree.png index 682ef25dd..2ac7b8eaf 100644 Binary files a/rep2/img/glyphish/icons2/52-pinetree.png and b/rep2/img/glyphish/icons2/52-pinetree.png differ diff --git a/rep2/img/glyphish/icons2/53-house.png b/rep2/img/glyphish/icons2/53-house.png index 7daaccd23..487651f69 100644 Binary files a/rep2/img/glyphish/icons2/53-house.png and b/rep2/img/glyphish/icons2/53-house.png differ diff --git a/rep2/img/glyphish/icons2/53-house@2x.png b/rep2/img/glyphish/icons2/53-house@2x.png new file mode 100644 index 000000000..2c0b152f5 Binary files /dev/null and b/rep2/img/glyphish/icons2/53-house@2x.png differ diff --git a/rep2/img/glyphish/icons2/53-house@3x.png b/rep2/img/glyphish/icons2/53-house@3x.png new file mode 100644 index 000000000..f4aa348f2 Binary files /dev/null and b/rep2/img/glyphish/icons2/53-house@3x.png differ diff --git a/rep2/img/glyphish/icons2/54-lock.png b/rep2/img/glyphish/icons2/54-lock.png index f0694b2cd..39b9fa42e 100644 Binary files a/rep2/img/glyphish/icons2/54-lock.png and b/rep2/img/glyphish/icons2/54-lock.png differ diff --git a/rep2/img/glyphish/icons2/55-network.png b/rep2/img/glyphish/icons2/55-network.png index b1ca76d5e..0aa28d692 100644 Binary files a/rep2/img/glyphish/icons2/55-network.png and b/rep2/img/glyphish/icons2/55-network.png differ diff --git a/rep2/img/glyphish/icons2/56-cloud.png b/rep2/img/glyphish/icons2/56-cloud.png index 7387ffccd..c0f4cfd33 100644 Binary files a/rep2/img/glyphish/icons2/56-cloud.png and b/rep2/img/glyphish/icons2/56-cloud.png differ diff --git a/rep2/img/glyphish/icons2/57-download.png b/rep2/img/glyphish/icons2/57-download.png index eb5a82c69..e2b0a6955 100644 Binary files a/rep2/img/glyphish/icons2/57-download.png and b/rep2/img/glyphish/icons2/57-download.png differ diff --git a/rep2/img/glyphish/icons2/58-bookmark.png b/rep2/img/glyphish/icons2/58-bookmark.png index aab3fce7e..7303ee3b5 100644 Binary files a/rep2/img/glyphish/icons2/58-bookmark.png and b/rep2/img/glyphish/icons2/58-bookmark.png differ diff --git a/rep2/img/glyphish/icons2/59-flag.png b/rep2/img/glyphish/icons2/59-flag.png index 9ab9fc7c3..57a33ed7d 100644 Binary files a/rep2/img/glyphish/icons2/59-flag.png and b/rep2/img/glyphish/icons2/59-flag.png differ diff --git a/rep2/img/glyphish/icons2/60-signpost.png b/rep2/img/glyphish/icons2/60-signpost.png index 4808b9e5d..3d993c319 100644 Binary files a/rep2/img/glyphish/icons2/60-signpost.png and b/rep2/img/glyphish/icons2/60-signpost.png differ diff --git a/rep2/img/glyphish/icons2/61-brightness.png b/rep2/img/glyphish/icons2/61-brightness.png index 529a82f8c..e0592e7af 100644 Binary files a/rep2/img/glyphish/icons2/61-brightness.png and b/rep2/img/glyphish/icons2/61-brightness.png differ diff --git a/rep2/img/glyphish/icons2/62-contrast.png b/rep2/img/glyphish/icons2/62-contrast.png index 473b17a3a..d517726ea 100644 Binary files a/rep2/img/glyphish/icons2/62-contrast.png and b/rep2/img/glyphish/icons2/62-contrast.png differ diff --git a/rep2/img/glyphish/icons2/63-runner.png b/rep2/img/glyphish/icons2/63-runner.png index 89cd1b1cf..3e6aabaf7 100644 Binary files a/rep2/img/glyphish/icons2/63-runner.png and b/rep2/img/glyphish/icons2/63-runner.png differ diff --git a/rep2/img/glyphish/icons2/63-runner@2x.png b/rep2/img/glyphish/icons2/63-runner@2x.png new file mode 100644 index 000000000..939835491 Binary files /dev/null and b/rep2/img/glyphish/icons2/63-runner@2x.png differ diff --git a/rep2/img/glyphish/icons2/63-runner@3x.png b/rep2/img/glyphish/icons2/63-runner@3x.png new file mode 100644 index 000000000..a28eda6a5 Binary files /dev/null and b/rep2/img/glyphish/icons2/63-runner@3x.png differ diff --git a/rep2/img/glyphish/icons2/64-zap.png b/rep2/img/glyphish/icons2/64-zap.png index 64fd017de..0567a6f0a 100644 Binary files a/rep2/img/glyphish/icons2/64-zap.png and b/rep2/img/glyphish/icons2/64-zap.png differ diff --git a/rep2/img/glyphish/icons2/64-zap@2x.png b/rep2/img/glyphish/icons2/64-zap@2x.png new file mode 100644 index 000000000..e615076ff Binary files /dev/null and b/rep2/img/glyphish/icons2/64-zap@2x.png differ diff --git a/rep2/img/glyphish/icons2/64-zap@3x.png b/rep2/img/glyphish/icons2/64-zap@3x.png new file mode 100644 index 000000000..26b66fd32 Binary files /dev/null and b/rep2/img/glyphish/icons2/64-zap@3x.png differ diff --git a/rep2/img/glyphish/icons2/65-note.png b/rep2/img/glyphish/icons2/65-note.png index 70e807da5..0354f8940 100644 Binary files a/rep2/img/glyphish/icons2/65-note.png and b/rep2/img/glyphish/icons2/65-note.png differ diff --git a/rep2/img/glyphish/icons2/66-microphone.png b/rep2/img/glyphish/icons2/66-microphone.png index 32ce4cb4e..3ecbb122d 100644 Binary files a/rep2/img/glyphish/icons2/66-microphone.png and b/rep2/img/glyphish/icons2/66-microphone.png differ diff --git a/rep2/img/glyphish/icons2/67-tshirt.png b/rep2/img/glyphish/icons2/67-tshirt.png index 57360d63f..d547ea6d2 100644 Binary files a/rep2/img/glyphish/icons2/67-tshirt.png and b/rep2/img/glyphish/icons2/67-tshirt.png differ diff --git a/rep2/img/glyphish/icons2/68-paperclip.png b/rep2/img/glyphish/icons2/68-paperclip.png index fb28a7fc9..ba2f85a79 100644 Binary files a/rep2/img/glyphish/icons2/68-paperclip.png and b/rep2/img/glyphish/icons2/68-paperclip.png differ diff --git a/rep2/img/glyphish/icons2/69-display.png b/rep2/img/glyphish/icons2/69-display.png index 14a67ad69..b9b4668e4 100644 Binary files a/rep2/img/glyphish/icons2/69-display.png and b/rep2/img/glyphish/icons2/69-display.png differ diff --git a/rep2/img/glyphish/icons2/70-tv.png b/rep2/img/glyphish/icons2/70-tv.png index 280d39559..ddb907feb 100644 Binary files a/rep2/img/glyphish/icons2/70-tv.png and b/rep2/img/glyphish/icons2/70-tv.png differ diff --git a/rep2/img/glyphish/icons2/71-compass.png b/rep2/img/glyphish/icons2/71-compass.png index d5d11f3ce..5fb323846 100644 Binary files a/rep2/img/glyphish/icons2/71-compass.png and b/rep2/img/glyphish/icons2/71-compass.png differ diff --git a/rep2/img/glyphish/icons2/72-pin.png b/rep2/img/glyphish/icons2/72-pin.png index a7ac857b3..0e6dfd101 100644 Binary files a/rep2/img/glyphish/icons2/72-pin.png and b/rep2/img/glyphish/icons2/72-pin.png differ diff --git a/rep2/img/glyphish/icons2/73-radar.png b/rep2/img/glyphish/icons2/73-radar.png index aeee10cb7..9c5185056 100644 Binary files a/rep2/img/glyphish/icons2/73-radar.png and b/rep2/img/glyphish/icons2/73-radar.png differ diff --git a/rep2/img/glyphish/icons2/74-location.png b/rep2/img/glyphish/icons2/74-location.png index c286d2ce1..cffb2968a 100644 Binary files a/rep2/img/glyphish/icons2/74-location.png and b/rep2/img/glyphish/icons2/74-location.png differ diff --git a/rep2/img/glyphish/icons2/75-phone.png b/rep2/img/glyphish/icons2/75-phone.png index ed58adc9f..9353db473 100644 Binary files a/rep2/img/glyphish/icons2/75-phone.png and b/rep2/img/glyphish/icons2/75-phone.png differ diff --git a/rep2/img/glyphish/icons2/76-baby.png b/rep2/img/glyphish/icons2/76-baby.png index cf00694d5..7f0671dde 100644 Binary files a/rep2/img/glyphish/icons2/76-baby.png and b/rep2/img/glyphish/icons2/76-baby.png differ diff --git a/rep2/img/glyphish/icons2/77-ekg.png b/rep2/img/glyphish/icons2/77-ekg.png index f9b0e0afc..71329e7eb 100644 Binary files a/rep2/img/glyphish/icons2/77-ekg.png and b/rep2/img/glyphish/icons2/77-ekg.png differ diff --git a/rep2/img/glyphish/icons2/78-stopwatch.png b/rep2/img/glyphish/icons2/78-stopwatch.png index 156457b16..b69c20f84 100644 Binary files a/rep2/img/glyphish/icons2/78-stopwatch.png and b/rep2/img/glyphish/icons2/78-stopwatch.png differ diff --git a/rep2/img/glyphish/icons2/79-medical-bag.png b/rep2/img/glyphish/icons2/79-medical-bag.png index 20fd92abc..df9a36960 100644 Binary files a/rep2/img/glyphish/icons2/79-medical-bag.png and b/rep2/img/glyphish/icons2/79-medical-bag.png differ diff --git a/rep2/img/glyphish/icons2/80-shopping-cart.png b/rep2/img/glyphish/icons2/80-shopping-cart.png index f14a6fb84..ede28e1b9 100644 Binary files a/rep2/img/glyphish/icons2/80-shopping-cart.png and b/rep2/img/glyphish/icons2/80-shopping-cart.png differ diff --git a/rep2/img/glyphish/icons2/81-dashboard.png b/rep2/img/glyphish/icons2/81-dashboard.png index 4f3e0984b..79312f524 100644 Binary files a/rep2/img/glyphish/icons2/81-dashboard.png and b/rep2/img/glyphish/icons2/81-dashboard.png differ diff --git a/rep2/img/glyphish/icons2/82-dogpaw.png b/rep2/img/glyphish/icons2/82-dogpaw.png index 3e3165716..26cf96efe 100644 Binary files a/rep2/img/glyphish/icons2/82-dogpaw.png and b/rep2/img/glyphish/icons2/82-dogpaw.png differ diff --git a/rep2/img/glyphish/icons2/83-calendar.png b/rep2/img/glyphish/icons2/83-calendar.png index fb859a1a8..240dcbccf 100644 Binary files a/rep2/img/glyphish/icons2/83-calendar.png and b/rep2/img/glyphish/icons2/83-calendar.png differ diff --git a/rep2/img/glyphish/icons2/84-lightbulb.png b/rep2/img/glyphish/icons2/84-lightbulb.png index 9f658ef20..6fadc828f 100644 Binary files a/rep2/img/glyphish/icons2/84-lightbulb.png and b/rep2/img/glyphish/icons2/84-lightbulb.png differ diff --git a/rep2/img/glyphish/icons2/85-trophy.png b/rep2/img/glyphish/icons2/85-trophy.png index f5da92d62..c3e77de06 100644 Binary files a/rep2/img/glyphish/icons2/85-trophy.png and b/rep2/img/glyphish/icons2/85-trophy.png differ diff --git a/rep2/img/glyphish/icons2/86-camera.png b/rep2/img/glyphish/icons2/86-camera.png index 1ea2cb80e..47fffaa10 100644 Binary files a/rep2/img/glyphish/icons2/86-camera.png and b/rep2/img/glyphish/icons2/86-camera.png differ diff --git a/rep2/img/glyphish/icons2/87-wineglass.png b/rep2/img/glyphish/icons2/87-wineglass.png index da35df489..2e7111653 100644 Binary files a/rep2/img/glyphish/icons2/87-wineglass.png and b/rep2/img/glyphish/icons2/87-wineglass.png differ diff --git a/rep2/img/glyphish/icons2/88-beermug.png b/rep2/img/glyphish/icons2/88-beermug.png index 1b29eb20b..c764ba1d6 100644 Binary files a/rep2/img/glyphish/icons2/88-beermug.png and b/rep2/img/glyphish/icons2/88-beermug.png differ diff --git a/rep2/img/glyphish/icons2/89-dumbbell.png b/rep2/img/glyphish/icons2/89-dumbbell.png index 29ecbdd93..f83251032 100644 Binary files a/rep2/img/glyphish/icons2/89-dumbbell.png and b/rep2/img/glyphish/icons2/89-dumbbell.png differ diff --git a/rep2/img/glyphish/icons2/90-lifebuoy.png b/rep2/img/glyphish/icons2/90-lifebuoy.png index a5d1bc8b5..deef71e94 100644 Binary files a/rep2/img/glyphish/icons2/90-lifebuoy.png and b/rep2/img/glyphish/icons2/90-lifebuoy.png differ diff --git a/rep2/img/glyphish/icons2/91-beaker2.png b/rep2/img/glyphish/icons2/91-beaker2.png index ea6304b95..f6a95f2bd 100644 Binary files a/rep2/img/glyphish/icons2/91-beaker2.png and b/rep2/img/glyphish/icons2/91-beaker2.png differ diff --git a/rep2/img/glyphish/icons2/92-testtube.png b/rep2/img/glyphish/icons2/92-testtube.png index 001e76c33..87335ac1c 100644 Binary files a/rep2/img/glyphish/icons2/92-testtube.png and b/rep2/img/glyphish/icons2/92-testtube.png differ diff --git a/rep2/img/glyphish/icons2/93-thermometer.png b/rep2/img/glyphish/icons2/93-thermometer.png index 0f78d2ebe..627e333bb 100644 Binary files a/rep2/img/glyphish/icons2/93-thermometer.png and b/rep2/img/glyphish/icons2/93-thermometer.png differ diff --git a/rep2/img/glyphish/icons2/94-pill.png b/rep2/img/glyphish/icons2/94-pill.png index 1e4a8f7f6..0151fc8b6 100644 Binary files a/rep2/img/glyphish/icons2/94-pill.png and b/rep2/img/glyphish/icons2/94-pill.png differ diff --git a/rep2/img/glyphish/icons2/95-equalizer.png b/rep2/img/glyphish/icons2/95-equalizer.png index 2a33eb8f6..821c9c5b6 100644 Binary files a/rep2/img/glyphish/icons2/95-equalizer.png and b/rep2/img/glyphish/icons2/95-equalizer.png differ diff --git a/rep2/img/glyphish/icons2/96-book.png b/rep2/img/glyphish/icons2/96-book.png index 4f1856fa6..16948c17a 100644 Binary files a/rep2/img/glyphish/icons2/96-book.png and b/rep2/img/glyphish/icons2/96-book.png differ diff --git a/rep2/img/glyphish/icons2/97-puzzle.png b/rep2/img/glyphish/icons2/97-puzzle.png index 328d4ca0a..53bf45dde 100644 Binary files a/rep2/img/glyphish/icons2/97-puzzle.png and b/rep2/img/glyphish/icons2/97-puzzle.png differ diff --git a/rep2/img/glyphish/icons2/98-palette.png b/rep2/img/glyphish/icons2/98-palette.png index 456235310..f2cfd475e 100644 Binary files a/rep2/img/glyphish/icons2/98-palette.png and b/rep2/img/glyphish/icons2/98-palette.png differ diff --git a/rep2/img/glyphish/icons2/99-umbrella.png b/rep2/img/glyphish/icons2/99-umbrella.png index 4c645daa3..290704923 100644 Binary files a/rep2/img/glyphish/icons2/99-umbrella.png and b/rep2/img/glyphish/icons2/99-umbrella.png differ diff --git a/rep2/img/gp0-more.png b/rep2/img/gp0-more.png index 0e0f2ca5f..919198183 100644 Binary files a/rep2/img/gp0-more.png and b/rep2/img/gp0-more.png differ diff --git a/rep2/img/gp0-more@2x.png b/rep2/img/gp0-more@2x.png new file mode 100644 index 000000000..27793f7cc Binary files /dev/null and b/rep2/img/gp0-more@2x.png differ diff --git a/rep2/img/gp0-more@3x.png b/rep2/img/gp0-more@3x.png new file mode 100644 index 000000000..069048342 Binary files /dev/null and b/rep2/img/gp0-more@3x.png differ diff --git a/rep2/img/gp1-up.png b/rep2/img/gp1-up.png index a918cde41..ed5c8d25b 100644 Binary files a/rep2/img/gp1-up.png and b/rep2/img/gp1-up.png differ diff --git a/rep2/img/gp1-up@2x.png b/rep2/img/gp1-up@2x.png new file mode 100644 index 000000000..d5263ae67 Binary files /dev/null and b/rep2/img/gp1-up@2x.png differ diff --git a/rep2/img/gp1-up@3x.png b/rep2/img/gp1-up@3x.png new file mode 100644 index 000000000..bf651377c Binary files /dev/null and b/rep2/img/gp1-up@3x.png differ diff --git a/rep2/img/gp2-down.png b/rep2/img/gp2-down.png index fed33c282..bcc85d365 100644 Binary files a/rep2/img/gp2-down.png and b/rep2/img/gp2-down.png differ diff --git a/rep2/img/gp2-down@2x.png b/rep2/img/gp2-down@2x.png new file mode 100644 index 000000000..2051d553d Binary files /dev/null and b/rep2/img/gp2-down@2x.png differ diff --git a/rep2/img/gp2-down@3x.png b/rep2/img/gp2-down@3x.png new file mode 100644 index 000000000..857ab9b12 Binary files /dev/null and b/rep2/img/gp2-down@3x.png differ diff --git a/rep2/img/gp3-prev.png b/rep2/img/gp3-prev.png index 8581955a4..e0fa4bfdf 100644 Binary files a/rep2/img/gp3-prev.png and b/rep2/img/gp3-prev.png differ diff --git a/rep2/img/gp3-prev@2x.png b/rep2/img/gp3-prev@2x.png new file mode 100644 index 000000000..577c2fe52 Binary files /dev/null and b/rep2/img/gp3-prev@2x.png differ diff --git a/rep2/img/gp3-prev@3x.png b/rep2/img/gp3-prev@3x.png new file mode 100644 index 000000000..5036d8550 Binary files /dev/null and b/rep2/img/gp3-prev@3x.png differ diff --git a/rep2/img/gp4-next.png b/rep2/img/gp4-next.png index 70b37d420..d70a89d74 100644 Binary files a/rep2/img/gp4-next.png and b/rep2/img/gp4-next.png differ diff --git a/rep2/img/gp4-next@2x.png b/rep2/img/gp4-next@2x.png new file mode 100644 index 000000000..216258b69 Binary files /dev/null and b/rep2/img/gp4-next@2x.png differ diff --git a/rep2/img/gp4-next@3x.png b/rep2/img/gp4-next@3x.png new file mode 100644 index 000000000..87cf56b99 Binary files /dev/null and b/rep2/img/gp4-next@3x.png differ diff --git a/rep2/img/gp5-info.png b/rep2/img/gp5-info.png index a4e525359..8fe68102d 100644 Binary files a/rep2/img/gp5-info.png and b/rep2/img/gp5-info.png differ diff --git a/rep2/img/gp5-info@2x.png b/rep2/img/gp5-info@2x.png new file mode 100644 index 000000000..8402e3d31 Binary files /dev/null and b/rep2/img/gp5-info@2x.png differ diff --git a/rep2/img/gp5-info@3x.png b/rep2/img/gp5-info@3x.png new file mode 100644 index 000000000..195270c13 Binary files /dev/null and b/rep2/img/gp5-info@3x.png differ diff --git a/rep2/img/live.png b/rep2/img/live.png new file mode 100755 index 000000000..88b9c57f2 Binary files /dev/null and b/rep2/img/live.png differ diff --git a/rep2/img/re.png b/rep2/img/re.png new file mode 100755 index 000000000..59397ebe9 Binary files /dev/null and b/rep2/img/re.png differ diff --git a/rep2/index.php b/rep2/index.php index 12df2b2ba..95ee4e89d 100644 --- a/rep2/index.php +++ b/rep2/index.php @@ -52,8 +52,14 @@ } // ftHg̃yC - $panes = 'default'; - $direction = 'rows'; + if(!$_conf['pane_mode']) + { + $panes = 'default'; + $direction = 'rows'; + } else { + $panes = 'v3'; + $direction = 'cols'; + } $_SESSION['use_narrow_toolbars'] = false; // index.php?panes={v3,v2,h2} or index.php?sidebar=1 ŃyCw diff --git a/rep2/info.php b/rep2/info.php index 0cd0f8a69..b430540cb 100644 --- a/rep2/info.php +++ b/rep2/info.php @@ -283,7 +283,7 @@ } $motothre_url = $aThread->getMotoThread(); -if (P2Util::isHost2chs($aThread->host)) { +if (P2HostMgr::isHost2chs($aThread->host)) { $motothre_org_url = $aThread->getMotoThread(true); } else { $motothre_org_url = $motothre_url; @@ -336,8 +336,7 @@ P2Util::printInfoHtml(); echo "

    \n"; -echo "{$hd['ttitle_name']}\n"; -echo "

    \n"; +echo "",(isset($title_msg) ? $hd['ttitle_name'] : $aThread->ttitle_hd),"\n";echo "

    \n"; // gтȂ`ŕ\ if ($_conf['ktai']) { diff --git a/rep2/info_js.php b/rep2/info_js.php index 85cb56485..165ac4178 100644 --- a/rep2/info_js.php +++ b/rep2/info_js.php @@ -32,7 +32,7 @@ */ function info_js_get_board_info($host, $bbs) { - return info_js_json_encode(get_board_info($host, $bbs)); + return p2_json_encode(get_board_info($host, $bbs)); } // }}} @@ -48,22 +48,7 @@ function info_js_get_board_info($host, $bbs) */ function info_js_get_thread_info($host, $bbs, $key) { - return info_js_json_encode(get_thread_info($host, $bbs, $key)); -} - -// }}} -// {{{ info_js_json_encode() - -/** - * Shift_JIS̒lUTF-8ɕϊĂJSONGR[h - * - * @param mixed $values - * @return string JSON - */ -function info_js_json_encode($values) -{ - mb_convert_variables('UTF-8', 'CP932', $values); - return json_encode($values); + return p2_json_encode(get_thread_info($host, $bbs, $key)); } // }}} diff --git a/rep2/info_sp.php b/rep2/info_sp.php index 209da5db3..e34e2dc2b 100644 --- a/rep2/info_sp.php +++ b/rep2/info_sp.php @@ -18,6 +18,7 @@ $resnum = isset($_GET['resnum']) ? $_GET['resnum'] : null; $popup = isset($_GET['popup']) ? $_GET['popup'] : null; $mode = isset($_GET['mode']) ? $_GET['mode'] : null; +$bbsonly = isset($_GET['bbsonly']) ? (int)$_GET['bbsonly'] : 0; if (isset($_GET['aborn_str_en'])) { $aborn_str_en = $_GET['aborn_str_en']; @@ -56,7 +57,7 @@ //===================================================== // f[^t@C̓ǂݏ //===================================================== -if (preg_match('/^(aborn|ng)_/', $mode)) { +if (preg_match('/^(aborn|ng|highlight)_/', $mode)) { $path = $_conf['pref_dir'] . '/p2_' . $mode . '.txt'; } @@ -74,7 +75,7 @@ $aborn_id = ''; } // +Wiki:BEځ[ - $aborn_be = preg_match('/BE:(\\d+)/', $resar[2], $idar) ? P2UtilWiki::calcBeId($idar[1]) : ''; + $aborn_be = preg_match('/BE:(\\d+)/', $resar[2], $idar) ? P2Util::calcBeId($idar[1]) : ''; if ($_conf['expack.spm.ngaborn_confirm'] == 0 && !isset($aborn_str)) { if ($mode == 'aborn_res') { $aborn_str = $host . '/' . $bbs . '/' . $key . '/' . $resnum; @@ -98,8 +99,14 @@ } if ($popup == 2) { - // ځ[ENG[ho^ - if (preg_match('/^(aborn|ng)_/', $mode) && ($aborn_str = trim($aborn_str)) !== '') { + // ځ[/NG/nCCg[ho^ + if (preg_match('/^(aborn|ng|highlight)_/', $mode) && ($aborn_str = trim($aborn_str)) !== '') { + + // bbsonlyw肳Ăꍇ́Abbs̎wlj + if(!empty($bbs) && $bbsonly) { + $aborn_str = sprintf('%s%s',$bbs,$aborn_str); + } + if (file_exists($path) && ($data = FileCtl::file_read_lines($path))) { $data = array_map('trim', $data); $data = array_filter($data, create_function('$v', 'return ($v !== "");')); @@ -246,6 +253,45 @@ } $edit_value = 'NG[hҏWFBE'; break; + case 'highlight_name': + $title_st = 'p2 - nCCg[ho^FO'; + if ($popup == 2) { + $msg = 'nCCg[hiOj ' . $aborn_str . ' o^܂B'; + } elseif ($resar[0] != "") { + $msg = 'nCCg[hiOj ' . $resar[0] . ' o^Ă낵łH'; + $aborn_str_en = UrlSafeBase64::encode($resar[0]); + } + $edit_value = 'nCCg[hҏWFO'; + break; + case 'highlight_mail': + $title_st = 'p2 - nCCg[ho^F['; + if ($popup == 2) { + $msg = 'nCCg[hi[j ' . $aborn_str . ' o^܂B'; + } elseif ($resar[1] != "") { + $msg = 'nCCg[hi[j ' . $resar[1] . ' o^Ă낵łH'; + $aborn_str_en = UrlSafeBase64::encode($resar[1]); + } + $edit_value = 'nCCg[hҏWF['; + break; + case 'highlight_msg': + $title_st = 'p2 - nCCg[ho^FbZ[W'; + if ($popup == 2) { + $msg = 'nCCg[hibZ[Wj ' . $aborn_str . ' o^܂B'; + } else { + $msg = 'nCCg[hibZ[Wj
    '; + } + $edit_value = 'nCCg[hҏWFbZ[W'; + break; + case 'highlight_id': + $title_st = 'p2 - nCCg[ho^FID'; + if ($popup == 2) { + $msg = 'nCCg[hiIDj ' . $aborn_str . ' o^܂B'; + } elseif ($aborn_id != "") { + $msg = 'nCCg[hiIDj ' . $aborn_id . ' o^Ă낵łH'; + $aborn_str_en = UrlSafeBase64::encode($aborn_id); + } + $edit_value = 'nCCg[hҏWFID'; + break; default: /*u*/ } @@ -293,7 +339,7 @@ function infoSpLiveAborn() var tgt = "{$aborn_target}"; var once = {$aborn_once}; /*try {*/ - var heads = opener.document.getElementsByTagName('div'); + var heads = opener.document.getElementsByTagName('*'); for (var i = heads.length - 1; i >= 0 ; i--) { if (heads[i].className.indexOf('res-header') != -1 && heads[i].innerHTML.indexOf(tgt) != -1) @@ -343,6 +389,9 @@ function infoSpLiveAborn() $aborn_id_ht = p2h($aborn_id); echo "\t\n"; } + + echo "\t

    \n"; + echo "\t\n"; if (!$_conf['ktai']) { echo "\t\n"; diff --git a/rep2/iui/backButton.png b/rep2/iui/backButton.png index e27ea8cdf..0385981c5 100644 Binary files a/rep2/iui/backButton.png and b/rep2/iui/backButton.png differ diff --git a/rep2/iui/backButton@2x.png b/rep2/iui/backButton@2x.png new file mode 100644 index 000000000..04cf254d9 Binary files /dev/null and b/rep2/iui/backButton@2x.png differ diff --git a/rep2/iui/backButton@3x.png b/rep2/iui/backButton@3x.png new file mode 100644 index 000000000..689bc9970 Binary files /dev/null and b/rep2/iui/backButton@3x.png differ diff --git a/rep2/iui/iui.css b/rep2/iui/iui.css index 1b2c58433..b5fd14da1 100644 --- a/rep2/iui/iui.css +++ b/rep2/iui/iui.css @@ -30,7 +30,7 @@ body[orient="landscape"] > *:not(.toolbar) { body > *[selected="true"] { display: block; } - +/* a[selected], a:active { background-color: #194fdb !important; background-image: url(listArrowSel.png), url(selection.png) !important; @@ -42,7 +42,7 @@ a[selected], a:active { a[selected="progress"] { background-image: url(loading.gif), url(selection.png) !important; } - +*/ /************************************************************************************************/ body > .toolbar { @@ -50,10 +50,10 @@ body > .toolbar { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; border-bottom: 1px solid #2d3642; - border-top: 1px solid #6d84a2; - padding: 10px; + border-top: 1px solid #333; /* l #6d84a2 */ + padding: 6px; height: 45px; - background: url(toolbar.png) #6d84a2 repeat-x; + background: #333; /* url(toolbar.png) #6d84a2 repeat-x; */ } .toolbar > h1 { @@ -84,9 +84,10 @@ body[orient="landscape"] > .toolbar > h1 { right: 6px; margin: 0; border-width: 0 5px; - padding: 0 3px; + padding: 1px 4px 0 4px; width: auto; height: 30px; + line-height: 30px; font-family: inherit; font-size: 12px; @@ -96,14 +97,18 @@ body[orient="landscape"] > .toolbar > h1 { text-overflow: ellipsis; text-decoration: none; white-space: nowrap; - background: none; - -webkit-border-image: url(toolButton.png) 0 5 0 5; + background: #444; border-radius: 5px; + /* background: none; + -webkit-border-image: url(toolButton.png) 0 5 0 5; */ + display:block; } +/* .blueButton { -webkit-border-image: url(blueButton.png) 0 5 0 5; border-width: 0 5px; } +*/ .leftButton { left: 6px; @@ -112,12 +117,15 @@ body[orient="landscape"] > .toolbar > h1 { #backButton { display: none; - left: 6px; - right: auto; - padding: 0; - max-width: 55px; + left: 6px; right: auto; + padding-right: 0px; padding-left: 0px; + width: auto; max-width: 55px; + font-family: Helvetica; border-width: 0 8px 0 14px; -webkit-border-image: url(backButton.png) 0 8 0 14; + border-image: url(backButton.png) 0 8 0 14 fill; + -webkit-border-image: -webkit-image-set(url(backButton.png) 1x,url(backButton@2x.png) 2x,url(backButton@3x.png) 3x) 0 8 0 14; + border-image: image-set(url(backButton.png) 1x,url(backButton@2x.png) 2x,url(backButton@3x.png) 3x) 0 8 0 14; } .whiteButton, @@ -163,13 +171,13 @@ body > ul > li { body > ul > li.group { position: relative; - top: -1px; - margin-bottom: -2px; + /* top: -1px; + margin-bottom: -2px; */ border-top: 1px solid #7d7d7d; border-bottom: 1px solid #999999; - padding: 1px 10px; - background: url(listGroup.png) repeat-x; - font-size: 17px; + padding: 2px 10px 0px 10px; + /* background: url(listGroup.png) repeat-x; */ background:#aaa; + font-size: 16px; font-weight: bold; text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0; color: #FFFFFF; @@ -220,12 +228,12 @@ body > .dialog { border: none; border-top: 1px solid #6d84a2; padding: 10px 6px; - background: url(toolbar.png) #7388a5 repeat-x; + background: #333; } .dialog > fieldset > h1 { margin: 0 10px 0 10px; - padding: 0; + padding-top: 2px; font-size: 20px; font-weight: bold; color: #FFFFFF; @@ -238,14 +246,16 @@ body > .dialog { margin: 16px 0 0 6px; font-size: 14px; color: #999999; + text-align: left; + width: 5em; } -input:not(input[type|=radio]):not(input[type|=checkbox]) { +input:not([type|="submit"]):not([type|="radio"]):not([type|="checkbox"]) { box-sizing: border-box; -webkit-box-sizing: border-box; width: 100%; margin: 8px 0 0 0; - padding: 6px 6px 6px 44px; + padding: 6px 6px 6px 5em; font-size: 16px; font-weight: normal; } diff --git a/rep2/iv2.php b/rep2/iv2.php index 553180c6f..934ff30b3 100644 --- a/rep2/iv2.php +++ b/rep2/iv2.php @@ -30,6 +30,7 @@ $_conf['extra_headers_ht'] .= << + \n @@ -37,6 +38,7 @@ $_conf['extra_headers_xht'] .= << + \n @@ -993,11 +995,8 @@ function iv2_sqlite_unix2date($ts) $flexy->setData('page', $page); $flexy->setData('move', $qfObj); $flexy->setData('lightbox', $lightbox); -if ($enable_zip) { $flexy->setData('jquery', $_conf['jquery_version']); -} else { $flexy->setData('jquery', null); -} // y[W\ P2Util::header_nocache(); diff --git a/rep2/js/basic.js b/rep2/js/basic.js index 214b9fdae..5e877b63d 100644 --- a/rep2/js/basic.js +++ b/rep2/js/basic.js @@ -34,25 +34,6 @@ var setWinTitle = rep2.util.setWindowTitle; // DOMIuWFNg擾 var p2GetElementById = document.getElementById; -// XMLHttpRequest IuWFNg擾 -function getXmlHttp() -{ - var objHTTP = null ; - try { - objHTTP = new ActiveXObject("Msxml2.XMLHTTP") ; // Mozillap - } catch (e) { - try { - objHTTP = new ActiveXObject("Microsoft.XMLHTTP") ; // IEp - } catch (oc) { - objHTTP = null ; - } - } - if (!objHTTP && typeof XMLHttpRequest != "undefined") { - objHTTP = new XMLHttpRequest(); // - } - return objHTTP -} - /** * objHTTP urlnāAʃeLXg擾 * diff --git a/rep2/js/bootstrap.min.js b/rep2/js/bootstrap.min.js new file mode 100644 index 000000000..9bcd2fcca --- /dev/null +++ b/rep2/js/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/rep2/js/delelog.js b/rep2/js/delelog.js index 019835f49..548246340 100644 --- a/rep2/js/delelog.js +++ b/rep2/js/delelog.js @@ -9,7 +9,7 @@ function deleLog(tquery, info_pop_width, info_pop_height, page, obj) return false; } - var objHTTP = getXmlHttp(); + var objHTTP = new XMLHttpRequest(); if (!objHTTP) { // alert("Error: XMLHTTP ʐMIuWFNg̍쐬Ɏs܂B") ; diff --git a/rep2/js/dpreview.js b/rep2/js/dpreview.js index 559e621d9..723ddac10 100644 --- a/rep2/js/dpreview.js +++ b/rep2/js/dpreview.js @@ -217,7 +217,7 @@ function DPSetTrip(tk) if (!dpreview_on) { return; } - var objHTTP = getXmlHttp(); + var objHTTP = new XMLHttpRequest(); if (!objHTTP) { DPReplaceInnerText('dp_trip', 'XMLHTTP Disabled.'); return; @@ -236,7 +236,7 @@ function DPSetTrip(tk) // XMLHttpRequestpăgbv擾 function DPGetTrip(tk) { - var objHTTP = getXmlHttp(); + var objHTTP = new XMLHttpRequest(); if (!objHTTP) { return 'XMLHTTP Disabled.'; } diff --git a/rep2/js/editpref.js b/rep2/js/editpref.js index 58ffe5f09..03f3bccd2 100644 --- a/rep2/js/editpref.js +++ b/rep2/js/editpref.js @@ -73,6 +73,17 @@ function setCacheMetaDataPopUpHeight(popup) } } +function deleteCheck() +{ + + if(window.confirm($('[name=delete] option:selected').text() + 'Sč폜Ă낵łH')){ + return true; + } + else{ + return false; // M𒆎~ + } +} + // }}} /* diff --git a/rep2/js/fitimage.js b/rep2/js/fitimage.js index fa2da02e2..ef00fdb48 100644 --- a/rep2/js/fitimage.js +++ b/rep2/js/fitimage.js @@ -189,7 +189,7 @@ function fiUpdateRank(rank) return false; } - var objHTTP = getXmlHttp(); + var objHTTP = new XMLHttpRequest(); if (!objHTTP) { alert('Error: XMLHTTP ʐMIuWFNg̍쐬Ɏs܂B') ; return false; diff --git a/rep2/js/ic2_getcount.js b/rep2/js/ic2_getcount.js index 82b606890..ab8e642da 100644 --- a/rep2/js/ic2_getcount.js +++ b/rep2/js/ic2_getcount.js @@ -11,7 +11,7 @@ function ic2_setcount(key, elem) var ic2_getcount = function (key) { var url, req, res, err; - req = getXmlHttp(); + req = new XMLHttpRequest(); if (!req) { return null; } diff --git a/rep2/js/ic2_getinfo.js b/rep2/js/ic2_getinfo.js index 58e704eaf..a1bef2527 100644 --- a/rep2/js/ic2_getinfo.js +++ b/rep2/js/ic2_getinfo.js @@ -16,7 +16,7 @@ function ic2_getinfo(type, value, thumb) { var url, req, res, err; - req = getXmlHttp(); + req = new XMLHttpRequest(); if (!req) { return null; } diff --git a/rep2/js/ic2_iphone.js b/rep2/js/ic2_iphone.js index 5bab24f4e..87e570937 100644 --- a/rep2/js/ic2_iphone.js +++ b/rep2/js/ic2_iphone.js @@ -49,6 +49,9 @@ document.addEventListener('DOMContentLoaded', function(event) { * 摜\ */ ic2info.show = function(key, evt) { + // skOuterClickȂ悤ɂ + evt.stopPropagation(); + var info = ic2info.get(key); while (_messageContainer.childNodes.length) { @@ -77,7 +80,11 @@ document.addEventListener('DOMContentLoaded', function(event) { _previewContainer.appendChild(edit).appendChild(thumb); } - _messageContainer.appendChild(document.createTextNode(info.uri)); + var aTag = document.createElement('a'); + aTag.appendChild(document.createTextNode(info.uri)); + aTag.href = info.uri; + aTag.target = '_blank'; + _messageContainer.appendChild(aTag); _messageContainer.appendChild(document.createElement('br')); _messageContainer.appendChild(document.createTextNode( info.width + 'x' + info.height + ' (' + _number_format(info.size) + ' bytes)' @@ -128,6 +135,7 @@ document.addEventListener('DOMContentLoaded', function(event) { try { req = new XMLHttpRequest(); req.open('GET', url, false); + req.withCredentials = true; req.send(null); res = null; @@ -170,14 +178,13 @@ document.addEventListener('DOMContentLoaded', function(event) { + _uniquery(), false ); + req.withCredentials = true; req.send(null); if (req.readyState == 4) { if (req.status == 200) { if (req.responseText == '1') { ic2info.setRank(rank); - } else { - window.alert('Internal error'); } } else { window.alert('HTTP error ' + req.statusText); @@ -189,7 +196,8 @@ document.addEventListener('DOMContentLoaded', function(event) { // }}} - document.getElementById('ic2-info-closer').onclick = ic2info.hide; + $('#ic2-info-closer').click(ic2info.hide); + $('#ic2-info-body').skOuterClick(ic2info.hide); for (var i = 0; i < _ranks.length; i++) { _ranks[i].onclick = (function(n){ diff --git a/rep2/js/ic2_popinfo.js b/rep2/js/ic2_popinfo.js index 55e4c4038..c8f0b33ca 100644 --- a/rep2/js/ic2_popinfo.js +++ b/rep2/js/ic2_popinfo.js @@ -113,6 +113,7 @@ var _ic2_popinfo_js_onload = function() { + _uniquery(), false ); + req.withCredentials = true; req.send(null); if (req.readyState == 4) { diff --git a/rep2/js/ic2_switch.js b/rep2/js/ic2_switch.js index b68330303..c4ead11ba 100644 --- a/rep2/js/ic2_switch.js +++ b/rep2/js/ic2_switch.js @@ -13,7 +13,7 @@ */ function ic2_switch(onoff, mobile) { - var objHTTP = getXmlHttp(); + var objHTTP = new XMLHttpRequest(); if (!objHTTP) { alert('Error: XMLHTTP ʐMIuWFNg̍쐬Ɏs܂B'); } diff --git a/rep2/js/invite.js b/rep2/js/invite.js index 7bcc533d7..91ada6625 100644 --- a/rep2/js/invite.js +++ b/rep2/js/invite.js @@ -16,8 +16,9 @@ function Invite(title, url, host, bbs, key, resnum) winHeight = 280; taRows = 15; var uri = 'read_async.php?host='+host+'&bbs='+bbs+'&key='+key+'&ls='+resnum+'n&q=2&offline=1'; - var req = getXmlHttp(); + var req = new XMLHttpRequest(); req.open('get', uri, false); + req.withCredentials = true; req.send(null); if (req.readyState == 4 && req.status == 200) { msg = '\n\n' + req.responseText; @@ -42,7 +43,6 @@ function Invite(title, url, host, bbs, key, resnum) invite.document.writeln('
    '); invite.document.writeln(''); invite.document.writeln(''); - invite.document.writeln(''); invite.document.writeln(''); invite.document.close(); invite.resizeTo(winWidth, winHeight); diff --git a/rep2/js/iphone.js b/rep2/js/iphone.js index 6108d42ee..5ee27b05c 100644 --- a/rep2/js/iphone.js +++ b/rep2/js/iphone.js @@ -9,7 +9,7 @@ var iutil = { * NCAgiPhoneǂ * @type {Boolean} */ - 'iphone': (/iP(hone|od)/).test(navigator.userAgent), + 'iphone': (/(iP(hone|od|ad)|Android)/).test(navigator.userAgent), /** * N̐K\ * @type {RegExp} @@ -619,6 +619,7 @@ iutil.httpGetText = function(uri) { try { req = new XMLHttpRequest(); req.open('GET', uri, false); + req.withCredentials = true; req.send(null); if (req.readyState == 4) { @@ -645,6 +646,7 @@ iutil.httpGetText = function(uri) { iutil.httpGetAsync = function(uri, callback) { var req = new XMLHttpRequest(); req.open('GET', uri, true); + req.withCredentials = true; req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) { @@ -778,6 +780,17 @@ iutil.toolbarShowHide = function(element, event) { } } } + + // ݃tH[ȂʂXN[({Ƃ) + if (id=='kakiko') { + var to = parseInt(target.offsetTop); + document.body.scrollTop = to - 60; + // ݃tH[ɃLbgڂ + var textbox = document.getElementById('MESSAGE'); + var len = textbox.value.length; + textbox.focus(); + textbox.setSelectionRange(len, len); + } } } } diff --git a/rep2/js/iv2.js b/rep2/js/iv2.js index c7ec1ed11..ce9f9c949 100644 --- a/rep2/js/iv2.js +++ b/rep2/js/iv2.js @@ -163,7 +163,7 @@ function getRank(itemId) function setRank(itemId, rank) { - var objHTTP = getXmlHttp(); + var objHTTP = new XMLHttpRequest(); if (!objHTTP) { alert("Error: XMLHTTP ʐMIuWFNg̍쐬Ɏs܂B") ; } diff --git a/rep2/js/jquery-1.8.3.min.js b/rep2/js/jquery-1.8.3.min.js deleted file mode 100644 index 83589daa7..000000000 --- a/rep2/js/jquery-1.8.3.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v1.8.3 jquery.com | jquery.org/license */ -(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/rep2/js/jquery-3.2.1.min.js b/rep2/js/jquery-3.2.1.min.js new file mode 100644 index 000000000..644d35e27 --- /dev/null +++ b/rep2/js/jquery-3.2.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), +a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"
    ","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), +null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + +
    +
    +

     

    +

     

    +
    +
    + + +LIVE; + +?> \ No newline at end of file diff --git a/rep2/live_frame.php b/rep2/live_frame.php new file mode 100755 index 000000000..1c5f9a8a7 --- /dev/null +++ b/rep2/live_frame.php @@ -0,0 +1,74 @@ +authorize(); // [UF + +// ϐ +if (empty($_GET['host'])) { + // G[ + die('p2 error: host w肳Ă܂'); +} else { + $host = $_GET['host']; +} +$bbs = isset($_GET['bbs']) ? $_GET['bbs'] : ''; +$key = isset($_GET['key']) ? $_GET['key'] : ''; +$rescount = isset($_GET['rescount']) ? intval($_GET['rescount']) : 1; + +$itaj = P2Util::getItaName($host, $bbs); +if (!$itaj) { $itaj = $bbs; } + +$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : ''; +$ttitle = (strlen($ttitle_en) > 0) ? UrlSafeBase64::decode($ttitle_en) : ''; +$ttitle_hd = htmlspecialchars($ttitle, ENT_QUOTES); +$ttitle_urlen = rawurlencode($ttitle_en); +$ttitle_en_q = "&ttitle_en=" . $ttitle_urlen; + +$live_read = "live_read.php"; +$live_q = "&live=1"; + +if ($_GET['offline']) { + $offline_l = isset($_GET['offline']) ? $_GET['offline'] : ''; + $offline_q = "&offline=" . $offline_l; + $live_read = "read.php"; + $live_q = "&live=0"; +} + +if ($_GET['word']) { + $word_l = isset($_GET['word']) ? $_GET['word'] : ''; + $method_l = isset($_GET['method']) ? $_GET['method'] : ''; + $word_q = "&word=" . $word_l . "&method=" . $method_l; + $live_read = "read.php"; + $live_q = "&live=0"; +} + +// HTMLvg +P2Util::header_nocache(); +P2Util::header_content_type(); + +if ($_conf['doctype']) { echo $_conf['doctype']; } + +echo << + + + + + {$itaj} / {$ttitle_hd} + + + + + + + + + + + +LIVE; + +?> \ No newline at end of file diff --git a/rep2/live_post_form.php b/rep2/live_post_form.php new file mode 100755 index 000000000..5c934622b --- /dev/null +++ b/rep2/live_post_form.php @@ -0,0 +1,213 @@ +authorize(); // [UF + +//================================================== +// ϐ +//================================================== +if (empty($_GET['host'])) { + // G[ + p2die('host w肳Ă܂'); +} else { + $host = $_GET['host']; +} + +$bbs = isset($_GET['bbs']) ? $_GET['bbs'] : ''; +$key = isset($_GET['key']) ? $_GET['key'] : ''; + +$rescount = isset($_GET['rescount']) ? intval($_GET['rescount']) : 1; +$popup = isset($_GET['popup']) ? intval($_GET['popup']) : 0; + +$itaj = P2Util::getItaName($host, $bbs); +if (!$itaj) { + $itaj = $bbs; +} +$itaj_hd = p2h($itaj, false); + +$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : ''; +$ttitle = (strlen($ttitle_en) > 0) ? UrlSafeBase64::decode($ttitle_en) : ''; +$ttitle_hd = p2h($ttitle); +$ttitle_urlen = rawurlencode($ttitle_en); +$ttitle_en_q = "&ttitle_en=" . $ttitle_urlen; + +$key_idx = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx'; + +// tH[̃IvVǂݍ +include P2_LIB_DIR . '/post_form_options.inc.php'; + +// \w +if (!$_conf['ktai']) { + $class_ttitle = ' class="thre_title"'; + $target_read = ' target="read"'; + $sub_size_at = ' size="40"'; +} else { + $class_ttitle = ''; + $target_read = ''; + $sub_size_at = ''; +} + +// {{{ XĂȂ +if (!empty($_GET['newthread'])) { + $ptitle = "{$itaj_hd} - VKXbh쐬"; + + // machibbsAJBBS@ Ȃ + if (P2HostMgr::isHostMachiBbs($host) or P2HostMgr::isHostJbbsShitaraba($host)) { + $submit_value = 'VK'; + // 2chȂ + } else { + $submit_value = 'VKXbh쐬'; + } + + $htm['subject'] = <<^CgF
    +EOP; + if ($_conf['ktai']) { + $htm['subject'] = "{$itaj_hd}
    ".$htm['subject']; + } + $newthread_hidden_ht = ''; +// }}} + +// {{{ ݂Ȃ +} else { + $ptitle = "{$itaj_hd} - X"; + + $submit_value = ""; + + $htm['resform_ttitle'] = <<{$ttitle_hd}

    +EOP; + $newthread_hidden_ht = ''; +} +// }}} + +$readnew_hidden_ht = !empty($_GET['from_read_new']) ? '' : ''; + + +//========================================================== +// HTMLvg +//========================================================== +echo $_conf['doctype']; +echo << + + + + + + {$_conf['extra_headers_ht']} + {$ptitle}\n +EOHEADER; + +if (!$_conf['ktai']) { + echo << + + \n +EOP; + if ($_conf['expack.editor.dpreview']) { + echo "\n"; + } + echo << + + \n +EOP; +} +// ۑJS +if ((!$_conf['ktai'] && $_conf['expack.editor.savedraft']) || + ($_conf['iphone'] && $_conf['expack.editor.mobile.savedraft'])) { + echo << +EOP; +} +// +live Kp^C}[ +if ($_GET['w_reg'] && $_conf['live.write_regulation']) { + $load_control = "cd_on()"; + if ($_conf['live.write_regulation'] == 3) { + $count_down_second = "31"; + } else if ($_conf['live.write_regulation'] == 2) { + $count_down_second = "21"; + } else if ($_conf['live.write_regulation'] == 1) { + $count_down_second = "11"; + } +} else { + $load_control = "cd_off()"; + $count_down_second = "0"; +} + +echo << + + +LIVE; + +$body_on_load = << +\n +EOP; + +P2Util::printInfoHtml(); + +// $htm['post_form'] 擾 +require_once P2_LIB_DIR . '/live/live_post_form.inc.php'; + +echo $htm['orig_msg']; +echo $htm['dpreview']; +echo $htm['post_form']; +echo $htm['dpreview2']; + +echo ''; + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/rep2/live_read.php b/rep2/live_read.php new file mode 100755 index 000000000..a03e8e17f --- /dev/null +++ b/rep2/live_read.php @@ -0,0 +1,448 @@ +authorize(); // [UF + +// +Wiki +require_once P2_LIB_DIR . '/wiki/read.inc.php'; + +// iPhone +if ($_conf['iphone']) { + include P2_LIB_DIR . '/toolbar_i.inc.php'; + define('READ_HEADER_INC_PHP', P2_LIB_DIR . '/read_header_i.inc.php'); + define('READ_FOOTER_INC_PHP', P2_LIB_DIR . '/read_footer_i.inc.php'); +// g +} elseif ($_conf['ktai']) { + define('READ_HEADER_INC_PHP', P2_LIB_DIR . '/read_header_k.inc.php'); + define('READ_FOOTER_INC_PHP', P2_LIB_DIR . '/read_footer_k.inc.php'); +// PC +} else { + define('READ_HEADER_INC_PHP', P2_LIB_DIR . '/read_header.inc.php'); + define('READ_FOOTER_INC_PHP', P2_LIB_DIR . '/read_footer.inc.php'); +} + +//================================================================ +// ϐ +//================================================================ +$newtime = date('gis'); // NNbNĂēǍȂdlɑ΍R_~[NG[ +// $_today = date('y/m/d'); + +//================================================= +// X̎w +//================================================= +detectThread(); // global $host, $bbs, $key, $ls + +//================================================= +// XtB^ +//================================================= +$do_filtering = false; +if (array_key_exists('rf', $_REQUEST) && is_array($_REQUEST['rf'])) { + $resFilter = ResFilter::configure($_REQUEST['rf']); + if ($resFilter->hasWord()) { + $do_filtering = true; + if ($_conf['ktai']) { + $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; + $resFilter->setRange($_conf['mobile.rnum_range'], $page); + } + if (empty($popup_filter) && isset($_REQUEST['submit_filter'])) { + $resFilter->save(); + } + } +} else { + $resFilter = ResFilter::restore(); +} + +//================================================= +// ځ[&NG[hݒǂݍ +//================================================= +$GLOBALS['ngaborns'] = NgAbornCtl::loadNgAborns(); + +//================================================================== +// C +//================================================================== + +if (!isset($aThread)) { + $aThread = new ThreadRead(); +} + +// ls̃Zbg +if (!empty($ls)) { + $aThread->ls = mb_convert_kana($ls, 'a'); +} + +//========================================================== +// idx̓ǂݍ +//========================================================== + +// host𕪉idxt@C̃pX߂ +if (!isset($aThread->keyidx)) { + $aThread->setThreadPathInfo($host, $bbs, $key); +} + +// ƒfBNg΍ +FileCtl::mkdirFor($aThread->keyidx); +FileCtl::mkdirFor($aThread->keydat); + +$aThread->itaj = P2Util::getItaName($host, $bbs); +if (!$aThread->itaj) { $aThread->itaj = $aThread->bbs; } + +// idxt@CΓǂݍ +if ($lines = FileCtl::file_read_lines($aThread->keyidx, FILE_IGNORE_NEW_LINES)) { + $idx_data = explode('<>', $lines[0]); +} else { + $idx_data = array_fill(0, 12, ''); +} +$aThread->getThreadInfoFromIdx(); + +//=========================================================== +// DAT̃_E[h +//=========================================================== +$offline = !empty($_GET['offline']); + +if (!$offline) { + $aThread->downloadDat(); +} + +// DATǂݍ +$aThread->readDat(); + +// ItCwłOȂ΁A߂ċǂݍ +if (empty($aThread->datlines) && $offline) { + $aThread->downloadDat(); + $aThread->readDat(); +} + +// ^Cg擾Đݒ +$aThread->setTitleFromLocal(); + +//=========================================================== +// \XԂ͈̔͂ݒ +//=========================================================== +if ($_conf['ktai']) { + $before_respointer = $_conf['mobile.before_respointer']; +} else { + $before_respointer = $_conf['before_respointer']; +} + +// 擾ς݂Ȃ +if ($aThread->isKitoku()) { + + //uVX̕\v͓̎ʂɂƑÕX\ + if (!empty($_GET['nt'])) { + if (substr($aThread->ls, -1) == '-') { + $n = $aThread->ls - $before_respointer; + if ($n < 1) { $n = 1; } + $aThread->ls = $n . '-'; + } + + } elseif (!$aThread->ls) { + $from_num = $aThread->readnum +1 - $_conf['respointer'] - $before_respointer; + if ($from_num < 1) { + $from_num = 1; + } elseif ($from_num > $aThread->rescount) { + $from_num = $aThread->rescount - $_conf['respointer'] - $before_respointer; + } + $aThread->ls = $from_num . '-'; + } + + if ($_conf['ktai'] && strpos($aThread->ls, 'n') === false) { + $aThread->ls = $aThread->ls . 'n'; + } + +// 擾Ȃ +} else { + if (!$aThread->ls) { + $aThread->ls = $_conf['get_new_res_l']; + } +} + +// tB^O̎́AallŒƂ +if ($resFilter && $resFilter->hasWord()) { + $aThread->ls = 'all'; +} + +$aThread->lsToPoint(); + +//=============================================================== +// vg +//=============================================================== +$ptitle_ht = p2h($aThread->itaj) . ' / ' . $aThread->ttitle_hd; + +if ($_conf['ktai']) { + include READ_HEADER_INC_PHP; + + echo "PĈݎł܂B"; + + include READ_FOOTER_INC_PHP; + +} else { + + // wb_ \ + include READ_HEADER_INC_PHP; + flush(); + + //=========================================================== + // [JDatϊHTML\ + //=========================================================== + // XAw肪 + if ($resFilter && $resFilter->hasWord() && $aThread->rescount) { + + $all = $aThread->rescount; + + $GLOBALS['filter_hits'] = 0; + + echo "

    {$all}X nXqbg

    \n"; + } + if ($_GET['showbl']) { + echo '

    ' . p2h($aThread->resrange['start']) . 'ւ̃X

    '; + } + + //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection("datToHtml"); + + if ($aThread->rescount) { + // ǂ\Ȃ̂Ŗ{̂ShowThreadPcg + // \ȂeŜAȂ̂ōŒ̏o͂ShowThreadLiveɕύX + require_once P2_LIB_DIR . '/live/live_ShowThreadLive.php'; + $aShowThread = new ShowThreadLive($aThread); + + if ($_conf['expack.spm.enabled']) { + echo $aShowThread->getSpmObjJs(); + } + + $res1 = $aShowThread->quoteOne(); // >>1|bvAbvp + + // Ă΂ȂIDJ[ȂǂfȂ̂ŌĂԂʂ͕\Ȃ + if ($_GET['showbl']) { + $aShowThread->getDatToHtml_resFrom(); + } else { + $aShowThread->getDatToHtml(); + } + + // XǐՃJ[ + if ($_conf['backlink_coloring_track']) { + echo $aShowThread->getResColorJs(); + } + + // IDJ[O + if ($_conf['coloredid.enable'] > 0 && $_conf['coloredid.click'] > 0) { + echo $aShowThread->getIdColorJs(); + } + + // {̑ + echo <<\n +LIVE; + + // Oc[ + $pluswiki_js = ''; + + if ($_conf['wiki.idsearch.spm.mimizun.enabled']) { + if (!class_exists('Mimizun', false)) { + require P2_PLUGIN_DIR . '/mimizun/Mimizun.php'; + } + $mimizun = new Mimizun(); + $mimizun->host = $aThread->host; + $mimizun->bbs = $aThread->bbs; + if ($mimizun->isEnabled()) { + $pluswiki_js .= "WikiTools.addMimizun({$aShowThread->spmObjName});"; + } + } + + if ($_conf['wiki.idsearch.spm.hissi.enabled']) { + if (!class_exists('Hissi', false)) { + require P2_PLUGIN_DIR . '/hissi/Hissi.php'; + } + $hissi = new Hissi(); + $hissi->host = $aThread->host; + $hissi->bbs = $aThread->bbs; + if ($hissi->isEnabled()) { + $pluswiki_js .= "WikiTools.addHissi({$aShowThread->spmObjName});"; + } + } + + if ($_conf['wiki.idsearch.spm.stalker.enabled']) { + if (!class_exists('Stalker', false)) { + require P2_PLUGIN_DIR . '/stalker/Stalker.php'; + } + $stalker = new Stalker(); + $stalker->host = $aThread->host; + $stalker->bbs = $aThread->bbs; + if ($stalker->isEnabled()) { + $pluswiki_js .= "WikiTools.addStalker({$aShowThread->spmObjName});"; + } + } + + if ($pluswiki_js !== '') { + echo << +// + +EOP; + } + + } elseif ($aThread->diedat && count($aThread->datochi_residuums) > 0) { + $aShowThread = new ShowThreadPc($aThread); + echo $aShowThread->getDatochiResiduums(); + } + + //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection("datToHtml"); + + // tB^ʂ\ + if ($resFilter && $resFilter->hasWord() && $aThread->rescount) { + echo << +// +\n +EOP; + if ($GLOBALS['filter_hits'] > 5) { + echo "

    {$all}X {$GLOBALS['filter_hits']}Xqbg

    \n"; + } + } + + // tb^ \ + include READ_FOOTER_INC_PHP; +} +flush(); + +//=========================================================== +// idx̒lݒAL^ +//=========================================================== +if ($aThread->rescount) { + + // ̎́AǐXVȂ + if ((isset($GLOBALS['word']) && strlen($GLOBALS['word']) > 0)) { + $aThread->readnum = $idx_data[5]; + } else { + $aThread->readnum = min($aThread->rescount, max(0, $idx_data[5], $aThread->resrange['to'])); + } + $newline = $aThread->readnum + 1; // $newline͔p~\肾A݊pɔÔ + + $sar = array($aThread->ttitle, $aThread->key, $idx_data[2], $aThread->rescount, '', + $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline, + $idx_data[10], $idx_data[11], $aThread->datochiok); + P2Util::recKeyIdx($aThread->keyidx, $sar); // key.idxɋL^ +} + +//=========================================================== +// L^ +// headline͍ŋߓǂ񂾃XɋL^Ȃ悤ɂĂ݂ +//=========================================================== +if ($aThread->rescount && $aThread->host != 'headline.2ch.net'&& $aThread->host != 'headline.5ch.net') { + recRecent(implode('<>', array($aThread->ttitle, $aThread->key, $idx_data[2], '', '', + $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline, + $aThread->host, $aThread->bbs))); +} + +// NGځ[L^ +NgAbornCtl::saveNgAborns(); + +// ȏ --------------------------------------------------------------- +exit; + +//=============================================================================== +// ֐ +//=============================================================================== +// {{{ detectThread() + +/** + * Xbhw肷 + */ +function detectThread() +{ + global $_conf, $host, $bbs, $key, $ls; + + list($nama_url, $host, $bbs, $key, $ls) = P2Util::detectThread(); + + if (!($host && $bbs && $key)) { + if ($nama_url) { + $nama_url = p2h($nama_url); + p2die('Xbh̎w肪ςłB', "{$nama_url}", true); + } else { + p2die('Xbh̎w肪ςłB'); + } + } +} + +// }}} +// {{{ recRecent() + +/** + * L^ + */ +function recRecent($data) +{ + global $_conf; + + $lock = new P2Lock($_conf['recent_idx'], false); + + // $_conf['recent_idx'] t@CȂΐ + FileCtl::make_datafile($_conf['recent_idx']); + + $lines = FileCtl::file_read_lines($_conf['recent_idx'], FILE_IGNORE_NEW_LINES); + $neolines = array(); + + // {{{ ŏɏdvf폜Ă + + if (is_array($lines)) { + foreach ($lines as $l) { + $lar = explode('<>', $l); + $data_ar = explode('<>', $data); + if (!$lar[1] || !strlen($lar[11])) { continue; } // sf[^폜 + if ($lar[1] == $data_ar[1] && $lar[11] == $data_ar[11]) { continue; } // key, bbsŏd + $neolines[] = $l; + } + } + + // }}} + + // VKf[^lj + array_unshift($neolines, $data); + + while (sizeof($neolines) > $_conf['rct_rec_num']) { + array_pop($neolines); + } + + // {{{ + + if ($neolines) { + $cont = ''; + foreach ($neolines as $l) { + $cont .= $l . "\n"; + } + + if (FileCtl::file_write_contents($_conf['recent_idx'], $cont) === false) { + p2die('cannot write file.'); + } + } + + // }}} + + return true; +} + +// }}} + +/* + * Local Variables: + * mode: php + * coding: cp932 + * tab-width: 4 + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ +// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker: diff --git a/rep2/login2ch.php b/rep2/login2ch.php index 14790a8d1..24ac1ac7b 100644 --- a/rep2/login2ch.php +++ b/rep2/login2ch.php @@ -157,6 +157,9 @@ function checkPass2ch(){ $tora3_url = "http://2ch.tora3.net/"; $tora3_url_r = P2Util::throughIme($tora3_url); +$tool_url = "https://maraga.jp/1.1/RoninTool.php"; +$tool_url_r = P2Util::throughIme($tool_url); + if (!$_conf['ktai']) { $id_input_size_at = " size=\"30\""; $pass_input_size_at = " size=\"24\""; @@ -190,7 +193,10 @@ function checkPass2ch(){ //================================================================ echo <<2ch IDɂ‚Ă̏ڍׂ͂灨 {$tora3_url}

    +

    +Ql𗧂c[͂灨 {$tool_url}
    +Q˂Qlɂ‚Ă̏ڍׂ͂灨 {$tora3_url} +

    EOP; if ($_conf['ktai']) { diff --git a/rep2/menu_async.php b/rep2/menu_async.php index 71fee6806..038ed9197 100644 --- a/rep2/menu_async.php +++ b/rep2/menu_async.php @@ -49,7 +49,7 @@ // }}} // {{{ {̏o -if (P2Util::isBrowserSafariGroup()) { +if (UA::isSafariGroup()) { $menuItem = P2Util::encodeResponseTextForSafari($menuItem); } echo $menuItem; diff --git a/rep2/menu_i.php b/rep2/menu_i.php index f210084ed..071a50b55 100644 --- a/rep2/menu_i.php +++ b/rep2/menu_i.php @@ -55,10 +55,10 @@ - + - + ŋߓǂ񂾃X̐V */ ?> -
  • ŋߓǂ񂾃X
  • +
  • ŋߓǂ񂾃X
  • ݗ
  • @@ -175,7 +175,7 @@
  • 摜LbVꗗ
  • Xbh
  • - +
  • XURL
  • Ǘ
  • ݒǗ
  • OCǗ
  • @@ -186,7 +186,7 @@ // }}} // {{{ G[ -if (P2Util::hasInfoHtml()) { +if (P2Util::hasInfoHtml()) { echo '
    '; P2Util::printInfoHtml(); echo '
    '; @@ -258,7 +258,7 @@ // }}} // {{{ RSS - if ($_conf['expack.rss.enabled']) { + if ($_conf['expack.rss.enabled']) { $rss = FavSetManager::getFavSetTitles('m_rss_set'); if (!$rss) { $rss = array(); @@ -292,7 +292,7 @@ } else { menu_iphone_show_favorite_boards('Cɔ'); - if ($_conf['expack.rss.enabled']) { + if ($_conf['expack.rss.enabled']) { menu_iphone_show_feed_list('RSS'); } } @@ -382,7 +382,28 @@ - +
    +
    + ő\
    + + 924 diff --git a/rep2/post.php b/rep2/post.php index d8ed63d59..f27c50afc 100644 --- a/rep2/post.php +++ b/rep2/post.php @@ -64,28 +64,33 @@ // ^uXy[X $MESSAGE = tab2space($MESSAGE); // ꕶ̎QƂ - $MESSAGE = p2h($MESSAGE); + $MESSAGE = strtr(p2h($MESSAGE), array( + '"' => '"', // " + '&' => '&', // & + ''' => ''', // ' + '<' => '<', // < + '>' => '>', // > + )); // URLN $MESSAGE = str_replace('tp://', 'tp://', $MESSAGE); // s̃Xy[X̎QƂ - $MESSAGE = preg_replace('/^ /m', ' ', $MESSAGE); + $MESSAGE = preg_replace('/^ /m', ' ', $MESSAGE); // ‘Xy[Ẍ–ڂ̎QƂ - $MESSAGE = preg_replace('/(?user_u . '/' . P2Util::normalizeHostName(P2Util::isHostBbsPink($host) ? 'www.bbspink.com' : P2Util::isHost2chs($host) ? 'www.2ch.net' : $host); // E@Ή - if ($p2cookies = CookieDataStore::get($cookie_key)) { - if (is_array($p2cookies)) { - if (array_key_exists('expires', $p2cookies)) { - // ؂Ȃj - if (time() > strtotime($p2cookies['expires'])) { - CookieDataStore::delete($cookie_key); - $p2cookies = null; - } +// cookie ǂݍ +$cookie_key = $_login->user_u . '/' . P2Util::normalizeHostName(P2HostMgr::isHostBbsPink($host) ? 'www.bbspink.com' : P2HostMgr::isHost2chs($host) ? 'www.2ch.net' : $host); // E@Ή +if ($p2cookies = CookieDataStore::get($cookie_key)) { + if (is_array($p2cookies)) { + if (array_key_exists('expires', $p2cookies)) { + // ؂Ȃj + if (time() > strtotime($p2cookies['expires'])) { + CookieDataStore::delete($cookie_key); + $p2cookies = null; } - } else { - CookieDataStore::delete($cookie_key); - $p2cookies = null; } } else { + CookieDataStore::delete($cookie_key); $p2cookies = null; } +} else { + $p2cookies = null; +} - // ڏ - $posted = postIt($host, $bbs, $key, $post); +// ڏ +$posted = postIt($host, $bbs, $key, $post); - // cookie ۑ - if ($p2cookies) { - CookieDataStore::set($cookie_key, $p2cookies); - } +// cookie ۑ +if ($p2cookies) { + CookieDataStore::set($cookie_key, $p2cookies); } // esL^폜 @@ -284,7 +300,7 @@ // d, keŷȂ͕̂sf[^ if (!$lar[1] || $lar[1] == $key) { continue; - } + } $neolines[] = $line; } } @@ -372,170 +388,105 @@ function postIt($host, $bbs, $key, $post) global $_conf, $post_result, $post_error2ch, $p2cookies, $popup, $rescount, $ttitle_en; global $bbs_cgi; - $method = 'POST'; - $bbs_cgi_url = 'http://' . $host . $bbs_cgi; - - $URL = parse_url($bbs_cgi_url); // URL - if (isset($URL['query'])) { // NG[ - $URL['query'] = '?' . $URL['query']; - } else { - $URL['query'] = ''; - } - - // vLV - if ($_conf['proxy_use']) { - $send_host = $_conf['proxy_host']; - $send_port = $_conf['proxy_port']; - $send_path = $bbs_cgi_url; + // ڑ悪2ch.netȂSSLʐMs(pink͑ΉĂȂ̂łȂ) + if (P2HostMgr::isHost2chs($host) && ! P2HostMgr::isHostBbsPink($host) && $_conf['2ch_ssl.post']) { + $bbs_cgi_url = 'https://' . $host . $bbs_cgi; } else { - $send_host = $URL['host']; - $send_port = isset($URL['port']) ? $URL['port'] : 80; - $send_path = $URL['path'] . $URL['query']; + $bbs_cgi_url = 'http://' . $host . $bbs_cgi; } - if (!$send_port) { $send_port = 80; } // ftHg80 + try { + $req = P2Commun::createHTTPRequest ($bbs_cgi_url,HTTP_Request2::METHOD_POST); - $request = "{$method} {$send_path} HTTP/1.0\r\n"; - $request .= "Host: {$URL['host']}\r\n"; - $request .= "User-Agent: Monazilla/1.00 ({$_conf['p2ua']})\r\n"; - $request .= "Referer: http://{$URL['host']}/\r\n"; + // wb_ + $req->setHeader('Referer', "http://{$host}/{$bbs}/{$key}/"); - // NbL[ - $cookies_to_send = ''; - if ($p2cookies) { - foreach ($p2cookies as $cname => $cvalue) { - if ($cname != 'expires') { - $cookies_to_send .= " {$cname}={$cvalue};"; + // NbL[ + if ($p2cookies) { + foreach ($p2cookies as $cname => $cvalue) { + if ($cname != 'expires') { + $req->addCookie($cname,$cvalue); + } } } - } - // be.2ch.net F؃NbL[ - if (P2Util::isHostBe2chNet($host) || !empty($_REQUEST['beres'])) { - $cookies_to_send .= ' MDMD='.$_conf['be_2ch_code'].';'; // be.2ch.net̔F؃R[h(pX[hł͂Ȃ) - $cookies_to_send .= ' DMDM='.$_conf['be_2ch_mail'].';'; // be.2ch.net̓o^[AhX - } - - if (!$cookies_to_send) { $cookies_to_send = ' ;'; } - $request .= 'Cookie:'.$cookies_to_send."\r\n"; - //$request .= 'Cookie: PON='.$SPID.'; NAME='.$FROM.'; MAIL='.$mail."\r\n"; - - $request .= "Connection: Close\r\n"; - - // {{{ POST̎̓wb_ljĖURLGR[hf[^Yt + // be.2ch.net F؃NbL[ + if (P2HostMgr::isHostBe2chs($host) || !empty($_REQUEST['beres'])) { + if ($_conf['be_2ch_DMDM'] && $_conf['be_2ch_MDMD']) { + $req->addCookie('DMDM', urlencode( rawurldecode( $_conf['be_2ch_DMDM']) ) ); + $req->addCookie('MDMD', urlencode( rawurldecode( $_conf['be_2ch_MDMD']) ) ); + } else { + $ar = P2Util::getBe2chCodeWithUserConf($host); // urlencodeꂽ܂܂̏ + if (is_array($ar)) { + $req->addCookie('DMDM', $ar['DMDM']); + $req->addCookie('MDMD', $ar['MDMD']); + } + } + } - if (strcasecmp($method, 'POST') == 0) { - $post_enc = array(); + // POSTe while (list($name, $value) = each($post)) { // or be.2ch.netȂAEUCɕϊ - if (P2Util::isHostJbbsShitaraba($host) || P2Util::isHostBe2chNet($host)) { + if (P2HostMgr::isHostJbbsShitaraba($host) || P2HostMgr::isHostBe2chs($host)) { $value = mb_convert_encoding($value, 'CP51932', 'CP932'); + } elseif (P2HostMgr::isHost2chs($host) && ! P2HostMgr::isHostBbsPink($host)) { + // 2chUnicode̕post + $value = html_entity_decode(mb_convert_encoding($value, 'UTF-8', 'CP932'),ENT_QUOTES,'UTF-8'); } - - $post_enc[] = $name . '=' . rawurlencode($value); + $req->addPostParameter($name, $value); } - $postdata = implode("&", $post_enc); - $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $request .= "Content-Length: ".strlen($postdata)."\r\n"; - $request .= "\r\n"; - $request .= $postdata; - } else { - $request .= "\r\n"; - } - // }}} - - // WEBT[o֐ڑ - $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); - if (!$fp) { - $errstr = p2h($errstr); - showPostMsg(false, "T[oڑG[: $errstr ($errno)
    p2 Error: ƒT[oւ̐ڑɎs܂", false); - return false; - } - stream_set_timeout($fp, $_conf['http_read_timeout'], 0); - - //echo '

    $request

    ' . $request . "

    "; //for debug - fputs($fp, $request); + // POSTf[^̑M + $response = P2Commun::getHTTPResponse($req); - $start_here = false; - $post_seikou = false; - - while (!p2_stream_eof($fp, $timed_out)) { - - if ($start_here) { - $wr = ''; - while (!p2_stream_eof($fp, $timed_out)) { - $wr .= fread($fp, 164000); + // Cookie擾 + $cookies = $response->getCookies(); + if ($cookies) { + foreach ($cookies as $cookie) { + if (!$p2cookies) { + $p2cookies = array(); + } + $p2cookies[ $cookie['name'] ] = $cookie['value']; } - $response = $wr; - break; + } - } else { - $l = fgets($fp, 164000); - //echo $l .'
    '; // for debug - // NbL[L^ - if (preg_match('/Set-Cookie: (.+?)\\r\\n/', $l, $matches)) { - //echo '

    ' . $matches[0] . '

    '; // - $cgroups = explode(';', $matches[1]); - if ($cgroups) { - foreach ($cgroups as $v) { - if (preg_match('/(.+)=(.*)/', $v, $m)) { - $k = ltrim($m[1]); - if ($k != 'path') { - if (!$p2cookies) { - $p2cookies = array(); - } - $p2cookies[$k] = $m[2]; - } - } - } - } - if ($p2cookies) { - $cookies_to_send = ''; - foreach ($p2cookies as $cname => $cvalue) { - if ($cname != 'expires') { - $cookies_to_send .= " {$cname}={$cvalue};"; - } - } - $newcookies = "Cookie:{$cookies_to_send}\r\n"; - - $request = preg_replace('/Cookie: .*?\\r\\n/', $newcookies, $request); - } + $code = $response->getStatus(); + $body = $response->getBody(); - // ]͏ݐƔf - } elseif (preg_match('/^Location: /', $l, $matches)) { - $post_seikou = true; - } - if ($l == "\r\n") { - $start_here = true; - } + if($response->getHeader('Location')) { + $post_seikou = true; } + } catch (Exception $e) { + $error_msg = $e->getMessage(); + showPostMsg(false, "T[oڑG[: {$error_msg}
    p2 Error: ƒT[oւ̐ڑɎs܂", false); } - fclose($fp); // be.2ch.net or JBBS R[hϊ EUCSJIS - if (P2Util::isHostBe2chNet($host) || P2Util::isHostJbbsShitaraba($host)) { - $response = mb_convert_encoding($response, 'CP932', 'CP51932'); + if (P2HostMgr::isHostBe2chs($host) || P2HostMgr::isHostJbbsShitaraba($host)) { + $body = mb_convert_encoding($body, 'CP932', 'CP51932'); // - $response = preg_replace( - '{(.*?)(.*)}is', - '$1$2', - $response); + $body = preg_replace( + '{(.*?)(.*)}is', + '$1$2', + $body); } $kakikonda_match = '{.*(?:݂܂| ݂܂ |ݏI - SubAll BBS).*}is'; $cookie_kakunin_match = '{| ݊mF |>݊mFB<}'; - if (preg_match('/<.+>/s', $response, $matches)) { - $response = $matches[0]; + if (preg_match('/<.+>/s', $body, $matches)) { + $body = $matches[0]; } // JLR~ - if ($post_seikou || preg_match($kakikonda_match, $response)) { - $reload = empty($_POST['from_read_new']); + if ($post_seikou || preg_match($kakikonda_match, $body)) { + $reload = (bool)$_conf['res_popup_reload']; + if (!empty($_POST['from_read_new'])) { + $reload = false; //@V܂Ƃߓǂ݂痈͋IɃ[h + } showPostMsg(true, '݂I܂B', $reload); // +Wiki samba^C}[ @@ -551,54 +502,17 @@ function postIt($host, $bbs, $key, $post) //echo "
    {$response_ht}
    "; // cookiemFipostă`Wj - } elseif (preg_match($cookie_kakunin_match, $response)) { - showCookieConfirmation($host, $response); + } elseif (preg_match($cookie_kakunin_match, $body)) { + showCookieConfirmation($host, $body); return false; // ̑̓X|X̂܂ܕ\ } else { - echo preg_replace('@Ń[hĂB GO!
    @', '', $response); + echo preg_replace('@Ń[hĂB GO!
    @', '', $body); return false; } } -// }}} -// {{{ postIt2() - -/** - * p2ŃX - * - * @return boolean ݐȂ trueAsȂ false - */ -function postIt2($host, $bbs, $key, $FROM, $mail, $MESSAGE) -{ - if (P2Util::isHostBe2chNet($host) || !empty($_REQUEST['beres'])) { - $beRes = true; - } else { - $beRes = false; - } - - try { - $posted = P2Util::getP2Client()->post($host, $bbs, $key, - $FROM, $mail, $MESSAGE, - $beRes, $response); - } catch (P2Exception $e) { - p2die('p2|Xgs', $e->getMessage()); - } - - if ($posted) { - $reload = empty($_POST['from_read_new']); - showPostMsg(true, '݂I܂B', $reload); - } else { - $result_msg = 'p2|Xgs

    ' - . '
    ' . p2h($response['body']) . '
    ' - . '

    -'; - showPostMsg(false, $result_msg, false); - } - - return $posted; -} - // }}} // {{{ showPostMsg() @@ -621,21 +535,33 @@ function showPostMsg($isDone, $result_msg, $reload) $ttitle_ht = "{$ttitle}"; $popup_ht = ''; + + // ݂ĂA[hB if ($isDone) { // 2005/03/01 aki: jiguEUɑΉ邽߁A& ł͂Ȃ & // 2005/04/25 rsk: EOJS; } else { + // |bvAbvł͖Ƃ͊ۂƃ[h $_conf['extra_headers_ht'] .= << EOP; @@ -675,14 +601,18 @@ function showPostMsg($isDone, $result_msg, $reload) EOSCRIPT; } - if ($reload) { - echo $popup_ht; - } + + echo $popup_ht; $kakunin_ht = ''; } else { - $kakunin_ht = <<mF

    EOP; + } } echo "\n"; @@ -827,6 +757,14 @@ function showCookieConfirmation($host, $response) $form->appendChild($elem); } + // [h + if (!empty($_POST['live'])) { + $elem = $hidden->cloneNode(); + $elem->setAttribute('name', 'live'); + $elem->setAttribute('value', '1'); + $form->appendChild($elem); + } + // r[w if ($_conf['b'] != $_conf['client_type']) { $elem = $hidden->cloneNode(); @@ -907,9 +845,9 @@ function showUnexpectedResponse($response, $line = null) echo 'p2 ERROR'; echo '

    p2 ERROR

    T[õX|XςłB'; if (is_numeric($line)) { - echo "({$line})"; + echo "(sԍF{$line})"; } - echo '

    ';
    +    echo '

    X|X(񍐂̍ۂ̓Xɏ)F

    ';
         echo p2h($response);
         echo '
    '; } @@ -960,18 +898,15 @@ function tab2space($in_str, $tabwidth = 4, $linebreak = "\n") while ($i < $ln) { $parts = explode("\t", rtrim($lines[$i])); $pn = count($parts); + $l = $parts[0]; - for ($j = 0; $j < $pn; $j++) { - if ($j == 0) { - $l = $parts[$j]; - } else { - //$t = $tabwidth - (strlen($l) % $tabwidth); - $sn = $tabwidth - (mb_strwidth($l) % $tabwidth); // UTF-8łSp2ƃJEg - for ($k = 0; $k < $sn; $k++) { - $l .= ' '; - } - $l .= $parts[$j]; + for ($j = 1; $j < $pn; $j++) { + //$t = $tabwidth - (strlen($l) % $tabwidth); + $sn = $tabwidth - (mb_strwidth($l) % $tabwidth); // UTF-8łSp2ƃJEg + for ($k = 0; $k < $sn; $k++) { + $l .= ' '; } + $l .= $parts[$j]; } $out_str .= $l; diff --git a/rep2/post_draft.php b/rep2/post_draft.php index 152585d0b..f1ca4fcfe 100644 --- a/rep2/post_draft.php +++ b/rep2/post_draft.php @@ -44,10 +44,10 @@ } // ΂livedoorړ]ɑΉBpostlivedoorƂB -$host = P2Util::adjustHostJbbs($host); +$host = P2HostMgr::adjustHostJbbs($host); // machibbsAJBBS@ Ȃ -if (P2Util::isHostMachiBbs($host) or P2Util::isHostJbbsShitaraba($host)) { +if (P2HostMgr::isHostMachiBbs($host) or P2HostMgr::isHostJbbsShitaraba($host)) { /* compact() array_combine() POSTl̔ẑŁA $post_param_keys $post_send_keys ̒l̏͑I */ //$post_param_keys = array('bbs', 'key', 'time', 'FROM', 'mail', 'MESSAGE', 'subject', 'submit'); diff --git a/rep2/post_form.php b/rep2/post_form.php index 8c47d1009..62cfe71a7 100644 --- a/rep2/post_form.php +++ b/rep2/post_form.php @@ -55,7 +55,7 @@ $ptitle = "{$itaj_hd} - VKXbh쐬"; // machibbsAJBBS@ Ȃ - if (P2Util::isHostMachiBbs($host) or P2Util::isHostJbbsShitaraba($host)) { + if (P2HostMgr::isHostMachiBbs($host) or P2HostMgr::isHostJbbsShitaraba($host)) { $submit_value = 'VK'; // 2chȂ } else { @@ -104,12 +104,15 @@ if (!$_conf['ktai']) { echo << \n EOP; if ($_conf['expack.editor.dpreview']) { echo "\n"; } +} +if (!$_conf['ktai'] || $_conf['iphone']) { echo << diff --git a/rep2/read.php b/rep2/read.php index 1d0fbb256..5e0939882 100644 --- a/rep2/read.php +++ b/rep2/read.php @@ -122,6 +122,11 @@ include READ_HEADER_INC_PHP; echo $preview; + echo <<
    +ǂ +
    +EOP; include READ_FOOTER_INC_PHP; return; @@ -154,7 +159,12 @@ if ($_conf['ktai']) { $before_respointer = $_conf['mobile.before_respointer']; } else { + // +live X\ؑ + if ($_GET['live']) { + $before_respointer = $_conf['live.before_respointer']; + } else { $before_respointer = $_conf['before_respointer']; + } } // 擾ς݂Ȃ @@ -185,7 +195,12 @@ // 擾Ȃ } else { if (!$aThread->ls) { + // +live X\ؑ + if ($_GET['live']) { + $aThread->ls = 'l' .$_conf['live.before_respointer']; + } else { $aThread->ls = $_conf['get_new_res_l']; + } } } @@ -209,7 +224,11 @@ $GLOBALS['filter_hits'] = null; } - $aShowThread = new ShowThreadK($aThread); + if ($_conf['iphone']) { + $aShowThread = new ShowThreadI($aThread); + } else { + $aShowThread = new ShowThreadK($aThread); + } if ($is_ajax) { $response = trim(mb_convert_encoding($aShowThread->getDatToHtml(true), 'UTF-8', 'CP932')); @@ -261,8 +280,13 @@ } else { + // +live wb_ؑ + if ($_GET['live']) { + P2Util::header_content_type(); + } else { // wb_ \ include READ_HEADER_INC_PHP; + } flush(); //=========================================================== @@ -292,23 +316,13 @@ } $res1 = $aShowThread->quoteOne(); // >>1|bvAbvp - if ($_conf['coloredid.enable'] > 0 && $_conf['coloredid.click'] > 0 && - $_conf['coloredid.rate.type'] > 0) { - if ($_GET['showbl']) { - $mainhtml = $aShowThread->datToHtml_resFrom(true); - } else { - $mainhtml .= $aShowThread->datToHtml(true); - } - $mainhtml .= $res1['q']; + + if ($_GET['showbl']) { + $mainhtml = $aShowThread->getDatToHtml_resFrom(); } else { - if ($_GET['showbl']) { - $aShowThread->datToHtml_resFrom(); - } else { - $aShowThread->datToHtml(); - } - echo $res1['q']; + $mainhtml .= $aShowThread->getDatToHtml(); } - + $mainhtml .= $res1['q']; // XǐՃJ[ if ($_conf['backlink_coloring_track']) { @@ -318,11 +332,12 @@ // IDJ[O if ($_conf['coloredid.enable'] > 0 && $_conf['coloredid.click'] > 0) { echo $aShowThread->getIdColorJs(); - // uEU׌ŷ߁ACSSXNvǧŃRec - // _O - echo $mainhtml; } + // uEU׌ŷ߁ACSSXNvǧŃRec + // _O + echo $mainhtml; + // Oc[ $pluswiki_js = ''; @@ -398,8 +413,17 @@ } } + // +live tb^ؑ + if ($_GET['live']) { + echo << + + +LIVE; + } else { // tb^ \ include READ_FOOTER_INC_PHP; + } } flush(); @@ -416,6 +440,17 @@ } $newline = $aThread->readnum + 1; // $newline͔p~\肾A݊pɔÔ +/* + + ܂̒iKȂ̂ŃRg + // ڑ悪 2ch / 5ch / pink ̏ꍇ idx extdat ۑ + if (!P2HostMgr::isHost2chs($host)) { + $aLastmodify = new LastmodifyTxt($host, $bbs); + echo "extdat:[". $aLastmodify->getThreadExtend($key) ."]
    \n"; + } + + */ + $sar = array($aThread->ttitle, $aThread->key, $idx_data[2], $aThread->rescount, '', $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline, $idx_data[10], $idx_data[11], $aThread->datochiok); @@ -424,8 +459,9 @@ //=========================================================== // L^ +// headline͍ŋߓǂ񂾃XɋL^Ȃ悤ɂĂ݂ //=========================================================== -if ($aThread->rescount && !$is_ajax) { +if ($aThread->rescount && !$is_ajax && $aThread->host != 'headline.2ch.net'&& $aThread->host != 'headline.5ch.net') { recRecent(implode('<>', array($aThread->ttitle, $aThread->key, $idx_data[2], '', '', $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline, $aThread->host, $aThread->bbs))); @@ -485,8 +521,8 @@ function recRecent($data) foreach ($lines as $l) { $lar = explode('<>', $l); $data_ar = explode('<>', $data); - if ($lar[1] == $data_ar[1]) { continue; } // keyŏd - if (!$lar[1]) { continue; } // keŷȂ͕̂sf[^ + if (!$lar[1] || !strlen($lar[11])) { continue; } // sf[^폜 + if ($lar[1] == $data_ar[1] && $lar[11] == $data_ar[11]) { continue; } // key, bbsŏd $neolines[] = $l; } } diff --git a/rep2/read_async.php b/rep2/read_async.php index 5c8c43ab3..fb936c373 100644 --- a/rep2/read_async.php +++ b/rep2/read_async.php @@ -133,7 +133,7 @@ // }}} // {{{ {̏o -if (P2Util::isBrowserSafariGroup()) { +if (UA::isSafariGroup()) { $node = P2Util::encodeResponseTextForSafari($node); } echo $node; @@ -145,14 +145,6 @@ exit; } - -// erԑg2chȂǂ̓OEidxEۑȂ -if (P2Util::isHostNoCacheData($aThread->host)) { - //@unlink($aThread->keydat); // ThreadRead::readDat()ō폜 - exit; -} - - //=========================================================== // idx̒lݒAL^ //=========================================================== diff --git a/rep2/read_filter_k.php b/rep2/read_filter_k.php index 61c379aef..f41f37354 100644 --- a/rep2/read_filter_k.php +++ b/rep2/read_filter_k.php @@ -23,6 +23,7 @@ $word_field_ht = ResFilterElement::getWordField(array( 'autocorrect' => 'off', 'autocapitalize' => 'off', + 'class' => 'form-control', )); } else { $word_field_ht = ResFilterElement::getWordField(); diff --git a/rep2/read_new.php b/rep2/read_new.php old mode 100644 new mode 100755 index 2416cebfc..9be0b2ac5 --- a/rep2/read_new.php +++ b/rep2/read_new.php @@ -27,17 +27,35 @@ //================================================= // ‚̎w //================================================= -if (isset($_GET['host'])) { $host = $_GET['host']; } -if (isset($_POST['host'])) { $host = $_POST['host']; } -if (isset($_GET['bbs'])) { $bbs = $_GET['bbs']; } -if (isset($_POST['bbs'])) { $bbs = $_POST['bbs']; } -if (isset($_GET['spmode'])) { $spmode = $_GET['spmode']; } -if (isset($_POST['spmode'])) { $spmode = $_POST['spmode']; } - -if ((!isset($host) || !isset($bbs)) && !isset($spmode)) { +if (isset($_GET['host'])) { + $host = $_GET['host']; +} elseif (isset($_POST['host'])) { + $host = $_POST['host']; +} +if (isset($_GET['bbs'])) { + $bbs = $_GET['bbs']; +} elseif (isset($_POST['bbs'])) { + $bbs = $_POST['bbs']; +} +if (isset($_GET['spmode'])) { + $spmode = $_GET['spmode']; +} elseif (isset($_POST['spmode'])) { + $spmode = $_POST['spmode']; +} + +if (!(isset($host) && isset($bbs)) && !isset($spmode)) { p2die('KvȈw肳Ă܂'); } +// ǐ +if (ctype_digit($_GET['unum_limit'])) { + $unum_limit = (int)$_GET['unum_limit']; +} elseif (ctype_digit($_POST['unum_limit'])) { + $unum_limit = (int)$_POST['unum_limit']; +} else { + $unum_limit = 0; +} + //================================================= // ځ[&NG[hݒǂݍ //================================================= @@ -119,32 +137,34 @@ + + \n EOHEADER; +// +live \ html popup ؊ +if ($_conf['live.view_type'] > 1 ) { + $live_view_popup = live_; +} + if ($_conf['iframe_popup_type'] == 1) { echo << - + EOP; } else { echo << + EOP; } -if ($_conf['link_youtube'] == 2 || $_conf['link_niconico'] == 2) { - echo <<\n -EOP; -} if ($_conf['expack.am.enabled']) { echo <<\n @@ -333,9 +353,7 @@ function pageLoaded() $subject_id = $aThread->host . '/' . $aThread->bbs; $aThread->setThreadPathInfo($aThread->host, $aThread->bbs, $aThread->key); - - // Xbhf[^idx擾 - $aThread->getThreadInfoFromIdx(); + $aThread->getThreadInfoFromIdx(); // Xbhf[^idx擾 // V̂(for subject) ========================================= if (!$aThreadList->spmode && $sb_view == 'shinchaku' && empty($_GET['word'])) { @@ -382,6 +400,12 @@ function pageLoaded() } } + // ǐ + if ($unum_limit > 0 && $aThread->unum >= $unum_limit) { + unset($aThread); + continue; + } + if ($aThread->isonline) { $online_num++; } // set P2Util::printInfoHtml(); @@ -505,7 +529,7 @@ function readNew($aThread) } //if (!$aThread->ls) { - $aThread->ls = "$from_num-"; + $aThread->ls = "{$from_num}-"; //} } @@ -769,7 +793,13 @@ function readNew($aThread) echo "
    "; } -$shinchaku_matome_url = "{$_conf['read_new_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}&nt={$newtime}"; +if ($unum_limit > 0) { + $unum_limit_at_a = "&unum_limit={$unum_limit}"; +} else { + $unum_limit_at_a = ''; +} + +$shinchaku_matome_url = "{$_conf['read_new_php']}?host={$aThreadList->host}&bbs={$aThreadList->bbs}&spmode={$aThreadList->spmode}&nt={$newtime}{$unum_limit_at_a}"; if ($aThreadList->spmode == 'merge_favita') { $shinchaku_matome_url .= $_conf['m_favita_set_at_a']; diff --git a/rep2/read_new_k.php b/rep2/read_new_k.php index d0d428d0d..91fa896cd 100644 --- a/rep2/read_new_k.php +++ b/rep2/read_new_k.php @@ -23,8 +23,8 @@ $sb_view = 'shinchaku'; $newtime = date('gis'); -$newthre_num = 0; $online_num = 0; +$newthre_num = 0; //================================================= // ‚̎w @@ -50,9 +50,9 @@ } // ǐ -if (isset($_GET['unum_limit'])) { +if (ctype_digit($_GET['unum_limit'])) { $unum_limit = (int)$_GET['unum_limit']; -} elseif (isset($_POST['unum_limit'])) { +} elseif (ctype_digit($_POST['unum_limit'])) { $unum_limit = (int)$_POST['unum_limit']; } else { $unum_limit = 0; @@ -72,7 +72,7 @@ // ‚ƃ[h̃Zbg =================================== $ta_keys = array(); if ($spmode) { - if ($spmode == "taborn" or $spmode == "soko") { + if ($spmode == 'taborn' or $spmode == 'soko') { $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs)); } $aThreadList->setSpMode($spmode); @@ -130,6 +130,7 @@ // iPhone if ($_conf['iphone']) { $_conf['extra_headers_ht'] .= << EOS; // ImageCache2 @@ -150,7 +151,6 @@ if ($_conf['expack.aas.enabled'] || $_conf['expack.ic2.enabled']) { $_conf['extra_headers_ht'] .= << -