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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 8月 12日 (木) 01:25:24 JST


Revision: 872
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=872
Author:   rsk
Date:     2010-08-12 01:25:24 +0900 (Thu, 12 Aug 2010)

Log Message:
-----------
expack:
- レスフィルタリング関連のミス・変更し忘れ等を修正。

Modified Paths:
--------------
    p2ex/trunk/lib/ResFilter.php
    p2ex/trunk/lib/ShowThreadK.php
    p2ex/trunk/lib/ShowThreadPc.php
    p2ex/trunk/lib/read_filter_k.inc.php
    p2ex/trunk/lib/read_header_k.inc.php
    p2ex/trunk/lib/read_jump_k.inc.php
    p2ex/trunk/read_filter_k.php


-------------- next part --------------
Modified: p2ex/trunk/lib/ResFilter.php
===================================================================
--- p2ex/trunk/lib/ResFilter.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/lib/ResFilter.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -95,6 +95,39 @@
     }
 
     // }}}
+    // {{{ getQuery()
+
+    /**
+     * configure()‚ōì‚ç‚ꂽƒIƒuƒWƒFƒNƒg‚ɐݒ肳‚ê‚Ä‚¢‚éƒpƒ‰ƒ[ƒ^‚©‚ç
+     * HTTP GET—pƒNƒGƒŠ‚ðì¬‚·‚é
+     *
+     * @param string $separator
+     * @return string
+     */
+    static public function getQuery($separator = '&')
+    {
+        $filter = self::$_instance;
+        if ($filter === null) {
+            $params = array('rf' => array(
+                'field'   => self::FIELD_DEFAULT,
+                'method'  => self::METHOD_DEFAULT,
+                'match'   => self::MATCH_DEFAULT,
+                'include' => self::INCLUDE_DEFAULT,
+            ));
+        } else {
+            $params = array('rf' => array(
+                'field'   => $filter->field,
+                'method'  => $filter->method,
+                'match'   => $filter->match,
+                'include' => $filter->include,
+                'word'    => $filter->word,
+            ));
+        }
+
+        return http_build_query($params, '', $separator);
+    }
+
+    // }}}
     // {{{ getWord()
 
     /**

Modified: p2ex/trunk/lib/ShowThreadK.php
===================================================================
--- p2ex/trunk/lib/ShowThreadK.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/lib/ShowThreadK.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -636,7 +636,21 @@
         }
         */
 
-        $filter_url = "{$_conf['read_php']}?host={$this->thread->host}&bbs={$this->thread->bbs}&key={$this->thread->key}&ls=all&offline=1&idpopup=1&field=id&method=just&match=on&word=" . rawurlencode($id).$_conf['k_at_a'];
+        $filter_url = $_conf['read_php'] . '?' . http_build_query(array(
+            'host' => $this->thread->host,
+            'bbs'  => $this->thread->bbs,
+            'key'  => $this->thread->key,
+            'ls'   => 'all',
+            'offline' => '1',
+            'idpopup' => '1',
+            'rf' => array(
+                'field'   => ResFilter::FIELD_ID,
+                'method'  => ResFilter::METHOD_JUST,
+                'match'   => ResFilter::MATCH_ON,
+                'include' => ResFilter::INCLUDE_NONE,
+                'word'    => $id,
+            ),
+        ), '', '&') . $_conf['k_at_a'];
 
         if (isset($this->thread->idcount[$id]) && $this->thread->idcount[$id] > 0) {
             $num_ht = "(<a href=\"{$filter_url}\"{$this->target_at}>{$this->thread->idcount[$id]}</a>)";

Modified: p2ex/trunk/lib/ShowThreadPc.php
===================================================================
--- p2ex/trunk/lib/ShowThreadPc.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/lib/ShowThreadPc.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -557,8 +557,21 @@
             return $idstr;
         }
 
