svnno****@sourc*****
svnno****@sourc*****
2010年 1月 26日 (火) 21:05:30 JST
Revision: 811 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=811 Author: rsk Date: 2010-01-26 21:05:30 +0900 (Tue, 26 Jan 2010) Log Message: ----------- expack: - ã¾ã¡BBSã®datèªã¿è¾¼ã¿ã§offlaw.cgiã«ã¢ã¯ã»ã¹ããããã«å¤æ´ã -- read.cgiã®HTML解æã§ã¯æ¥ä»ã»IDæ¬ã«IPã¢ãã¬ã¹ãå«ã¾ãã¦ãããã offlaw.cgiã®datã«ã¯åå¨ããªãã - StrSjisã¯ã©ã¹ã«Shift_JISç¨æ£è¦è¡¨ç¾ãã¿ã¼ã³ãUnicodeç¨ã«å¤æããã¡ã½ãã toUnicodePattern() ã追å ã - RSSã§ImageCache2ã使ããªãä¸å ·åãä¿®æ£ã - å¤æ°åã®ãã¹çãä¿®æ£ã - E_NOTICEåæ¸ä¸ã Modified Paths: -------------- p2ex/trunk/info.php p2ex/trunk/iv2.php p2ex/trunk/lib/FileCtl.php p2ex/trunk/lib/ShowThread.php p2ex/trunk/lib/StrSjis.php p2ex/trunk/lib/ThreadRead.php p2ex/trunk/lib/expack/rss/getimage.inc.php p2ex/trunk/lib/read_footer.inc.php p2ex/trunk/lib/read_shitaraba.inc.php p2ex/trunk/lib/startup.funcs.php p2ex/trunk/style/fitimage_css.inc p2ex/trunk/style/info_css.inc p2ex/trunk/style/iv2_css.inc p2ex/trunk/style/menu_css.inc p2ex/trunk/style/post_css.inc p2ex/trunk/style/read_css.inc p2ex/trunk/style/style_css.inc p2ex/trunk/style/subject_css.inc Removed Paths: ------------- p2ex/trunk/lib/read_machibbs.inc.php -------------- next part -------------- Modified: p2ex/trunk/info.php =================================================================== --- p2ex/trunk/info.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/info.php 2010-01-26 12:05:30 UTC (rev 811) @@ -290,7 +290,7 @@ } -if (!is_null($title_msg)) { +if (isset($title_msg)) { $hc['title'] = $title_msg; } else { $hc['title'] = "info - {$hc['ttitle_name']}"; Modified: p2ex/trunk/iv2.php =================================================================== --- p2ex/trunk/iv2.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/iv2.php 2010-01-26 12:05:30 UTC (rev 811) @@ -384,7 +384,7 @@ $removed_files = array(); // èlÅtB^O -if (!($threshold == -1 && $compate == '>=')) { +if (!($threshold == -1 && $compare == '>=')) { $icdb->whereAddQuoted('rank', $compare, $threshold); } Modified: p2ex/trunk/lib/FileCtl.php =================================================================== --- p2ex/trunk/lib/FileCtl.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/FileCtl.php 2010-01-26 12:05:30 UTC (rev 811) @@ -53,7 +53,7 @@ if (!file_exists($file)) { // efBNgª³¯êÎìé - self::mkdir_for($file) or p2die("cannot make parent dirs. ({$file})"); + self::mkdirFor($file) or p2die("cannot make parent dirs. ({$file})"); touch($file) or p2die("cannot touch. ({$file})"); chmod($file, $perm); } else { @@ -70,7 +70,7 @@ } // }}} - // {{{ mkdir_for() + // {{{ mkdirFor() /** * efBNgªÈ¯ê欵Äp[~bVð²®·é @@ -79,7 +79,7 @@ * @param int $perm * @return bool */ - static public function mkdir_for($apath, $perm = null) + static public function mkdirFor($apath, $perm = null) { global $_conf; @@ -103,7 +103,7 @@ if ($i > $dir_limit) { p2die("cannot mkdir. ({$parentdir})", 'Kwðãªè߬½ÌÅAXgbvµÜµ½B'); } - self::mkdir_for($parentdir); + self::mkdirFor($parentdir); mkdir($parentdir, $perm) or p2die("cannot mkdir. ({$parentdir})"); chmod($parentdir, $perm); $i++; @@ -112,7 +112,7 @@ } // }}} - // {{{ mkdir_r() + // {{{ mkdirRecursive() /** * fBNgªÈ¯ê欵Äp[~bVð²®·é @@ -121,9 +121,39 @@ * @param int $perm * @return bool */ + static public function mkdirRecursive($apath, $perm = null) + { + return self::mkdirFor($apath . DIRECTORY_SEPARATOR . '_', $perm); + } + + // }}} + // {{{ mkdir_for() + + /** + * mkdirFor() ÌGCAX + * + * @param string $apath + * @param int $perm + * @return bool + */ + static public function mkdir_for($apath, $perm = null) + { + return self::mkdirFor($apath, $perm); + } + + // }}} + // {{{ mkdir_r() + + /** + * mkdirRecursive() ÌGCAX + * + * @param string $apath + * @param int $perm + * @return bool + */ static public function mkdir_r($apath, $perm = null) { - return self::mkdir_for($apath . DIRECTORY_SEPARATOR . '_', $perm); + return self::mkdirRecursive($apath, $perm); } // }}} Modified: p2ex/trunk/lib/ShowThread.php =================================================================== --- p2ex/trunk/lib/ShowThread.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/ShowThread.php 2010-01-26 12:05:30 UTC (rev 811) @@ -268,6 +268,8 @@ $to = $this->thread->resrange['to']; $nofirst = $this->thread->resrange['nofirst']; + $count = count($this->thread->datlines); + $buf = $is_fragment ? '' : "<div class=\"thread\">\n"; // ܸ 1 ð\¦ @@ -277,7 +279,8 @@ // A½Ì½ßAÍÍOÌNG Ú[ñ`FbN if ($_conf['ngaborn_chain_all'] && empty($_GET['nong'])) { - for ($i = ($nofirst) ? 0 : 1; $i < $start; $i++) { + $pre = min($count, $start); + for ($i = ($nofirst) ? 0 : 1; $i < $pre; $i++) { list($name, $mail, $date_id, $msg) = $this->thread->explodeDatLine($this->thread->datlines[$i]); if (($id = $this->thread->ids[$i]) !== null) { $date_id = str_replace($this->thread->idp[$i] . $id, $idstr, $date_id); @@ -287,14 +290,11 @@ } // wèÍÍð\¦ - for ($i = $start - 1; $i < $to; $i++) { + $end = min($count, $to); + for ($i = $start - 1; $i < $end; $i++) { if (!$nofirst and $i == 0) { continue; } - if (!$this->thread->datlines[$i]) { - $this->thread->readnum = $i; - break; - } $buf .= $this->transRes($this->thread->datlines[$i], $i + 1); if (!$capture && $i % 10 == 0) { echo $buf; @@ -302,6 +302,9 @@ $buf = ''; } } + if ($this->thread->readnum < $end) { + $this->thread->readnum = $end; + } if (!$is_fragment) { $buf .= "</div>\n"; @@ -1032,14 +1035,18 @@ * AJ[̳K\»ðÔ· * * @param string $pattern ex)'/%full%/' + * @param boolean $unicode * @return string */ - static public function getAnchorRegex($pattern) + static public function getAnchorRegex($pattern, $unicode = false) { if (!array_key_exists($pattern, self::$_anchorRegexes)) { self::$_anchorRegexes[$pattern] = strtr($pattern, self::_getAnchorRegexParts()); // å·ÍÈ¢ª compileMobile2chUriCallBack() Ìæ¤É preg_relplace_callback()µÄࢢ©àB } + if ($unicode) { + return StrSjis::toUnicodePattern($_anchorRegexes[$pattern]); + } return self::$_anchorRegexes[$pattern]; } Modified: p2ex/trunk/lib/StrSjis.php =================================================================== --- p2ex/trunk/lib/StrSjis.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/StrSjis.php 2010-01-26 12:05:30 UTC (rev 811) @@ -122,6 +122,64 @@ } // }}} + // {{{ getUnicodePattern() + + /** + * Shift_JIS̶ðÜÞ³K\»p^[ð + * PCREÌUnicode[hp³K\»p^[ÉÏ··é + * + * @param string $pattern + * @return string + */ + static public function toUnicodePattern($pattern) + { + $sjis_char_class_1st = '[\\x81-\\x9F\\xE0-\\xFC]'; + $sjis_char_class_2nd = '[\\x40-\\x7E\\x80-\\xFC]'; + $sjis_char_regex_1st = '\\\\x(8[1-9A-F]|[9E][0-9A-F]|F[0-9A-C])'; + $sjis_char_regex_2nd = '\\\\x([45689A-E][0-9A-F]|7[0-9A-E]|F[0-9A-C])'; + + $pattern = preg_replace_callback("/{$sjis_char_class_1st}{$sjis_char_class_2nd}/", + array(__CLASS__, '_sjisStringToUnicodePatternCb'), + $pattern); + $pattern = preg_replace_callback("/{$sjis_char_regex_1st}{$sjis_char_regex_2nd}/i", + array(__CLASS__, '_sjisPatternToUnicodePatternCb'), + $pattern); + return $pattern; + } + + // }}} + // {{{ _sjisStringToUnicodePattern() + + /** + * Shift_JISÌ2oCg¶ð + * Unicode¶É}b`·é³K\»p^[ÉÏ··é + * + * @param array $m + * @return string + */ + static protected function _sjisStringToUnicodePatternCb($m) + { + $u = unpack('C2', mb_convert_encoding($m[0], 'UCS-2BE', 'SJIS-win')); + return sprintf('\\x{%02X%02X}', $u[1], $u[2]); + } + + // }}} + // {{{ _sjisCodeToUnicodePattern() + + /** + * Shift_JISÌ2oCg¶É}b`·é³K\»p^[ð + * Unicode¶É}b`·é³K\»p^[ÉÏ··é + * + * @param array $m + * @return string + */ + static protected function _sjisPatternToUnicodePatternCb($m) + { + $s = pack('C2', hexdec($m[1]), hexdec($m[2])); + return self::_sjisStringToUnicodePatternCb(array($s)); + } + + // }}} } // }}} Modified: p2ex/trunk/lib/ThreadRead.php =================================================================== --- p2ex/trunk/lib/ThreadRead.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/ThreadRead.php 2010-01-26 12:05:30 UTC (rev 811) @@ -52,12 +52,13 @@ // Ü¿BBS if (P2Util::isHostMachiBbs($this->host)) { - require_once P2_LIB_DIR . '/read_machibbs.inc.php'; - machiDownload(); + DownloadDatMachiBbs::invoke($this); // JBBS@µ½çÎ } elseif (P2Util::isHostJbbsShitaraba($this->host)) { - require_once P2_LIB_DIR . '/read_shitaraba.inc.php'; - shitarabaDownload(); + if (!function_exists('shitarabaDownload')) { + include P2_LIB_DIR . '/read_shitaraba.inc.php'; + } + shitarabaDownload($this); // 2chn } else { @@ -70,7 +71,9 @@ !empty($_REQUEST['relogin2ch']) || (filemtime($_conf['sid2ch_php']) < time() - 60*60*24)) { - require_once P2_LIB_DIR . '/login2ch.inc.php'; + if (!function_exists('login2ch')) { + include P2_LIB_DIR . '/login2ch.inc.php'; + } if (!login2ch()) { $this->getdat_error_msg_ht .= $this->get2chDatError(); $this->diedat = true; @@ -191,7 +194,7 @@ // WEBT[oÖÚ± $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { - $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); + self::_pushInfoConnectFailed($url, $errno, $errstr); $this->diedat = true; return false; } @@ -211,7 +214,7 @@ } if ($timed_out) { - $this->_pushInfoReadTimedOut($url); + self::_pushInfoReadTimedOut($url); $this->diedat = true; fclose($fp); return false; @@ -329,7 +332,7 @@ fclose($fp); if ($timed_out) { - $this->_pushInfoReadTimedOut($url); + self::_pushInfoReadTimedOut($url); $this->diedat = true; return false; } else { @@ -419,7 +422,7 @@ // WEBT[oÖÚ± $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { - $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); + self::_pushInfoConnectFailed($url, $errno, $errstr); $this->diedat = true; return false; } @@ -439,7 +442,7 @@ } if ($timed_out) { - $this->_pushInfoReadTimedOut($url); + self::_pushInfoReadTimedOut($url); //$this->diedat = true; fclose($fp); return false; @@ -447,7 +450,7 @@ // gzip³kÈç if ($isGzip) { - $body = $this->_decodeGzip($body, $url); + $body = self::_decodeGzip($body, $url); if ($body === null) { //$this->diedat = true; fclose($fp); @@ -605,7 +608,7 @@ // WEBT[oÖÚ± $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { - $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); + self::_pushInfoConnectFailed($url, $errno, $errstr); return false; } stream_set_timeout($fp, $_conf['http_read_timeout'], 0); @@ -624,14 +627,14 @@ } if ($timed_out) { - $this->_pushInfoReadTimedOut($url); + self::_pushInfoReadTimedOut($url); $this->diedat = true; fclose($fp); return false; } if ($isGzip) { - $body = $this->_decodeGzip($body, $url); + $body = self::_decodeGzip($body, $url); if ($body === null) { $this->diedat = true; fclose($fp); @@ -901,7 +904,7 @@ // WEBT[oÖÚ± $fp = @fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']); if (!$fp) { - $this->_pushInfoConnectionTimedOut($url, $errno, $errstr); + self::_pushInfoConnectFailed($url, $errno, $errstr); $this->diedat = true; return false; } @@ -1459,7 +1462,7 @@ * @param string $caller * @return string */ - protected function _decodeGzip($body, $url) + static protected function _decodeGzip($body, $url) { global $_conf; @@ -1491,46 +1494,47 @@ } if (is_null($body)) { - $msg = '<p class="info-msg">gzipWJG[<br>'; - $msg .= sprintf('rep2 error: <a href="%s"%s>%s</a> ðgzipfR[hūܹñŵ½B', - P2Util::throughIme($url), - $_conf['ext_win_target_at'], - htmlspecialchars($url, ENT_QUOTES, 'Shift_JIS', false)); - $msg .= '</p>'; - - P2Util::pushInfoHtml($msg); + $summary = 'gzipWJG['; + $description = self::_urlToAnchor($url) . ' ðgzipfR[hūܹñŵ½B'; + self::_pushInfoMessage($summary, $description); } return $body; } // }}} - // {{{ _pushInfoConnectionTimedOut() + // {{{ _pushInfoMessage() /** - * Ú±ª^CAEgµ½|ÌbZ[WðvbV ·é + * îñbZ[WðvbV ·é * + * @param string $summary + * @param string $description + * @return void + */ + static protected function _pushInfoMessage($summary, $description) + { + $message = '<p class="info-msg">' . $summary . '<br>rep2 info: ' . $description . '</p>'; + P2Util::pushInfoHtml($message); + } + + + // }}} + // {{{ _pushInfoConnectFailed() + + /** + * ڱɸsµ½|ÌbZ[WðvbV ·é + * * @param string $url * @param int $errno * @param string $errstr * @return void */ - protected function _pushInfoConnectionTimedOut($url, $errno, $errstr) + static protected function _pushInfoConnectFailed($url, $errno, $errstr) { - global $_conf; - - $msg = '<p class="info-msg">'; - $msg .= sprintf('HTTPÚ±G[ (%d) %s', - $errno, - htmlspecialchars($errstr, ENT_QUOTES)); - $msg .= '<br>'; - $msg .= sprintf('rep2 info: <a href="%s"%s>%s</a> Éڱūܹñŵ½B', - P2Util::throughIme($url), - $_conf['ext_win_target_at'], - htmlspecialchars($url, ENT_QUOTES, 'Shift_JIS', false)); - $msg .= '</p>'; - - P2Util::pushInfoHtml($msg); + $summary = sprintf('HTTPÚ±G[ (%d) %s', $errno, $errstr); + $description = self::_urlToAnchor($url) . ' Éڱūܹñŵ½B'; + self::_pushInfoMessage($summary, $description); } @@ -1543,21 +1547,51 @@ * @param string $url * @return void */ - protected function _pushInfoReadTimedOut($url) + static protected function _pushInfoReadTimedOut($url) { - global $_conf; + $summary = 'HTTPÚ±^CAEg'; + $description = self::_urlToAnchor($url) . ' ðÇÝÝ®¹Å«Ü¹ñŵ½B'; + self::_pushInfoMessage($summary, $description); + } - $msg = '<p class="info-msg">HTTPÚ±^CAEg<br>'; - $msg .= sprintf('rep2 info: <a href="%s"%s>%s</a> ðÇÝÝ®¹Å«Ü¹ñŵ½B', - P2Util::throughIme($url), - $_conf['ext_win_target_at'], - htmlspecialchars($url, ENT_QUOTES, 'Shift_JIS', false)); - $msg .= '</p>'; + // }}} + // {{{ _pushInfoHttpError() - P2Util::pushInfoHtml($msg); + /** + * HTTPG[ÌbZ[WðvbV ·é + * + * @param string $url + * @param int $errno + * @param string $errstr + * @return void + */ + static protected function _pushInfoHttpError($url, $errno, $errstr) + { + $summary = sprintf('HTTP %d %s', $errno, $errstr); + $description = self::_urlToAnchor($url) . ' ðÇÝßܹñŵ½B'; + self::_pushInfoMessage($summary, $description); } // }}} + // {{{ _urlToAnchor() + + /** + * _pushInfon\bhpÉURLðAJ[ÉÏ··é + * + * @param string $url + * @return string + */ + static protected function _urlToAnchor($url) + { + global $_conf; + + return sprintf('<a href="%s"%s>%s</a>', + P2Util::throughIme($url), + $_conf['ext_win_target_at'], + htmlspecialchars($url, ENT_QUOTES)); + } + + // }}} } // }}} Modified: p2ex/trunk/lib/expack/rss/getimage.inc.php =================================================================== --- p2ex/trunk/lib/expack/rss/getimage.inc.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/expack/rss/getimage.inc.php 2010-01-26 12:05:30 UTC (rev 811) @@ -3,7 +3,7 @@ * rep2expck - RSSæLbV */ -require_once P2EX_LIB_DIR . '/bootstrap.php'; +require_once P2EX_LIB_DIR . '/ic2/bootstrap.php'; // {{{ rss_get_image() Modified: p2ex/trunk/lib/read_footer.inc.php =================================================================== --- p2ex/trunk/lib/read_footer.inc.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/read_footer.inc.php 2010-01-26 12:05:30 UTC (rev 811) @@ -58,22 +58,29 @@ } $res_form_ht_pb = $res_form_ht; + } else { + $htm['dores'] = ''; + $res_form_ht_pb = ''; } if ($res1['body']) { $q_ichi = $res1['body']." | "; + } else { + $q_ichi = ''; } // XÌ·Îâ³ - $htm['spd'] = ''; if ($spd_st = $aThread->getTimePerRes() and $spd_st != '-') { $htm['spd'] = '<span class="spd" title="·Îâ³Ô/X">' . $spd_st . '</span>'; + } else { + $htm['spd'] = ''; } // datTCY - $htm['dsize'] = ''; if (file_exists($aThread->keydat) && $dsize_ht = filesize($aThread->keydat)) { $htm['dsize'] = sprintf('<span class="spd" title="%s">%01.1fKB</span> |', 'datTCY', $dsize_ht / 1024); + } else { + $htm['dsize'] = ''; } // XÔwèÚ® Deleted: p2ex/trunk/lib/read_machibbs.inc.php =================================================================== --- p2ex/trunk/lib/read_machibbs.inc.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/read_machibbs.inc.php 2010-01-26 12:05:30 UTC (rev 811) @@ -1,168 +0,0 @@ -<?php -/** - * rep2 - Ü¿BBSpÌÖ - */ - -// {{{ machiDownload() - -/** - * Ü¿BBSÌ read.cgi ðÇñÅ datÉÛ¶·é - */ -function machiDownload() -{ - global $aThread; - - $GLOBALS['machi_latest_num'] = ''; - - // {{{ ù¾datÌæ¾XªK«©Ç¤©ðO̽ß`FbN - if (file_exists($aThread->keydat)) { - $dls = FileCtl::file_read_lines($aThread->keydat); - if (!$dls || sizeof($dls) != $aThread->gotnum) { - // echo 'bad size!<br>'; - unlink($aThread->keydat); - $aThread->gotnum = 0; - } - } else { - $aThread->gotnum = 0; - } - // }}} - - if ($aThread->gotnum == 0) { - $file_append = false; - $START = 1; - } else { - $file_append = true; - $START = $aThread->gotnum + 1; - } - - // Ü¿BBS - $machiurl = "http://{$aThread->host}/bbs/read.cgi?BBS={$aThread->bbs}&KEY={$aThread->key}&START={$START}"; - - $tempfile = $aThread->keydat.'.html.temp'; - - FileCtl::mkdir_for($tempfile); - $machiurl_res = P2Util::fileDownload($machiurl, $tempfile); - - if ($machiurl_res->isError()) { - $aThread->diedat = true; - return false; - } - - $mlines = FileCtl::file_read_lines($tempfile); - - // êt@Cðí·é - unlink($tempfile); - - // iÜ¿BBSj<html>error</html> - if (trim($mlines[0]) == '<html>error</html>') { - $aThread->getdat_error_msg_ht .= 'error'; - $aThread->diedat = true; - return false; - } - - // {{{ DATð«Þ - if ($mdatlines = machiHtmltoDatLines($mlines)) { - - $file_append = ($file_append) ? FILE_APPEND : 0; - - $cont = ''; - for ($i = $START; $i <= $GLOBALS['machi_latest_num']; $i++) { - if ($mdatlines[$i]) { - $cont .= $mdatlines[$i]; - } else { - $cont .= " Ú[ñ<> Ú[ñ<> Ú[ñ<> Ú[ñ<>\n"; - } - } - if (FileCtl::file_write_contents($aThread->keydat, $cont, $file_append) === false) { - p2die('cannot write file.'); - } - } - // }}} - - $aThread->isonline = true; - - return true; -} - -// }}} -// {{{ machiHtmltoDatLines() - -/** - * Ü¿BBSÌread.cgiÅÇÝñ¾HTMLðdatÉÏ··é - * - * @see machiDownload() - */ -function machiHtmltoDatLines($mlines) -{ - if (!$mlines) { - $retval = false; - return $retval; - } - $mdatlines = ""; - - foreach ($mlines as $ml) { - $ml = rtrim($ml); - if (!$tuduku) { - unset($order, $mail, $name, $date, $ip, $body); - } - - if ($tuduku) { - if (preg_match('{^ \\]</font><br><dd>(.*) <br><br>$}i', $ml, $matches)) { - $body = $matches[1]; - } else { - unset($tuduku); - continue; - } - } elseif (preg_match('{^<dt>(?:<a[^>]+?>)?(\\d+)(?:</a>)? ¼OF(<font color="#.+?">|<a href="mailto:(.*)">)<b> (.+) </b>(</font>|</a>) eúF (.+)<br><dd>(.*) <br><br>$}i', $ml, $matches)) { - $order = $matches[1]; - $mail = $matches[3]; - $name = preg_replace('{<font color="?#.+?"?>(.+)</font>}i', '\\1', $matches[4]); - $date = $matches[6]; - $body = $matches[7]; - } elseif (preg_match('{<title>(.*)</title>}i', $ml, $matches)) { - $mtitle = $matches[1]; - continue; - } elseif (preg_match('{^<dt>(?:<a[^>]+?>)?(\\d+)(?:</a>)? ¼OF(<font color="#.+?">|<a href="mailto:(.*)">)<b> (.+) </b>(</font>|</a>) eúF (.+) <font size=1>\\[ ?(.*)$}i', $ml, $matches)) { - $order = $matches[1]; - $mail = $matches[3]; - $name = preg_replace('{<font color="?#.+?"?>(.+)</font>}i', '\\1', $matches[4]); - $date = $matches[6]; - $ip = $matches[7]; - $tuduku = true; - continue; - } - - if ($ip) { - $date = "$date [$ip]"; - } - - // NOµ - $body = preg_replace('{<a href="(https?://[-_.!~*\'()0-9A-Za-z;/?:@&=+\$,%#]+)" target="_blank">(https?://[-_.!~*\'()0-9A-Za-z;/?:@&=+\$,%#]+)</a>}i', '$1', $body); - - if ($order == 1) { - $datline = $name.'<>'.$mail.'<>'.$date.'<>'.$body.'<>'.$mtitle."\n"; - } else { - $datline = $name.'<>'.$mail.'<>'.$date.'<>'.$body.'<>'."\n"; - } - $mdatlines[$order] = $datline; - if ($order > $GLOBALS['machi_latest_num']) { - $GLOBALS['machi_latest_num'] = $order; - } - unset($tuduku); - } - - return $mdatlines; -} - -// }}} - -/* - * 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_shitaraba.inc.php =================================================================== --- p2ex/trunk/lib/read_shitaraba.inc.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/read_shitaraba.inc.php 2010-01-26 12:05:30 UTC (rev 811) @@ -10,10 +10,8 @@ /** * µ½çÎJBBSÌ rawmode.cgi ðÇñÅAdatÉÛ¶·éi2chÉ®`j */ -function shitarabaDownload() +function shitarabaDownload(ThreadRead $aThread) { - global $aThread; - $GLOBALS['machi_latest_num'] = ''; // {{{ ù¾datÌæ¾XªK«©Ç¤©ðO̽ß`FbN Modified: p2ex/trunk/lib/startup.funcs.php =================================================================== --- p2ex/trunk/lib/startup.funcs.php 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/lib/startup.funcs.php 2010-01-26 12:05:30 UTC (rev 811) @@ -155,6 +155,7 @@ BrdCtl | BrdMenu(?:Cate|Ita)? | DataPhp | + DownloadDat[0-9A-Z][0-9A-Za-z]* | FavSetManager | FileCtl | HostCheck | Modified: p2ex/trunk/style/fitimage_css.inc =================================================================== --- p2ex/trunk/style/fitimage_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/fitimage_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -5,9 +5,9 @@ */ if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { - $button_position = 'absolute'; + $button_position = 'absolute'; } else { - $button_position = 'fixed'; + $button_position = 'fixed'; } echo <<<EOSTYLE Modified: p2ex/trunk/style/info_css.inc =================================================================== --- p2ex/trunk/style/info_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/info_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -4,8 +4,10 @@ * for info.php îñEBhE */ -if($STYLE['a_underline_none'] == 2){ - $thre_title_underline_css = "a.thre_title{text-decoration:none;}"; +if ($STYLE['a_underline_none'] == 2) { + $thre_title_underline_css = 'a.thre_title { text-decoration:none; }'; +} else { + $thre_title_underline_css = ''; } echo <<<EOSTYLE Modified: p2ex/trunk/style/iv2_css.inc =================================================================== --- p2ex/trunk/style/iv2_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/iv2_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -4,16 +4,16 @@ * for ImageCache2:iv2.php */ -if ($STYLE['fontfamily_bold']) { - $boldstyle = "font-family: \"{$STYLE['fontfamily_bold']}\";"; - if (!empty($STYLE['fontstyle_bold'])) { - $boldstyle .= "font-style: {$STYLE['fontstyle_bold']};"; - } - if (!empty($STYLE['fontweight_bold'])) { - $boldstyle .= "font-weight: {$STYLE['fontweight_bold']};"; - } +if (!empty($STYLE['fontfamily_bold'])) { + $boldstyle = "font-family: \"{$STYLE['fontfamily_bold']}\";"; + if (!empty($STYLE['fontstyle_bold'])) { + $boldstyle .= "font-style: {$STYLE['fontstyle_bold']};"; + } + if (!empty($STYLE['fontweight_bold'])) { + $boldstyle .= "font-weight: {$STYLE['fontweight_bold']};"; + } } else { - $boldstyle = 'font-weight: bold;'; + $boldstyle = 'font-weight: bold;'; } echo <<<EOSTYLE Modified: p2ex/trunk/style/menu_css.inc =================================================================== --- p2ex/trunk/style/menu_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/menu_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -5,11 +5,11 @@ */ if ($STYLE['a_underline_none'] == 1) { - $cate_underline_css = ''; - $fav_underline_css = ''; + $cate_underline_css = ''; + $fav_underline_css = ''; } else { - $cate_underline_css = 'b.menu_cate{text-decoration:underline;}'; - $fav_underline_css = 'span.fav{text-decoration:underline;}'; + $cate_underline_css = 'b.menu_cate { text-decoration:underline; }'; + $fav_underline_css = 'span.fav { text-decoration:underline; }'; } echo <<<EOSTYLE Modified: p2ex/trunk/style/post_css.inc =================================================================== --- p2ex/trunk/style/post_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/post_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -4,10 +4,10 @@ * for post.php îñEBhE */ -if($STYLE['a_underline_none'] == 2){ - $thre_title_underline_css = "a.thre_title{text-decoration:none;}"; +if ($STYLE['a_underline_none'] == 2) { + $thre_title_underline_css = 'a.thre_title { text-decoration:none; }'; } else { - thre_title_underline_css = ''; + $thre_title_underline_css = ''; } echo <<<EOSTYLE Modified: p2ex/trunk/style/read_css.inc =================================================================== --- p2ex/trunk/style/read_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/read_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -4,7 +4,7 @@ * for read.php */ -if (!isset($STYLE['respop_bgcolor'])) { $STYLE['respop_bgcolor'] = '#ffffcc'; } +if (!isset($STYLE['respop_bgcolor'])) { $STYLE['respop_bgcolor'] = '#ffffcc'; } if (!isset($STYLE['respop_background'])) { $STYLE['respop_background'] = ''; } $respop_background = "background:{$STYLE['respop_bgcolor']} {$STYLE['respop_background']};"; @@ -13,15 +13,16 @@ if (!isset($STYLE['respop_b_color'])) { $STYLE['respop_b_color'] = 'black'; } $respop_border = "border:{$STYLE['respop_b_style']} {$STYLE['respop_b_width']} {$STYLE['respop_b_color']};"; -$respop_color = ''; if (isset($STYLE['respop_color']) && strlen($STYLE['respop_color']) > 0) { - $respop_color = "color:{$STYLE['respop_color']};"; + $respop_color = "color: {$STYLE['respop_color']};"; +} else { + $respop_color = ''; } if ($STYLE['fontfamily_bold']) { - $fontstyle_bold = empty($STYLE['fontstyle_bold']) ? 'normal' : $STYLE['fontstyle_bold']; - $fontweight_bold = empty($STYLE['fontweight_bold']) ? 'normal' : $STYLE['fontweight_bold']; - echo <<<EOSTYLE + $fontstyle_bold = empty($STYLE['fontstyle_bold']) ? 'normal' : $STYLE['fontstyle_bold']; + $fontweight_bold = empty($STYLE['fontweight_bold']) ? 'normal' : $STYLE['fontweight_bold']; + echo <<<EOSTYLE h3, h4 { font-family:"{$STYLE['fontfamily_bold']}"; Modified: p2ex/trunk/style/style_css.inc =================================================================== --- p2ex/trunk/style/style_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/style_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -4,9 +4,10 @@ * SÊ */ -$a_underline_none_css = ''; if ($STYLE['a_underline_none'] == 1) { - $a_underline_none_css = "a{text-decoration:none;}"; + $a_underline_none_css = "a{text-decoration:none;}"; +} else { + $a_underline_none_css = ''; } // uEUª Camino Èç Modified: p2ex/trunk/style/subject_css.inc =================================================================== --- p2ex/trunk/style/subject_css.inc 2010-01-25 23:56:27 UTC (rev 810) +++ p2ex/trunk/style/subject_css.inc 2010-01-26 12:05:30 UTC (rev 811) @@ -5,13 +5,13 @@ */ if ($STYLE['a_underline_none'] == 2) { - $thre_title_underline_css = <<<EOSTYLE + $thre_title_underline_css = <<<EOSTYLE a.thre_title, a.thre_title_new, a.thre_title_fav { text-decoration: none; } EOSTYLE; } else { - $thre_title_underline_css = ''; + $thre_title_underline_css = ''; } echo <<<EOSTYLE