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()Åìçê½IuWFNgÉÝè³êÄ¢ép[^©ç + * HTTP GETpNGð쬷é + * + * @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}&key={$this->thread->key}&host={$this->thread->host}&ls=all&field=id&word={$word}&method=just&match=on&idpopup=1&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, + ), + ), '', '&') . $_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 @@ */ // õNG -$_conf['filter_q'] = '?host=' . $aThread->host . $bbs_q . $key_q . $offline_q; -$_conf['filter_q'] .= '&word=' . ResFilter::getWord('rawurlencode'); -foreach ($res_filter as $_key => $_value) { - $_conf['filter_q'] .= "&{$_key}=" . rawurldecode($_value); -} -$_conf['filter_q'] .= '&ls=all&page='; +$_conf['filter_q'] = '?host=' . $aThread->host . $bbs_q . $key_q . $offline_q + . ResFilter::getQuery('&') . '&ls=all&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 ""{$hd['word']}"ð"; - 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[WJÚpÌHTMLvfðæ¾·é (õ) */ -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['mobile.rnum_range'] Ì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>