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)
+// OFgpOC 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̔FR[h(pX[hł͂Ȃ)
-$conf_user_def['be_2ch_code'] = ""; // ("")
+// be.2ch.net̔FpX[h(FR[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[WBICURLB
-$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)',
+);
+
+// APIFSSLgp
+$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[Xpɕϊ (: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ł̕sCD悷邽ߓˑ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 [hw(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^ꂽÕNrep2ŊJ悤ɂiJaneƓj
+* 0˂XNvggpỎߋ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[̕sC
+* ݂Ɏsۂ̃G[bZ[WύX
+* DAŤmF邽߂read.cgiANZXLbV悤ɕύX
+* ̃o[Wȍ~ʼnߋOqɂ荞XDATĎ擾Ȃ悤ɕύX
+* IE11IE6̃R[hsĉۑ@\ȂsC
+
+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 ł̋DATIbZ[WG[悤ɂ
+
+171018.1540
+* bintan ǂݍݑΉ
+* QlOCp2chv.tora3.netSSLK{ɂȂ̂őΉ
+* X}z readF|bvAbv̕{^ۂɑ̃|bvAbvYɕsC
+* subject̃`FbN{bNX@\ȂsC
+* X}zFV܂Ƃߓǂ݂珑ۂɃ[hȂ悤ɕύX
+* V܂Ƃߓǂ݂珑ۂɏ݃EChE悤ɕύX
+
+171013.2230
+* X}zFꕔ̊ŃXCvj[삵ȂsC
+* X}z:res_popup_reload̐ݒ肪fȂsC
+* PHP7.1ŃX^CgpWarningosC
+* cURLMultiL̂fetch-subject-txt.phpPECL_HTTP`FbN폜
+* expack.ic2.enabled2ɂPCANZXfatal errorosC
+
+171011.1515
+* X}zpread̃c[o[|bvAbvj[`ɕύX
+* X}zpread̊ONtarget="_blank"w
+* X}zp摜\̃{^ɑčׂsC
+* 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[osC
+* X^CSSLK{ɂȂ̂ŏC
+* ꕔ̊ŃXꗗ\ۂɌxosC
+
+171005.1930
+* ˑCuXVicomposer updateK{j
+* X}zpŋߓǂXꗗɍXV{^lj
+* ɔIɍXVȂ悤ɕύXiPCƓj
+* Ïړ]ɑΉ邽߁A2ch(sc)open2chDATۑfBNgύX
+* dl̃fBNgDATLƂ͂D悷
+* 5chbΉ
+* rss[_[삵ȂsC
+* rss[_[HTTPSURLljłȂsC
+* X}zy[WbootstrapljĈꕔfUCύX
+* `FbN̍ŒPHP5.6ȏɕύX
+
+170921.1800
+* vip2ch.comǂݍݑΉ
+* 2chUnicodeGeɑΉ
+* PHP7.1łꂪǂ߂ȂsC
+* TorȂsC
+* 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ߓǂ݂Ǝ삵ȂŝŏC
+* N&lstȂ悤ɕύX
+* [U[ݒǗ+Wikisamba^C}[Ɋւݒ荀ڂ\悤ɕύX
+
+160409.1000
+* NGXbh@\삵ȂsC
+* 摜uURL삵ȂsC
+* тURLXV
+* composer.jsonURLXVĐVKCXg[̕sC
+
+160309.0710
+* ȉ̕ύX_killer4989̃pb`荞
+* SOCKS5ڑtorڑ@\ĂȂsC
+* 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[_퓮삵ȂsC
+* RSS[_HTTP_Request2ɑ݂ȂĂяoĂ폜
+* P2Util::fileDownloadIf-Modified-Since𑗐MȂsC
+* 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˂XNvggpỎߋODAT荞ݑΉ
+* headline.2ch.netŋߓǂXɒNjLȂ悤ɕύX
+* FirefoxŃX}zp\sC
+* 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삵ȂsC
+* ̑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ڑłSSLW̐ݒ悤ɕύX
+* 2ch.netƂSSLʐMݒőIׂ悤ɕύX
+* ݂ŗOۂɃG[bZ[W\ȂsC
+* ̑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)ɑΉĂȂsC
+* dig2chŁuōi荞ށvɑΉ
+* u[h|bvAbvɂ悤ɕύX
+* X|bvAbv(quote_res_view)ȂƂɎ[hIDFÂ(coloredid)ȂsC
+
+150320.1020
+* |bvAbv珑ݐɃXēǂݍ݂Ȃݒlj
+* [h݂̏CookiemFꍇ[hɖ߂ȂsC
+* eiXコ邽live_ShowThreadPc.phplive_ShowThread.php̑
+* live_ShowThreadLive.phpƖ{̂ShowThread.phpgp悤ɕύX
+* ۑ(expack.editor.savedraft)ȂƂɎ[h珑߂ȂsC
+* X^CWarningosC
+
+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폜sC
+* IDFÂȂݒ̍ۂID̕\ȂsC
+* 2chDATIɔOjlj
+* {Ƃ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
+OUser-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ꍇ͍ĔFsKv܂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ƔFEF؉EĔFsƂo܂B
+ʏdat擾2chapi_intervalɐݒ肵ԊuŎIɔFs܂A
+2ch API̔F؏ύXꍇ͎蓮ōĔFsKv܂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
+
+
+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(Oo^\ɂȂĂ邽)
+ 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('',
'', $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擾
+ * iFR[hurlencodeꂽ܂܂̏ԁj
*
- * @param void
- * @return P2Client
+ * @access public
+ * @param string $host BeFzXg
+ * @return array|false|null FR[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擾
+ * iFR[hurlencodeꂽ܂܂̏ԁj
+ *
+ * @access private
+ * @param string $host BeFzXg
+ * @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ɂ́APHPcURLOpenSSLLł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 = "
+
@@ -182,6 +201,10 @@ function sf() {
|
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 @@
@@ -70,6 +91,7 @@
+
ita;
}
?>
-.
+ .\">
tkey); ?>(bid]->hits; ?>)
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 "{$profile['cm0']}";}
+ if ($_conf['test.search_dig2ch']) { echo ""; echo $profile['cm0'];echo $profile['cm1'];echo $profile['cm2'];echo "";}
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ʼnB
+ // 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()
{$_conf['k_accesskey_st'][3]}Cɔ
{$_conf['k_accesskey_st'][4]}ؽ
{$_conf['k_accesskey_st'][5]}ŋߓǂڂ̐V
-{$_conf['k_accesskey_st'][6]}ŋߓǂڂ̑S
+{$_conf['k_accesskey_st'][6]}ŋߓǂڂ̑S
{$_conf['k_accesskey_st'][7]} ۸
{$_conf['k_accesskey_st'][8]}ڂ̓a
{$_conf['k_accesskey_st'][9]}۸݊Ǘ
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 @@
+ 0) {
+ // QƃubN\ponclickݒ
+ $tores .= "\n";
+ } else {
+ $tores .= " \n";
+ }
+ $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
+
+?>
\ 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 @@
+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("{ ((\?#*)|(Lv\.\d+))}", array($this, 'iframePopupCallback'), $date_id);
+ }
+
+ // NGbZ[Wϊ
+ if ($ng_type != self::NG_NONE && count($ng_info)) {
+ $ng_info = implode(', ', $ng_info);
+ $msg = << {$ng_info}
+{$msg}
+EOMSG;
+ }
+
+ // NGl[ϊ
+ if ($ng_type & self::NG_NAME) {
+ $name = <<{$name}
+EONAME;
+ $msg = <<{$msg}
+EOMSG;
+
+ // NG[ϊ
+ } elseif ($ng_type & self::NG_MAIL) {
+ $mail = <<{$mail}
+EOMAIL;
+ $msg = <<{$msg}
+EOMSG;
+
+ // NGIDϊ
+ } elseif ($ng_type & self::NG_ID) {
+ $date_id = <<{$date_id}
+EOID;
+ $msg = <<{$msg}
+EOMSG;
+
+ }
+
+ /*
+ //uVv摜}
+ if ($i == $this->thread->readnum +1) {
+ $tores .= <<
+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 .= <<
+//
+\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 @@
+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 <<
+
+ \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 @@
+_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 @@
+_highlight_nums));
+ $highlight_chain_nums = "(" . $highlight_chain_nums . ")(?!\d)(?![^<]*>)"; // ꕔĂ܂AJ[HTML^OɃ}b`Ȃ
+ $msg = preg_replace("(((?:>||-)+)($highlight_chain_nums))", "$1$2", $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)", "\\1", $msg);
+ } else {
+ $highlight_msgs = preg_replace("(<(regex|regex:i|i)>)", "", $highlight_msgs);
+ $msg = mb_ereg_replace("($highlight_msgs)", "\\1", $msg);
+ }
+}
+
+// nCCgl[ϊ
+if ($ng_type & self::HIGHLIGHT_NAME) {
+ $name = preg_replace("(|)", "", $name);
+ $name = "$name";
+}
+
+// nCCg[ϊ
+if ($ng_type & self::HIGHLIGHT_MAIL) {
+ $mail = "$mail";
+}
+
+// nCCgIDϊ
+if ($ng_type & self::HIGHLIGHT_ID) {
+ $date_id = preg_replace("((ID:))", "$1", $date_id ."");
+}
+
+?>
\ 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 @@
+OF';
+ $htm['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;
+} elseif ($_conf['ktai'] && $_conf['expack.editor.mobile.savedraft']) {
+ $savedraft = <<
+EOP;
+}
+
+// R[hp擪ɎdނƂmb_convert_variables()̎
+$htm['post_form'] = <<
+ {$ttitle_pfi}
+{$htm['maru_post']}
+{$htm['name_label']}
+{$htm['mail_label']}
+{$htm['sage_cb']}
+{$htm['options']}
+{$htm['src_fix']}
+{$htm['block_submit']}
+
+
+
+{$htm['beres']}
+{$htm['p2res']}
+{$htm['samba']}
+{$htm['k_br']}{$savedraft}
+{$upload_form}
+
+
+
+
+
+
+
+
+
+
+
+
+
+{$newthread_hidden_ht}{$readnew_hidden_ht}
+{$_conf['detect_hint_input_ht']}
+
+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 @@
+ | |