-        $word = rawurlencode($id);
-        $filter_url = "{$_conf['read_php']}?bbs={$this->thread->bbs}&amp;key={$this->thread->key}&amp;host={$this->thread->host}&amp;ls=all&amp;field=id&amp;word={$word}&amp;method=just&amp;match=on&amp;idpopup=1&amp;offline=1";
+        $filter_url = $_conf['read_php'] . '?' . http_build_query(array(
+            'host' => $this->thread->host,
+            'bbs'  => $this->thread->bbs,
+            'key'  => $this->thread->key,
+            'ls'   => 'all',
+            'offline' => '1',
+            'idpopup' => '1',
+            'rf' => array(
+                'field'   => ResFilter::FIELD_ID,
+                'method'  => ResFilter::METHOD_JUST,
+                'match'   => ResFilter::MATCH_ON,
+                'include' => ResFilter::INCLUDE_NONE,
+                'word'    => $id,
+            ),
+        ), '', '&amp;') . $_conf['k_at_a'];
 
         if ($_conf['iframe_popup']) {
             return $this->iframePopup($filter_url, $idstr, $_conf['bbs_win_target_at']) . $num_ht;

Modified: p2ex/trunk/lib/read_filter_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_filter_k.inc.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/lib/read_filter_k.inc.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -4,16 +4,14 @@
  */
 
 // ŒŸõƒNƒGƒŠ
-$_conf['filter_q'] = '?host=' . $aThread->host . $bbs_q . $key_q . $offline_q;
-$_conf['filter_q'] .= '&amp;word=' . ResFilter::getWord('rawurlencode');
-foreach ($res_filter as $_key => $_value) {
-    $_conf['filter_q'] .= "&amp;{$_key}=" . rawurldecode($_value);
-}
-$_conf['filter_q'] .= '&amp;ls=all&amp;page=';
+$_conf['filter_q'] = '?host=' . $aThread->host . $bbs_q . $key_q . $offline_q
+                   . ResFilter::getQuery('&amp;') . '&amp;ls=all&amp;page=';
 
 $prev_st = '‘O*';
 $next_st = 'ŽŸ*';
 
+$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>";

Modified: p2ex/trunk/lib/read_header_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_header_k.inc.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/lib/read_header_k.inc.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -259,13 +259,21 @@
 echo "<hr>";
 echo "<h3><font color=\"{$STYLE['mobile_read_ttitle_color']}\">{$aThread->ttitle_hd}</font></h3>\n";
 
-$filter_fields = array('hole' => '', 'msg' => 'Ò¯¾°¼Þ‚ª', 'name' => '–¼‘O‚ª', 'mail' => 'Ò°Ù‚ª', 'date' => '“ú•t‚ª', 'id' => 'ID‚ª', 'belv' => 'Îß²ÝÄ‚ª');
+$filter_fields = array(
+    ResFilter::FIELD_HOLE => '', 
+    ResFilter::FIELD_MESSAGE => 'Ò¯¾°¼Þ‚ª',
+    ResFilter::FIELD_NAME => '–¼‘O‚ª',
+    ResFilter::FIELD_MAIL => 'Ò°Ù‚ª',
+    ResFilter::FIELD_DATE => '“ú•t‚ª',
+    ResFilter::FIELD_ID => 'ID‚ª',
+);
 
+
 if ($do_filtering) {
-    echo "ŒŸõŒ‹‰Ê: ";
-    echo "{$filter_fields[$res_filter['field']]}";
+    $resFilter = ResFilter::getFilter();
+    echo "ŒŸõŒ‹‰Ê: {$filter_fields[$resFilter->field]}";
     echo "&quot;{$hd['word']}&quot;‚ð";
-    echo ($res_filter['match'] == 'on') ? 'ŠÜ‚Þ' : 'ŠÜ‚Ü‚È‚¢';
+    echo ($resFilter->match == ResFilter::MATCH_ON) ? 'ŠÜ‚Þ' : 'ŠÜ‚Ü‚È‚¢';
 }
 
 if (!$_conf['iphone']) {

Modified: p2ex/trunk/lib/read_jump_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_jump_k.inc.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/lib/read_jump_k.inc.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -12,7 +12,7 @@
 {
     global $_conf;
 
-    $resFilter = RefFilter::getFilter();
+    $resFilter = ResFilter::getFilter();
 
     if ($resFilter && $resFilter->word !== null) {
         $jump = _get_read_jump_filter($aThread, $resFilter, $use_onchange);
@@ -106,7 +106,7 @@
 /**
  * ƒy[ƒW‘JˆÚ—p‚ÌHTML—v‘f‚ðŽæ“¾‚·‚é (ŒŸõŽž)
  */
-function _get_read_jump_filter(ThreadRead $aThread, RefFilter $resFilter, $use_onchange)
+function _get_read_jump_filter(ThreadRead $aThread, ResFilter $resFilter, $use_onchange)
 {
     global $_conf;
 
@@ -114,6 +114,7 @@
         $options = '<option value="1">$_conf[&#39;mobile.rnum_range&#39;] ‚Ì’l‚ª•s³‚Å‚·</option>';
     } else {
         $options = '';
+        $filter_hits = $resFilter->hits;
 
         /*$optgroup = $_conf['mobile.rnum_range'] * 5;
         if ($optgroup >= $filter_hits) {

Modified: p2ex/trunk/read_filter_k.php
===================================================================
--- p2ex/trunk/read_filter_k.php	2010-08-11 05:44:08 UTC (rev 871)
+++ p2ex/trunk/read_filter_k.php	2010-08-11 16:25:24 UTC (rev 872)
@@ -57,8 +57,8 @@
 {$field_field_ht}‚É<br>
 {$method_field_ht}‚ð<br>
 {$match_field_ht}<br>
+<input type="submit" id="submit2" name="submit_filter" value="ŒŸõ"><br>
 {$include_field_ht}
-<input type="submit" id="submit2" name="submit_filter" value="ŒŸõ">
 </div>
 {$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']}
 </form>



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