[P2-php-svn] [806] expack:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 26日 (火) 01:57:05 JST


Revision: 806
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=806
Author:   rsk
Date:     2010-01-26 01:57:05 +0900 (Tue, 26 Jan 2010)

Log Message:
-----------
expack:
- 本家rep2からSPMの逆参照機能をインポート。
- 設定管理 > ユーザー設定編集 > 拡張パック設定 > SPM > expack.spm.filter_target
  の値を「HTMLポップアップ」にすると、SPMのフィルタリング結果 (逆参照も含む) を
  HTMLポップアップ表示できるようにした。

Modified Paths:
--------------
    p2ex/trunk/conf/conf_admin_ex.inc.php
    p2ex/trunk/conf/conf_user_def_ex.inc.php
    p2ex/trunk/js/smartpopup.js
    p2ex/trunk/lib/ShowThread.php
    p2ex/trunk/read_filter.php
    p2ex/trunk/read_filter_k.php
    p2ex/trunk/style/post_css.inc


-------------- next part --------------
Modified: p2ex/trunk/conf/conf_admin_ex.inc.php
===================================================================
--- p2ex/trunk/conf/conf_admin_ex.inc.php	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/conf/conf_admin_ex.inc.php	2010-01-25 16:57:05 UTC (rev 806)
@@ -17,7 +17,7 @@
 // Zend Framework (Zend Gdata‚Å‚à‰Â) ‚ÌlibraryƒfƒBƒŒƒNƒgƒŠ‚ւ̃pƒX
 $_conf['expack.zf_path'] = ""; // ("")
 
-// pecl_http ‚ª—˜—p‚Å‚«‚éê‡AHttpRequestPool ‚É‚æ‚é•À—ñƒ_ƒEƒ[ƒh‚ð—LŒø‚É‚·‚é
+// pecl_http ‚ª—˜—p‚Å‚«‚éê‡AHttpRequestPool ‚É‚æ‚é•À—ñƒ_ƒEƒ“ƒ[ƒh‚ð—LŒø‚É‚·‚é
 // (off:0, on:1, ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚ÅŽÀs:2)
 $_conf['expack.use_pecl_http'] = 1; // (1)
 

Modified: p2ex/trunk/conf/conf_user_def_ex.inc.php
===================================================================
--- p2ex/trunk/conf/conf_user_def_ex.inc.php	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/conf/conf_user_def_ex.inc.php	2010-01-25 16:57:05 UTC (rev 806)
@@ -91,7 +91,14 @@
 $conf_user_rad['expack.spm.filter'] = array('1' => '•\Ž¦', '0' => '”ñ•\Ž¦');
 
 // ƒtƒBƒ‹ƒ^ƒŠƒ“ƒOŒ‹‰Ê‚ðŠJ‚­ƒtƒŒ[ƒ€‚Ü‚½‚̓EƒCƒ“ƒhƒE
-$conf_user_def['expack.spm.filter_target'] = "read"; // ("read")
+$conf_user_def['expack.spm.filter_target'] = "_popup"; // ("_popup")
+$conf_user_sel['expack.spm.filter_target'] = array(
+    '_popup'    => 'HTMLƒ|ƒbƒvƒAƒbƒv',
+    '_blank'    => 'V‹KƒEƒCƒ“ƒhƒE',
+    '_self'     => '“¯‚¶ƒtƒŒ[ƒ€',
+    //'_parent' => 'eƒtƒŒ[ƒ€',
+    //'_top'    => '“¯‚¶ƒEƒCƒ“ƒhƒE',
+);
 
 // }}}
 // {{{ ƒAƒNƒeƒBƒuƒ‚ƒi[

Modified: p2ex/trunk/js/smartpopup.js
===================================================================
--- p2ex/trunk/js/smartpopup.js	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/js/smartpopup.js	2010-01-25 16:57:05 UTC (rev 806)
@@ -16,8 +16,7 @@
 /**
  * ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚𐶐¬‚·‚é
  */
