svnno****@sourc*****
svnno****@sourc*****
2010年 1月 27日 (水) 23:05:51 JST
Revision: 820 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=820 Author: akid Date: 2010-01-27 23:05:51 +0900 (Wed, 27 Jan 2010) Log Message: ----------- ã¡ã½ãããåãã¦ã³ã¼ãæ´çããã Modified Paths: -------------- p2/trunk/lib/ThreadRead.php -------------- next part -------------- Modified: p2/trunk/lib/ThreadRead.php =================================================================== --- p2/trunk/lib/ThreadRead.php 2010-01-27 11:20:41 UTC (rev 819) +++ p2/trunk/lib/ThreadRead.php 2010-01-27 14:05:51 UTC (rev 820) @@ -1052,21 +1052,7 @@ $marutori_ht = ''; //if (file_exists($_conf['idpw2ch_php']) || file_exists($_conf['sid2ch_php'])) { - $marutori_ht = sprintf(' [%s]', - P2View::tagA( - UriUtil::buildQueryUri($_conf['read_php'], - array( - 'host' => $this->host, - 'bbs' => $this->bbs, - 'key' => $this->key, - 'ls' => $this->ls, - 'maru' => 'true', - UA::getQueryKey() => UA::getQueryValue() - ) - ), - hs('IDÅp2ÉæèÞ') - ) - ); + $marutori_ht = ' ' . $this->getMarutoriHtml(); //} else { // $marutori_ht = "<a href=\"login2ch.php?b={$_conf['b']}\" target=\"subject\">IDOC</a>"; @@ -1085,17 +1071,7 @@ $dat_response_status = "à·! ßOqÉÅAhtml»³ê½Xbhð©µÜµ½B"; $kakolog_uri = "http://{$this->host}/{$matches[1]}"; - $read_kako_url = UriUtil::buildQueryUri($_conf['read_php'], - array( - 'host' => $this->host, - 'bbs' => $this->bbs, - 'key' => $this->key, - 'ls' => $this->ls, - 'kakolog' => $kakolog_uri, - 'kakoget' => '1', - UA::getQueryKey() => UA::getQueryValue() - ) - ); + $read_kako_url = $this->getReadKakologUri($kakolog_uri); $soko_atag = P2View::tagA($kakolog_uri . '.html', 'Xbh ' . $matches[3] . '.html', @@ -1110,22 +1086,7 @@ } elseif (preg_match($waithtml_match, $read_response_html, $matches)) { $dat_response_status = "à·! XbhÍhtml»³êéÌðÒÁÄ¢éæ¤Å·B"; - - $marutori_atag = P2View::tagA( - UriUtil::buildQueryUri($_conf['read_php'], - array( - 'host' => $this->host, - 'bbs' => $this->bbs, - 'key' => $this->key, - 'ls' => $this->ls, - 'maru' => 'true', - UA::getQueryKey() => UA::getQueryValue() - ) - ), - hs('IDÅp2ÉæèÞ') - ); - $marutori_ht = " [$marutori_atag]"; - + $marutori_ht = ' ' . $this->getMarutoriHtml(); $dat_response_msg_ht = "<p>2ch info - à·! XbhÍhtml»³êéÌðÒÁÄ¢éæ¤Å·B {$marutori_ht}</p>"; } else { @@ -1133,17 +1094,7 @@ $dat_response_status = "»ñÈÂorXbhȢŷB"; $kako_html_url = $_GET['kakolog'] . ".html"; - $read_kako_url = UriUtil::buildQueryUri($_conf['read_php'], - array( - 'host' => $this->host, - 'bbs' => $this->bbs, - 'key' => $this->key, - 'ls' => $this->ls, - 'kakolog' => $_GET['kakolog'], - 'kakoget' => '1', - UA::getQueryKey() => UA::getQueryValue() - ) - ); + $read_kako_url = $this->getReadKakologUri($_GET['kakolog']); $attrs = array(); if ($_conf['bbs_win_target']) { @@ -1166,17 +1117,7 @@ $dat_response_status = ''; $kako_html_url = $_GET['kakolog'] . '.html'; - $read_kako_url = UriUtil::buildQueryUri($_conf['read_php'], - array( - 'host' => $this->host, - 'bbs' => $this->bbs, - 'key' => $this->key, - 'ls' => $this->ls, - 'kakolog' => $_GET['kakolog'], - 'kakoget' => '1', - UA::getQueryKey() => UA::getQueryValue() - ) - ); + $read_kako_url = $this->getReadKakologUri($_GET['kakolog']); $attrs = array(); if ($_conf['bbs_win_target']) { $attrs['target'] = $_conf['bbs_win_target']; @@ -1193,6 +1134,50 @@ } /** + * @param string $kakolog ßOURI©ç.htmlðOµ½¶ñ @see $kakohtml_match + * @return string + */ + private function getReadKakologUri($kakolog) + { + global $_conf; + + return UriUtil::buildQueryUri($_conf['read_php'], + array( + 'host' => $this->host, + 'bbs' => $this->bbs, + 'key' => $this->key, + 'ls' => $this->ls, + 'kakolog' => $kakolog, + 'kakoget' => '1', + UA::getQueryKey() => UA::getQueryValue() + ) + ); + } + + /** + * @return string HTML + */ + private function getMarutoriHtml() + { + global $_conf; + + $marutori_atag = P2View::tagA( + UriUtil::buildQueryUri($_conf['read_php'], + array( + 'host' => $this->host, + 'bbs' => $this->bbs, + 'key' => $this->key, + 'ls' => $this->ls, + 'maru' => 'true', + UA::getQueryKey() => UA::getQueryValue() + ) + ), + hs('IDÅp2ÉæèÞ') + ); + return "[$marutori_atag]"; + } + + /** * >>1ÌÝðvr [\¦·é½ßÌHTMLðæ¾·éiIUtCÉÎj * * @access public