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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 8月 16日 (月) 01:27:41 JST


Revision: 879
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=879
Author:   rsk
Date:     2010-08-16 01:27:41 +0900 (Mon, 16 Aug 2010)

Log Message:
-----------
expack:
- iPhone用ビューのツールバーを更新。
- 320x480以外の画面サイズでのiPhone用ビュー表示を改善。
- レスフィルタリング後のページングが正しく行えないバグを修正。
- その他、細かなバグ修正少々。

Modified Paths:
--------------
    p2ex/trunk/css/iphone.css
    p2ex/trunk/httpcmd.php
    p2ex/trunk/img/gp5-info.png
    p2ex/trunk/js/iphone.js
    p2ex/trunk/js/limelight.js
    p2ex/trunk/js/menu_i.js
    p2ex/trunk/js/smartpopup.js
    p2ex/trunk/lib/ResFilter.php
    p2ex/trunk/lib/ThreadRead.php
    p2ex/trunk/lib/get_info.inc.php
    p2ex/trunk/lib/read_filter_k.inc.php
    p2ex/trunk/lib/read_footer_k.inc.php
    p2ex/trunk/lib/read_header.inc.php
    p2ex/trunk/lib/read_header_k.inc.php
    p2ex/trunk/lib/read_jump_k.inc.php
    p2ex/trunk/lib/sb_footer_i.inc.php
    p2ex/trunk/lib/sb_header_i.inc.php
    p2ex/trunk/lib/setfav.inc.php
    p2ex/trunk/lib/setfavita.inc.php
    p2ex/trunk/lib/setpalace.inc.php
    p2ex/trunk/lib/settaborn.inc.php
    p2ex/trunk/lib/spm_k.inc.php
    p2ex/trunk/lib/toolbar_i.inc.php
    p2ex/trunk/read.php
    p2ex/trunk/read_filter.php
    p2ex/trunk/read_filter_k.php
    p2ex/trunk/spm_k.php

Added Paths:
-----------
    p2ex/trunk/lib/read_footer_i.inc.php
    p2ex/trunk/lib/read_header_i.inc.php


-------------- next part --------------
Modified: p2ex/trunk/css/iphone.css
===================================================================
--- p2ex/trunk/css/iphone.css	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/css/iphone.css	2010-08-15 16:27:41 UTC (rev 879)
@@ -128,7 +128,7 @@
 	background: #ffffff url('../img/iphone/btn-bg.png') repeat-x left bottom;
 	border: #505050 solid 1px;
 	-webkit-border-radius: 15px;
-	border-radius: 8px;
+	border-radius: 15px;
 }
 
 div#read_new_header {
@@ -217,12 +217,10 @@
 }
 
 div.res:not(.aborned) {
-	margin: 8px 0;
+	margin: 0;
 	padding: 0;
+	border-top: #808080 solid 1px;
 	background-color: #ffffff;
-	border: #808080 solid 1px;
-	-webkit-border-radius: 8px;
-	border-radius: 8px;
 }
 
 div.res.aborned {
@@ -234,16 +232,17 @@
 
 div.res > div.message {
 	margin: 0;
-	padding: 8px;
+	padding: 10px;
 	line-height: 140%;
 	word-break: break-all;
 }
 
 div.res > div.res-header {
 	margin: 0;
-	padding: 8px;
+	padding: 8px 10px;
 	line-height: 120%;
 	border-bottom: #808080 solid 1px;
+	background-color: #fafafa;
 }
 
 div.res-header > span.no {
@@ -294,13 +293,18 @@
 
 div.respop > div.res {
 	margin: 0 0 8px 0 !important;
-	background-color: rgba(255, 255, 240, 0.9) !important;
-	border-color: rgba(108, 108, 108, 0.8) !important;
+	background-color: rgba(255, 255, 246, 0.95) !important;
+	border: rgba(108, 108, 108, 0.8) solid 1px !important;
+	-webkit-border-radius: 8px;
+	border-radius: 8px;
 	-webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px;
 	box-shadow: rgba(0, 0, 0, 0.7) 0 2px 5px;
 }
 
 div.respop > div.res > div.res-header {
+	background-color: rgba(250, 250, 225, 0.8) !important;
+	-webkit-border-top-right-radius: 8px;
+	border-top-right-radius: 8px;
 	border-bottom-color: rgba(108, 108, 108, 0.8) !important;
 }
 
@@ -314,6 +318,11 @@
 div.respop > div.res > div.respop-back {
 	margin: 0;
 	padding: 0;
+	background-color: rgba(250, 250, 225, 0.8) !important;
+	-webkit-border-bottom-left-radius: 8px;
+	-webkit-border-bottom-right-radius: 8px;
+	border-bottom-left-radius: 8px;
+	border-bottom-right-radius: 8px;
 	border-top: rgba(108, 108, 108, 0.8) solid 1px;
 	text-align: center;
 }
@@ -322,7 +331,7 @@
 	display: block;
 	margin: 0;
 	padding: 3px;
-	font-size: medium;
+	font-size: small;
 	text-decoration: none;
 	color: #252525;
 }
@@ -586,6 +595,7 @@
 /* {{{ new toolbar */
 
 div.ntoolbar {
+	min-width: 320px;
 	margin: 0;
 	padding: 0;
 	background-color: #000;
@@ -605,11 +615,16 @@
 	overflow: hidden;
 	text-overflow: ellipsis;
 	text-align: center;
-	font-weight: normal;
+	font-weight: bold;
 	font-size: 16px;
 	line-height: 16px;
 }
 
+div.ntoolbar > h1.ptitle > span.thin {
+	font-weight: noraml;
+	font-size: 14px;
+}
+
 div.ntoolbar > form,
 div.ntoolbar > div > form {
 	margin: 0;
@@ -687,7 +702,7 @@
 div.ntoolbar td > a {
 	display: inline-block;
 	position: relative;
-	width: 64px; /* 320/5 px */
+	width: 60px;
 	margin: 0 auto;
 	padding: 0;
 	white-space: nowrap;
@@ -705,9 +720,12 @@
 	color: #fff;
 }
 
-div.ntoolbar td > a.inactive,
+div.ntoolbar td > a.inactive {
+	color: #888;
+}
+
 div.ntoolbar td > span.unavailable {
-	color: #666;
+	color: #555;
 }
 
 div.ntoolbar > h1.ptitle > a.hover,
@@ -772,9 +790,12 @@
 	background-color: #fff;
 }
 
-div.ntoolbar td > a.inactive > img,
+div.ntoolbar td > a.inactive > img {
+	background-color: #888;
+}
+
 div.ntoolbar td > span.unavailable > img {
-	background-color: #666;
+	background-color: #555;
 }
 
 div.ntoolbar td > a.hover > img,
@@ -793,7 +814,40 @@
 }
 
 /* }}} */
+/* {{{ Media Queries */
 
+ @ media screen and (min-width: 340px) {
+	div.ntoolbar td > a {
+		width: 64px;
+	}
+}
+
+ @ media screen and (min-width: 360px) {
+	div.ntoolbar td > a {
+		width: 68px;
+	}
+}
+
+ @ media screen and (min-width: 400px) {
+	div.ntoolbar td > a {
+		width: 76px;
+	}
+}
+
+ @ media screen and (min-width: 480px) {
+	div.ntoolbar td > a {
+		width: 92px;
+	}
+}
+
+ @ media screen and (min-width: 640px) {
+	div.ntoolbar td > a {
+		width: 100%;
+	}
+}
+
+/* }}} */
+
 /*
  * Local Variables:
  * mode: css

Modified: p2ex/trunk/httpcmd.php
===================================================================
--- p2ex/trunk/httpcmd.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/httpcmd.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -88,10 +88,10 @@
         } else {
             $r = setFavItaByHostBbs($host, $bbs, $_REQUEST['setfavita'], $itaj);
         }
-        if (empty($r)) {
+        if ($r) {
+            $r_msg = '1'; // Š®—¹
+        } else {
             $r_msg = '0'; // Ž¸”s
-        } elseif ($r == 1) {
-            $r_msg = '1'; // Š®—¹
         }
     }
     break;
@@ -116,10 +116,10 @@
         } else {
             $r = setFav($host, $bbs, $key, $_REQUEST['setfav'], $ttitle);
         }
-        if (empty($r)) {
+        if ($r) {
+            $r_msg = '1'; // Š®—¹
+        } else {
             $r_msg = '0'; // Ž¸”s
-        } elseif ($r == 1) {
-            $r_msg = '1'; // Š®—¹
         }
     }
     break;
@@ -140,10 +140,10 @@
             $ttitle = null;
         }
         $r = setPal($host, $bbs, $key, $_REQUEST['setpal'], $ttitle);
-        if (empty($r)) {
+        if ($r) {
+            $r_msg = '1'; // Š®—¹
+        } else {
             $r_msg = '0'; // Ž¸”s
-        } elseif ($r == 1) {
-            $r_msg = '1'; // Š®—¹
         }
     }
     break;
@@ -157,10 +157,10 @@
             include P2_LIB_DIR . '/settaborn.inc.php';
         }
         $r = settaborn($host, $bbs, $key, $_REQUEST['taborn']);
-        if (empty($r)) {
+        if ($r) {
+            $r_msg = '1'; // Š®—¹
+        } else {
             $r_msg = '0'; // Ž¸”s
-        } elseif ($r == 1) {
-            $r_msg = '1'; // Š®—¹
         }
     }
     break;

Modified: p2ex/trunk/img/gp5-info.png
===================================================================
(Binary files differ)

Modified: p2ex/trunk/js/iphone.js
===================================================================
--- p2ex/trunk/js/iphone.js	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/js/iphone.js	2010-08-15 16:27:41 UTC (rev 879)
@@ -723,11 +723,13 @@
  * @return {false}
  */
 iutil.toolbarShowHide = function(element, event) {
-	var href = element.href;
-	var offset = element.href.indexOf('#');
+	var url, offset, id, target;
 
+	url = element.href;
+	offset = url.indexOf('#');
 	if (offset !== -1) {
-		var target = document.getElementById(href.substring(offset + 1, href.length));
+		id = url.substring(offset + 1, url.length);
+		target = document.getElementById(id);
 		if (target) {
 			if (target.style.display === 'block') {
 				target.style.display = 'none';
@@ -735,6 +737,20 @@
 			} else {
 				target.style.display = 'block';
 				element.className = 'active';
+
+				if (id.indexOf('toolbar_filter') !== -1) {
+					var i, l, f;
+					f = target.getElementsByTagName('input');
+					if (f) {
+						l = f.length;
+						for (i = 0; i < l; i++) {
+							if (f[i].type === 'text') {
+								f[i].focus();
+								break;
+							}
+						}
+					}
+				}
 			}
 		}
 	}
@@ -743,39 +759,26 @@
 };
 
 // }}}
-// {{{ toolbarSetFav()
+// {{{ toolbarRunHttpCommand()
 
 /**
- * ƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“‚Å‚¨‹C‚ɃXƒŒ‚Ì“o˜^E‰ðœ‚ðƒgƒOƒ‹‚·‚é
+ * ƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“‚ÅŠeŽíó‘Ô‚ðƒgƒOƒ‹‚·‚é
  *
  * @param {Element} element
  * @param {Event} event
  * @return {false}
  */
