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';
/*
* �ʏ�̓Z�b�V�����t�@�C���̃��b�N�҂����ɗ͒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�ϊ��Ɏ��s�������������l�Q�Ƃɒ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', // ���O�C������ (�f�[�^PHP)
'login_failed_log_file' => 'p2_login_failed.dat.php', // ���O�C�����s���� (�f�[�^PHP)
+ 'sid2chapi_php' => 'p2_sid2chapi.php', // 2ch API�Z�b�V����ID�L�^�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)
-// �l�b�g���[�N�ڑ��^�C���A�E�g���� (�b)
-// @deprecated use $_conf['http_conn_timeout'] and $_conf['http_read_timeout']
-$_conf['fsockopen_time_limit'] = 7; // (7)
-
// HTTP�ڑ��^�C���A�E�g���� (�b)
-$_conf['http_conn_timeout'] = 2; // (2)
+$_conf['http_conn_timeout'] = 5; // (5)
// HTTP�Ǎ��^�C���A�E�g���� (�b)
-$_conf['http_read_timeout'] = 8; // (8)
+$_conf['http_read_timeout'] = 10; // (10)
// p2�̍ŐV�o�[�W�����������`�F�b�N(����:1, ���Ȃ�:0)
$_conf['updatan_haahaa'] = 1; // (1)
@@ -111,6 +107,9 @@
// �V���܂Ƃߓǂ݂̃L���b�V�����c���� (����:0, ����:-1)
$_conf['matome_cache_max'] = 5; // (5)
+// �O���F���g�p�������O�C�� �i����:1, ���Ȃ�:0�j
+$_conf['external_authentication'] = 0; // (0)
+
// }}}
// ----------------------------------------------------------------------
// {{{ �g�уA�N�Z�X�L�[
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�ł���) ��library�f�B���N�g���ւ̃p�X
$_conf['expack.zf_path'] = ""; // ("")
+// curl �ɂ�����_�E�����[�h��L���ɂ���
+// (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�����[�h��L���ɂ���
// (off:0, on:1, �R�}���h���C���Ŏ��s:2)
-$_conf['expack.use_pecl_http'] = 1; // (1)
+$_conf['expack.use_pecl_http'] = 0; // (0)
// expack.use_pecl_http �� 2 ����CLI�pphp.ini��http�G�N�X�e���V������
// ���[�h����悤�ɂȂ��Ă��Ȃ��ꍇ�̂� 1 �ɂ���
$_conf['expack.dl_pecl_http'] = 0; // (0)
+// �X���^�C������dig.2ch.net�ōs��
+$_conf['test.search_dig2ch'] = 1; // (1)
+
+
// }}}
// {{{ �X�L��
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�^�C�g��
$_conf['expack.ic2.getter.title'] = "ImageCache2::Getter";
-// �T�[�o�ɐڑ�����ۂɃ^�C���A�E�g����܂ł̎��ԁi�b�j
-$_conf['expack.ic2.getter.conn_timeout'] = 5;
-
-// �_�E�����[�h���^�C���A�E�g����܂ł̎��ԁi�b�j
-$_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.net�A�J�E���g
-// be.2ch.net�̔F�R�[�h(�p�X���[�h�ł͂Ȃ�)
-$conf_user_def['be_2ch_code'] = ""; // ("")
+// be.2ch.net�̔F�p�X���[�h(�F�R�[�h�͎g���Ȃ��Ȃ�܂���)
+$conf_user_def['be_2ch_password'] = ""; // ("")
// be.2ch.net�̓o�^���[���A�h���X
$conf_user_def['be_2ch_mail'] = ""; // ("")
-// }}}
-// {{{ p2.2ch.net�A�J�E���g
-
-// 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�^���[���A�h���X
-$conf_user_def['p2_2ch_mail'] = ""; // ("")
+// be.2ch.net��DMDM(�蓮�ݒ肷��ꍇ�̂ݓ���)
+$conf_user_def['be_2ch_DMDM'] = ""; // ("")
-// p2.2ch.net�̃��O�C���p�X���[�h
-$conf_user_def['p2_2ch_pass'] = ""; // ("")
-
-// p2.2ch.net Cookie�F�؎���IP�A�h���X�̓��ꐫ���`�F�b�N
-$conf_user_def['p2_2ch_ignore_cip'] = 0; // (0)
-$conf_user_rad['p2_2ch_ignore_cip'] = array('0' => '�`�F�b�N����', '1' => '�`�F�b�N���Ȃ�');
+// be.2ch.net��MDMD(�蓮�ݒ肷��ꍇ�̂ݓ���)
+$conf_user_def['be_2ch_MDMD'] = ""; // ("")
// }}}
// {{{ PATH
// �E�������ɍŏ��ɕ\�������y�[�W�B�I�����C��URL���B
-$conf_user_def['first_page'] = "first_cont.php"; // ("first_cont.php")
+$conf_user_def['first_page'] = "first_cont.php"; // ("first_cont.php")
/*
���X�g�̓I�����C���ƃ��[�J���̗�������ǂݍ��߂�
@@ -59,9 +48,9 @@
// �X���b�h�ꗗ�̎����X�V�Ԋu�B�i���w��B0�Ȃ玩���X�V���Ȃ��B�j
$conf_user_def['refresh_time'] = 0; // (0)
-// �X���b�h�ꗗ�Ŗ��擾�X���ɑ��Č��X���ւ̃����N�i�E�j��\�� (����:1, ���Ȃ�:0)
+// �X���b�h�ꗗ�Ŗ��擾�X���ɑ��Č��X���ւ̃����N�i�E�j��\�� (����: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�{�����A�X���b�h�ꗗ�i�\���j�� ����ޭ�>>1 ��\�� (����:1, ���Ȃ�:0, �j���[�X�n�̂�:2)
$conf_user_def['sb_show_one'] = 0; // (0)
@@ -86,7 +75,7 @@
// �\���̃X���b�h�ꗗ�ł̃f�t�H���g�̃\�[�g�w��
$conf_user_def['sb_sort_ita'] = 'ikioi'; // ('ikioi')
$conf_user_sel['sb_sort_ita'] = array(
- 'midoku' => '�V��', 'res' => '���X', 'no' => 'No.', 'title' => '�^�C�g��', // 'spd' => '���₳',
+ 'midoku' => '�V��', 'res' => '���X', 'no' => 'No.', 'title' => '�^�C�g��', // 'spd' => '���₳',
'ikioi' => '����', 'bd' => 'Birthday'); // , 'fav' => '���C�ɃX��'
// �V���\�[�g�ł́u�����Ȃ��v�́u�V�����[���v�ɑ���\�[�g�D�揇�� (���: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' => '���Ȃ�');
+// �X���b�h�̃^�C�g�����璘�쌠�\�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�щ{�����A��x�ɕ\������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' => '����');
+// �X���b�h�쐬�����̕\���t�H�[�}�b�g
+$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');
-// YouTube�̃����N���v���r���[�\���i����:1, ���Ȃ�:0, �蓮�ł���:2�j
-$conf_user_def['link_youtube'] = 1; // (1)
-$conf_user_rad['link_youtube'] = array('1' => '����', '0' => '���Ȃ�', '2' => '�蓮�ł���');
-
-// �j�R�j�R����̃����N���v���r���[�\���i����:1, ���Ȃ�:0, �蓮�ł���:2�j
-$conf_user_def['link_niconico'] = 1; // (1)
-$conf_user_rad['link_niconico'] = array('1' => '����', '0' => '���Ȃ�', '2' => '�蓮�ł���');
-
// HTML�|�b�v�A�b�v�i����:1, ���Ȃ�:0, p�ł���:2, �摜�ł���:3�j
$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' => '�I���W�i��', '1' => 'thermon��');
+// �܂�BBS�Ń����[�g�z�X�g����\��
+$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���ځ[��̑ΏۂɂȂ������X��ID�������I��NG���ځ[��(����:1, ���Ȃ�:0 NG�ɂ���:2)
+$conf_user_def['ngaborn_auto'] = 0; // (0)
+$conf_user_rad['ngaborn_auto'] = array('1' => '����', '0' => '���Ȃ�');
+
// �\���͈͊O�̃��X���A��NG���ځ[��̑Ώۂɂ���(����:1, ���Ȃ�:0)
// �������y�����邽�߁A�f�t�H���g�ł͂��Ȃ�
$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 ���g�p����
+$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'] = ""; // ("")
+
+// API�F�Ŏg�p����User-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�擾�Ŏg�p����User-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)',
+);
+
+// API�F��SSL���g�p����
+$conf_user_def['2chapi_ssl.auth'] = 1; // (1)
+$conf_user_rad['2chapi_ssl.auth'] = array('1' => '����', '0' => '���Ȃ�');
+
+// DAT�擾��SSL���g�p����
+$conf_user_def['2chapi_ssl.read'] = 1; // (1)
+$conf_user_rad['2chapi_ssl.read'] = array('1' => '����', '0' => '���Ȃ�');
+
+// �f�o�b�O�p�̏����o�͂���
+$conf_user_def['2chapi_debug_print'] = 0; // (0)
+$conf_user_rad['2chapi_debug_print'] = array('1' => '����', '0' => '���Ȃ�');
+
+// 2ch API ���g�p����
+$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' => '���Ȃ�');
+// �|�b�v�A�b�v���珑�����ݐ���������X�����ēǂݍ��݂���(����:1, ���Ȃ�:0)
+$conf_user_def['res_popup_reload'] = 1; // (1)
+$conf_user_rad['res_popup_reload'] = array('1' => '����', '0' => '���Ȃ�');
+
// �O��URL�W�����v����ۂɒʂ��Q�[�g
// �u���ځv�ł�Cookie���g���Ȃ��[���ł� 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�ŃA�N�Z�X���Ă���Ƃ��͊O��URL�Q�[�g��ʂ��Ȃ��iHTTPS�ł͒�:1, ��ɒʂ�:0�j
@@ -421,11 +484,13 @@
$conf_user_rad['through_ime_http_only'] = array('1' => 'HTTPS�ł͒�', '0' => '��ɒʂ�');
// �Q�[�g�Ŏ����]�����Ȃ��g���q�i�J���}���ŁA�g���q�̑O�̃s���I�h�͕s�v�j
-$conf_user_def['ime_manual_ext'] = "exe,zip"; // ("exe,zip")
+$conf_user_def['ime_manual_ext'] = "exe,zip"; // ("exe,zip")
+/*
// ���C�ɃX�����L�ɎQ���i����:1, ���Ȃ�:0�j
$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�щ{�����A�p�P�b�g�ʂ����炷���߁A�S�p�p���E�J�i�E�X�y�[�X�p�ɕϊ� (����:1, ���Ȃ�:0)
-$conf_user_def['mobile.save_packet'] = 1; // (1)
+$conf_user_def['mobile.save_packet'] = 1; // (1)
$conf_user_rad['mobile.save_packet'] = array('1' => '����', '0' => '���Ȃ�');
// �v���L�V�𗘗p(����:1, ���Ȃ�:0)
@@ -472,6 +537,42 @@
// �v���L�V�|�[�g ex)"8080"
$conf_user_def['proxy_port'] = ""; // ("")
+// �v���L�V���[�U�[�� (�g�p����ꍇ�̂�)
+$conf_user_def['proxy_user'] = ""; // ("")
+
+// �v���L�V�p�X���[�h (�g�p����ꍇ�̂�)
+$conf_user_def['proxy_password'] = ""; // ("")
+
+// �v���L�V�̎��
+$conf_user_def['proxy_mode'] = "http"; // ("http")
+$conf_user_sel['proxy_mode'] = array(
+ 'socks5' => 'SOCKS5 �v���L�V',
+ 'http' => 'HTTP �v���L�V',
+);
+
+// Tor �f����(.onion �h���C��)�̃A�N�Z�X�� Tor ���g�p(����:1, ���Ȃ�:0)
+$conf_user_def['tor_use'] = 0; // (0)
+$conf_user_rad['tor_use'] = array('1' => '����', '0' => '���Ȃ�');
+
+// Tor �v���L�V�z�X�g ex)"127.0.0.1", "www.p2proxy.com"
+$conf_user_def['tor_proxy_host'] = ""; // ("")
+
+// Tor �v���L�V�|�[�g ex)"8080"
+$conf_user_def['tor_proxy_port'] = ""; // ("")
+
+// Tor �v���L�V���[�U�[�� (�g�p����ꍇ�̂�)
+$conf_user_def['tor_proxy_user'] = ""; // ("")
+
+// Tor �v���L�V�p�X���[�h (�g�p����ꍇ�̂�)
+$conf_user_def['tor_proxy_password'] = ""; // ("")
+
+// Tor �v���L�V�̎��
+$conf_user_def['tor_proxy_mode'] = "socks5"; // ("socks5")
+$conf_user_sel['tor_proxy_mode'] = array(
+ 'socks5' => 'SOCKS5 �v���L�V',
+ 'http' => 'HTTP �v���L�V',
+);
+
// �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%")
-
-
-// �����O�C�����A�܂���openssl�Ŏ��݂�B��PHP 4.3.0�ȍ~�ŁAOpenSSL���ÓI�Ƀ����N����Ă���K�v������
-$conf_user_def['precede_openssl'] = 0; // (0)
-$conf_user_rad['precede_openssl'] = array('1' => 'Yes', '0' => 'No');
-
-// curl���g�����A�R�}���h���C���ł�PHP���łǂ����D�悷�邩 (�R�}���h���C����:0, PHP����:1)
-$conf_user_def['precede_phpcurl'] = 0; // (0)
-$conf_user_rad['precede_phpcurl'] = array('0' => '�R�}���h���C����', '1' => 'PHP����');
+$conf_user_def['frame_read_width'] = "60%"; // ("60%")
+
+// 3�y�C����ʂ̃t���[���̕��ו�
+$conf_user_def['pane_mode'] = 0; // (0)
+$conf_user_rad['pane_mode'] = array('0' => '�W���i�Ɍ`�j', '1' => '�����i��`�j');
+
+// SSL�ʐM�̐ڑ���������邽�߂Ɏg�p����ؖ������i�[���ꂽ�f�B���N�g�� �����ł��Ȃ����̂ݎw��
+$conf_user_def['ssl_capath'] = ""; // ()
+
+// 2ch.net��subjec.txt��SETTING.TXT�̎擾��SSL���g�p����
+$conf_user_def['2ch_ssl.subject'] = 0; // (0)
+$conf_user_rad['2ch_ssl.subject'] = array('1' => '����', '0' => '���Ȃ�');
+
+// 2ch.net�̏������݂�SSL���g�p����
+$conf_user_def['2ch_ssl.post'] = 0; // (0)
+$conf_user_rad['2ch_ssl.post'] = array('1' => '����', '0' => '���Ȃ�');
+
+// �Q�l�̗L�������\��
+$conf_user_def['disp_ronin_expiration'] = 0; // (0)
+$conf_user_sel['disp_ronin_expiration'] = array(
+ '0' => '����',
+ '1' => '�G���[�������̏ꍇ�̂ݕ\��',
+ '2' => '�^�C�g����ʂ̂ݕ\��',
+ '3' => '���Ȃ�'
+);
// }}}
// {{{ �g���p�b�N��iPhone
@@ -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' => '���Ȃ�');
// �{������łȂ����`�F�b�N
-$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 �`�F�b�N
-$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�ɐڑ�����ۂɃ^�C���A�E�g����܂ł̎��ԁi�b�j[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���^�C���A�E�g����܂ł̎��ԁi�b�j[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�\���̃w�b�_�ƃt�b�^�[�Ɏ����\���ւ̃����N��\��
+$conf_user_def['live.livelink_thread'] = "2"; // ("2")
+$conf_user_sel['live.livelink_thread'] = array('2' => '�S�Ă̔ŕ\��', '1' => '�����̂ݕ\��', '0' => '�\�����Ȃ�');
+
+// �����̃X���b�h����Ɏ����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' => '��Ƀf�t�H���g�\��', '1' => '�������̂ݎ����p�\��', '2' => '��Ɏ����p�\��');
+
+// ID������ O (�g��) P (����p2) Q (�t���u���E�U) I (iPhone) ����
+$conf_user_def['live.id_b'] = 0; // (0)
+$conf_user_rad['live.id_b'] = array('1' => '����', '0' => '���Ȃ�');
+
+// �A���n�C���C�g (�\���͈͂̃��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")
+
+// �f�t�H���g�̖������̕\��
+$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�ƃX�y�[�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���_�u���N���b�N');
+
+// �����K���p�^�C�}�[
+$conf_user_def['live.write_regulation'] = 0; // (0)
+$conf_user_sel['live.write_regulation'] = array('0' => '�^�C�}�[����', '1' => '15�b', '2' => '20�b', '3' => '30�b', '4' => '40�b', '5' => '50�b', '6' => '1��');
+
+// ImageCache2�̃T���l�C���쐬
+$conf_user_def['live.ic2_onoff'] = "1"; // ("1")
+$conf_user_rad['live.ic2_onoff'] = array('1' => 'on', '0' => 'off');
+
+// }}}
+// {{{ �������[�h/�X�N���[��
+
+// �I�[�g�����[�h�̊Ԋu
+$conf_user_def['live.reload_time'] = 2; // (2)
+$conf_user_sel['live.reload_time'] = array('0' => '�����[�h����', '1' => '5�b', '2' => '10�b', '3' => '15�b', '4' => '20�b');
+
+// �I�[�g�X�N���[���̊��炩�� (�ł����炩 1 �A�X�N���[������ 0)
+$conf_user_def['live.scroll_move'] = 3; // (3)
+
+// �I�[�g�X�N���[���̑��x (�ő� 1 �A�X�N���[�������̏ꍇ�͏�̊��炩���̒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
-
-// NG�X���b�h��L���ɂ��� (����:1, ���Ȃ�:0)
-$conf_user_def['wiki.ng_thread'] = 0; // (0)
-$conf_user_rad['wiki.ng_thread'] = array('1' => '����', '0' => '���Ȃ�');
-// �g�щ{�����A���X�ԍ���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'] = "�q���M�m�p�S Pro W3"; // ("�q���M�m�p�S Pro W3") ��{�̃t�H���g
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
- if(!P2Util::isBrowserSafariGroup()){ /* �u���E�U�� Mac�� Safari �ȊO �Ȃ� */
+ if(!UA::isSafariGroup()){ /* �u���E�U�� Mac�� Safari �ȊO �Ȃ� */
$STYLE['fontfamily_bold'] = "�q���M�m�p�S Pro W6"; // ("�q���M�m�p�S Pro W6") ��{�{�[���h�p�t�H���g�i���ʂɑ����ɂ������ꍇ�͎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 �n�C���C�g���[�h�\�����̔w�i�F
+$STYLE['live_highlight_chain'] = "#ffc"; // ("#ffc") +live �A���n�C���C�g�\�����̔w�i�F
+$STYLE['live_highlight_word_weight'] = "bold"; // ("bold") +live �A���n�C���C�g�\�����̃t�H���g�̑���
+$STYLE['live_highlight_word_border'] = "3px #f30 double"; // ("3px #f30 double") +live �A���n�C���C�g�\�����̃A���_�[���C��
+$STYLE['live_font-size'] = "10px"; // ("10px") +live �ԍ� �ڗ� ���O ���t ID ���̃t�H���g�T�C�Y
+$STYLE['live2_color'] = "#ddd"; // ("#ddd") +live Type-B�� �ԍ� �ڗ� ���O ���t ID �\�����̔w�i�F
+
// }}}
/*
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�{�g�����W���[��
$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 �@�\�g���p�b�N �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
+��L��X���ɏグ��ꂽ�C������荞��őS�������ڎw���œ�o�[�W�����ł��B
+�Ǝ��̉��ǂ��s���Ă��܂��B
+
+�������
+Linux(openSUSE Leap)��PHP7+Apache�œ���m�F���Ă��܂��B
+PHP5.6�ȍ~�œ����͂��ł����APHP7.*�����ł��B
+PHP7�ł̕s��C����D�悷�邽�ߓˑRPHP5.x�̃T�|�[�g���I���\��������܂��B
+
+����ȋ@�\
+### �ݒ�̒lj�
+* �u���[�U�[�ݒ�ҏW�v����+live�����N�̕\���ݒ��ύX�\
+* �����̃X���ꗗ����X�����J�����Ƃ��Ɏ����I�Ɏ������[�h�ŃX�����J���ݒ��lj�
+* 3�y�C���\���̔z�u��ύX�ł���ݒ��lj�
+* �X���b�h�^�C�g�����璘�쌠�\�L���폜����ݒ��lj�
+* �X���b�h�쐬�����̕\���t�H�[�}�b�g���w��ł���悤�ɂ���
+* �܂�BBS�̃z�X�g����\������ݒ��lj�
+
+### �V�@�\
+* cron�Ƃ��ōŋߓǂX���Ȃǂ�dat��DL�o����X�N���v�g�lj�
+ - php scripts/fetch-dat.php --mode ���[�h����w��(fav recent res_hist)
+* ���������ߌ��ɂȂ�ɖ������ŏ������ނƂ��Ɍx�����o���@�\��lj�
+* NG���ځ[��̑ΏۂɂȂ������X��ID�������I��NG���ځ[��@�\��lj�
+ - NG���ځ[��̏������폜�����ꍇ�͎���NG���ځ[��̃f�[�^�������Ȃ��Ɣ��f����܂���
+ - ����NG���ځ[��̃f�[�^�͎蓮NG���ځ[��ƓƗ����Ă���A����NG���ځ[��ON�̎������ǂݍ��܂�܂��B
+* �u�ݒ�Ǘ��v����L���b�V���E�����̏����ł���@�\��lj�
+* �{�Ƃ���be�̃��O�C���������ڐA����BE2.0�ɑΉ�
+* rep2�ɓo�^���ꂽ�O���̃����N����rep2�ŊJ����悤�ɂ����iJane�Ɠ�������j
+* 0�����˂�X�N���v�g���g�p�����O���̉ߋ����ODAT����荞�ݑΉ�
+* SOCKS5�v���N�V�o�R�̐ڑ��ɑΉ�(�l��)
+* tor���̌f����(.onion�h���C��)��tor�o�R�ʼn{������@�\��lj�(�l��)
+* curl ��p��������_�E�����[�h�@�\��lj�(�l���@�\)
+
+### �d�l�ύX
+* ���[�J���ꗗ�p.brd�t�@�C���̒u���ꏊ��rep2/board����$_conf['data_dir']/brard�ɕύX
+ - .brd��openJane�Ɠ����`���ł��B
+* �X�}�z�p��ʂ̃c�[���o�[�A�C�R�������𑜓x��ʂɑΉ�(thx https://github.com/dgg712/p2-php)
+* �X�}�z�p���X�|�b�v�A�b�v�ASPM�AIC2�̊O�����^�b�v����ƕ���悤�ɕύX
+ - ���X�|�b�v�A�b�v����J�������X�|�b�v�A�b�v���^�b�v�����ۂɌ��̃��X�|�b�v�A�b�v��������͎̂d�l�Ƃ����Ă��������܂��B
+ - �X�N���[���͎w�̏I���_���|�b�v�A�b�v���ɂȂ�悤�ɂ���Ώ����܂���B
+* headline.2ch.net���ŋߓǂX���ɒNjL���Ȃ��悤�ɕύX
+* Youtube�ƃj�R�j�R�����\������@�\���폜
+ - �����N�v���O�C�����g�p���������� 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�}�z�p��ʂ̃f�U�C���ύX
+* 2ch��Unicode�G�������e�ɑΉ�
+* �\�����X���̏����2000����65535�ɕύX
+
+���̑������̃A���ɍ��킹���C����git�̃R�~�b�g���O���m�F���Ă��������B
+
+
+���Ɛ�
+
+ �{�\�t�g�E�F�A�̎g�p�ɂ�蒼�ڂ���ъԐړI�ɐ����������Ȃ鑹�Q���⏞�������܂���B
+ �g�p�͎��ȐӔC�ŁB
+
+
+������
+
+ �ݒu�Җ{�l�����p����̂͂������A�F���Ȃǂ���
+ ��O�҂Ɉ��p����Ă��d���Ȃ����Ŏg���̂͂�߂Ă��������B
+
+
+�����C�Z���X
+
+ �{��p2�Ɠ������AX11���C�Z���X�ł��B
+
+
+��ChangeLog
+180705.1300
+* 2ch��API�������ꂽ�̂Őڑ����5ch�ɕύX
+* api.5ch.net�̃��X�|���X�w�b�_�[��Content-Length���t���Ȃ��s��ɑΉ�
+* composer.json���C�����ĐV�K�C���X�g�[�����̕s����C��
+* �������݂Ɏ��s�����ۂ̃G���[���b�Z�[�W��ύX
+* DAT�����̌������m�F���邽�߂�read.cgi�A�N�Z�X���L���b�V������悤�ɕύX
+* ���̃o�[�W�����ȍ~�ʼnߋ����O�q�ɂ����荞�X����DAT���Ď擾���Ȃ��悤�ɕύX
+* IE11��IE6�����̃R�[�h�����s����ĉ������ۑ����@�\���Ȃ��s����C��
+
+171122.1500
+* itest(https://itest.5ch.net/�T�[�o�[/test/read.cgi/��/�X��)�̃����N���J���@�\��lj�
+* DAT�j���h�~�̂��߂ɋ��d�l��itest�������N���Ȃ��悤�ɕύX
+* ���̍���PHP 2chBBS�X�N���v�g(http://script.s16.xrea.com/)���g�p�����O���ɑΉ�
+* SPM���g�p����NG���ځ[��o�^���ɁA���̓o�^���o����@�\��lj�
+* ic2:�_�E�����[�_�[��fatal error���o�Ȃ��悤�ɏC��
+* P2HttpExt.php�ȊO�̒ʐM�����ׂ�cURL�ɓ���
+* �Q�l��SSL�K�{�ɂȂ����̂Őݒ荀�ڂ�����
+* dig5ch��JSON��form�^�O����������s��ɑΉ�
+* �ȉ��Akiller4989 ����̃p�b�`����荞��
+* dat�擾�s�������ꍇ�̃��b�Z�[�W��\������悤�ɂ���
+* ImageCache2 �ł̃^�C���A�E�g�l��ݒ�ł���悤�ɂ���
+* �Q�l�̗L�������m�F�ł���悤�ɂ���
+* 5ch �ł̋�DAT�I�����b�Z�[�W���G���[��������悤�ɂ���
+
+171018.1540
+* bintan �ǂݍ��ݑΉ�
+* �Q�l���O�C���p��2chv.tora3.net��SSL�K�{�ɂȂ����̂őΉ�
+* �X�}�z read�F�|�b�v�A�b�v�̕���{�^�����������ۂɑ��̃|�b�v�A�b�v�������Y���ɕ���s��C��
+* subject�̃`�F�b�N�{�b�N�X���@�\���Ȃ��s��C��
+* �X�}�z�F�V���܂Ƃߓǂ݂��珑�����ۂɃ����[�h���Ȃ��悤�ɕύX
+* �V���܂Ƃߓǂ݂��珑�����ۂɏ������݃E�C���h�E��������悤�ɕύX
+
+171013.2230
+* �X�}�z�F�ꕔ�̊��ŃX���C�v���j���[�����삵�Ȃ��s��C��
+* �X�}�z:res_popup_reload�̐ݒ肪���f����Ȃ��s��C��
+* PHP7.1�ŃX���^�C�������g�p�����Warning���o��s��C��
+* cURLMulti���L��̂�fetch-subject-txt.php��PECL_HTTP�`�F�b�N���폜
+* expack.ic2.enabled��2�ɂ�������PC����A�N�Z�X�����fatal error���o��s��C��
+
+171011.1515
+* �X�}�z�pread�̃c�[���o�[���|�b�v�A�b�v���j���[�`���ɕύX
+* �X�}�z�pread�̊O�������N��target="_blank"���w��
+* �X�}�z�p�摜�\���̃{�^���������ɑ��čׂ�����s��C��
+* Firefox��Android�ł��X�}�z�����ɕύX
+* Android 2.2�ȉ��ɑΉ����邽�߂̃R�[�h���폜���ĕ\����������
+* �X�}�z�p�X���ꗗ��Android�ł��X���C�v���j���[�������悤�ɏC��
+
+171009.0000
+* �X�}�z�p��ʂ̍X�V�{�^���̕\�������Ɍ�肪�������̂��C��
+* headline.5ch.net�̃X���𗚗��ɒlj����Ȃ��悤�ɏC��
+* HTTP�ʐM���̃w�b�_�[�̃X�y���~�X�C��
+* �X�V�`�F�b�N�Ɏ��s�����ۂɃG���[���o��s��C��
+* �X���^�C������SSL�K�{�ɂȂ����̂ŏC��
+* �ꕔ�̊��ŃX���ꗗ��\�������ۂɌx�����o��s��C��
+
+171005.1930
+* �ˑ����C�u�������X�V�icomposer update�K�{�j
+* �X�}�z�p�ŋߓǂX���ꗗ���ɍX�V�{�^����lj�
+* ���ɔ��������I�ɍX�V���Ȃ��悤�ɕύX�iPC�Ɠ�������j
+* �I�̈ړ]�ɑΉ����邽�߁A2ch(sc)��open2ch��DAT�ۑ��f�B���N�g����ύX
+* �����d�l�̃f�B���N�g����DAT���L��Ƃ��͂������D�悷��
+* 5ch�b��Ή�
+* rss���[�_�[�����삵�Ȃ��s��C��
+* rss���[�_�[��HTTPS��URL��lj��ł��Ȃ��s����C��
+* �X�}�z�����y�[�W��bootstrap��lj����Ĉꕔ�f�U�C���ύX
+* ����`�F�b�N�̍Œ������PHP5.6�ȏ�ɕύX
+
+170921.1800
+* vip2ch.com�ǂݍ��ݑΉ�
+* 2ch��Unicode�G�������e�ɑΉ�
+* PHP7.1�ł�����ꂪ�ǂ߂Ȃ��s����C��
+* Tor�������Ȃ��s��C��
+* 2ch��API ���g�p�ł������ɑΉ�
+* �܂�BBS �ɂăh���C���ł��X���������悤�ɂ���
+* SS ���� R �̈ړ]���m�ł���悤�ɂ���
+* (�l���@�\)curl ��p��������_�E�����[�h�@�\��lj�
+* �X�}�z�p�������ݗ��̃f�U�C����ύX
+
+160410.0125
+* NG�X���b�h�@�\���{�̂�+Wiki�ŏd�����Ď�������Ă���̂ō폜
+* 160409.1000 �ɐV���Z�ߓǂ݂Ǝ����������삵�Ȃ��s�������̂ŏC��
+* ���������N��&ls��t�����Ȃ��悤�ɕύX
+* ���[�U�[�ݒ�Ǘ���+Wiki��samba�^�C�}�[�Ɋւ���ݒ荀�ڂ�\������悤�ɕύX
+
+160409.1000
+* NG�X���b�h�@�\�����삵�Ȃ��s����C��
+* �摜�u��URL�����삵�Ȃ��s��C��
+* �т��URL������X�V
+* composer.json����URL���X�V���ĐV�K�C���X�g�[�����̕s��C��
+
+160309.0710
+* �ȉ��̕ύX�_��killer4989����̃p�b�`����荞��
+* SOCKS5�ڑ���tor�ڑ����@�\���Ă��Ȃ��s����C��
+* �X�}�z�ł������URL���J����悤�ɕύX
+
+160304.1333
+* �s�����Ă������𑜓x�A�C�R����lj� thx! http://potato.2ch.net/test/read.cgi/software/1431258367/767
+* ����DAT���_�E�����[�h����ׂ̃R�[�h�ƃ����N������
+* DAT�����̔����2ch API�̓Ǝ����X�|���X�w�b�_���g�p����悤�ɕύX
+* API+�Q�l�Ŏ擾����DAT���ߋ����O��������悤�ɕύX
+* SOCKS5�v���N�V�o�R�̐ڑ��ɑΉ�(�l��)
+* tor���̌f����(.onion�h���C��)��tor�o�R�ʼn{������@�\��lj�(�l��)
+* �ȉ��̕ύX�_��killer4989����̃p�b�`����荞��
+* vip2ch.com �Ή�
+* �т�ׂ����� URL ���w�肳�ꂽ���ɐ������X�����\�������悤�ɂ���
+* ��Q�l���𗧂��c�[����̃����N��lj�
+* �X���b�h�쐬�����̕\���t�H�[�}�b�g���w��ł���悤�ɂ���
+* ���̑����X
+
+150815.1030
+* �\�����X���̏����2000����65535�ɕύX
+* �܂�BBS�̃z�X�g����\������ݒ��lj��ikiller4989����̃p�b�`����荞�݁j
+
+150711.1000
+* �o�[�W�����ԍ��̐����~�X���Ă��̂� 151710.1400 �����Ԃɂ��ĕt������
+* �X�V���e�ɖ�薳���͂��Ȃ̂œ��e�� 151710.1400 �Ɠ���ł��B
+
+151710.1400
+* �L���b�V���m�F��30�������ɍX�V����͂���30���ԂɂȂ��Ă����̂ŏC��
+* DAT ��2�s�ڂ��ߋ����O�ł��邱�Ƃ������Ă���悤�ł���Ήߋ����O�����ɂ���
+* ���� P2 �֘A�̃R�[�h���폜
+* offlaw2(shiro=kuma)���폜
+* ��L�̕ύX�_��killer4989����̃p�b�`����荞��
+* �ݒ荀��2chapi_rounin���폜�i����ON�ɕύX�j
+
+150510.1111
+* Youtube�ƃj�R���̓��������N�v���O�C�����폜
+* Youtube�֘A�̐ݒ��S�č폜
+* show�{�^���������N�v���O�C�����痘�p�o����悤�ɕύX
+* �X�}�z����read��PC�̃����N�v���O�C�������f�����悤�ɂ���
+* �摜�u��URL��EXTRACT�̏d��URL������悤�ɕύX
+* �T�[�r�X�I���ɔ����Ďg�p�ł��Ȃ��Ȃ����@�\�̐ݒ���ꕔ�폜
+
+150426.1033
+* �K���P�[����read��syntax error�C��
+* 302����������URL��RSS���[�_���퓮�삵�Ȃ��s����C��
+* RSS���[�_����HTTP_Request2�ɑ��݂��Ȃ������Ăяo���Ă����������폜
+* P2Util::fileDownload��If-Modified-Since�𑗐M���Ȃ��s����C��
+* �L���b�V���폜�ɔꗗ�̍폜�@�\�lj�
+* ����߂�{�^�������𑜓x�Ή��ɕύX
+
+150418.1111
+* �X�}�z�p��ʂ̃c�[���o�[�A�C�R�������𑜓x��ʂɑΉ�(thx https://github.com/dgg712/p2-php)
+* rep2�ɓo�^���ꂽ�O���փ����N����@�\��lj�
+* 0�����˂�X�N���v�g���g�p�����O���̉ߋ����ODAT����荞�ݑΉ�
+* headline.2ch.net���ŋߓǂX���ɒNjL���Ȃ��悤�ɕύX
+* Firefox�ŃX�}�z�p�\���������s����C��
+* �X�}�z�pIC2�̃|�b�v�A�b�v�Ŋ��ɐݒ�ς݂̐����^�b�v�����ۂɃG���[���o���Ȃ��悤�ɕύX
+* �X�}�z�pIC2�̃|�b�v�A�b�v�ɕ\�������URL�������N�ɕύX(thx http://anago.2ch.net/test/read.cgi/software/1426940268/711)
+* �X�}�z�pIC2�ʼn摜�\�����_�u���^�b�v����ƕ���悤�ɕύX(txh http://anago.2ch.net/test/read.cgi/software/1426940268/711)
+* �X�}�z�p���X�|�b�v�A�b�v�ASPM�AIC2�̊O�����^�b�v����ƕ���悤�ɕύX
+
+150414.2333
+* �X�}�z�pread�ɏ������݃t�H�[����lj�
+* �X�}�z�p��ʂ̃f�U�C����ύX
+* DAT�擾�v���O�C�������삵�Ȃ��s����C��
+* ���̑����X
+
+150408.1234
+* NG���ځ[��̑ΏۂɂȂ������X��ID�������I��NG���ځ[��@�\��lj�
+* HTTP�ʐM�̃w�b�_��������
+* dig2ch.php�ʼn�̓G���[�����������ۂɏڍ����o���悤�ɕύX
+
+150406.2211
+* �ߌ��Ɩ������ŏ������݂ł��Ȃ��̏����𐳂������삷��悤�ɏC��
+* �������ŏ����o���Ȃ��͏������ݑ��s�ł��Ȃ��悤�ɕύX
+* expack��sage�`�F�b�N�@�\�Ɩ{������`�F�b�N�@�\�̃f�t�H���g�l��ON�ɕύX
+
+150406.1111
+* ���������ߌ��ɂȂ�ɖ������ŏ������ނƂ��Ɍx�����o���@�\��lj�
+* �ݒ�Ǘ���Cookie�₻�̑��̗������폜�o����@�\��lj�
+* http://page2.skr.jp/rep2/ �����ł��Ă��܂����̂�gate.php�̑�ւ�lj�
+* HTTP�ڑ��ł�SSL�W�̐ݒ������悤�ɕύX
+* 2ch.net�Ƃ�SSL�ʐM��ݒ�őI�ׂ�悤�ɕύX
+* �������݂ŗ�O�����������ۂɃG���[���b�Z�[�W���\������Ȃ��s����C��
+* ���̑����X
+
+150402.1350
+* �ڑ��悪2ch.net�Ȃ��SSL�ʐM���s���悤�ɕύX(pink��be���O�C���F�͑Ή����Ă��Ȃ��̂ł��Ȃ�)
+* ssl_function�̃f�t�H���g�ݒ��cURL�ɕύX
+* SSL�ʐM�ȊO�ł�SSL�̐ݒ肪���f�����悤�ɕύX
+* ��L�ύX�̂���cURL�K�{�ɕύX
+
+150401.2321
+* �F�ؕt�v���L�V�ɑΉ��iBASIC�F�̂݁j
+* SSL�ʐM��openSSL��cURL���ւ��邱�Ƃ��o����ݒ��lj�
+* dig.2ch.net�ɑ���w�b�_��ύX
+* 2ch�Ƃ̒ʐM��HTTP_Request2�ɕύX
+
+150328.2132
+* dig2ch�̎I�Ɍy���ȕs������������Ƃ��̑���u����
+* dig2ch�Ō������ʂ̔ԍ���1����\�������悤�ɏC��
+* dig2ch��json�G���[������ύX
+* dig2ch���v���L�V�ݒ�(proxy_use)�ɑΉ����Ă��Ȃ��s����C��
+* dig2ch�Łu�ōi�荞�ށv�ɑΉ�����
+* �u�����[�h���|�b�v�A�b�v�ɂ������悤�ɕύX
+* ���X���|�b�v�A�b�v(quote_res_view)�������ȂƂ��Ɏ������[�h��ID�F�Â�(coloredid)�������Ȃ��s����C��
+
+150320.1020
+* �|�b�v�A�b�v���珑�����ݐ���������ɃX�����ēǂݍ��݂��Ȃ��ݒ��lj�
+* �������[�h����̏������݂�Cookie�m�F�����������ꍇ�������[�h�ɖ߂�Ȃ��s����C��
+* �����e�i���X�������コ���邽��live_ShowThreadPc.php��live_ShowThread.php�̑����
+* live_ShowThreadLive.php�Ɩ{�̂�ShowThread.php���g�p����悤�ɕύX
+* �������ۑ�(expack.editor.savedraft)�������ȂƂ��Ɏ������[�h���珑�����߂Ȃ��s����C��
+* �X���^�C������Warning���o��s����C��
+
+150317.1200
+* ���̑����X
+
+150316.1120
+* 3�y�C���\���̔z�u��ύX�ł���ݒ��lj�
+* Be�̃A�C�R����\���ł���悤�ɂ���
+* ���̑����X
+
+150315.0117
+* youtu.be��nico.(ms|sc)�̃v���r���[�ɑΉ�
+* YouTube�̖��ߍ��ݕ��@��object����iframe�ɕύX
+* cron�Ƃ��ōŋߓǂX���Ȃǂ�dat��DL�o����X�N���v�g�lj�
+* �ꕔ�̉�ʃf�U�C����{�Ƃ��ۂ��f�U�C���ɕύX
+* �ꕔ�̃��X�̉��s���폜�����s����C��
+* ID��F�Â����Ȃ��ݒ�̍ۂ�ID�̕\�������������Ȃ�s����C��
+* 2ch��DAT�I���ɔ������O�j�����lj�
+* �{�Ƃ���be�̃��O�C���������ڐA����BE2.0�ɑΉ�
+* ���擾�X���ł��X���ꗗ�Ɍ��X���̃����N��\���ł���ݒ��lj�
+* ���̑����X
+
+150307.1230
+* doc�f�B���N�g���Ɋe�@�\��Readme.txt���쐬
+* �u���[�U�[�ݒ�ҏW�v����+live�����N�̕\���ݒ��ύX�\
+* �����̃X���ꗗ����X�����J�����Ƃ��Ɏ����I�Ɏ������[�h�ŃX�����J���ݒ��lj�
+* �X���b�h�^�C�g�����璘�쌠�\�L���폜����ݒ��lj�
+* ���[�J���ꗗ�p.brd�t�@�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�Ή��p�b�` README
+
+�����H
+�����܂Ŕ�����Ȏ����@�\�ł��B
+�@�\���g�p���邽�߂ɂ͐ݒ肪�K�v�ɂȂ�܂��B
+
+2ch API���g�p����dat�̎擾�ɑΉ����Ă��܂��B
+
+PHP��OpenSSL�ɑΉ����Ă���K�v������܂��B
+
+���ݒ���@
+�u�ݒ�Ǘ��v���u���[�U�[�ݒ�ҏW�v���urep2��{�ݒ�v���u2ch API�v����ݒ�ύX�ł��܂��B
+
+2chapi_use
+�u����v�ɐݒ肵���ꍇ��2ch API��dat�̎擾���s���܂��B
+dat�擾�ȊO��User-Agent��rep2�W������2chapi_appname���g�p�������ɕύX���܂��B
+�O����User-Agent��dat�擾�͂�rep2�W���̂܂܂ł��B
+
+2chapi_ssl.auth
+2chapi_ssl.read
+���̐ݒ��SSL�ʐM���G���[�ƂȂ�������̐ݒ�ł��B
+2chapi_use ���u���Ȃ��v�̏ꍇ�͖�������܂��B
+
+2chapi_interval
+2ch API �F����Ԋu�ł��BSessionID���ǂꂭ�炢�̊��Ԏ��̂��s���Ȃ��߂Ƃ肠����1���Ԃɂ��Ă��܂��B
+
+2chapi_appkey
+2chapi_hmkey
+2ch API�̔F�؏��ł��B
+�ύX�����ꍇ�͍ĔF���s���K�v������܂��B
+
+2chapi_appname
+2ch API���g�p����Ƃ���2ch�ɑ��M����User-Agent�ł��B
+�uHoge/1.00�v�̌`���Ŏw�肵�܂��B
+�����ŁuMonazilla/1.00 (Hoge/1.00)�v�̂悤��User-Agent�̈ꕔ�Ƃ��Ďg�p���܂��B
+
+���lj��@�\
+�u���O�C���Ǘ��v�Ɂu2ch API�F�؊Ǘ��v��lj����Ă��܂��B
+2ch API�F�؏̊m�F�ƔF�E�F�؉����E�ĔF���s�����Ƃ��o���܂��B
+�ʏ��dat�擾����2chapi_interval�ɐݒ肵���Ԋu�Ŏ����I�ɔF���s���܂����A
+2ch API�̔F�؏���ύX�����ꍇ�͎蓮�ōĔF���s���K�v������܂��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 �����ɁA�����p�@�\��lj����Ă��܂��B
+
+
+### �lj��@�\
+
+* �����p�\��
+* �I�[�g�����[�h/�X�N���[��
+* �n�C���C�g���[�h/�A���n�C���C�g
+
+���̑���{�@�\�̓x�[�X�ƂȂ��Ă��� rep2expack �Ɠ����ł��B
+
+�ȉ���2ch774��Internetw Archive����T���x�[�W����+live�@�\�̐����ł��B
+http://web.archive.org/web/20101105031616/http://plus-live.main.jp/
+
+�\���ݒ�
+
+ ���X�\���̎�ށB
+ �����l (�������̂ݎ����p�\��)
+
+ ���X�\���̎�ނ��m�[�}���Ǝ����p��2��ނ���I�ׂ܂��B
+ �T�u�W�F�N�g���ŃX���^�C���N���b�N����ƒʏ�\���A�X���^�C���� live.png ���N���b�N����ƕʑ��Ŏ����\������悤�ɂȂ��Ă��܂��B
+
+ ID������ O (�g��) P (����p2) Q (�t���u���E�U) I (iPhone) ���ɁB
+ �����l (���Ȃ�)
+
+ �g�т���̏��� O �A����p2����̏��� P�A�t���u���E�U����̏��� Q�AiPhone����̏��� I ���ɂ��܂��B
+
+ �A���n�C���C�g
+ �����l (���Ȃ�)
+
+ �n�C���C�g���[�h�Ƀq�b�g�������X�ɑ���A���J�[���܂ރ��X�������\�����܂��B
+ �A���͈̔͂�NG���ځ[��ł̐ݒ� (ngaborn_chain_all) �ƘA�����Ă��܂��B
+
+ YouTube�v���r���[�\���̃T�C�Y
+ �����l (�m�[�}���T�C�Y)
+
+ �v���r���[�\���̃T�C�Y��2�i�K�Ŏw��o���܂��B
+ �m�[�}���T�C�Y 425�~350px
+ �n�[�t�T�C�Y 212�~175px
+
+
+�������ݒ�
+
+ �\�����郌�X���B
+ �����l (50)
+
+ �����\���̃��X�\�����ł��B
+ �\�����������Ɠ��삪�d���Ȃ�A���Ȃ���NG/���ځ[��/�n�C���C�g�̘A���������Ȃ��Ȃ�܂��B
+
+ �����t���[���̍����B
+ �����l (85)
+
+ �����\���̉��������t���[���̍����ł��B
+ �s�N�Z���P�ʂŎw�肵�܂��B
+
+ �f�t�H���g�̖������̕\���B
+ �����l (���Ȃ�)
+
+ �X�y�[�X�ߖ�̈׃f�t�H���g�́u�������v���\���ɂ��܂��B
+
+ sage �� �� �� �B (�I�[�g�����[�h/�X�N���[������X���̂�)
+ �����l (����)
+
+ �X�y�[�X�ߖ�̈� sage �� �� �ɕϊ����܂��B
+ ���[������ sage �ȊO�̌��t���܂ޏꍇ�� �� �ɂȂ�܂��B
+ �}�E�X�I�[�o�[�œ��e���\������܂��B
+
+ �S�Ẳ��s�ƃX�y�[�X�̍폜�B
+ �����l (����)
+
+ �S�Ẳ��s���폜���Ĕ��p�X�y�[�X�ɕϊ����܂��A�A���������s��X�y�[�X�����p�X�y�[�X1�ɂȂ�܂��B
+ �S�p�p���y�уX�y�[�X�͑S�Ĕ��p�ɕϊ�����܂��B
+ AA�͑S���l�����Ă��Ȃ��̂ŕ���܂��B
+ �O�������N����ꗗ���܂ޓ��̈ꕔ�̃��X�ɂ͓K�p����܂���B
+
+ pop.png ���� (p) �Ŕ�Q�ƃ��X�|�b�v�A�b�v�B
+ �����l (����)
+
+ �Y�����X�ɑ��ẴA���J�[ (>>����) ���L�郌�X�� pop.png ���� (p) �Ń|�b�v�A�b�v���܂��B
+ �\����HTML�|�b�v�A�b�v�̐ݒ�ƘA�����Ă��܂��B
+
+ ���X�̕��@�B
+ �����l (���X�{�^���摜 re.png )
+
+ ���X�̕��@��2��ނ���I�ׂ܂��B
+
+ ���X�{�^���摜 re.png ���� (re:)�B
+ ���e���_�u���N���b�N�B
+ �������g�p���鎖���\�ł��B
+
+ �����K���p�^�C�}�[�B
+ �����l (�^�C�}�[����)
+
+ 10,20,30�b�Őݒ�ł��܂��B
+ �J�E���g�_�E����0�ɂȂ�Ə����{�^�����\������܂��B
+
+ ImageCache2�̃T���l�C���쐬�B
+ �����l (on)
+
+ off�ɐݒ肵���ꍇ�A�����p�ɃE�C���h�E���J�����ۂ�ImageCache2�̃T���l�C���쐬���ꎞ�I��off�ɂ��܂��B
+ �ēx�T���l�C���쐬��on�ɂ���ꍇ�́A�T�C�h���j���[����ݒ肵�ĉ�����
+
+
+�����[�h/�X�N���[���ݒ�
+
+ �I�[�g�����[�h�̊Ԋu�B
+ �����l (10�b)
+
+ �X�����e���I�[�g�����[�h���鎞�Ԃ��w�肵�܂��B
+ �ݒ�ł��鎞�Ԃ́A5,10,15,20�b�ł��B
+
+ �y�[�W�Ǎ��݂Ɠ����Ɏ��Ԃ��J�E���g����n�߂�̂ŁA����̑����X���ł̓X�N���[�����Ɏ��̓Ǎ��݂ɂȂ��Ă��܂������L��܂��B
+
+ �I�[�g�X�N���[���̊��炩���B
+ �����l (3)
+
+ �X�N���[���̊��炩���ł��B
+ �ł����炩�Ȃ̂� 1 �A�I�[�g�X�N���[�������̏ꍇ 0 �ɂȂ�܂��B
+
+ �I�[�g�X�N���[���̑��x�B
+ �����l (10)
+
+ �I�[�g�X�N���[���̑����ł��B
+ �ő��� 1 �A�I�[�g�X�N���[�������̏ꍇ�͏�̊��炩���̒l�� 0 �ɂ��ĉ������B
+
+ �X�N���[���̓����́u���炩���v�Ɓu���x�v�̑g�����ŕω����܂��B
+ �u���x�v���������l�ł��A�u���炩���v�̐ݒ�l�ɂ���ĕς���Ă��܂��A���炩�Ȓ����F���͏オ��܂����A�t�ɑ��x�͗����Ă����܂��B
+ �f�t�H���g��葬���������ꍇ�́u���炩���v�͂��̂܂܂Łu���x�v�� 1 �ɋ߂Â��ĉ������B
+ �f�t�H���g�ł͑�������Ƃ����ꍇ�́u���x�v�͂��̂܂܂Łu���炩���v�� 1 �ɂ���Ƃ����ł��傤�B
+ �u���x�v�� 0 �ɂ��Ă��X�N���[���͎~�܂�܂���A�~�߂����ꍇ�́u���炩���v�� 0 �ɂ��ĉ������B
+
+
+�����ݒ�Ɋւ��钍�ӓ_
+
+ �����p�ɃX�����J���ۂ́A���̔̃X���b�h�ꗗ�̃X���^�C���� �{�^������J���ĉ������B�X�����̃����N����J���ƒʏ�̕\���ɂȂ�܂��B
+
+ ����~�V���Ԃ̎d�胉�C���̓I�[�g�����[�h/�X�N���[���ɐݒ肵���X���̂ݕ\������܂��B
+
+ �V�����X�̐擪�����ځ[��Ă���ꍇ�A�d�胉�C���͕\������܂���B
+
+ �uFatal error: Maximum execution time of 60 seconds exceeded in �`�v���o��ꍇ�́Aconf.inc.php��91�s�ڂɗL��X�N���v�g���s�������Ԃ̒l�𑝂₵�ĉ������B
+
+ �I�̃X�y�b�N�ɂ���Ă͉��s�̍폜�������ǂ������A�X���b�h���e�̕\�����~�܂�ꍇ������܂��B���̏ꍇ�͉��s�̍폜��off�ɂ��ĉ������B
+
+ safari 4�ł͎������̏����݃{�^���pAccess Key�uctl+z�v���g���Ȃ��悤�ł��BAccess Key�̎d�l���ς�����ׁuctl+opt+z�v�ɂȂ�܂��B
+
+ �������Ƀ��X�ԍ��|�b�v�A�b�v����́u����Ƀ��X�v���g�p����ƁA���̌�̃����[�h�Ŏ������[�h����������Ă��܂��܂��B�Ȃ̂Ŏ������́u�����Ƀ��X�v�� [Re:] ���N���b�N�A���͊Y�����X�̃_�u���N���b�N����s���ĉ������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���̃T���v���W
+
+�W���ݒ�̏ꍇ��data/pref/�ɓ����Ƌ@�\���܂��B
+�ڂ���������doc/wiki/���̃e�L�X�g�ɋL�ڂ���Ă��܂��B
+
+p2_plugin_dat.txt DAT�擾�v���O�C��
+p2_plugin_link.txt �����N�v���O�C��
+p2_replace_imageurl.txt �u���摜URL(Jane��ImageViewURLReplace.dat����)
+
+���L�̃t�@�C���͒��ڕҏW����K�v������܂��B
+�ҏW���@��doc/wiki/���̃e�L�X�g���悭�ǂ�ł��������B
+p2_replace_mail.txt ���[��
+p2_replace_name.txt ���O
+p2_replace_date.txt ���t�EID��
+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�擾 EXTRACT�u�����ʂ̉摜URL�ɑ��鐳�K�\���B�w�肳��Ă���ꍇ�͂���Ń}�b�`����������őO��L���b�V���Ɣ�r���A����ł���Γ����摜�ƌ��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)
+�@�E�X���^�C������AND/OR�������ł���悤�ɂ���
+�@�E���p�X�y�[�X�A�S�p�X�y�[�X�̏���
+
+2014/09/03 (140903.1600)
+�@�Edig.2ch.net�ŃX���^�C�������ł���悤�ɂ��� (tgrepc.php�̕ύX�Adig2����.php�쐬)
+
+2014/07/19 (140719.1733)
+�@�E�ߋ����O�擾��offlaw�ōs����rokka(��ID)�ōs�����I������悤�ɂ���
+
+2014/07/18 (140718.2130)
+�@�E�ߋ����O�擾��offlaw2.so�o�R�Arokka�o�R�����ɑΉ�(��)
+�@�@�Eread.cgi�o�R�Ŋm�F����HTML�łǂ���𗘗p���邩�I��
+
+2014/07/16 (140716.1150)
+�@�E�ߋ����O�������@�̕ύX
+�@�@�E2ch.net��offraw.so�Ashoro=kuma�Ŏ擾
+�@�@�Ebbspink��rokka�Ŏ擾
+�@�@��2ch�ꕔ�� (�I�H)��rokka�Ŏ擾�ł����肷�邪�ʓ|�������̂ŏ�L�̂悤�ɂ���
+
+2014/07/15 (140715.1701)
+�@�E�Q�lID�ł�dat�擾�ɑΉ� (rokka system���p�A�ꕔ�I�A�ł͎擾�s�\)
+�@�Evip2ch.com�ǂݍ��݊W�C�� (�{�� 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 @@
+�����N�v���O�C���Ŏg����774�Ǝ��@�\
+
+�� show�{�^��
+jQuery�̗͂ɂ��A�N���b�N�����iframe�ɕϐ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�{) iframe��src����
+data-video_width(�K�{) iframe��width����
+data-video_height(�K�{) iframe��height����
+data-video_style(�I�v�V����) iframe��style����
+data-video_harf(�I�v�V����) 1�ɂ����width��height�������ɂȂ�܂�
+data-video_option(�I�v�V����) Javascript�̘A�z�z��`����iframe�̒lj��������w�肵�܂��B���O�ƒl�͕K���y�A�ł���K�v������܂��B
+
+�� �萔
+�����N�v���O�C������Replace�Ɉȉ��̍��ڂ��w�肷��ƁA���̓��e�ɕϊ����܂��B
+�E$atag rep2�̐ݒ�Ɛڑ��[���ɉ��������e��a�^�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�ɐݒ肵����Ԃł�PC����A�N�Z�X�����ꍇ��$atag��
+�u(p)$str�v�ɕϊ����܂��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: �z�X�g�̈ړ]�����o���܂����B(%s/%s �� %s/%s)
';
- $msg_fmt .= '���C�ɔA���C�ɃX���A�ŋߓǂ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 �z�X�g��
- * @param string $bbs ��
- * @return string ���j���[�ɋL�ڂ���Ă����
- */
- static public function getBbsName($host, $bbs)
- {
- // �}�b�s���O�ǂݍ���
- $map = self::_getMapping();
- if (!$map) {
- return $bbs;
- }
- $type = self::_detectHostType($host);
-
- // �`�F�b�N
- if (isset($map[$type]) && isset($map[$type][$bbs])) {
- $itaj = $map[$type][$bbs]['itaj'];
- } else {
- $itaj = $bbs;
- }
-
- return $itaj;
- }
-
- // }}}
- // {{{ syncBrd()
-
- /**
- * ���C�ɔȂǂ�brd�t�@�C��������
- *
- * @param string $brd_path brd�t�@�C���̃p�X
- * @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���Ȃǂ�idx�t�@�C��������
- *
- * @param string $idx_path idx�t�@�C���̃p�X
- * @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�ɔA���C�ɃX���A�ŋߓǂ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()
-
- /**
- * 2ch�������j���[���p�[�X���A��-�z�X�g�̑Ή��\���쐬����
- *
- * @return array site/bbs/(host,itaj) �̑������A�z�z��
- * �_�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;
-
- // }}}
- // {{{ �L���b�V���m�F
-
- 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���[�̂Ƃ��A����̃��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�|���X�R�[�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);
- }
-
- // }}}
- // {{{ �L���b�V������
-
- $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�V��̃f�[�^����������
- *
- * @param string $path �������ރt�@�C���̃p�X
- * @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()
-
- /**
- * �z�X�g�̎�ނ肷��
- *
- * @param string $host �z�X�g��
- * @return string �z�X�g�̎��
- */
- 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';
+
+ // �f�B���N�g�����Ȃ��ꍇ�͐V�K�ō쐬
+ if (!file_exists($brd_dir)) {
+ FileCtl::mkdirRecursive($brd_dir);
+ if(!is_writable($brd_dir)){
+ // �������������Ȃ������ꍇ�̓p�[�~�b�V�����̒��ӊ��N������
+ p2die("�e�f�B���N�g���̃p�[�~�b�V�������������ĉ������B");
+ }
+ return $brd_menus;
+ }
if ($cdir = @dir($brd_dir)) {
// �f�B���N�g������
@@ -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;
- // �L���b�V��������ꍇ
- if (file_exists($cachefile.'.p2.brd')) {
- // norefresh�Ȃ�DL���Ȃ�
- if (!empty($_GET['nr'])) {
- $noDL = true;
- // �L���b�V���̍X�V���w�莞�Ԉȓ��Ȃ�DL���Ȃ�
- } elseif (@filemtime($cachefile.'.p2.brd') > time() - 60 * 60 * $_conf['menu_dl_interval']) {
- $noDL = true;
- }
- }
+ $read_html_flag = false;
- // DL���Ȃ�
- if ($noDL) {
- ;
- // DL����
- } else {
+ // DL����A������norefresh�Ȃ�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�����[�h�����e�s���`�F�b�N�����[�J��dat�ɏ�������
@@ -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�`�F�b�N
- 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()
-
- /**
- * �v���C�x�[�g�A�h���X?
- *
- * @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()
-
- /**
- * �l��Shift_JIS��UTF-8�Ԋ҂��Ă���JSON�G���R�[�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 �ȊO�̏ꍇ�_�E�����[�h���Ȃ�
+ if (!P2HostMgr::isHost2chs($this->host)) {
+ return ;
+ }
+ $this->lastmodify_url = 'https://' . $host . '/' . $bbs . '/lastmodify.txt';
+
+ // lastmodify.txt�� �_�E�����[�h���Z�b�g����
+ $this->dlAndSetLastmodify();
+ }
+
+ // }}}
+ // {{{ dlAndSetLastmodify()
+
+ /**
+ * lastmodify.txt���_�E�����[�h���Z�b�g����
+ *
+ * @return boolean �Z�b�g�ł���� true�A�ł��Ȃ���� 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); // �f�B���N�g������������
+
+ if (file_exists($this->lastmodify_file)) {
+ if (!empty($_REQUEST['norefresh']) || (empty($_REQUEST['refresh']) && isset($_REQUEST['word']))) {
+ return; // �X�V���Ȃ��ꍇ�́A���̏�Ŕ����Ă��܂�
+ } elseif (!empty($GLOBALS['expack.subject.multi-threaded-download.done'])) {
+ return; // ����_�E�����[�h�ς̏ꍇ��������
+ } elseif (empty($_POST['newthread']) and $this->isLastmodifyTxtFresh()) {
+ return; // �V�K�X�����Ď��łȂ��A�X�V���V�����ꍇ��������
+ }
+ $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) {
+ // �z�X�g�̈ړ]��ǐ�
+ $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 �Ȃ�EUC��SJIS�ɕϊ�
+ 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���邱�ƂōX�V�C���^�[�o���������̂ŁA���炭�ă`�F�b�N����Ȃ��Ȃ�
+ // �i�ύX���Ȃ��̂ɏC�����Ԃ��X�V����̂́A�����C���i�܂Ȃ����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 ���V�N�Ȃ� true ��Ԃ�
+ *
+ * @return boolean �V�N�Ȃ� true�B�����łȂ���� false�B
+ */
+ public function isLastmodifyTxtFresh()
+ {
+ global $_conf;
+
+ // �L���b�V��������ꍇ
+ if (file_exists($this->lastmodify_file)) {
+ // �L���b�V���̍X�V���w�莞�Ԉȓ��Ȃ�
+ // clearstatcache();
+ if (filemtime($this->lastmodify_file) > time() - $_conf['sb_dl_interval']) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ // }}}
+ // {{{ setLastmodifyLines()
+
+ /**
+ * lastmodify.txt ��ǂݍ���
+ *
+ * ��������A$this->lastmodify_lines ���Z�b�g�����
+ *
+ * @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 ���Z�b�g�����
+ *
+ * @param string $cont ����� eashm �p�ɓn���Ă���B
+ * @return boolean ���s����
+ */
+ public function getThreadExtend($key)
+ {
+ // �ڑ��悪 2ch / 5ch / pink �ȊO�̏ꍇ�� '' ��Ԃ�
+ 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'];
- /*
- // Basic�F�Ŏ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. ���[�U�F�Ɏ��s���܂����B';
- exit;
- }
- */
-
+ // �O���F�Ŏ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���ځ[��HIT�L�^���X�V���ԂŃ\�[�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 �lj�������e
+ * @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']);
-
- // �^�C�g������
- 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:
+ // �G�X�P�[�v����Ă��Ȃ����ꕶ�����G�X�P�[�v
+ // $ar['word'] = p2h($ar['word'], false);
+ // 2ch�̎d�l��A���͊��Ғʂ�̌��ʂ������Ȃ����Ƃ������̂Ł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]);
+ }
+ // �^�C�g������
+ if ($matches[3] !== '') {
+ $ar['title'] = $matches[3];
}
- // �啶����������
- } elseif (preg_match('/^(.+)$/', $ar['word'], $matches)) {
- $ar['word'] = $matches[1];
- $ar['ignorecase'] = true;
- }
-
- // ���K�\���łȂ��Ȃ�A�G�X�P�[�v����Ă��Ȃ����ꕶ�����G�X�P�[�v
- /*if (!$ar['regex']) {
- $ar['word'] = p2h($ar['word'], false);
- }*/
- // 2ch�̎d�l��A���͊��Ғʂ�̌��ʂ������Ȃ����Ƃ������̂Ł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');
+
+ // �^�C���A�E�g�̐ݒ�
+ $req->setConfig (array (
+ 'connect_timeout' => $_conf['http_conn_timeout'],
+ 'timeout' => $_conf['http_read_timeout'],
+ ));
+
+ // �O���Ƃ̒ʐM�͑S��cURL���g���isocket��openSSL���݂Œn�����ނ̂Ő�Ύg�p�֎~�I�j
+ $req->setAdapter('curl');
+
+ // SSL�̐ݒ�
+ if($purl['scheme'] == 'https') {
+ if($_conf['ssl_capath'])
+ {
+ $req->setConfig ('ssl_capath', $_conf['ssl_capath']);
+ }
+ }
+
+ // �v���L�V
+ if ($_conf['tor_use'] && P2HostMgr::isHostTor($purl['host'], 0)) { // Tor(.onion)��Tor�p�̐ݒ���Z�b�g
+ $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()
+ /**
+ * p2����API��UA��Ԃ�
+ * @param bool $withMonazilla true�Ȃ�Monazilla/1.00��t����
+ * @param bool $apiUA true�ŏ�����API�����p�\�ȂƂ���API��UA��Ԃ�
+ * @return string
+ */
+ static public function getP2UA($withMonazilla = true,$apiUA = false)
+ {
+ global $_conf;
+
+ // API���g�p����ݒ�̏ꍇ��API��UA��Ԃ�
+ if ($apiUA && $_conf['2chapi_use'] == 1) {
+ if ($_conf['2chapi_appname'] != "") {
+ $p2ua = $_conf['2chapi_appname'];
+ } else {
+ p2die("2ch�ƒʐM���邽�߂ɕK�v�ȏ�ݒ肳��Ă��܂���B");
+ }
+ } else {
+ $p2ua = $_conf['p2ua'];
+ }
+
+ if ($withMonazilla) {
+ $p2ua = sprintf('Monazilla/1.00 (%s)', $p2ua);
+ }
+
+ return $p2ua;
+ }
+ // }}}
+ // {{{ getWebPage
+
+ /**
+ * Web�y�[�W���擾����
+ *
+ * 200 OK
+ * 206 Partial Content
+ * 304 Not Modified �� ���s����
+ *
+ * @return string|false ����������y�[�W���e��Ԃ��B���s������false��Ԃ��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)) {
+ // �L���b�V���L�����ԂȂ�_�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���[���o����null��Ԃ��ďI���
+ if (isset($error_msg) && strlen($error_msg) > 0) {
+ // �G���[���b�Z�[�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;
+ }
+
+ // �X�V����Ă�����ۑ�
+ 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);
+
+ // �v���L�V
+ if ($_conf['tor_use'] && P2HostMgr::isHostTor($purl['host'], 0)) { // Tor(.onion)��Tor�p�̐ݒ���Z�b�g
+ $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�Ɏ��s����P�[�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�@�C�����p�[�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] �̘A�z�z�������
+ } 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 �ւ̃��N�G�X�g���L���[�ɒlj�
+ $self->add($subjects, $force);
+
+ // �_�E�����[�h�X�^�[�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���� : ������̃z�X�g���ύX�ɑΉ����ĕύX����
+ *
+ * @param string $in_str �z�X�g���ł�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()
+
+ /**
+ * URL���E�B�L�y�f�B�A���{��ł̋L���Ȃ�true��Ԃ�
+ */
+ static public function isUrlWikipediaJa($url)
+ {
+ return (strncmp($url, 'http://ja.wikipedia.org/wiki/', 29) == 0);
+ }
+
+ // }}}
+ // {{{ getCurrentHost()
+
+ /**
+ * �ŐV�̃z�X�g���擾����
+ *
+ * @param string $host �z�X�g��
+ * @param string $bbs ��
+ * @param bool $autosync �ړ]�����o�����Ƃ��Ɏ����œ������邩�ۂ�
+ * @return string �ɑΉ�����ŐV�̃z�X�g
+ */
+ static public function getCurrentHost($host, $bbs, $autosync = true)
+ {
+ static $synced = false;
+
+ // �}�b�s���O�ǂݍ���
+ $map = self::_getMapping();
+ if (!$map) {
+ return $host;
+ }
+ $type = self::getHostGroupName($host);
+
+ // �`�F�b�N
+ if (isset($map[$type]) && isset($map[$type][$bbs])) {
+ $new_host = $map[$type][$bbs]['host'];
+ if ($host != $new_host && $autosync && !$synced) {
+ // �ړ]�����o�����炨�C�ɔA���C�ɃX���A�ŋߓǂX���������œ���
+ $msg_fmt = 'rep2 info: �z�X�g�̈ړ]�����o���܂����B(%s/%s �� %s/%s)
';
+ $msg_fmt .= '���C�ɔA���C�ɃX���A�ŋߓǂ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 �z�X�g��
+ * @param string $bbs ��
+ * @return string ���j���[�ɋL�ڂ���Ă����
+ */
+ static public function getItaName($host, $bbs)
+ {
+ // �}�b�s���O�ǂݍ���
+ $map = self::_getMapping();
+ if (!$map) {
+ return $bbs;
+ }
+ $type = self::getHostGroupName($host);
+
+ // �`�F�b�N
+ if (isset($map[$type]) && isset($map[$type][$bbs])) {
+ $itaj = $map[$type][$bbs]['itaj'];
+ } else {
+ $itaj = $bbs;
+ }
+
+ return $itaj;
+ }
+
+ // }}}
+ // {{{ isRegisteredBbs()
+
+ /**
+ * ��rep2�ɓo�^����Ă��邩�ǂ���
+ *
+ * @param string $host �z�X�g��
+ * @param string $bbs ��
+ * @return bool rep2�ɒlj�����Ă���Ȃ�true
+ */
+ static public function isRegisteredBbs($host, $bbs)
+ {
+ global $_conf;
+
+ $type = self::getHostGroupName($host);
+
+ // dat�j���h�~�̂���itest.[25]ch.net�͖ⓚ���p��false
+ if($host == 'itest.5ch.net'||$host == 'itest.2ch.net') {
+ return false;
+ }
+
+ // �o�^�����ł�rep2�ň�����̓`�F�b�N������true
+ if($host != $type) {
+ return true;
+ }
+
+ // �}�b�s���O�ǂݍ���
+ $map = self::_getMapping();
+ if (!$map) {
+ return false;
+ }
+
+ // �`�F�b�N
+ if (isset($map[$type]) && isset($map[$type][$bbs])) {
+ return true;
+ }
+
+ // ����������Ȃ�����C�ɔ̓��e���m�F(�O�����o�^�\�ɂȂ��Ă��邽��)
+ if ($lines = FileCtl::file_read_lines($_conf['favita_brd'], FILE_IGNORE_NEW_LINES)) {
+ foreach ($lines as $l) {
+ if (preg_match("/^\t?(.+)\t(.+)\t(.+)\$/", $l, $matches)) {
+ if ($host == $matches[1])
+ {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ // }}}
+ // {{{ syncBrd()
+
+ /**
+ * ���C�ɔȂǂ�brd�t�@�C��������
+ *
+ * @param string $brd_path brd�t�@�C���̃p�X
+ * @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���Ȃǂ�idx�t�@�C��������
+ *
+ * @param string $idx_path idx�t�@�C���̃p�X
+ * @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�ɔA���C�ɃX���A�ŋߓǂ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()
+
+ /**
+ * 2ch�������j���[���p�[�X���A��-�z�X�g�̑Ή��\���쐬����
+ *
+ * @return array site/bbs/(host,itaj) �̑������A�z�z��
+ * �_�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�������ɃL���b�V�����č\�z���邪�ABrdCtl���ōŒ�30���̓A�N�Z�X���Ȃ��B
+
+ // }}}
+ // {{{ �L���b�V���m�F
+
+ 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);
+ // }}}
+ // {{{ �L���b�V������
+
+ $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�V��̃f�[�^����������
+ *
+ * @param string $path �������ރt�@�C���̃p�X
+ * @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()
+
+ /**
+ * �z�X�g�ɑΉ����邨�C�ɔE���C�ɃX���O���[�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!��URL�Q�[�g�E�F�C��ʂ��悤��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() �̃L���b�V��
- */
- static private $_hostIs2chs = array();
-
- /**
- * isHostBe2chNet() �̃L���b�V��
- */
- //static private $_hostIsBe2chNet = array();
-
- /**
- * isHostBbsPink() �̃L���b�V��
- */
- static private $_hostIsBbsPink = array();
-
- /**
- * isHostMachiBbs() �̃L���b�V��
- */
- static private $_hostIsMachiBbs = array();
-
- /**
- * isHostMachiBbsNet() �̃L���b�V��
- */
- static private $_hostIsMachiBbsNet = array();
-
- /**
- * isHostJbbsShitaraba() �̃L���b�V��
- */
- static private $_hostIsJbbsShitaraba = array();
-
/**
* P2Ime�I�u�W�F�N�g
*
@@ -120,11 +90,11 @@ static private function encodeCookieName($key)
* setcookie() �ł́Aau�ŕK�v��max 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 = '',
/**
* �N�b�L�[����������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);
-
- // 1�i�K�������_�C���N�g��ǐ�
- 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���[���b�Z�[�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);
- }
-
- // �X�V���������
- 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 .= "�f�B���N�g���̎����쐬�����݂܂�...
";
- if (mkdir($aDir)) {
+ if (FileCtl::mkdirRecursive($aDir)) {
//$info_msg_ht .= "�f�B���N�g���̎����쐬���������܂����B";
} else {
//$info_msg_ht .= "�f�B���N�g���������쐬�ł��܂���ł����B
�蓮�Ńf�B���N�g�����쐬���A�p�[�~�b�V������ݒ肵�ĉ������B";
}
} else {
- //$info_msg_ht .= "�f�B���N�g�����쐬���A�p�[�~�b�V������ݒ肵�ĉ������B";
+ //$info_msg_ht .= "�f�B���N�g�����쐬���A�p�[�~�b�V������ݒ肵�ĉ������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���}�b�s���O�f�[�^����擾
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)) {
+ //�݊����ێ��̂��ߋ����̃f�B���N�g�����w��
+ $host_dir = $base_dir . DIRECTORY_SEPARATOR . rawurlencode($host);
+ if (!file_exists($host_dir)) {
+ //�����̃f�B���N�g��������=�����V�K�C���X�g�[����or�I�ړ]�̂��߁A�f�B���N�g���̎w���ύX
+ $host_dir = $base_dir . DIRECTORY_SEPARATOR . 'open2ch';
+ }
- // machibbs.com
- } elseif (self::isHostMachiBbs($host)) {
+ } elseif (P2HostMgr::isHost2chSc($host)) {
+ //�݊����ێ��̂��ߋ����̃f�B���N�g�����w��
+ $host_dir = $base_dir . DIRECTORY_SEPARATOR . rawurlencode($host);
+ if (!file_exists($host_dir)) {
+ //�����̃f�B���N�g��������=�����V�K�C���X�g�[����or�I�ړ]�̂��߁A�f�B���N�g���̎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�ŃX���b�V�����̕������܂ނƂ�
+ // 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�ŃX���b�V�����̕������܂ނƂ�
} 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 �v�f�̏��ԂɈӖ�����B
+ * @param array $data �v�f�̏��ԂɈӖ�����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);
- // ���݊��p��string����t
+ // ���݊��p��string����t
} else {
$cont = rtrim($data);
}
@@ -764,8 +719,8 @@ static public function recKeyIdx($keyidx, $data)
/**
* ���p�Q�[�g��ʂ����߂�URL�ϊ�
*
- * @param string $url
- * @param int $delay �����̏ꍇ�͎蓮�]���A����ȊO�̓Q�[�g�̎d�l�ɂ��
+ * @param string $url
+ * @param int $delay �����̏ꍇ�͎蓮�]���A����ȊO�̓Q�[�g�̎d�l�ɂ��
* @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 ���Ꭶ�p�h���C���Ȃ� 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���� : ������̃z�X�g���ύX�ɑΉ����ĕύX����
- *
- * @param string $in_str �z�X�g���ł�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�`���iTAB�j�ɕϊ�����
- */
- 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����
- // �܂��^�u��S�Ċ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()
-
- /**
- * �u���E�U��Safari�n�Ȃ�true��Ԃ�
- */
- static public function isBrowserSafariGroup()
- {
- return UA::isSafariGroup();
- }
-
- // }}}
- // {{{ isClientOSWindowsCE()
-
- /**
- * �u���E�U��Windows CE�œ��삷����̂Ȃ�true��Ԃ�
- */
- static public function isClientOSWindowsCE()
- {
- return (strpos($_SERVER['HTTP_USER_AGENT'], 'Windows CE') !== false);
- }
-
- // }}}
- // {{{ isBrowserNintendoDS()
-
- /**
- * �j���e���h�[DS�u���E�U�[�Ȃ�true��Ԃ�
- */
- static public function isBrowserNintendoDS()
- {
- return UA::isNintendoDS();
- }
-
- // }}}
- // {{{ isBrowserPSP()
- /**
- * �u���E�U��PSP�Ȃ�true��Ԃ�
- */
- static public function isBrowserPSP()
- {
- return UA::isPSP();
- }
-
- // }}}
- // {{{ isBrowserIphone()
-
- /**
- * �u���E�U��iPhone, iPod Touch or Android�Ȃ�true��Ԃ�
- */
- static public function isBrowserIphone()
- {
- return UA::isIPhoneGroup();
- }
-
- // }}}
- // {{{ isUrlWikipediaJa()
-
- /**
- * URL���E�B�L�y�f�B�A���{��ł̋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;
// IE�f�t�H���g�̃��b�Z�[�W��\�������Ȃ��悤�ɃX�y�[�X���o��
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����ŏI�X�V���$lifeTime�b�ȏソ�����t�@�C�����폜
*
- * @param string $targetDir �K�[�x�b�W�R���N�V�����Ώۃf�B���N�g��
- * @param integer $lifeTime �t�@�C���̗L�������i�b�j
- * @param string $prefix �Ώۃt�@�C�����̐ړ����i�I�v�V�����j
- * @param string $suffix �Ώۃt�@�C�����̐ڔ����i�I�v�V�����j
- * @param boolean $recurive �ċA�I�ɃK�[�x�b�W�R���N�V�������邩�ۂ��i�f�t�H���g�ł�false�j
+ * @param string $targetDir �K�[�x�b�W�R���N�V�����Ώۃf�B���N�g��
+ * @param integer $lifeTime �t�@�C���̗L�������i�b�j
+ * @param string $prefix �Ώۃt�@�C�����̐ړ����i�I�v�V�����j
+ * @param string $suffix �Ώۃt�@�C�����̐ڔ����i�I�v�V�����j
+ * @param boolean $recurive �ċA�I�ɃK�[�x�b�W�R���N�V�������邩�ۂ��i�f�t�H���g�ł�false�j
* @return array �폜�ɐ��������t�@�C���Ǝ��s�����t�@�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�[�W����1.0.0�ȍ~�AVar_Dump::display() �̑��������^�̂Ƃ�
* ���ڕ\���������ɁA�_���v���ʂ�������Ƃ��ĕԂ�B)
*
- * @param array $info �e�[�u���ɂ������z��
- * @param integer $indent ���ʂ�HTML�����₷�����邽�߂̃C���f���g��
+ * @param array $info �e�[�u���ɂ������z��
+ * @param integer $indent ���ʂ�HTML�����₷�����邽�߂̃C���f���g��
* @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���œW�J
+ $table .= self::Info_Dump($value, $indent + 1); //�z��̏ꍇ�͍ċA�Ăяo���œW�J
} 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
-
- /**
- * Web�y�[�W���擾����
- *
- * 200 OK
- * 206 Partial Content
- * 304 Not Modified �� ���s����
- *
- * @return array|false ����������y�[�W���e��Ԃ��B���s������false��Ԃ��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)
// �X��URL�̒��ڎ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���C���̂�) - 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�̃X���b�h���w�肷��QUERY_STRING����͂���
*
- * @param string $query
+ * @param string $query
* @return array
*/
static public function parseMachiQuery($query)
@@ -1969,9 +1679,9 @@ static public function parseMachiQuery($query)
/**
* HTML����DOMDocument������
*
- * @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�[���o�b�N���Ƃ���
+ * �}�b�`�ӏ��S�̂�rawurlencode()��������
+ *
+ * @param array $m
+ * @return string
+ */
+ static public function rawurlencodeCallback(array $m)
+ {
+ return rawurlencode($m[0]);
+ }
+
+ // }}}
+ // {{{ isEnableBe2ch()
+ /**
+ * be���g�p�\�Ȑݒ肩���ׂ�
+ * @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;
+ }
+ // }}}
+ // {{{
/**
- * P2Client�N���X�̃C���X�^���X������
+ * ���[�U�[�ݒ肵���A�J�E���g�ŁAbe.2ch.net�Ƀ��O�C������DMDM, MDMD���擾����
+ * �i�F�R�[�h��urlencode���ꂽ�܂܂̏�ԁj
*
- * @param void
- * @return P2Client
+ * @access public
+ * @param string $host Be�F����z�X�g��
+ * @return array|false|null �F�R�[�h�z��|�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�Ƀ��O�C������DMDM, MDMD���擾����
+ * �i�F�R�[�h��urlencode���ꂽ�܂܂̏�ԁj
+ *
+ * @access private
+ * @param string $host Be�F����z�X�g��
+ * @return array|string ����|�G���[���b�Z�[�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', '���O�C������');
+
+ $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�[���o�b�N���Ƃ���
- * �}�b�`�ӏ��S�̂�rawurlencode()��������
+ * +Wiki:�v���t�B�[��ID����BEID���v�Z����
*
- * @param array $m
- * @return string
+ * @return integer|0 ����������BEID��Ԃ��B���s������0��Ԃ��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()
+
+ /**
+ * �Q�l ID �̗L�����m�F
+ *
+ * @return boolean �Q�l 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���邽�߂ɕK�v�ȏ�ݒ肳��Ă��܂���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);
+ }
+
+ // 2ch�Q�l<��>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);
+
+ // POST�f�[�^�̑��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: �Q�l<��>�̔F�؊m�F�T�[�o�ɐڑ��o���܂���ł����B({$e->getMessage()}) ");
+ }
+
+ // �ڑ����s�Ȃ��
+ if (empty($body)) {
+ self::pushInfoHtml('p2 info: �Q�l<��>ID�Ɋւ���m�F���s���ɂ́APHP��cURL������OpenSSL�����L���ł���K�v������܂��B ');
+
+ self::pushInfoHtml("p2 error: �Q�l<��>�̗L�����m�F�Ɏ��s���܂����B{$curl_msg} ");
+ return false;
+ }
+
+ $body = trim($body);
+
+ // �G���[���o
+ if (preg_match('/ERROR (\d+): (.*)/', $body, $matches)) {
+ self::pushInfoHtml("p2 error: �Q�l<��>�̗L�����m�F�Ɏ��s���܂����B{$matches[2]}[{$matches[1]}] ");
+ return false;
+ }
+
+ // �A�J�E���g�����o�^
+ if (preg_match('/User does not exists/', $body, $matches)) {
+ self::pushInfoHtml("p2 error: �Q�l�A�J�E���g���o�^����Ă��܂��� ");
+ 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�������`�F�b�N
+ if (time() >= $expiration) {
+ self::pushInfoHtml("p2 error: �Q�l<��>�̗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: �Q�l<��>�̗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�̒l��UTF-8�ɕϊ����Ă���JSON�G���R�[�h����
+ *
+ * @param mixed $values
+ * @return string JSON
+ */
+function p2_json_encode($values)
+{
+ // mb_convert_variables�͖{���������z��ł̓����ۏ��Ă��Ȃ��̂�
+ // array_walk_recursive�ʼnB
+ // array_walk_recursive���������z��Ή����ĂȂ��͂������ǂƂ肠���������B�B�B
+ // 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�ƃu���b�N�\���p��onclick��ݒ�
+ $tores .= "\n";
+ } else {
+ $tores .= " \n";
+ }
+ $tores .= "\n"; // res-header�����
+
+ // �탌�X���X�g(�c�`��)
+ if ($_conf['backlink_list'] == 1 || $_conf['backlink_list'] > 2) {
+ $tores .= $this->_quotebackListHtml($i, 1);
+ }
+
+ $tores .= " {$msg} \n"; // ���e
+ // �탌�X�W�J�p�u���b�N
+ if ($_conf['backlink_block'] > 0) {
+ $backlinks = $this->_getBacklinkComment($i);
+ if (strlen($backlinks)) {
+ $tores .= ' ';
+ $tores .= $backlinks;
+ }
+ }
+ // �탌�X���X�g(���`��)
+ if ($_conf['backlink_list'] == 2 || $_conf['backlink_list'] > 2) {
+ $tores .= $this->_quotebackListHtml($i, 2, false);
+ }
+ $tores .= " \n";
+
+// $tores .= $rpop; // ���X�|�b�v�A�b�v�p���p
+
+?>
\ 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���ځ[��`�F�b�N
+ $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); // ���b�Z�[�WHTML�ϊ�
+
+ // BE�v���t�@�C�������N�ϊ�
+ $date_id = $this->replaceBeId($date_id, $i);
+
+ // ID�t�B���^
+ if ($_conf['flex_idpopup'] == 1 && $id && $this->thread->idcount[$id] > 1) {
+ $date_id = str_replace($idstr, $this->idFilter($idstr, $id), $date_id);
+ }
+
+ // HTML�|�b�v�A�b�v
+ if ($_conf['iframe_popup']) {
+ $date_id = preg_replace_callback("{ ((\?#*)|(Lv\.\d+))}", array($this, 'iframePopupCallback'), $date_id);
+ }
+
+ // NG���b�Z�[�W�ϊ�
+ if ($ng_type != self::NG_NONE && count($ng_info)) {
+ $ng_info = implode(', ', $ng_info);
+ $msg = << {$ng_info}
+{$msg}
+EOMSG;
+ }
+
+ // NG�l�[���ϊ�
+ 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;
+
+ }
+
+ /*
+ //�u��������V���v�摜��}��
+ 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 �X�����e�\�����폜
+
+ /*if ($_conf['expack.am.enabled'] == 2) {
+ $tores .= <<
+//
+\n
+EOJS;
+ }*/
+
+ // �܂Ƃ߂ăt�B���^�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);
+ }
+}
+
+// �n�C���C�g�l�[���`�F�b�N
+if ($this->ngAbornCheck('highlight_name', $name) !== false) {
+ $ngaborns_hits['highlight_name']++;
+ $type |= $this->_markHighlight($i, self::HIGHLIGHT_NAME, false);
+}
+
+// �n�C���C�g���[���`�F�b�N
+if ($this->ngAbornCheck('highlight_mail', $mail) !== false) {
+ $ngaborns_hits['highlight_mail']++;
+ $type |= $this->_markHighlight($i, self::HIGHLIGHT_MAIL, false);
+}
+
+// �n�C���C�gID�`�F�b�N
+if ($this->ngAbornCheck('highlight_id', $date_id) !== false) {
+ $ngaborns_hits['highlight_id']++;
+ $type |= $this->_markHighlight($i, self::HIGHLIGHT_ID, false);
+}
+
+// �n�C���C�g���b�Z�[�W�`�F�b�N
+$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)(?![^<]*>)"; // �������ꕔ����Ă��܂��A���J�[��HTML�^�O���Ƀ}�b�`�����Ȃ�
+ $msg = preg_replace("(((?:>|��|-)+)($highlight_chain_nums))", "$1$2", $msg);
+}
+
+// �n�C���C�g���b�Z�[�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);
+ }
+}
+
+// �n�C���C�g�l�[���ϊ�
+if ($ng_type & self::HIGHLIGHT_NAME) {
+ $name = preg_replace("(|)", "", $name);
+ $name = "$name";
+}
+
+// �n�C���C�g���[���ϊ�
+if ($ng_type & self::HIGHLIGHT_MAIL) {
+ $mail = "$mail";
+}
+
+// �n�C���C�gID�ϊ�
+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 @@
+���O�F';
+ $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���^�C��15�����ȏ�̏ꍇ�͒Z�k
+ $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�[�h����p�������擪�Ɏ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 @@
+ | |