-SPM.init = function(aThread)
-{
+SPM.init = function (aThread) {
 	var threadId = aThread.objName;
 	if (document.getElementById(threadId + '_spm')) {
 		return false;
@@ -28,14 +27,13 @@
 	var spm = document.createElement('div');
 	spm.id = threadId + '_spm';
 	spm.className = 'spm';
-	spm.appendItem = function()
-	{
+	spm.appendItem = function() {
 		this.appendChild(SPM.createMenuItem.apply(this, arguments));
 	};
 	SPM.setOnPopUp(spm, spm.id, false);
 
 	// ƒRƒsƒy—pƒtƒH[ƒ€
-	spm.appendItem('ƒŒƒXƒRƒs[', (function(){
+	spm.appendItem('ƒŒƒXƒRƒs[', (function () {
 		SPM.invite(aThread);
 	}));
 
@@ -46,7 +44,7 @@
 	}
 
 	// ‚±‚±‚Ü‚Å“Ç‚ñ‚¾
-	spm.appendItem('‚±‚±‚Ü‚Å“Ç‚ñ‚¾', (function(){
+	spm.appendItem('‚±‚±‚Ü‚Å“Ç‚ñ‚¾', (function () {
 		SPM.httpcmd('setreadnum', aThread, SPM.callbacks.setreadnum);
 	}));
 
@@ -76,9 +74,14 @@
 		var SpmFilter = false;
 	}
 
+	// ‹tŽQÆ
+	spm.appendItem('‹tŽQÆ', (function (event) {
+		SPM.openFilter(aThread, 'rres', 'on', event);
+	}));
+
 	// ƒAƒNƒeƒBƒuƒ‚ƒi[
 	if (opt[4] == 1) {
-		spm.appendItem('AA—pƒtƒHƒ“ƒg', (function(){
+		spm.appendItem('AA—pƒtƒHƒ“ƒg', (function () {
 			activeMona(SPM.getBlockID());
 		}));
 	}
@@ -89,7 +92,7 @@
 	}
 
 	// PRE
-	/*spm.appendItem('PRE', (function(){
+	/*spm.appendItem('PRE', (function () {
 		var msg = document.getElementById(SPM.getBlockID());
 		if (msg.style.whiteSpace == 'pre') {
 			msg.style.whiteSpace = 'normal';
@@ -124,11 +127,11 @@
 	}
 
 	// •\Ž¦E”ñ•\Ž¦ƒƒ\ƒbƒh‚ðÝ’è
-	aThread.show = (function(resnum, resid, evt){
-		SPM.show(aThread, resnum, resid, evt);
+	aThread.show = (function(resnum, resid, event){
+		SPM.show(aThread, resnum, resid, event);
 	});
-	aThread.hide = (function(evt){
-		SPM.hide(aThread, evt);
+	aThread.hide = (function(event){
+		SPM.hide(aThread, event);
 	});
 
 	return false;
@@ -137,11 +140,10 @@
 /**
  * ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ðƒ|ƒbƒvƒAƒbƒv•\Ž¦‚·‚é
  */
-SPM.show = function(aThread, resnum, resid, evt)
-{
-	var evt = (evt) ? evt : ((window.event) ? event : null);
+SPM.show = function (aThread, resnum, resid, event) {
+	event = event || window.event;
 	if (spmResNum != resnum || spmBlockID != resid) {
-		SPM.hideImmediately(aThread, evt);
+		SPM.hideImmediately(aThread, event);
 	}
 	spmResNum  = resnum;
 	spmBlockID = resid;
@@ -150,16 +152,15 @@
 	} else if (document.selection) {
 		spmSelected = document.selection.createRange().text;
 	}
-	showResPopUp(aThread.objName + '_spm' ,evt);
+	showResPopUp(aThread.objName + '_spm' ,event);
 	return false;
 };
 
 /**
  * ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ð•Â‚¶‚é
  */
-SPM.hide = function(aThread, evt)
-{
-	var evt = (evt) ? evt : ((window.event) ? event : null);
+SPM.hide = function (aThread, event) {
+	event = event || window.event;
 	hideResPopUp(aThread.objName + '_spm');
 	return false;
 };
@@ -167,9 +168,8 @@
 /**
  * ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ð’x‰„ƒ[ƒ‚ŕ‚¶‚é
  */
-SPM.hideImmediately = function(aThread, evt)
-{
-	var evt = (evt) ? evt : ((window.event) ? event : null);
+SPM.hideImmediately = function (aThread, event) {
+	event = event || window.event;
 	document.getElementById(aThread.objName + '_spm').style.visibility = 'hidden';
 	return false;
 };
@@ -177,21 +177,18 @@
 /**
  * ƒNƒ[ƒWƒƒ‚©‚çƒOƒ[ƒoƒ‹•Ï” spmBlockID ‚ðŽæ“¾‚·‚邽‚߂̊֐”
  */
-SPM.getBlockID = function()
-{
+SPM.getBlockID = function() {
 	return spmBlockID;
 };
 
 /**
  * ƒNƒŠƒbƒNŽž‚ÉŽÀs‚³‚ê‚éŠÖ” (ƒ|ƒbƒvƒAƒbƒvƒEƒCƒ“ƒhƒE‚ðŠJ‚­) ‚ðÝ’è‚·‚é
  */
-SPM.setOnClick = function(obj, aThread, inUrl)
-{
+SPM.setOnClick = function (obj, aThread, inUrl) {
 	var option = (arguments.length > 3) ? arguments[3] : '';
-	obj.onclick = function(evt)
-	{
-		evt = (evt) ? evt : ((window.event) ? window.event : null);
-		if (evt) {
+	obj.onclick = function (event) {
+		event = event || window.event;
+		if (event) {
 			return SPM.openSubWin(aThread, inUrl, option);
 		}
 		return false;
@@ -201,21 +198,18 @@
 /**
  * ƒ}ƒEƒXƒI[ƒo[/ƒAƒEƒgŽž‚ÉŽÀs‚³‚ê‚éŠÖ” (ƒƒjƒ…[‚Ì•\Ž¦/”ñ•\Ž¦) ‚ðÝ’è‚·‚é
  */
-SPM.setOnPopUp = function(obj, targetId, isSubMenu)
-{
+SPM.setOnPopUp = function (obj, targetId, isSubMenu) {
 	// ƒ[ƒ‹ƒI[ƒo[
-	obj.onmouseover = function(evt)
-	{
-		evt = (evt) ? evt : ((window.event) ? window.event : null);
-		if (evt) {
-			showResPopUp(targetId, evt);
+	obj.onmouseover = function (event) {
+		event = event || window.event;
+		if (event) {
+			showResPopUp(targetId, event);
 		}
 	};
 	// ƒ[ƒ‹ƒAƒEƒg
-	obj.onmouseout = function(evt)
-	{
-		evt = (evt) ? evt : ((window.event) ? window.event : null);
-		if (evt) {
+	obj.onmouseout = function (event) {
+		event = event || window.event;
+		if (event) {
 			hideResPopUp(targetId);
 		}
 	}
@@ -224,11 +218,12 @@
 /**
  * ƒAƒ“ƒJ[‚𐶐¬‚·‚é
  */
-SPM.createMenuItem = function(txt)
-{
+SPM.createMenuItem = function (txt) {
 	var anchor = document.createElement('a');
 	anchor.href = 'javascript:void(null)';
-	anchor.onclick = function() { return false; };
+	anchor.onclick = function() {
+		return false;
+	};
 	anchor.appendChild(document.createTextNode(txt));
 
 	// ƒNƒŠƒbƒN‚³‚ꂽ‚Æ‚«‚̃Cƒxƒ“ƒgƒnƒ“ƒhƒ‰‚ðÝ’è
@@ -254,13 +249,11 @@
 /**
  * ‚ ‚ځ[‚ñ/NGƒTƒuƒƒjƒ…[‚𐶐¬‚·‚é
  */
-SPM.createNgAbornSubMenu = function(menuId, aThread, mode)
-{
+SPM.createNgAbornSubMenu = function (menuId, aThread, mode) {
 	var amenu = document.createElement('div');
 	amenu.id = menuId;
 	amenu.className = 'spm';
-	amenu.appendItem = function()
-	{
+	amenu.appendItem = function () {
 		this.appendChild(SPM.createMenuItem.apply(this, arguments));
 	};
 	SPM.setOnPopUp(amenu, amenu.id, true);
@@ -276,23 +269,17 @@
 /**
  * ƒtƒBƒ‹ƒ^ƒŠƒ“ƒOƒTƒuƒƒjƒ…[‚𐶐¬‚·‚é
  */
-SPM.createFilterSubMenu = function(menuId, aThread)
-{
-	this.getOnClick = function(field, match)
-	{
-		return (function(evt){
-			evt = (evt) ? evt : ((window.event) ? window.event : null);
-			if (evt) {
-				SPM.openFilter(aThread, field, match);
-			}
+SPM.createFilterSubMenu = function (menuId, aThread) {
+	this.getOnClick = function (field, match) {
+		return (function (event) {
+			SPM.openFilter(aThread, field, match, event);
 		});
 	}
 
 	var fmenu = document.createElement('div');
 	fmenu.id = menuId;
 	fmenu.className = 'spm';
-	fmenu.appendItem = function()
-	{
+	fmenu.appendItem = function() {
 		this.appendChild(SPM.createMenuItem.apply(this, arguments));
 	};
 	SPM.setOnPopUp(fmenu, fmenu.id, true);
@@ -318,8 +305,7 @@
 /**
  * URI‚̏ˆ—‚ð‚µAƒ|ƒbƒvƒAƒbƒvƒEƒCƒ“ƒhƒE‚ðŠJ‚­
  */
-SPM.openSubWin = function(aThread, inUrl, option)
-{
+SPM.openSubWin = function (aThread, inUrl, option) {
 	var inWidth  = 650; // ƒ|ƒbƒvƒAƒbƒvƒEƒCƒ“ƒhƒE‚Ì•
 	var inHeight = 350; // ƒ|ƒbƒvƒAƒbƒvƒEƒCƒ“ƒhƒE‚̍‚‚³
 	var boolS = 1; // ƒXƒNƒ[ƒ‹ƒo[‚ð•\Ž¦ioff:0, on:1j
@@ -367,28 +353,31 @@
 /**
  * URI‚̏ˆ—‚ð‚µAƒtƒBƒ‹ƒ^ƒŠƒ“ƒOŒ‹‰Ê‚ð•\Ž¦‚·‚é
  */
-SPM.openFilter = function(aThread, field, match)
-{
+SPM.openFilter = function (aThread, field, match, event) {
 	var inUrl = 'read_filter.php?bbs=' + aThread.bbs + '&key=' + aThread.key + '&host=' + aThread.host;
 	inUrl += '&rescount=' + aThread.rc + '&ttitle_en=' + aThread.ttitle_en + '&resnum=' + spmResNum;
 	inUrl += '&ls=all&field=' + field + '&method=just&match=' + match + '&offline=1';
 
 	switch (spmFlexTarget) {
+		case '_popup':
+			showHtmlPopUp(inUrl, event || window.event, 0);
+			SPM.hideImmediately(aThread, event);
+			break;
+		case '_blank':
+			window.open(inUrl, '', '');
+			break;
 		case '_self':
-			location.href = inUrl;
+			window.self.location.href = inUrl;
 			break;
 		case '_parent':
-			parent.location.href = inUrl;
+			window.parent.location.href = inUrl;
 			break;
 		case '_top':
-			top.location.href = inUrl;
+			window.top.location.href = inUrl;
 			break;
-		case '_blank':
-			window.open(inUrl, '', '');
-			break;
 		default:
-			if (parent.spmFlexTarget.location.href) {
-				parent.spmFlexTarget.location.href = inUrl;
+			if (window.parent != window.self && typeof window.parent[spmFlexTarget] !== 'undefined') {
+				window.parent[spmFlexTarget].location.href = inUrl;
 			} else {
 				window.open(inUrl, spmFlexTarget, '')
 			}
@@ -400,16 +389,14 @@
 /**
  * ƒRƒsƒy—p‚ɃXƒŒî•ñ‚ðƒ|ƒbƒvƒAƒbƒv‚·‚é (for SPM)
  */
-SPM.invite = function(aThread)
-{
+SPM.invite = function (aThread) {
 	Invite(aThread.title, aThread.url, aThread.host, aThread.bbs, aThread.key, spmResNum);
 };
 
 /**
  * httpcmd.php‚̃‰ƒbƒp[
  */
-SPM.httpcmd = function(cmd, aThread, callback)
-{
+SPM.httpcmd = function (cmd, aThread, callback) {
 	var num = spmResNum;
 	var url = 'httpcmd.php?host=' + aThread.host + '&bbs=' + aThread.bbs + '&key=' + aThread.key
 	        + '&cmd=' + cmd + '&' + cmd + '=' + num;
@@ -422,8 +409,7 @@
 /**
  * u‚±‚±‚Ü‚Å“Ç‚ñ‚¾vƒŠƒNƒGƒXƒgŒã‚ÉŽÀs‚·‚éƒR[ƒ‹ƒoƒbƒNŠÖ”
  */
-SPM.callbacks.setreadnum = function(result, cmd, aThread, num, url)
-{
+SPM.callbacks.setreadnum = function (result, cmd, aThread, num, url) {
 	var msg = 'ƒXƒŒƒbƒhg' + aThread.title + 'h‚ÌŠù“ǐ”‚ð';
 	if (result == '1') {
 		msg += ' ' + num + ' ‚ɃZƒbƒg‚µ‚Ü‚µ‚½B';

Modified: p2ex/trunk/lib/ShowThread.php
===================================================================
--- p2ex/trunk/lib/ShowThread.php	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/lib/ShowThread.php	2010-01-25 16:57:05 UTC (rev 806)
@@ -12,7 +12,7 @@
     /**
      * ƒŠƒ“ƒN‚Æ‚µ‚Ĉµ‚¤ƒpƒ^[ƒ“
      *
-     * @type string
+     * @var string
      */
     const LINK_REGEX = '{
 (?P<link>(<[Aa][ ].+?>)(.*?)(</[Aa]>)) # ƒŠƒ“ƒNiPCRE‚Ì“Á«ãA•K‚¸‚±‚̃pƒ^[ƒ“‚ðÅ‰‚ÉŽŽs‚·‚éj
@@ -41,7 +41,7 @@
     /**
      * ƒŠƒ_ƒCƒŒƒNƒ^‚ÌŽí—Þ
      *
-     * @type int
+     * @var int
      */
     const REDIRECTOR_NONE = 0;
     const REDIRECTOR_IMENU = 1;
@@ -51,7 +51,7 @@
     /**
      * NG‚ ‚ځ[‚ñ‚ÌŽí—Þ
      *
-     * @type int
+     * @var int
      */
     const ABORN = -1;
     const NG_NONE = 0;
@@ -69,31 +69,45 @@
     /**
      * ‚܂Ƃߓǂ݃‚[ƒhŽž‚̃XƒŒƒbƒh”
      *
-     * @type int
+     * @var int
      */
     static private $_matome_count = 0;
 
     /**
      * –{•¶ˆÈŠO‚ªNG‚ ‚ځ[‚ñ‚Ƀqƒbƒg‚µ‚½‘”
      *
-     * @type int
+     * @var int
      */
     static protected $_ngaborns_head_hits = 0;
 
     /**
      * –{•¶‚ªNG‚ ‚ځ[‚ñ‚Ƀqƒbƒg‚µ‚½‘”
      *
-     * @type int
+     * @var int
      */
     static protected $_ngaborns_body_hits = 0;
 
+    /**
+     * getAnchorRegex() ‚̃LƒƒƒbƒVƒ…
+     *
+     * @var array
+     */
+    static private $_anchorRegexes = array();
+
+    /**
+     * _getAnchorRegexParts() ‚̃LƒƒƒbƒVƒ…
+     *
+     * @var array
+     */
+    static private $_anchorRegexParts = null;
+
     // }}}
     // {{{ properties
 
     /**
      * ‚܂Ƃߓǂ݃‚[ƒhŽž‚̃XƒŒƒbƒh”ԍ†
      *
-     * @type int
+     * @var int
      */
     protected $_matome;
 
@@ -101,7 +115,7 @@
      * URL‚ðˆ—‚·‚éŠÖ”Eƒƒ\ƒbƒh–¼‚È‚Ç‚ðŠi”[‚·‚é”z—ñ
      * (‘g‚ݍž‚Ý)
      *
-     * @type array
+     * @var array
      */
     protected $_url_handlers;
 
@@ -109,21 +123,21 @@
      * URL‚ðˆ—‚·‚éŠÖ”Eƒƒ\ƒbƒh–¼‚È‚Ç‚ðŠi”[‚·‚é”z—ñ
      * (ƒ†[ƒU’è‹`A‘g‚ݍž‚Ý‚Ì‚à‚Ì‚æ‚è—Dæ)
      *
-     * @type array
+     * @var array
      */
     protected $_user_url_handlers;
 
     /**
      * •poID‚ð‚ ‚Ú[‚ñ‚·‚é
      *
-     * @type bool
+     * @var bool
      */
     protected $_ngaborn_frequent;
 
     /**
      * NG or ‚ ‚ځ[‚ñƒŒƒX‚ª‚ ‚é‚©‚Ç‚¤‚©
      *
-     * @type bool
+     * @var bool
      */
     protected $_has_ngaborns;
 
@@ -131,7 +145,7 @@
      * ‚ ‚ځ[‚ñƒŒƒX”ԍ†‚¨‚æ‚ÑNGƒŒƒX”ԍ†‚ðŠi”[‚·‚é”z—ñ
      * array_intersect()‚ðŒø—¦‚æ‚­s‚¤‚½‚߁AŠY“–‚·‚郌ƒX”ԍ†‚Í•¶Žš—ñ‚ɃLƒƒƒXƒg‚µ‚ÄŠi”[‚·‚é
      *
-     * @type array
+     * @var array
      */
     protected $_aborn_nums;
     protected $_ng_nums;
@@ -139,28 +153,28 @@
     /**
      * ƒŠƒ_ƒCƒŒƒNƒ^‚ÌŽí—Þ
      *
-     * @type int
+     * @var int
      */
     protected $_redirector;
 
     /**
      * ƒXƒŒƒbƒhƒIƒuƒWƒFƒNƒg
      *
-     * @type ThreadRead
+     * @var ThreadRead
      */
     public $thread;
 
     /**
      * ƒAƒNƒeƒBƒuƒ‚ƒi[EƒIƒuƒWƒFƒNƒg
      *
-     * @type ActiveMona
+     * @var ActiveMona
      */
     public $activeMona;
 
     /**
      * ƒAƒNƒeƒBƒuƒ‚ƒi[‚ª—LŒø‚©”Û‚©
      *
-     * @type bool
+     * @var bool
      */
     public $am_enabled = false;
 
@@ -1012,6 +1026,139 @@
     }
 
     // }}}
+    // {{{ getAnchorRegex()
+
+    /**
+     * ƒAƒ“ƒJ[‚̐³‹K•\Œ»‚ð•Ô‚·
+     *
+     * @param   string  $pattern  ex)'/%full%/'
+     * @return  string
+     */
+    static public function getAnchorRegex($pattern)
+    {
+        if (!array_key_exists($pattern, self::$_anchorRegexes)) {
+            self::$_anchorRegexes[$pattern] = strtr($pattern, self::_getAnchorRegexParts());
+            // ‘卷‚Í‚È‚¢‚ª compileMobile2chUriCallBack() ‚̂悤‚É preg_relplace_callback()‚µ‚Ä‚à‚¢‚¢‚©‚àB
+        }
+        return self::$_anchorRegexes[$pattern];
+    }
+
+    // }}}
+    // {{{ _getAnchorRegexParts()
+
+    /**
+     * ƒAƒ“ƒJ[‚̍\¬—v‘fi³‹K•\Œ»ƒp[ƒc‚Ì”z—ñj‚ð•Ô‚·
+     *
+     * @param   void
+     * @return  string
+     */
+    static private function _getAnchorRegexParts()
+    {
+        if (!is_null(self::$_anchorRegexParts)) {
+            return self::$_anchorRegexParts;
+        }
+
+        $anchor = array();
+
+        // ƒAƒ“ƒJ[‚̍\¬—v‘fi³‹K•\Œ»ƒp[ƒc‚Ì”z—ñj
+
+        // ‹ó”’•¶Žš
+        $anchor_space = '(?:[ ]|@)';
+        //$anchor[' '] = '';
+
+        // ƒAƒ“ƒJ[ˆø—pŽq >>
+        $anchor['prefix'] = "(?:&gt;|„|&lt;|ƒ|r|t|â){1,2}{$anchor_space}*\.?";
+
+        // ”Žš
+        $anchor['a_digit'] = '(?:\\d|‚O|‚P|‚Q|‚R|‚S|‚T|‚U|‚V|‚W|‚X)';
+        /*
+        $anchor[0] = '(?:0|‚O)';
+        $anchor[1] = '(?:1|‚P)';
+        $anchor[2] = '(?:2|‚Q)';
+        $anchor[3] = '(?:3|‚R)';
+        $anchor[4] = '(?:4|‚S)';
+        $anchor[5] = '(?:5|‚T)';
+        $anchor[6] = '(?:6|‚U)';
+        $anchor[7] = '(?:7|‚V)';
+        $anchor[8] = '(?:8|‚W)';
+        $anchor[9] = '(?:9|‚X)';
+        */
+
+        // ”͈͎w’èŽq
+        $anchor['range_delimiter'] = "(?:-|]|\x81\\x5b)"; // [
+
+        // —ñ‹“Žw’èŽq
+        $anchor['delimiter'] = "{$anchor_space}?(?:[,=+]|A|E||C){$anchor_space}?";
+
+        // ‚ ‚ځ[‚ñ—pƒAƒ“ƒJ[ˆø—pŽq
+        //$anchor['prefix_abon'] = "&gt;{1,2}{$anchor_space}?";
+
+        // ƒŒƒX”ԍ†
+        $anchor['a_num'] = sprintf('%s{1,4}', $anchor['a_digit']);
+
+        // ƒŒƒX”͈Í
+        /*
+        $anchor['a_range'] = sprintf("%s(?:%s%s)?",
+            $anchor['a_num'], $anchor['range_delimiter'], $anchor['a_num']
+        );
+        */
+        $anchor['a_range'] = sprintf("%s(?:%s(?:%s)?%s)?",
+            $anchor['a_num'], $anchor['range_delimiter'], $anchor['prefix'], $anchor['a_num']
+        );
+
+        // ƒŒƒX”͈̗͂ñ‹“
+        $anchor['ranges'] = sprintf('%s(?:%s%s)*(?!%s)',
+            $anchor['a_range'], $anchor['delimiter'], $anchor['a_range'], $anchor['a_digit']
+        );
+
+        // ƒŒƒX”ԍ†‚Ì—ñ‹“
+        $anchor['nums'] = sprintf("%s(?:%s%s)*(?!%s)",
+            $anchor['a_num'], $anchor['delimiter'], $anchor['a_num'], $anchor['a_digit']
+        );
+
+        // ƒAƒ“ƒJ[‘S‘Ì
+        $anchor['full'] = sprintf('(%s)(%s)', $anchor['prefix'], $anchor['ranges']);
+
+        // getAnchorRegex() ‚Ì strtr() ’uŠ·—p‚Ékey‚ð '%key%' ‚É•ÏŠ·‚·‚é
+        foreach ($anchor as $k => $v) {
+            $anchor['%' . $k . '%'] = $v;
+            unset($anchor[$k]);
+        }
+
+        self::$_anchorRegexParts = $anchor;
+
+        return self::$_anchorRegexParts;
+    }
+
+    // }}}
+    // {{{_buildStrToLinkRegex()
+
+    /**
+     * ƒŠƒ“ƒN‚Æ‚µ‚Ĉµ‚¤ƒpƒ^[ƒ“‚ð•Ô‚·
+     *
+     * @param   void
+     * @return  string
+     */
+    static protected function _buildStrToLinkRegex()
+    {
+        return '{'
+            . '(?P<link>(<[Aa] .+?>)(.*?)(</[Aa]>))' // ƒŠƒ“ƒNiPCRE‚Ì“Á«ãA•K‚¸‚±‚̃pƒ^[ƒ“‚ðÅ‰‚ÉŽŽs‚·‚éj
+            . '|'
+            . '(?:'
+            .   '(?P<quote>' // ˆø—p
+            .       $this->getAnchorRegex('%full%')
+            .   ')'
+            . '|'
+            .   '(?P<url>'
+            .       '(ftp|h?ttps?|tps?)://([0-9A-Za-z][\\w!#%&+*,\\-./:;=?@\\[\\]^~]+)' // URL
+            .   ')'
+            . '|'
+            .   '(?P<id>ID: ?([0-9A-Za-z/.+]{8,11})(?=[^0-9A-Za-z/.+]|$))' // IDi8,10Œ… +PC/Œg‘ÑŽ¯•Êƒtƒ‰ƒOj
+            . ')'
+            . '}';
+    }
+
+    // }}}
 }
 
 // }}}

Modified: p2ex/trunk/read_filter.php
===================================================================
--- p2ex/trunk/read_filter.php	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/read_filter.php	2010-01-25 16:57:05 UTC (rev 806)
@@ -45,7 +45,15 @@
     $msg = $resar[3];
 
     $aShowThread = new ShowThreadPc($aThread);
-    $word = $aShowThread->getFilterTarget($ares, $resnum, $name, $mail, $date_id, $msg);
+    if ($field == 'rres') {
+        $_REQUEST['field']  = 'msg';
+        $_REQUEST['method'] = 'regex';
+        $word = ShowThread::getAnchorRegex(
+            '%prefix%(.+%delimiter%)?' . $resnum . '(?!\\d|%range_delimiter%)'
+        );
+    } else {
+        $word = $aShowThread->getFilterTarget($ares, $resnum, $name, $mail, $date_id, $msg);
+    }
     if (strlen($word) == 0) {
         unset($word);
     } else {

Modified: p2ex/trunk/read_filter_k.php
===================================================================
--- p2ex/trunk/read_filter_k.php	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/read_filter_k.php	2010-01-25 16:57:05 UTC (rev 806)
@@ -54,7 +54,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
 {$_conf['extra_headers_ht']}
-<title>p2 - ƒXƒŒ“àŒŸõ</title>
+<title>rep2 - ƒXƒŒ“àŒŸõ</title>
 </head>
 <body{$_conf['k_colors']}>
 <p>{$ttitle_back}</p>

Modified: p2ex/trunk/style/post_css.inc
===================================================================
--- p2ex/trunk/style/post_css.inc	2010-01-25 14:10:15 UTC (rev 805)
+++ p2ex/trunk/style/post_css.inc	2010-01-25 16:57:05 UTC (rev 806)
@@ -6,6 +6,8 @@
 
 if($STYLE['a_underline_none'] == 2){
 	$thre_title_underline_css = "a.thre_title{text-decoration:none;}";
+} else {
+    thre_title_underline_css = '';
 }
 
 echo <<<EOSTYLE



P2-php-svn メーリングリストの案内
Back to archive index