-iutil.toolbarSetFav = function(element, event) {
+iutil.toolbarRunHttpCommand = function(element, event) {
 	if (iutil.httpGetText(element.href) == '1') {
 		iutil.toggleClass(element, 'inactive');
 	} else {
-		window.alert('‚¨‹C‚É“ü‚è‚Ì“o˜^E‰ðœ‚ÉŽ¸”s‚µ‚Ü‚µ‚½');
+		window.alert('ƒRƒ}ƒ“ƒhŽÀs‚ÉŽ¸”s‚µ‚Ü‚µ‚½');
 	}
 
 	return iutil.stopEvent(event);
 };
 
 // }}}
-// {{{ toolbarSetFavIta()
-
-/**
- * ƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“‚Å‚¨‹C‚ɔ‚̓o˜^E‰ðœ‚ðƒgƒOƒ‹‚·‚é
- * ŽÀ‘Ì‚Íiutil.toolbarSetFav
- *
- * @param {Element} element
- * @param {Event} event
- * @return {false}
- */
-iutil.toolbarSetFavIta = iutil.toolbarSetFav;
-
-// }}}
 // {{{ toggleClass()
 
 /**

Modified: p2ex/trunk/js/limelight.js
===================================================================
--- p2ex/trunk/js/limelight.js	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/js/limelight.js	2010-08-15 16:27:41 UTC (rev 879)
@@ -1181,6 +1181,16 @@
 			self.toggleImageLoading(false);
 			self.resetTransformation();
 			this.removeEventListener('load', self.handlers.imageload, false);
+			/*
+			this.addEventListener('dragstart', function(event) {
+				event.touches = [event];
+				self.onTouchStart(event);
+			}, false);
+			this.addEventListener('drop', function(event) {
+				event.touches = [event];
+				self.onTouchEnd(event);
+			}, false);
+			*/
 		}
 	};
 };
@@ -1886,6 +1896,7 @@
 	image.className = 'limelight-image';
 	image.setAttribute('src', uri);
 	image.setAttribute('alt', '');
+	image.setAttribute('draggable', 'true');
 	if (typeof title == 'string' && title.length) {
 		image.setAttribute('title', title);
 	}
@@ -2036,17 +2047,38 @@
 Limelight.prototype.onOrientationChange = function() {
 	var x, y, width, height, isPortrait, viewportSize, margins;
 
-	isPortrait = Limelight.ui.isPortrait();
-	viewportSize = Limelight.ui.getViewportSize(isPortrait);
-	margins = Limelight.ui.getMargins(isPortrait);
+	//isPortrait = Limelight.ui.isPortrait();
+	//viewportSize = Limelight.ui.getViewportSize(isPortrait);
+	//margins = Limelight.ui.getMargins(isPortrait);
 
 	x = 0;
 	y = window.scrollY;
-	width = viewportSize[0] - margins[0]
-	height = viewportSize[1] - margins[1]
+	if (document.all && !window.opera) {
+		if (document.compatMode === 'BackCompat') {
+			y = document.body.scrollTop;
+		} else {
+			y = document.documentElement.scrollTop;
+		}
+	} else {
+		if (typeof window.scrollX === 'number') {
+			y = window.scrollY;
+		} else {
+			y = window.pageYOffset;
+		}
+	}
+	if (typeof document.compatMode === 'undefined') {
+		width = document.innerWidth;
+		height = document.innerHeight;
+	} else if (document.compatMode === 'BackCompat') {
+		width = document.body.clientWidth;
+		height = document.body.clientHeight;
+	} else {
+		width = document.documentElement.clientWidth;
+		height = document.documentElement.clientHeight;
+	}
 
 	this.boxX = x;
-	this.boxY = y
+	this.boxY = y;
 	this.boxWidth = width;
 	this.boxHeight = height;
 

Modified: p2ex/trunk/js/menu_i.js
===================================================================
--- p2ex/trunk/js/menu_i.js	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/js/menu_i.js	2010-08-15 16:27:41 UTC (rev 879)
@@ -628,7 +628,7 @@
 			typeof window.iutil === 'undefined' ||
 			typeof window.JSON  === 'undefined')
 		{
-			window.setTimeout(arguments.callee, 50);
+			window.setTimeout(arguments.callee, 50, event);
 		} else {
 			document.removeEventListener(event.type, arguments.callee, false);
 			setup(window.iui, window.iutil, window.JSON);

Modified: p2ex/trunk/js/smartpopup.js
===================================================================
--- p2ex/trunk/js/smartpopup.js	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/js/smartpopup.js	2010-08-15 16:27:41 UTC (rev 879)
@@ -45,7 +45,7 @@
 
 	// ‹tŽQÆ
 	spm.appendItem('‹tŽQÆ', (function (event) {
-		SPM.openFilter(aThread, 'rres', 'on', event);
+		SPM.openFilter(aThread, 'num:refed', 'on', event);
 	}));
 
 	// ‚±‚±‚Ü‚Å“Ç‚ñ‚¾
@@ -371,11 +371,25 @@
  * URI‚̏ˆ—‚ð‚µAƒtƒBƒ‹ƒ^ƒŠƒ“ƒOŒ‹‰Ê‚ð•\Ž¦‚·‚é
  */
 SPM.openFilter = function (aThread, field, match, event) {
-	var target;
-	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';
+	var target, inUrl, encode;
 
+	encode = function (key, value) {
+		return encodeURIComponent(key) + '=' + encodeURIComponent(value);
+	};
+
+	inUrl = 'read_filter.php?' + [
+		encode('host', aThread.host),
+		encode('bbs', aThread.bbs),
+		encode('key', aThread.key),
+		encode('rescount', aThread.rc),
+		encode('ttitle_en',  aThread.ttitle_en),
+		encode('resnum', spmResNum),
+		encode('field', field),
+		encode('rf[method]', 'just'),
+		encode('rf[match]', match),
+		'offline=1'
+	].join('&');
+
 	event = event || window.event;
 	if (event.shiftKey) {
 		target = '_blank';

Modified: p2ex/trunk/lib/ResFilter.php
===================================================================
--- p2ex/trunk/lib/ResFilter.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/ResFilter.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -9,6 +9,7 @@
 {
     // {{{ constants
 
+    const FIELD_NUMBER = 'num';
     const FIELD_HOLE = 'hole';
     const FIELD_NAME = 'name';
     const FIELD_MAIL = 'mail';
@@ -39,6 +40,7 @@
     static private $_instance = null;
 
     static protected $_fields = array(
+        self::FIELD_NUMBER => 'ƒŒƒX”ԍ†',
         self::FIELD_HOLE => '‘S‘Ì',
         self::FIELD_MESSAGE => '–{•¶',
         self::FIELD_NAME => '–¼‘O',
@@ -108,25 +110,25 @@
     {
         $filter = self::$_instance;
         if ($filter === null) {
-            $params = array('rf' => array(
+            $params = array(
                 'field'   => self::FIELD_DEFAULT,
                 'method'  => self::METHOD_DEFAULT,
                 'match'   => self::MATCH_DEFAULT,
                 'include' => self::INCLUDE_DEFAULT,
-            ));
+            );
         } else {
-            $params = array('rf' => array(
+            $params = array(
                 'field'   => $filter->field,
                 'method'  => $filter->method,
                 'match'   => $filter->match,
                 'include' => $filter->include,
-            ));
+            );
             if ($filter->hasWord()) {
                 $params['word'] = $filter->word;
             }
         }
 
-        return http_build_query($params, '', $separator);
+        return http_build_query(array('rf' => $params), '', $separator);
     }
 
     // }}}
@@ -280,16 +282,19 @@
      * ƒtƒBƒ‹ƒ^ƒŠƒ“ƒO‚̃^[ƒQƒbƒg‚𓾂é
      *
      * @param string $ares
-     * @param int $ares
+     * @param int $resnum
      * @param string $name
      * @param string $mail
      * @param string $date_id
      * @param string $msg
      * @return string
      */
-    public function getTarget($ares, $i, $name, $mail, $date_id, $msg)
+    public function getTarget($ares, $resnum, $name, $mail, $date_id, $msg)
     {
         switch ($this->field) {
+            case self::FIELD_NUMBER:
+                $target = (string)$resnum;
+                break;
             case self::FIELD_NAME:
                 $target = $name;
                 break;
@@ -308,8 +313,9 @@
             case self::FIELD_MESSAGE:
                 $target = $msg;
                 break;
-            default: // 'hole'
-                $target = strval($i) . '<>' . $ares;
+            case self::FIELD_HOLE:
+            default:
+                $target = "{$resnum}<>{$ares}";
         }
 
         $target = @strip_tags($target, '<>');
@@ -431,7 +437,8 @@
     {
         $aThread = $aShowThread->thread;
         $failure = ($this->match == self::MATCH_ON) ? false : true;
-        $datlines = array_fill(0, count($aThread->datlines), null);
+        $count = count($aThread->datlines);
+        $datlines = array_fill(0, $count, null);
         $hit_nums = array();
         $res_nums = array();
         $check_refs = ($this->include & self::INCLUDE_REFERENCES) ? true : false;
@@ -439,24 +446,19 @@
 
         // {{{ 1ƒpƒX–Ú (ƒ}ƒbƒ`ƒ“ƒO‚ÆŽQÆƒŒƒXŒŸo)
 
-        foreach ($aThread->datlines as $i => $ares) {
-            $n = $i + 1;
-            list($name, $mail, $date_id, $msg) = $aThread->explodeDatLine($ares);
-            if (($id = $aThread->ids[$n]) !== null) {
-                $date_id = str_replace($aThread->idp[$n] . $id, "ID:$id", $date_id);
-            }
-
-            $target = $this->getTarget($ares, $n, $name, $mail, $date_id, $msg);
-            if (!$target) {
-                continue;
-            }
-
-            if ($this->_match($target, $n, $failure)) {
-                if ($datlines[$i] === null) {
-                    $datlines[$i] = $aThread->datlines[$i];
-                    $hit_nums[] = $i;
-                }
+        if ($this->field == self::FIELD_NUMBER &&
+            $this->method == self::METHOD_JUST &&
+            $this->match == self::MATCH_ON)
+        {
+            // ƒŒƒX”ԍ†Š®‘Sˆê’v‚Í“Á•Êˆµ‚¢
+            $n = (int)$this->word;
+            if ($n > 0 && $n <= $count) {
+                $i = $n - 1;
+                $ares = $aThread->datlines[$i];
+                $datlines[$i] = $ares;
+                $hit_nums[] = $i;
                 if ($check_refs) {
+                    list($name, $mail, $date_id, $msg) = $aThread->explodeDatLine($ares);
                     foreach ($aShowThread->checkQuoteResNums($n, $name, $msg) as $rn) {
                         $ri = $rn - 1;
                         if ($datlines[$ri] === null) {
@@ -469,6 +471,39 @@
                     $res_nums[] = $n;
                 }
             }
+        } else {
+            // ’ʏí‚̃}ƒbƒ`ƒ“ƒO
+            foreach ($aThread->datlines as $i => $ares) {
+                $n = $i + 1;
+                list($name, $mail, $date_id, $msg) = $aThread->explodeDatLine($ares);
+                if (($id = $aThread->ids[$n]) !== null) {
+                    $date_id = str_replace($aThread->idp[$n] . $id, "ID:$id", $date_id);
+                }
+    
+                $target = $this->getTarget($ares, $n, $name, $mail, $date_id, $msg);
+                if (!$target) {
+                    continue;
+                }
+    
+                if ($this->_match($target, $n, $failure)) {
+                    if ($datlines[$i] === null) {
+                        $datlines[$i] = $ares;
+                        $hit_nums[] = $i;
+                    }
+                    if ($check_refs) {
+                        foreach ($aShowThread->checkQuoteResNums($n, $name, $msg) as $rn) {
+                            $ri = $rn - 1;
+                            if ($datlines[$ri] === null) {
+                                $datlines[$ri] = $aThread->datlines[$ri];
+                                $hit_nums[] = $ri;
+                            }
+                        }
+                    }
+                    if ($check_refed) {
+                        $res_nums[] = $n;
+                    }
+                }
+            }
         }
 
         // }}}

Modified: p2ex/trunk/lib/ThreadRead.php
===================================================================
--- p2ex/trunk/lib/ThreadRead.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/ThreadRead.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -1126,7 +1126,7 @@
                 if ($start + $_conf['mobile.rnum_range'] <= $to) {
                     $to = $start + $_conf['mobile.rnum_range'];
                 }
-                if ($_conf['filtering']) {
+                if (ResFilter::getWord() !== null) {
                     $start = 1;
                     $to = $this->rescount;
                     $nofirst = false;

Modified: p2ex/trunk/lib/get_info.inc.php
===================================================================
--- p2ex/trunk/lib/get_info.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/get_info.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -177,11 +177,9 @@
     if ($tabornlines = FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES)) {
         foreach ($tabornlines as $l) {
             $tabornarray = explode('<>', $l);
-            if ($aThread->key == $tabornarray[1] && $aThread->bbs == $tabornarray[11]) {
-                if (P2Util::getHostGroupName($tabornarray[10]) == $group) {
-                    $info->taborn = true;
-                    break;
-                }
+            if ($key == $tabornarray[1]) {
+                $info->taborn = true;
+                break;
             }
         }
     }

Modified: p2ex/trunk/lib/read_filter_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_filter_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/read_filter_k.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -5,18 +5,17 @@
 
 // ŒŸõƒNƒGƒŠ
 $_conf['filter_q'] = '?host=' . $aThread->host . $bbs_q . $key_q . $offline_q
-                   . ResFilter::getQuery('&amp;') . '&amp;ls=all&amp;page=';
+                   . '&amp;' . ResFilter::getQuery('&amp;') . '&amp;ls=all&amp;page=';
 
-$prev_st = '‘O*';
-$next_st = 'ŽŸ*';
+$filter_hits = $resFilter->hits;
+$filter_range = $resFilter->range;
 
-$filter_range = ResFilter::getFilter()->range;
-
 if ($filter_range['page'] > 1) {
     $read_navi_previous_url = $_conf['read_php'] . $_conf['filter_q'] . ($filter_range['page'] - 1) . $_conf['k_at_a'];
     $read_navi_previous = "<a href=\"{$read_navi_previous_url}\">{$prev_st}</a>";
     $read_navi_previous_btm = "<a href=\"{$read_navi_previous_url}\"{$_conf['k_accesskey_at']['prev']}>{$_conf['k_accesskey_st']['prev']}{$prev_st}</a>";
 } else {
+    $read_navi_previous_url = '';
     $read_navi_previous = '';
     $read_navi_previous_btm = '';
 }
@@ -26,6 +25,7 @@
     $read_navi_next = "<a href=\"{$read_navi_next_url}\"{$_conf['k_accesskey_at']['next']}>{$_conf['k_accesskey_st']['next']}{$next_st}</a>";
     $read_navi_next_btm = "<a href=\"{$read_navi_next_url}\"{$_conf['k_accesskey_at']['next']}>{$_conf['k_accesskey_st']['next']}{$next_st}</a>";
 } else {
+    $read_navi_next_url = '';
     $read_navi_next = '';
     $read_navi_next_btm = '';
 }

Added: p2ex/trunk/lib/read_footer_i.inc.php
===================================================================
--- p2ex/trunk/lib/read_footer_i.inc.php	                        (rev 0)
+++ p2ex/trunk/lib/read_footer_i.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -0,0 +1,169 @@
+<?php
+/**
+ * rep2 - ƒXƒŒƒbƒh•\Ž¦ - ƒtƒbƒ^•”•ª - iPhone—p for read.php
+ */
+
+// {{{ ‘”
+
+if ($do_filtering) {
+    $last_resnum = $resFilter->last_hit_resnum;
+    $rescount_st = "{$resFilter->hits}/{$aThread->rescount}";
+} else {
+    $last_resnum = $aThread->resrange['to'];
+    $rescount_st = (string)$aThread->rescount;
+}
+
+// }}}
+// {{{ ƒc[ƒ‹ƒo[‚ð•\Ž¦
+
+$newtime = time();
+
+echo '<div class="ntoolbar" id="footer">';
+echo '<table><tbody><tr>';
+
+// {{{ ƒy[ƒWƒƒ
+
+// ‘O‚̃y[ƒW
+echo '<td>';
+if ($read_navi_previous_url) {
+    echo toolbar_i_standard_button('img/gp3-prev.png', '‘O', $read_navi_previous_url);
+} else {
+    echo toolbar_i_disabled_button('img/gp3-prev.png', '‘O');
+}
+echo '</td>';
+
+// ŽŸ‚̃y[ƒW
+echo '<td>';
+if ($read_navi_next_url) {
+    echo toolbar_i_standard_button('img/gp4-next.png', 'ŽŸ', $read_navi_next_url);
+} else {
+    echo toolbar_i_disabled_button('img/gp4-next.png', 'ŽŸ');
+}
+echo '</td>';
+
+// ƒy[ƒW”ԍ†‚𒼐ڎw’è
+echo '<td colspan="2">';
+if (!function_exists('get_read_jump')) {
+    include P2_LIB_DIR . '/read_jump_k.inc.php';
+}
+echo get_read_jump($aThread, $rescount_st, true);
+echo '<br>ƒWƒƒƒ“ƒv</td>';
+
+// ã‚Ö
+echo '<td>';
+echo toolbar_i_standard_button('img/gp1-up.png', 'ã', '#header');
+echo '</td>';
+
+// }}}
+
+echo '</tr><tr>';
+
+// {{{ ‚»‚Ì‘¼ƒ{ƒ^ƒ“—Þ
+
+// V’…
+echo '<td>';
+if (!$aThread->diedat) {
+    $escaped_url = "{$_conf['read_php']}?{$host_bbs_key_q}&amp;ls={$aThread->rescount}-n&amp;nt={$newtime}{$_conf['k_at_a']}#r{$aThread->rescount}";
+    echo toolbar_i_standard_button('img/glyphish/icons2/01-refresh.png', 'V’…', $escaped_url);
+} else {
+    echo toolbar_i_disabled_button('img/glyphish/icons2/01-refresh.png', 'V’…');
+}
+echo '</td>';
+
+// ƒXƒŒî•ñ
+echo '<td>';
+$escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}{$_conf['k_at_a']}";
+echo toolbar_i_opentab_button('img/gp5-info.png', 'ƒXƒŒî•ñ', $escaped_url);
+echo '</td>';
+
+// ƒgƒbƒv‚É–ß‚é
+echo '<td>';
+echo toolbar_i_standard_button('img/glyphish/icons2/53-house.png', 'TOP', "index.php{$_conf['k_at_q']}");
+echo '</td>';
+
+// ƒAƒNƒVƒ‡ƒ“
+echo '<td>';
+echo toolbar_i_action_thread_button('img/glyphish/icons2/12-eye.png', 'ƒAƒNƒVƒ‡ƒ“', $aThread);
+echo '</td>';
+
+// ‘‚«ž‚Þ
+echo '<td>';
+if (!$aThread->diedat) {
+    if (empty($_conf['disable_res'])) {
+        $escaped_url = "post_form.php?{$host_bbs_key_q}&amp;rescount={$aThread->rescount}{$ttitle_en_q}{$_conf['k_at_a']}";
+        echo toolbar_i_standard_button('img/glyphish/icons2/08-chat.png', 'ƒŒƒX', $escaped_url);
+    } else {
+        echo toolbar_i_opentab_button('img/glyphish/icons2/08-chat.png', 'Œ³ƒXƒŒ', $motothre_url);
+    }
+} else {
+    echo toolbar_i_disabled_button('img/glyphish/icons2/08-chat.png', 'ƒŒƒX');
+}
+echo '</td>';
+
+// }}}
+
+echo '</tr></tbody></table>';
+echo '</div>';
+
+// }}}
+
+// ImageCache2
+if ($_conf['expack.ic2.enabled']) {
+    if (!function_exists('ic2_loadconfig')) {
+        include P2EX_LIB_DIR . '/ic2/bootstrap.php';
+    }
+    $ic2conf = ic2_loadconfig();
+    if ($ic2conf['Thumb1']['width'] > 80) {
+        include P2EX_LIB_DIR . '/ic2/templates/info-v.tpl.html';
+    } else {
+        include P2EX_LIB_DIR . '/ic2/templates/info-h.tpl.html';
+    }
+}
+
+// SPM
+if ($_conf['expack.spm.enabled']) {
+    echo ShowThreadK::getSpmElementHtml();
+}
+
+// ÅIƒŒƒX”ԍ†‚ðXV
+echo <<<EOS
+<script type="text/javascript">
+//<![CDATA[
+(function(n){
+    var ktool_value = document.getElementById('ktool_value');
+    if (ktool_value) {
+        ktool_value.value = n;
+    }
+})({$last_resnum});
+//]]>
+</script>
+EOS;
+
+// ƒtƒBƒ‹ƒ^ƒqƒbƒg”‚ðXV
+if ($do_filtering) {
+    echo <<<EOS
+<script type="text/javascript">
+//<![CDATA[
+(function(n){
+    var searching = document.getElementById('searching');
+    if (searching) {
+        searching.innerHTML = n;
+    }
+})({$resFilter->hits});
+//]]>
+</script>
+EOS;
+}
+
+echo '</body></html>';
+
+/*
+ * 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:

Modified: p2ex/trunk/lib/read_footer_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_footer_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/read_footer_k.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -9,21 +9,32 @@
 // ƒtƒbƒ^
 //=====================================================================
 // •\Ž¦”͈Í
-if ($_conf['filtering'] && $aThread->rescount) {
+if ($do_filtering) {
+    $filter_hits = $resFilter->hits;
+    $filter_range = $resFilter->range;
     $filter_range['end'] = min($filter_range['to'], $filter_hits);
-    $read_range_on = "{$filter_range['start']}-{$filter_range['end']}";
-    $rescount_st = "{$filter_hits}hits/{$aThread->rescount}";
-} elseif ($aThread->resrange['start'] == $aThread->resrange['to']) {
-    $read_range_on = $aThread->resrange['start'];
-    $rescount_st = (string)$aThread->rescount;
+    if ($filter_hits > 1) {
+        $filter_unit = 'hits';
+        $read_range_on = "{$filter_range['start']}-{$filter_range['end']}";
+    } else {
+        $filter_unit = 'hit';
+        $read_range_on = "{$filter_range['start']}-{$filter_range['end']}";
+    }
+    $rescount_st = "{$filter_hits}{$filter_unit}/{$aThread->rescount}";
+    $last_resnum = $resFilter->last_hit_resnum;
 } else {
-    $read_range_on = "{$aThread->resrange['start']}-{$aThread->resrange['to']}";
+    if ($aThread->resrange['start'] == $aThread->resrange['to']) {
+        $read_range_on = $aThread->resrange['start'];
+    } else {
+        $read_range_on = "{$aThread->resrange['start']}-{$aThread->resrange['to']}";
+    }
     $rescount_st = (string)$aThread->rescount;
+    $last_resnum = $aThread->resrange['to'];
 }
 $hd['read_range'] = "{$read_range_on}/{$rescount_st}";
 
 // ƒŒƒX”ÔŽw’èˆÚ“® etc.
-$htm['goto'] = kspform($aThread, ($_conf['filtering'] ? $last_hit_resnum : $aThread->resrange['to']));
+$htm['goto'] = kspform($aThread, $last_resnum);
 
 //=====================================================================
 // ƒvƒŠƒ“ƒg
@@ -51,12 +62,10 @@
     }
 
     if (empty($_GET['one'])) {
-        require_once P2_LIB_DIR . '/read_jump_k.inc.php';
-        if ($_conf['iphone']) {
-            echo get_read_jump($aThread, "<span id=\"footer\">{$rescount_st}</span>", true);
-        } else {
-            echo get_read_jump($aThread, "<a id=\"footer\" name=\"footer\">{$hd['read_range']}</a>", false);
+        if (!function_exists('get_read_jump')) {
+            include P2_LIB_DIR . '/read_jump_k.inc.php';
         }
+        echo get_read_jump($aThread, "<a id=\"footer\" name=\"footer\">{$hd['read_range']}</a>", false);
     }
 
     echo <<<EOP
@@ -82,26 +91,6 @@
 echo "<hr>\n<div class=\"center\">{$_conf['k_to_index_ht']}";
 echo "</div>\n";
 
-// iPhone
-if ($_conf['iphone']) {
-    // ImageCache2
-    if ($_conf['expack.ic2.enabled']) {
-        if (!function_exists('ic2_loadconfig')) {
-            include P2EX_LIB_DIR . '/ic2/bootstrap.php';
-        }
-        $ic2conf = ic2_loadconfig();
-        if ($ic2conf['Thumb1']['width'] > 80) {
-            include P2EX_LIB_DIR . '/ic2/templates/info-v.tpl.html';
-        } else {
-            include P2EX_LIB_DIR . '/ic2/templates/info-h.tpl.html';
-        }
-    }
-    // SPM
-    if ($_conf['expack.spm.enabled']) {
-        echo ShowThreadK::getSpmElementHtml();
-    }
-}
-
 echo '</body></html>';
 
 /*

Modified: p2ex/trunk/lib/read_header.inc.php
===================================================================
--- p2ex/trunk/lib/read_header.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/read_header.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -267,6 +267,14 @@
         {$onload_script}
     }
 
+    function filterCount(n)
+    {
+        var searching = document.getElementById('searching');
+        if (searching) {
+            searching.innerHTML = n;
+        }
+    }
+
     (function(){
         if (typeof window.p2BindReady == 'undefined') {
             window.setTimeout(arguments.callee, 100);

Added: p2ex/trunk/lib/read_header_i.inc.php
===================================================================
--- p2ex/trunk/lib/read_header_i.inc.php	                        (rev 0)
+++ p2ex/trunk/lib/read_header_i.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -0,0 +1,332 @@
+<?php
+/**
+ * rep2 - ƒXƒŒƒbƒh•\Ž¦ - ƒwƒbƒ_•”•ª - iPhone—p for read.php
+ */
+
+require_once P2_LIB_DIR . '/get_info.inc.php';
+require_once P2_LIB_DIR . '/spm_k.inc.php';
+
+// {{{ •Ï”
+// {{{ Šî–{•Ï”
+
+$motothre_url = $aThread->getMotoThread(false, '1-10');
+$ttitle_en = UrlSafeBase64::encode($aThread->ttitle);
+$ttitle_en_q = '&amp;ttitle_en=' . $ttitle_en;
+$bbs_q = '&amp;bbs=' . $aThread->bbs;
+$key_q = '&amp;key=' . $aThread->key;
+$host_bbs_key_q = 'host=' . $aThread->host . $bbs_q . $key_q;
+$offline_q = '&amp;offline=1';
+$itaj_hd = htmlspecialchars($aThread->itaj, ENT_QUOTES);
+$rnum_range = $_conf['mobile.rnum_range'];
+$thread_info = get_thread_info($aThread->host, $aThread->bbs, $aThread->key);
+
+// }}}
+// {{{ ƒŒƒXƒiƒrÝ’è
+
+if ($do_filtering) {
+    include P2_LIB_DIR . '/read_filter_k.inc.php';
+} else {
+    // {{{ ƒiƒr - ‘O
+
+    $before_rnum = max(1, $aThread->resrange['start'] - $rnum_range);
+    if ($aThread->resrange['start'] == 1) {
+        $read_navi_previous_isInvisible = true;
+    } else {
+        $read_navi_previous_isInvisible = false;
+    }
+
+    if ($read_navi_previous_isInvisible) {
+        $read_navi_previous_url = '';
+    } else {
+        $read_navi_previous_url = "{$_conf['read_php']}?{$host_bbs_key_q}&amp;ls={$before_rnum}-{$aThread->resrange['start']}n{$offline_q}{$_conf['k_at_a']}";
+        /*if ($before_rnum != 1) {
+            $read_navi_previous_url .= "#r{$before_rnum}";
+        }*/
+    }
+
+    // }}}
+    // {{{ ƒiƒr - ŽŸ
+
+
+    if (!empty($_GET['one'])) {
+        $read_navi_next_isInvisible = false;
+    } elseif ($aThread->resrange['to'] >= $aThread->rescount) {
+        $aThread->resrange['to'] = $aThread->rescount;
+        $read_navi_next_isInvisible = true;
+    } else {
+        $read_navi_next_isInvisible = false;
+    }
+    $after_rnum = $aThread->resrange['to'] + $rnum_range;
+
+    if ($read_navi_next_isInvisible) {
+        $read_navi_next_url = '';
+    } else {
+        $read_navi_next_url = "{$_conf['read_php']}?{$host_bbs_key_q}&amp;ls={$aThread->resrange['to']}-{$after_rnum}n{$offline_q}&amp;nt={$newtime}{$_conf['k_at_a']}";
+        if ($aThread->resrange['to'] == $aThread->rescount) {
+            $read_navi_next_url .= "#r{$aThread->rescount}";
+        }
+    }
+
+    // }}}
+}
+
+// }}}
+// {{{ ƒwƒbƒ_—v‘f
+
+$_conf['extra_headers_ht'] .= <<<EOS
+<script type="text/javascript" src="js/respopup_iphone.js?{$_conf['p2_version_id']}"></script>
+EOS;
+// ImageCache2
+if ($_conf['expack.ic2.enabled']) {
+    $_conf['extra_headers_ht'] .= <<<EOS
+<link rel="stylesheet" type="text/css" href="css/ic2_iphone.css?{$_conf['p2_version_id']}">
+<script type="text/javascript" src="js/json2.js?{$_conf['p2_version_id']}"></script>
+<script type="text/javascript" src="js/ic2_iphone.js?{$_conf['p2_version_id']}"></script>
+EOS;
+}
+// SPM
+if ($_conf['expack.spm.enabled']) {
+    $_conf['extra_headers_ht'] .= <<<EOS
+<script type="text/javascript" src="js/spm_iphone.js?{$_conf['p2_version_id']}"></script>
+EOS;
+}
+// Limelight
+if ($_conf['expack.aas.enabled'] || $_conf['expack.ic2.enabled']) {
+    $_conf['extra_headers_ht'] .= <<<EOS
+<link rel="stylesheet" type="text/css" href="css/limelight.css?{$_conf['p2_version_id']}">
+<script type="text/javascript" src="js/limelight.js?{$_conf['p2_version_id']}"></script>
+<script type="text/javascript">
+// <![CDATA[
+document.addEventListener('DOMContentLoaded', function(event) {
+    var limelight;
+    document.removeEventListener(event.type, arguments.callee, false);
+    limelight = new Limelight({ 'savable': true, 'title': true });
+    limelight.bind();
+    window._IRESPOPG.callbacks.push(function(container) {
+        limelight.bind(null, container, true);
+    });
+}, false);
+// ]]>
+</script>
+EOS;
+}
+
+// }}}
+// }}}
+// {{{ HTMLƒvƒŠƒ“ƒg
+
+//!empty($_GET['nocache']) and P2Util::header_nocache();
+echo $_conf['doctype'];
+echo <<<EOP
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
+{$_conf['extra_headers_ht']}
+<title>{$ptitle_ht}</title>
+</head>
+<body class="nopad">
+<div class="ntoolbar" id="header">
+<h1 class="ptitle">{$aThread->ttitle_hd}</h1>
+EOP;
+
+// {{{ ŠeŽíƒ{ƒ^ƒ“—Þ
+
+echo '<table><tbody><tr>';
+
+// ”‚ɖ߂é
+echo '<td>';
+$escaped_url = "{$_conf['subject_php']}?{$host_bbs_key_q}{$_conf['k_at_a']}";
+echo toolbar_i_standard_button('img/glyphish/icons2/104-index-cards.png', $itaj_hd, $escaped_url);
+echo '</td>';
+
+// ƒŒƒXŒŸõ
+echo '<td>';
+echo toolbar_i_showhide_button('img/glyphish/icons2/06-magnifying-glass.png', 'ƒŒƒXŒŸõ', 'read_toolbar_filter');
+echo '</td>';
+
+// ‚¨‹C‚ɃXƒŒ
+echo '<td>';
+if ($thread_info) {
+    echo toolbar_i_fav_button('img/glyphish/icons2/28-star.png', '‚¨‹C‚ɃXƒŒ', $thread_info);
+} else {
+    echo toolbar_i_disabled_button('img/glyphish/icons2/28-star.png', '‚¨‹C‚ɃXƒŒ');
+}
+echo '</td>';
+
+// ‚»‚Ì‘¼
+echo '<td>';
+echo toolbar_i_showhide_button('img/gp0-more.png', '‚»‚Ì‘¼', 'read_toolbar_extra');
+echo '</td>';
+
+// ‰º‚Ö
+echo '<td>';
+echo toolbar_i_standard_button('img/gp2-down.png', '‰º', '#footer');
+echo '</td>';
+
+echo '</tr></tbody></table>';
+
+// }}}
+// {{{ ‚»‚Ì‘¼‚̃c[ƒ‹
+
+echo '<div id="read_toolbar_extra" class="extra">';
+
+// {{{ ‚»‚Ì‘¼ - ‚¨‹C‚É“ü‚èƒZƒbƒg
+
+if ($thread_info && $_conf['expack.misc.multi_favs']) {
+    echo '<table><tbody><tr>';
+    for ($i = 1; $i <= $_conf['expack.misc.favset_num']; $i++) {
+        echo '<td>';
+        echo toolbar_i_fav_button('img/glyphish/icons2/28-star.png', '-', $thread_info, $i);
+        echo '</td>';
+        if ($i % 5 === 0 && $i != $_conf['expack.misc.favset_num']) {
+            echo '</tr><tr>';
+        }
+    }
+    $mod_cells = $_conf['expack.misc.favset_num'] % 5;
+    if ($mod_cells) {
+        $mod_cells = 5 - $mod_cells;
+        for ($i = 0; $i < $mod_cells; $i++) {
+            echo '<td>&nbsp;</td>';
+        }
+    }
+    echo '</tr></tbody></table>';
+}
+
+// }}}
+// {{{ ‚»‚Ì‘¼ - ƒ{ƒ^ƒ“—Þ
+
+echo '<table><tbody><tr>';
+
+// >>1
+echo '<td>';
+$escaped_url = "{$_conf['read_php']}?{$host_bbs_key_q}&amp;ls=1-{$rnum_range}{$offline_q}{$_conf['k_at_a']}";
+echo toolbar_i_standard_button('img/glyphish/icons2/63-runner.png', '&gt;&gt;1-', $escaped_url);
+echo '</td>';
+
+// —ÞŽ—ƒXƒŒŒŸõ
+echo '<td>';
+$escaped_url = "{$_conf['subject_php']}?{$host_bbs_key_q}&amp;itaj_en="
+             . UrlSafeBase64::encode($aThread->itaj)
+             . '&amp;method=similar&amp;word='
+             . rawurlencode($aThread->ttitle_hc)
+             . "&amp;refresh=1{$_conf['k_at_a']}";
+echo toolbar_i_standard_button('img/glyphish/icons2/06-magnifying-glass.png', '—ÞŽ—ƒXƒŒ', $escaped_url);
+echo '</td>';
+
+
+// “a“°“ü‚è
+echo '<td>';
+echo toolbar_i_palace_button('img/glyphish/icons2/108-badge.png', '“a“°“ü‚è', $thread_info);
+echo '</td>';
+
+// ƒXƒŒƒbƒh‚ ‚ځ[‚ñ
+echo '<td>';
+echo toolbar_i_aborn_button('img/glyphish/icons2/128-bone.png', '‚ ‚ځ[‚ñ', $thread_info);
+echo '</td>';
+
+// ƒƒOíœ
+echo '<td>';
+if (file_exists($aThread->keydat)) {
+    $escaped_url = "info.php?{$host_bbs_key_q}{$ttitle_en_q}&amp;dele=1{$_conf['k_at_a']}";
+    echo toolbar_i_standard_button('img/glyphish/icons2/64-zap.png', 'ƒƒOíœ', $escaped_url);
+} else {
+    echo toolbar_i_disabled_button('img/glyphish/icons2/64-zap.png', 'ƒƒOíœ');
+}
+echo '</td>';
+
+echo '</tr></tbody></table>';
+
+// }}}
+// {{{ ‚»‚Ì‘¼ - SPMƒtƒH[ƒ€
+
+echo kspform($aThread);
+
+// }}}
+
+echo '</div>';
+
+// }}}
+// {{{ ƒŒƒXŒŸõƒtƒH[ƒ€
+
+$htm['rf_hidden_fields'] = ResFilterElement::getHiddenFields($aThread->host, $aThread->bbs, $aThread->key);
+$htm['rf_word_field'] = ResFilterElement::getWordField(array(
+    'autocorrect' => 'off',
+    'autocapitalize' => 'off',
+));
+$htm['rf_field_field'] = ResFilterElement::getFieldField();
+$htm['rf_method_field'] = ResFilterElement::getMethodField();
+$htm['rf_match_field'] = ResFilterElement::getMatchField();
+$htm['rf_include_field'] = ResFilterElement::getIncludeField();
+
+echo <<<EOP
+<div id="read_toolbar_filter" class="extra">
+<form id="read_filter" method="get" action="{$_conf['read_php']}" accept-charset="{$_conf['accept_charset']}">
+{$htm['rf_hidden_fields']}{$htm['rf_word_field']}
+<input type="submit" id="submit1" name="submit_filter" value="ŒŸõ"><br>
+{$htm['rf_field_field']}‚É{$htm['rf_method_field']}‚ð{$htm['rf_match_field']}
+{$htm['rf_include_field']}
+{$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']}
+</form>
+</div>
+EOP;
+
+// }}}
+// {{{ ŠeŽí’Ê’m
+
+$info_ht = P2Util::getInfoHtml();
+if (strlen($info_ht)) {
+    echo "<div class=\"info\">{$info_ht}</div>";
+}
+
+// ƒXƒŒ‚ª”ƒT[ƒo‚É‚È‚¯‚ê‚Î
+if ($aThread->diedat) {
+    echo '<div class="info">';
+    if ($aThread->getdat_error_msg_ht) {
+        echo $aThread->getdat_error_msg_ht;
+    } else {
+        echo $aThread->getDefaultGetDatErrorMessageHTML();
+    }
+    echo "<p><a href=\"{$motothre_url}\" target=\"_blank\">{$motothre_url}</a></p>";
+    echo '</div>';
+}
+
+// ƒtƒBƒ‹ƒ^ƒqƒbƒg”
+if ($do_filtering) {
+    $htm['rf_field_names'] = array(
+        ResFilter::FIELD_NUMBER => 'ƒŒƒX”ԍ†',
+        ResFilter::FIELD_HOLE => '‘S‘Ì', 
+        ResFilter::FIELD_MESSAGE => '–{•¶',
+        ResFilter::FIELD_NAME => '–¼‘O',
+        ResFilter::FIELD_MAIL => 'ƒ[ƒ‹',
+        ResFilter::FIELD_DATE => '“ú•t',
+        ResFilter::FIELD_ID => 'ID',
+    );
+    $hd['word'] = ResFilter::getWord('htmlspecialchars', array(ENT_QUOTES, 'Shift_JIS'));
+    echo "<div class=\"hits\">{$htm['rf_field_names'][$resFilter->field]}‚É&quot;{$hd['word']}&quot;‚ð";
+    echo ($resFilter->match == ResFilter::MATCH_ON) ? 'ŠÜ‚Þ' : 'ŠÜ‚Ü‚È‚¢';
+    if ($resFilter->include & ResFilter::INCLUDE_REFERENCES) {
+        echo '+ŽQÆ';
+    }
+    if ($resFilter->include & ResFilter::INCLUDE_REFERENCED) {
+        echo '+‹tŽQÆ';
+    }
+    echo ': <span id="searching">n</span>hit!</div>';
+}
+
+// }}}
+
+echo '</div>'; // end toolbar
+
+// }}}
+
+/*
+ * 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:

Modified: p2ex/trunk/lib/read_header_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_header_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/read_header_k.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -134,47 +134,6 @@
 
 // }}}
 
-// iPhone
-if ($_conf['iphone']) {
-    $_conf['extra_headers_ht'] .= <<<EOS
-<script type="text/javascript" src="js/respopup_iphone.js?{$_conf['p2_version_id']}"></script>
-EOS;
-    // ImageCache2
-    if ($_conf['expack.ic2.enabled']) {
-        $_conf['extra_headers_ht'] .= <<<EOS
-<link rel="stylesheet" type="text/css" href="css/ic2_iphone.css?{$_conf['p2_version_id']}">
-<script type="text/javascript" src="js/json2.js?{$_conf['p2_version_id']}"></script>
-<script type="text/javascript" src="js/ic2_iphone.js?{$_conf['p2_version_id']}"></script>
-EOS;
-    }
-    // SPM
-    if ($_conf['expack.spm.enabled']) {
-        $_conf['extra_headers_ht'] .= <<<EOS
-<script type="text/javascript" src="js/spm_iphone.js?{$_conf['p2_version_id']}"></script>
-EOS;
-    }
-    // Limelight
-    if ($_conf['expack.aas.enabled'] || $_conf['expack.ic2.enabled']) {
-        $_conf['extra_headers_ht'] .= <<<EOS
-<link rel="stylesheet" type="text/css" href="css/limelight.css?{$_conf['p2_version_id']}">
-<script type="text/javascript" src="js/limelight.js?{$_conf['p2_version_id']}"></script>
-<script type="text/javascript">
-// <![CDATA[
-document.addEventListener('DOMContentLoaded', function(event) {
-    var limelight;
-    document.removeEventListener(event.type, arguments.callee, false);
-    limelight = new Limelight({ 'savable': true, 'title': true });
-    limelight.bind();
-    window._IRESPOPG.callbacks.push(function(container) {
-        limelight.bind(null, container, true);
-    });
-}, false);
-// ]]>
-</script>
-EOS;
-    }
-}
-
 //====================================================================
 // ŒŸõŽž‚Ì“Á•Ê‚ȏˆ—
 //====================================================================
@@ -277,9 +236,7 @@
     echo ($resFilter->match == ResFilter::MATCH_ON) ? 'ŠÜ‚Þ' : 'ŠÜ‚Ü‚È‚¢';
 }
 
-if (!$_conf['iphone']) {
-    echo '<hr>';
-}
+echo '<hr>';
 
 /*
  * Local Variables:

Modified: p2ex/trunk/lib/read_jump_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_jump_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/read_jump_k.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -21,7 +21,7 @@
     }
 
     if ($use_onchange) {
-        return "<div>{$jump}/{$label}</div>";
+        return "{$jump}<span class=\"large\">/{$label}</span>";
     } else {
         return "<form method=\"get\" action=\"{$_conf['read_php']}\" accept-charset=\"{$_conf['accept_charset']}\">{$label}{$jump}</form>";
     }

Modified: p2ex/trunk/lib/sb_footer_i.inc.php
===================================================================
--- p2ex/trunk/lib/sb_footer_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/sb_footer_i.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -143,63 +143,6 @@
 }
 
 // }}}
-// {{{ ƒ\[ƒg•ÏX iV’… ƒŒƒX No. ƒ^ƒCƒgƒ‹ ” ‚·‚΂₳ ¨‚¢ Birthday ™j
-
-$sorts = array('midoku' => 'V’…', 'res' => 'ƒŒƒX', 'no' => 'No.', 'title' => 'ƒ^ƒCƒgƒ‹');
-
-if ($aThreadList->spmode and $aThreadList->spmode != 'taborn' and $aThreadList->spmode != 'soko') {
-    $sorts['ita'] = '”Â';
-}
-if ($_conf['sb_show_spd']) {
-    $sorts['spd'] = '‚·‚΂₳';
-}
-if ($_conf['sb_show_ikioi']) {
-    $sorts['ikioi'] = '¨‚¢';
-}
-$sorts['bd'] = 'Birthday';
-if ($_conf['sb_show_fav'] and $aThreadList->spmode != 'taborn') {
-    $sorts['fav'] = '™';
-}
-
-$htm['change_sort'] = "<form method=\"get\" action=\"{$_conf['subject_php']}\">";
-$htm['change_sort'] .= $_conf['k_input_ht'];
-$htm['change_sort'] .= '<input type="hidden" name="norefresh" value="1">';
-// spmodeŽž
-if ($aThreadList->spmode) {
-    $htm['change_sort'] .= "<input type=\"hidden\" name=\"spmode\" value=\"{$aThreadList->spmode}\">";
-}
-// spmode‚Å‚È‚¢A‚Ü‚½‚́Aspmode‚ª‚ ‚ځ[‚ñ or dat‘qŒÉ‚È‚ç
-if (!$aThreadList->spmode || $aThreadList->spmode == "taborn" || $aThreadList->spmode == "soko") {
-    $htm['change_sort'] .= "<input type=\"hidden\" name=\"host\" value=\"{$aThreadList->host}\">";
-    $htm['change_sort'] .= "<input type=\"hidden\" name=\"bbs\" value=\"{$aThreadList->bbs}\">";
-}
-
-$htm['change_sort'] .= '<select name="sort">';
-foreach ($sorts as $k => $v) {
-    if ($GLOBALS['now_sort'] == $k) {
-        $sb_sort_selected_at = ' selected';
-    } else {
-        $sb_sort_selected_at = '';
-    }
-    $htm['change_sort'] .= "<option value=\"{$k}\"{$sb_sort_selected_at}>{$v}</option>";
-}
-$htm['change_sort'] .= '</select>';
-
-if (!empty($_REQUEST['sb_view'])) {
-    $htm['change_sort'] .= '<input type="hidden" name="sb_view" value="'
-                        . htmlspecialchars($_REQUEST['sb_view']) . '">';
-}
-
-if (!empty($_REQUEST['rsort'])) {
-    $sb_rsort_checked_at = ' checked';
-} else {
-    $sb_rsort_checked_at = '';
-}
-$htm['change_sort'] .= ' <input type="checkbox" id="sb_rsort" name="rsort" value="1"'
-                    . $sb_rsort_checked_at . '><label for="sb_rsort">‹t‡</label>';
-$htm['change_sort'] .= ' <input type="submit" value="•À‚Ñ‘Ö‚¦"></form>';
-
-// }}}
 // {{{ ƒc[ƒ‹ƒo[‚ð•\Ž¦
 
 echo '<div class="ntoolbar" id="footer">';
@@ -231,7 +174,9 @@
 echo "<td colspan=\"2\">{$k_sb_navi_ht}<span class=\"large\">/{$sb_all_pages}</span><br>ƒy[ƒW</td>";
 
 // ã‚Ö
-echo '<td>', toolbar_i_standard_button('img/gp1-up.png', 'ã', '#header'), '</td>';
+echo '<td>';
+echo toolbar_i_standard_button('img/gp1-up.png', 'ã', '#header');
+echo '</td>';
 
 // }}}
 
@@ -243,12 +188,12 @@
 echo '<td>';
 if ($ta_num) {
     $escaped_url = "{$_conf['subject_php']}?{$host_bbs_q}{$norefresh_q}&amp;spmode=taborn{$_conf['k_at_a']}";
-    echo toolbar_i_badged_button('img/glyphish/icons2/21-skull.png', '‚ ‚ځ[‚ñ', $escaped_url, $ta_num);
+    echo toolbar_i_badged_button('img/glyphish/icons2/128-bone.png', '‚ ‚ځ[‚ñ', $escaped_url, $ta_num);
 } elseif ($aThreadList->spmode == 'taborn') {
     $escaped_url = "{$_conf['subject_php']}?{$host_bbs_q}{$_conf['k_at_a']}";
     echo toolbar_i_standard_button('img/glyphish/icons2/63-runner.png', '”‚ɖ߂é', $escaped_url);
 } else {
-    echo toolbar_i_disabled_button('img/glyphish/icons2/21-skull.png', '‚ ‚ځ[‚ñ');
+    echo toolbar_i_disabled_button('img/glyphish/icons2/128-bone.png', '‚ ‚ځ[‚ñ');
 }
 echo '</td>';
 
@@ -266,10 +211,14 @@
 echo '</td>';
 
 // ƒgƒbƒv‚É–ß‚é
-echo '<td>', toolbar_i_standard_button('img/glyphish/icons2/53-house.png', 'TOP', "index.php{$_conf['k_at_q']}"), '</td>';
+echo '<td>';
+echo toolbar_i_standard_button('img/glyphish/icons2/53-house.png', 'TOP', "index.php{$_conf['k_at_q']}");
+echo '</td>';
 
 // ƒAƒNƒVƒ‡ƒ“
-echo '<td>', toolbar_i_action_board_button('img/glyphish/icons2/12-eye.png', 'ƒAƒNƒVƒ‡ƒ“', $aThreadList), '</td>';
+echo '<td>';
+echo toolbar_i_action_board_button('img/glyphish/icons2/12-eye.png', 'ƒAƒNƒVƒ‡ƒ“', $aThreadList);
+echo '</td>';
 
 // V‚µ‚¢ƒXƒŒƒbƒh‚𗧂Ăé
 echo '<td>';

Modified: p2ex/trunk/lib/sb_header_i.inc.php
===================================================================
--- p2ex/trunk/lib/sb_header_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/sb_header_i.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -49,13 +49,13 @@
 }
 
 if ($aThreadList->spmode == 'taborn') {
-    $ptitle_ht = "<a href=\"{$ptitle_url}\"><b>{$aThreadList->itaj_hd}</b></a> (‚ ‚ځ[‚ñ’†)";
+    $ptitle_ht = "<a href=\"{$ptitle_url}\">{$aThreadList->itaj_hd}</a> <span class=\"thin\">(‚ ‚ځ[‚ñ’†)</span>";
 } elseif ($aThreadList->spmode == 'soko') {
-    $ptitle_ht = "<a href=\"{$ptitle_url}\"><b>{$aThreadList->itaj_hd}</b></a> (dat‘qŒÉ)";
+    $ptitle_ht = "<a href=\"{$ptitle_url}\">{$aThreadList->itaj_hd}</a> <span class=\"thin\">(dat‘qŒÉ)</span>";
 } elseif (!empty($ptitle_url)) {
-    $ptitle_ht = "<a href=\"{$ptitle_url}\"><b>{$ptitle_hd}</b></a>";
+    $ptitle_ht = "<a href=\"{$ptitle_url}\">{$ptitle_hd}</a>";
 } else {
-    $ptitle_ht = "<b>{$ptitle_hd}</b>";
+    $ptitle_ht = $ptitle_hd;
 }
 
 // }}}
@@ -78,8 +78,8 @@
 <script type="text/javascript" src="js/sb_iphone.js?{$_conf['p2_version_id']}"></script>
 EOS;
 
-// ƒXƒŒî•ñ
-if (!$spmode) {
+// ”î•ñ
+if (!$aThreadList->spmode) {
     if (!function_exists('get_board_info')) {
         include P2_LIB_DIR . '/get_info.inc.php';
     }
@@ -156,37 +156,19 @@
 echo '</td>';
 
 // ‰º‚Ö
-echo '<td>', toolbar_i_standard_button('img/gp2-down.png', '‰º', '#footer'), '</td>';
+echo '<td>';
+echo toolbar_i_standard_button('img/gp2-down.png', '‰º', '#footer');
+echo '</td>';
 
 echo '</tr></tbody></table>';
 
 // }}}
-// {{{ ƒXƒŒŒŸõƒtƒH[ƒ€
-
-if (!$spmode_without_palace_or_favita) {
-    if (array_key_exists('method', $sb_filter) && $sb_filter['method'] == 'or') {
-        $hd['method_checked_at'] = ' checked';
-    } else {
-        $hd['method_checked_at'] = '';
-    }
-
-    echo <<<EOP
-<div id="sb_toolbar_filter" class="extra">
-<form id="sb_filter" method="get" action="{$_conf['subject_php']}" accept-charset="{$_conf['accept_charset']}">
-{$sb_form_hidden_ht}<input type="text" id="sb_filter_word" name="word" value="{$hd['word']}" size="15" autocorrect="off" autocapitalize="off">
-<input type="checkbox" id="sb_filter_method" name="method" value="or"{$hd['method_checked_at']}><label for="sb_filter_method">OR</label>
-<input type="submit" name="submit_kensaku" value="ŒŸõ">
-</form>
-</div>
-EOP;
-}
-
-
-// }}}
 // {{{ ‚»‚Ì‘¼‚̃c[ƒ‹
 
 echo '<div id="sb_toolbar_extra" class="extra">';
 
+// {{{ ‚»‚Ì‘¼ - ‚¨‹C‚É“ü‚èƒZƒbƒg
+
 if ($board_info && $_conf['expack.misc.multi_favs']) {
     echo '<table><tbody><tr>';
     for ($i = 1; $i <= $_conf['expack.misc.favset_num']; $i++) {
@@ -207,6 +189,9 @@
     echo '</tr></tbody></table>';
 }
 
+// }}}
+// {{{ ‚»‚Ì‘¼ - –¢“ǐ”§ŒÀ‚‚«V’…‚Ü‚Æ‚ß“Ç‚Ý
+
 echo <<<EOP
 <form method="get" action="{$_conf['read_new_k_php']}">
 {$sb_form_hidden_ht}<input type="hidden" name="nt" value="1">{$shinchaku_norefresh_ht}
@@ -215,9 +200,91 @@
 </form>
 EOP;
 
+// }}}
+// {{{ ‚»‚Ì‘¼ - •À‚Ñ‘Ö‚¦
+
+$sorts = array('midoku' => 'V’…', 'res' => 'ƒŒƒX', 'no' => 'No.', 'title' => 'ƒ^ƒCƒgƒ‹');
+
+if ($aThreadList->spmode && $aThreadList->spmode != 'taborn' && $aThreadList->spmode != 'soko') {
+    $sorts['ita'] = '”Â';
+}
+if ($_conf['sb_show_spd']) {
+    $sorts['spd'] = '‚·‚΂₳';
+}
+if ($_conf['sb_show_ikioi']) {
+    $sorts['ikioi'] = '¨‚¢';
+}
+$sorts['bd'] = 'Birthday';
+if ($_conf['sb_show_fav'] and $aThreadList->spmode != 'taborn') {
+    $sorts['fav'] = '™';
+}
+
+$htm['change_sort'] = "<form method=\"get\" action=\"{$_conf['subject_php']}\">";
+$htm['change_sort'] .= $_conf['k_input_ht'];
+$htm['change_sort'] .= '<input type="hidden" name="norefresh" value="1">';
+// spmodeŽž
+if ($aThreadList->spmode) {
+    $htm['change_sort'] .= "<input type=\"hidden\" name=\"spmode\" value=\"{$aThreadList->spmode}\">";
+}
+// spmode‚Å‚È‚¢A‚Ü‚½‚́Aspmode‚ª‚ ‚ځ[‚ñ or dat‘qŒÉ‚È‚ç
+if (!$aThreadList->spmode || $aThreadList->spmode == 'taborn' || $aThreadList->spmode == 'soko') {
+    $htm['change_sort'] .= "<input type=\"hidden\" name=\"host\" value=\"{$aThreadList->host}\">";
+    $htm['change_sort'] .= "<input type=\"hidden\" name=\"bbs\" value=\"{$aThreadList->bbs}\">";
+}
+
+$htm['change_sort'] .= '<select name="sort">';
+foreach ($sorts as $k => $v) {
+    if ($GLOBALS['now_sort'] == $k) {
+        $sb_sort_selected_at = ' selected';
+    } else {
+        $sb_sort_selected_at = '';
+    }
+    $htm['change_sort'] .= "<option value=\"{$k}\"{$sb_sort_selected_at}>{$v}</option>";
+}
+$htm['change_sort'] .= '</select>';
+
+if (!empty($_REQUEST['sb_view'])) {
+    $htm['change_sort'] .= '<input type="hidden" name="sb_view" value="'
+                        . htmlspecialchars($_REQUEST['sb_view']) . '">';
+}
+
+if (!empty($_REQUEST['rsort'])) {
+    $sb_rsort_checked_at = ' checked';
+} else {
+    $sb_rsort_checked_at = '';
+}
+$htm['change_sort'] .= ' <input type="checkbox" id="sb_rsort" name="rsort" value="1"'
+                    . $sb_rsort_checked_at . '><label for="sb_rsort">‹t‡</label>';
+$htm['change_sort'] .= ' <input type="submit" value="•À‚Ñ‘Ö‚¦"></form>';
+
+echo $htm['change_sort'];
+
+// }}}
+
 echo '</div>';
 
 // }}}
+// {{{ ƒXƒŒŒŸõƒtƒH[ƒ€
+
+if (!$spmode_without_palace_or_favita) {
+    if (array_key_exists('method', $sb_filter) && $sb_filter['method'] == 'or') {
+        $hd['method_checked_at'] = ' checked';
+    } else {
+        $hd['method_checked_at'] = '';
+    }
+
+    echo <<<EOP
+<div id="sb_toolbar_filter" class="extra">
+<form id="sb_filter" method="get" action="{$_conf['subject_php']}" accept-charset="{$_conf['accept_charset']}">
+{$sb_form_hidden_ht}<input type="text" id="sb_filter_word" name="word" value="{$hd['word']}" size="15" autocorrect="off" autocapitalize="off">
+<input type="checkbox" id="sb_filter_method" name="method" value="or"{$hd['method_checked_at']}><label for="sb_filter_method">OR</label>
+<input type="submit" name="submit_kensaku" value="ŒŸõ">
+</form>
+</div>
+EOP;
+}
+
+// }}}
 // {{{ ŠeŽí’Ê’m
 
 $info_ht = P2Util::getInfoHtml();

Modified: p2ex/trunk/lib/setfav.inc.php
===================================================================
--- p2ex/trunk/lib/setfav.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/setfav.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -22,7 +22,7 @@
  * @param   string      $host
  * @param   string      $bbs
  * @param   string      $key
- * @param   int|string  $setfavita  -1(“o˜^E‰ðœ‚ðƒgƒOƒ‹), 0(‰ðœ), 1(’ljÁ), top, up, down, bottom
+ * @param   int|string  $setfavita  0(‰ðœ), 1(’ljÁ), 2(ƒgƒOƒ‹), top, up, down, bottom
  * @param   string      $ttitle
  * @param   int|null    $setnum
  * @return  bool
@@ -111,7 +111,7 @@
         }
     }
 
-    if ($setfav == -1) {
+    if ($setfav == 2) {
         $setfav = ($was_set) ? 0 : 1;
     }
 

Modified: p2ex/trunk/lib/setfavita.inc.php
===================================================================
--- p2ex/trunk/lib/setfavita.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/setfavita.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -87,7 +87,7 @@
  *
  * @param   string      $host
  * @param   string      $bbs
- * @param   int|string  $setfavita  -1(“o˜^E‰ðœ‚ðƒgƒOƒ‹), 0(‰ðœ), 1(’ljÁ), top, up, down, bottom
+ * @param   int|string  $setfavita  0(‰ðœ), 1(’ljÁ), 2(ƒgƒOƒ‹), top, up, down, bottom
  * @param   string      $itaj
  * @param   int|null    $setnum
  * @return  bool
@@ -133,7 +133,7 @@
         }
     }
 
-    if ($setfavita == -1) {
+    if ($setfavita == 2) {
         $setfavita = ($was_set) ? 0 : 1;
     }
 

Modified: p2ex/trunk/lib/setpalace.inc.php
===================================================================
--- p2ex/trunk/lib/setpalace.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/setpalace.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -11,7 +11,7 @@
  * @param   string      $host
  * @param   string      $bbs
  * @param   string      $key
- * @param   int|string  $setpal  0(‰ðœ), 1(’ljÁ), top, up, down, bottom
+ * @param   int|string  $setpal  0(‰ðœ), 1(’ljÁ), 2(ƒgƒOƒ‹) top, up, down, bottom
  * @param   string      $ttitle
  * @return  bool
  */
@@ -44,6 +44,7 @@
     $pallines = FileCtl::file_read_lines($_conf['palace_idx'], FILE_IGNORE_NEW_LINES);
 
     $neolines = array();
+    $pal_attayo = false;
     $before_line_num = 0;
 
      // {{{ Å‰‚ɏd•¡—v‘f‚ðíœ‚µ‚Ä‚¨‚­
@@ -55,6 +56,7 @@
             $lar = explode('<>', $l);
             // d•¡‰ñ”ð
             if ($lar[1] == $key && $lar[11] == $bbs) {
+                $pal_attayo = true;
                 $before_line_num = $i;    // ˆÚ“®‘O‚̍s”ԍ†‚ðƒZƒbƒg
                 continue;
             // key‚Ì‚È‚¢‚à‚Ì‚Í•s³ƒf[ƒ^‚Ȃ̂ŃXƒLƒbƒv
@@ -68,6 +70,10 @@
 
     // }}}
 
+    if ($setpal == 2) {
+        $setpal = ($pal_attayo) ? 0 : 1;
+    }
+
     // V‹Kƒf[ƒ^Ý’è
     if ($setpal) {
         $newdata = "{$data[0]}<>{$key}<>{$data[2]}<>{$data[3]}<>{$data[4]}<>{$data[5]}<>{$data[6]}<>{$data[7]}<>{$data[8]}<>{$data[9]}<>{$host}<>{$bbs}";

Modified: p2ex/trunk/lib/settaborn.inc.php
===================================================================
--- p2ex/trunk/lib/settaborn.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/settaborn.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -43,6 +43,7 @@
     $taborn_lines= FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES);
 
     $neolines = array();
+    $aborn_attayo = false;
 
     if ($taborn_lines) {
         foreach ($taborn_lines as $l) {
@@ -62,7 +63,7 @@
 
     // V‹Kƒf[ƒ^’ljÁ
     if ($set == 1 or !$aborn_attayo && $set == 2) {
-        $newdata = "$data[0]<>{$key}<><><><><><><><>";
+        $newdata = "{$data[0]}<>{$key}<><><><><><><><>";
         $neolines ? array_unshift($neolines, $newdata) : $neolines = array($newdata);
         $title_msg_pre = "› ‚ ‚ځ[‚ñ ‚µ‚Ü‚·‚½";
         $info_msg_pre = "› ‚ ‚ځ[‚ñ ‚µ‚Ü‚·‚½";

Modified: p2ex/trunk/lib/spm_k.inc.php
===================================================================
--- p2ex/trunk/lib/spm_k.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/spm_k.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -25,6 +25,7 @@
     // ‘I‘ð‰Â”\‚ȃIƒvƒVƒ‡ƒ“
     $options = array();
     $options['goto'] = 'GO';
+    $options['rref'] = '‹tŽQÆ';
     $options['copy'] = '宰澎';
     $options['copy_quote'] = '&gt;宰澎';
     $options['res']  = '攴';
@@ -44,7 +45,11 @@
     $options['ng_msg']  = 'NG:勵尚灼';
 
     // ƒtƒH[ƒ€¶¬
-    $form = "<form method=\"get\" action=\"spm_k.php\">";
+    if ($_conf['iphone']) {
+        $form = '<form method="get" action="spm_k.php" target="_blank">';
+    } else {
+        $form = '<form method="get" action="spm_k.php">';
+    }
     $form .= $_conf['k_input_ht'];
 
     // ‰B‚µƒpƒ‰ƒ[ƒ^
@@ -70,8 +75,12 @@
     $form .= '</select>';
 
     // ”’l“ü—̓tƒH[ƒ€‚ÆŽÀsƒ{ƒ^ƒ“
-    $form .= "<input type=\"text\" size=\"3\" name=\"ktool_value\" value=\"{$default}\"{$input_numeric_at}>";
-    $form .= '<input type="submit" value="OK" title="OK">';
+    $form .= "<input type=\"text\" size=\"3\" name=\"ktool_value\" id=\"ktool_value\" value=\"{$default}\"{$input_numeric_at}>";
+    if ($_conf['iphone']) {
+        $form .= '<input type="submit" value="&#x2713;">';
+    } else {
+        $form .= '<input type="submit" value="OK" title="OK">';
+    }
 
     $form .= '</form>';
 

Modified: p2ex/trunk/lib/toolbar_i.inc.php
===================================================================
--- p2ex/trunk/lib/toolbar_i.inc.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/lib/toolbar_i.inc.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -16,19 +16,11 @@
  */
 function _toolbar_i_button($icon, $label, $uri, $attrs = '')
 {
-    static $hover = null;
-
-    if ($hover === null) {
-        $hover = implode(' ', array(
-            '',
-            'ontouchstart="iutil.toggleClass(this, \'hover\', true);"',
-            'ontouchend="iutil.toggleClass(this, \'hover\', false);"',
-            'ontouchcancel="iutil.toggleClass(this, \'hover\', false);"',
-        ));
+    if ($attrs !== '' && strncmp($attrs, ' ', 1) === 0) {
+        $attrs = ' ' . $attrs;
     }
-
     return <<<EOS
-<a href="{$uri}"{$attrs}{$hover}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}</a>
+<a href="{$uri}" ontouchstart="iutil.toggleClass(this, 'hover', true);" ontouchend="iutil.toggleClass(this, 'hover', false);" ontouchcancel="iutil.toggleClass(this, 'hover', false);"{$attrs}><img src="{$icon}" width="48" height="32" alt=""><br>{$label}</a>
 EOS;
 }
 
@@ -136,7 +128,7 @@
     }
 
     $fav = $info->favs[$setnum];
-    $attrs = ' onclick="return iutil.toolbarSetFavIta(this, event);"';
+    $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"';
     if (!$fav['set']) {
         $attrs .= ' class="inactive"';
     }
@@ -146,7 +138,7 @@
         'bbs'       => $info->bbs,
         'itaj_en'   => UrlSafeBase64::encode($info->itaj),
         'setnum'    => $setnum,
-        'setfavita' => -1,
+        'setfavita' => 2,
     ), '', '&amp;');
 
     return _toolbar_i_button($icon, $fav['title'], $uri, $attrs);
@@ -171,7 +163,7 @@
     }
 
     $fav = $info->favs[$setnum];
-    $attrs = ' onclick="return iutil.toolbarSetFav(this, event);"';
+    $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"';
     if (!$fav['set']) {
         $attrs .= ' class="inactive"';
     }
@@ -182,13 +174,71 @@
         'key'       => $info->key,
         'ttitle_en' => UrlSafeBase64::encode($info->ttitle),
         'setnum'    => $setnum,
-        'setfav'    => -1,
+        'setfav'    => 2,
     ), '', '&amp;');
 
     return _toolbar_i_button($icon, $fav['title'], $uri, $attrs);
 }
 
 // }}}
+// {{{ toolbar_i_palace_button()
+
+/**
+ * “a“°“ü‚è‚Ì“o˜^E‰ðœ‚ðƒgƒOƒ‹‚·‚éƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“
+ *
+ * @param string $icon
+ * @param string $label
+ * @param object $info @see lib/get_info.inc.php: get_thread_info()
+ * @return string
+ */
+function toolbar_i_palace_button($icon, $label, $info)
+{
+    $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"';
+    if (!$info->palace) {
+        $attrs .= ' class="inactive"';
+    }
+    $uri = 'httpcmd.php?' . http_build_query(array(
+        'cmd'       => 'setpal',
+        'host'      => $info->host,
+        'bbs'       => $info->bbs,
+        'key'       => $info->key,
+        'ttitle_en' => UrlSafeBase64::encode($info->ttitle),
+        'setpal'    => 2,
+    ), '', '&amp;');
+
+    return _toolbar_i_button($icon, $label, $uri, $attrs);
+}
+
+// }}}
+// {{{ toolbar_i_aborn_button()
+
+/**
+ * ƒXƒŒƒbƒh‚ ‚ځ[‚ñó‘Ô‚ðƒgƒOƒ‹‚·‚éƒc[ƒ‹ƒo[ƒ{ƒ^ƒ“
+ *
+ * @param string $icon
+ * @param string $label
+ * @param object $info @see lib/get_info.inc.php: get_thread_info()
+ * @return string
+ */
+function toolbar_i_aborn_button($icon, $label, $info)
+{
+    $attrs = ' onclick="return iutil.toolbarRunHttpCommand(this, event);"';
+    if (!$info->taborn) {
+        $attrs .= ' class="inactive"';
+    }
+    $uri = 'httpcmd.php?' . http_build_query(array(
+        'cmd'       => 'taborn',
+        'host'      => $info->host,
+        'bbs'       => $info->bbs,
+        'key'       => $info->key,
+        'ttitle_en' => UrlSafeBase64::encode($info->ttitle),
+        'taborn'    => 2,
+    ), '', '&amp;');
+
+    return _toolbar_i_button($icon, $label, $uri, $attrs);
+}
+
+// }}}
 // {{{ toolbar_i_action_board_button()
 
 /**

Modified: p2ex/trunk/read.php
===================================================================
--- p2ex/trunk/read.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/read.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -8,6 +8,21 @@
 
 $_login->authorize(); // ƒ†[ƒU”FØ
 
+// iPhone
+if ($_conf['iphone']) {
+    include P2_LIB_DIR . '/toolbar_i.inc.php';
+    define('READ_HEADER_INC_PHP', P2_LIB_DIR . '/read_header_i.inc.php');
+    define('READ_FOOTER_INC_PHP', P2_LIB_DIR . '/read_footer_i.inc.php');
+// Œg‘Ñ
+} elseif ($_conf['ktai']) {
+    define('READ_HEADER_INC_PHP', P2_LIB_DIR . '/read_header_k.inc.php');
+    define('READ_FOOTER_INC_PHP', P2_LIB_DIR . '/read_footer_k.inc.php');
+// PC
+} else {
+    define('READ_HEADER_INC_PHP', P2_LIB_DIR . '/read_header.inc.php');
+    define('READ_FOOTER_INC_PHP', P2_LIB_DIR . '/read_footer.inc.php');
+}
+
 //================================================================
 // •Ï”
 //================================================================
@@ -23,9 +38,11 @@
 //=================================================
 // ƒŒƒXƒtƒBƒ‹ƒ^
 //=================================================
+$do_filtering = false;
 if (array_key_exists('rf', $_REQUEST) && is_array($_REQUEST['rf'])) {
     $resFilter = ResFilter::configure($_REQUEST['rf']);
     if ($resFilter->hasWord()) {
+        $do_filtering = true;
         if ($_conf['ktai']) {
             $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
             $resFilter->setRange($_conf['mobile.rnum_range'], $page);
@@ -98,19 +115,9 @@
     $preview = $aThread->previewOne();
     $ptitle_ht = htmlspecialchars($aThread->itaj, ENT_QUOTES) . ' / ' . $aThread->ttitle_hd;
 
-    // PC
-    if (!$_conf['ktai']) {
-        $read_header_inc_php = P2_LIB_DIR . '/read_header.inc.php';
-        $read_footer_inc_php = P2_LIB_DIR . '/read_footer.inc.php';
-    // Œg‘Ñ
-    } else {
-        $read_header_inc_php = P2_LIB_DIR . '/read_header_k.inc.php';
-        $read_footer_inc_php = P2_LIB_DIR . '/read_footer_k.inc.php';
-    }
-
-    require_once $read_header_inc_php;
+    include READ_HEADER_INC_PHP;
     echo $preview;
-    require_once $read_footer_inc_php;
+    include READ_FOOTER_INC_PHP;
 
     return;
 }
@@ -191,7 +198,7 @@
 
 if ($_conf['ktai']) {
 
-    if (isset($GLOBALS['word']) && strlen($GLOBALS['word']) > 0) {
+    if ($resFilter && $resFilter->hasWord() && $aThread->rescount) {
         $GLOBALS['filter_hits'] = 0;
     } else {
         $GLOBALS['filter_hits'] = NULL;
@@ -228,7 +235,7 @@
     } else {
         $content = $aShowThread->getDatToHtml();
 
-        require_once P2_LIB_DIR . '/read_header_k.inc.php';
+        include READ_HEADER_INC_PHP;
 
         if ($_conf['iphone'] && $_conf['expack.spm.enabled']) {
             echo $aShowThread->getSpmObjJs();
@@ -236,13 +243,13 @@
 
         echo $content;
 
-        require_once P2_LIB_DIR . '/read_footer_k.inc.php';
+        include READ_FOOTER_INC_PHP;
     }
 
 } else {
 
     // ƒwƒbƒ_ •\Ž¦
-    require_once P2_LIB_DIR . '/read_header.inc.php';
+    include READ_HEADER_INC_PHP;
     flush();
 
     //===========================================================
@@ -256,19 +263,7 @@
         $GLOBALS['filter_hits'] = 0;
 
         echo "<p><b id=\"filterstart\">{$all}ƒŒƒX’† <span id=\"searching\">n</span>ƒŒƒX‚ªƒqƒbƒg</b></p>\n";
-        echo <<<EOP
-<script type="text/javascript">
-//<![CDATA[
-var searching = document.getElementById('searching');
-function filterCount(n){
-    if (searching) {
-        searching.innerHTML = n;
     }
-}
-//]]>
-</script>
-EOP;
-    }
 
     //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection("datToHtml");
 
@@ -306,8 +301,7 @@
     }
 
     // ƒtƒbƒ^ •\Ž¦
-    require_once P2_LIB_DIR . '/read_footer.inc.php';
-
+    include READ_FOOTER_INC_PHP;
 }
 flush();
 
@@ -325,8 +319,8 @@
     $newline = $aThread->readnum + 1; // $newline‚Í”pŽ~—\’肾‚ªA‹ŒŒÝŠ·—p‚É”O‚Ì‚½‚ß
 
     $sar = array($aThread->ttitle, $aThread->key, $idx_data[2], $aThread->rescount, '',
-                $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline,
-                $idx_data[10], $idx_data[11], $aThread->datochiok);
+                 $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline,
+                 $idx_data[10], $idx_data[11], $aThread->datochiok);
     P2Util::recKeyIdx($aThread->keyidx, $sar); // key.idx‚É‹L˜^
 }
 
@@ -334,8 +328,9 @@
 // —š—ð‚ð‹L˜^
 //===========================================================
 if ($aThread->rescount && !$is_ajax) {
-    $newdata = "{$aThread->ttitle}<>{$aThread->key}<>$idx_data[2]<><><>{$aThread->readnum}<>$idx_data[6]<>$idx_data[7]<>$idx_data[8]<>{$newline}<>{$aThread->host}<>{$aThread->bbs}";
-    recRecent($newdata);
+    recRecent(implode('<>', array($aThread->ttitle, $aThread->key, $idx_data[2], '', '',
+                                  $aThread->readnum, $idx_data[6], $idx_data[7], $idx_data[8], $newline,
+                                  $aThread->host, $aThread->bbs)));
 }
 
 // NG‚ ‚ځ[‚ñ‚ð‹L˜^

Modified: p2ex/trunk/read_filter.php
===================================================================
--- p2ex/trunk/read_filter.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/read_filter.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -9,68 +9,63 @@
 
 $_login->authorize(); // ƒ†[ƒU”FØ
 
-/**
- * •Ï”‚̐ݒè
- */
-$host = $_GET['host'];
-$bbs  = $_GET['bbs'];
-$key  = $_GET['key'];
-$rc   = $_GET['rescount'];
-$ttitle_en = $_GET['ttitle_en'];
-$resnum = $_GET['resnum'];
-$field  = $_GET['field'];
-$itaj = P2Util::getItaName($host, $bbs);
-if (!$itaj) { $itaj = $bbs; }
-$ttitle_name = UrlSafeBase64::decode($ttitle_en);
 $popup_filter = 1;
 
-/**
- * ‘ΏۃŒƒX‚̏ˆ—
- */
-$aThread = new ThreadRead;
-$aThread->setThreadPathInfo($host, $bbs, $key);
-$aThread->readDat($aThread->keydat);
+function _read_filter_setup()
+{
+    $host = $_GET['host'];
+    $bbs  = $_GET['bbs'];
+    $key  = $_GET['key'];
+    $resnum = (int)$_GET['resnum'];
+    $field  = $_GET['field'];
 
-if (isset($aThread->datlines[$resnum - 1])) {
-    $ares = $aThread->datlines[$resnum - 1];
+    $aThread = new ThreadRead;
+    $aThread->setThreadPathInfo($host, $bbs, $key);
+    $aThread->readDat($aThread->keydat);
+
+    $i = $resnum - 1;
+    if (!($i >= 0 && $i < count($aThread->datlines) &&
+          isset($_GET['rf']) && is_array($_GET['rf'])))
+    {
+        P2Util::pushInfoHtml('<p>ƒtƒBƒ‹ƒ^ƒŠƒ“ƒO‚ÌŽw’肪•Ï‚Å‚·B</p>');
+        unset($_GET['rf'], $_REQUEST['rf']);
+        return;
+    }
+
+    $ares = $aThread->datlines[$i];
     $resar = $aThread->explodeDatLine($ares);
     $name = $resar[0];
     $mail = $resar[1];
     $date_id = $resar[2];
     $msg = $resar[3];
+    $params = $_GET['rf'];
 
-    $aShowThread = new ShowThreadPc($aThread);
-    if ($field == 'rres') {
-        $_REQUEST['rf'] = array(
-            'field' => ResFilter::FIELD_MESSAGE,
-            'method' => ResFilter::METHOD_REGEX,
-            'match' => ResFilter::MATCH_ON,
-            'include' => ResFilter::INCLUDE_NONE,
-        );
-        $_REQUEST['rf']['word'] = ShowThread::getAnchorRegex(
-            '%prefix%(.+%delimiter%)?' . $resnum . '(?!\\d|%range_delimiter%)'
-        );
-    } else {
-        $params = array(
-            'field' => $field,
-            'method' => $_GET['method'],
-            'match' => $_GET['match'],
-            'include' => ResFilter::INCLUDE_NONE,
-        );
-        $resFilter = ResFilter::configure($params);
-        $target = $resFilter->getTarget($ares, $resnum, $name, $mail, $date_id, $msg);
-        $_REQUEST['rf'] = $params;
-        if ($field == 'date') {
-            $date_part = explode(' ', trim($target));
-            $_REQUEST['rf']['word'] = $date_part[0];
-        } else {
-            $_REQUEST['rf']['word'] = $target;
-        }
+    $include = ResFilter::INCLUDE_NONE;
+    $fields = explode(':', $field);
+    $field = array_shift($fields);
+    if (in_array('refs', $fields)) {
+        $include |= ResFilter::INCLUDE_REFERENCES;
     }
+    if (in_array('refed', $fields)) {
+        $include |= ResFilter::INCLUDE_REFERENCED;
+    }
+    $params['field'] = $field;
+    $params['include'] = $include;
 
-    unset($ares, $resar, $name, $mail, $date_id, $msg, $params, $target, $aShowThread);
+    $resFilter = ResFilter::configure($params);
+    $target = $resFilter->getTarget($ares, $resnum, $name, $mail, $date_id, $msg);
+    if ($field == 'date') {
+        $date_part = explode(' ', trim($target));
+        $word = $date_part[0];
+    } else {
+        $word = $target;
+    }
+    $params['word'] = $word;
+    $_REQUEST['rf'] = $params;
 }
 
+_read_filter_setup();
+
 // read.php‚ɏˆ—‚ð“n‚·
 include P2_BASE_DIR . '/read.php';
 

Modified: p2ex/trunk/read_filter_k.php
===================================================================
--- p2ex/trunk/read_filter_k.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/read_filter_k.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -18,12 +18,15 @@
     ? '<a href="' . htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES) . '" title="–ß‚é">' . $ttitle . '</a>'
     : $ttitle;
 
-
 $hidden_fields_ht = ResFilterElement::getHiddenFields($host, $bbs, $key);
-$word_field_ht = ResFilterElement::getWordField(array(
-    'autocorrect' => 'off',
-    'autocapitalize' => 'off',
-));
+if ($_conf['iphone']) {
+    $word_field_ht = ResFilterElement::getWordField(array(
+        'autocorrect' => 'off',
+        'autocapitalize' => 'off',
+    ));
+} else {
+    $word_field_ht = ResFilterElement::getWordField();
+}
 $field_field_ht = ResFilterElement::getFieldField();
 $method_field_ht = ResFilterElement::getMethodField();
 $match_field_ht = ResFilterElement::getMatchField();

Modified: p2ex/trunk/spm_k.php
===================================================================
--- p2ex/trunk/spm_k.php	2010-08-14 17:55:06 UTC (rev 878)
+++ p2ex/trunk/spm_k.php	2010-08-15 16:27:41 UTC (rev 879)
@@ -16,9 +16,19 @@
     $base_dir_s = P2_BASE_DIR . DIRECTORY_SEPARATOR;
     switch ($_GET['ktool_name']) {
         case 'goto':
-            $_REQUEST['ls'] = $_GET['ls'] = $ktv . '-' . ($ktv + $_conf['mobile.rnum_range']);
+            $_REQUEST['ls'] = $_GET['ls'] = spirntf('%d-%d', $ktv, $ktv + $_conf['mobile.rnum_range']);
             include $base_dir_s . 'read.php';
             exit;
+        case 'rref':
+            $_REQUEST['rf'] = array(
+                'field' => ResFilter::FIELD_NUMBER,
+                'method' => ResFilter::METHOD_JUST,
+                'match' => ResFilter::MATCH_ON,
+                'include' => ResFilter::INCLUDE_REFERENCED,
+                'word' => (string)$ktv, // int‚Å‚Í‚¾‚ß
+            );
+            include $base_dir_s . 'read.php';
+            exit;
         case 'res':
         case 'res_quote':
             $_GET['resnum'] = $ktv;



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