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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 25日 (月) 16:01:16 JST


Revision: 801
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=801
Author:   rsk
Date:     2010-01-25 16:01:16 +0900 (Mon, 25 Jan 2010)

Log Message:
-----------
expack:
- conf/conf_admin.inc.php のネットワーク接続タイムアウト設定
  $_conf['fsockopen_time_limit'] に代えて $_conf['http_conn_timeout'] と
  $_conf['http_read_timeout'] を使うように変更。
- グローバル変数 $_info_msg_ht を直接扱っている箇所を rep2 1.8.x にならって
  P2Util::{push|print|get}InfoHtml() を使うように変更。
-- $_info_msg_ht が空かどうかを調べるメソッド P2Util::hasInfoHtml() を追加。
-- スクリプトの終了時に P2Util::printInfoHtml() が呼ばれるようにした。
- ThreadReadクラスをリファクタリングした。
- 同梱しているiuiをバージョン0.31にアップグレード。

Modified Paths:
--------------
    p2ex/trunk/cli/fetch-subject-txt.php
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/conf/conf_admin.inc.php
    p2ex/trunk/conf/conf_ic2.inc.php
    p2ex/trunk/doc/iui/NOTICE.txt
    p2ex/trunk/doc/iui/releaseNotes.txt
    p2ex/trunk/edit_aborn_word.php
    p2ex/trunk/edit_conf_user.php
    p2ex/trunk/editfavita.php
    p2ex/trunk/editfile.php
    p2ex/trunk/editpref.php
    p2ex/trunk/editrss.php
    p2ex/trunk/ic2_getter.php
    p2ex/trunk/ic2_manager.php
    p2ex/trunk/ic2_setrank.php
    p2ex/trunk/ic2_setter.php
    p2ex/trunk/ic2_viewtable.php
    p2ex/trunk/import.php
    p2ex/trunk/info.php
    p2ex/trunk/iui/iui.css
    p2ex/trunk/iui/iui.js
    p2ex/trunk/lib/BbsMap.php
    p2ex/trunk/lib/BrdCtl.php
    p2ex/trunk/lib/BrdMenu.php
    p2ex/trunk/lib/Login.php
    p2ex/trunk/lib/P2CommandRunner.php
    p2ex/trunk/lib/P2HttpExt.php
    p2ex/trunk/lib/P2Util.php
    p2ex/trunk/lib/SettingTxt.php
    p2ex/trunk/lib/ShowBrdMenuK.php
    p2ex/trunk/lib/ShowBrdMenuPc.php
    p2ex/trunk/lib/SubjectTxt.php
    p2ex/trunk/lib/ThreadList.php
    p2ex/trunk/lib/ThreadRead.php
    p2ex/trunk/lib/Wap.php
    p2ex/trunk/lib/bootstrap.php
    p2ex/trunk/lib/expack/ic2/DatabaseManager.php
    p2ex/trunk/lib/expack/rss/common.inc.php
    p2ex/trunk/lib/expack/rss/parser.inc.php
    p2ex/trunk/lib/expack/rss/read.inc.php
    p2ex/trunk/lib/expack/rss/read_k.inc.php
    p2ex/trunk/lib/expack/rss/setrss.inc.php
    p2ex/trunk/lib/expack/rss/subject.inc.php
    p2ex/trunk/lib/expack/rss/subject_k.inc.php
    p2ex/trunk/lib/global.funcs.php
    p2ex/trunk/lib/index_print_k.inc.php
    p2ex/trunk/lib/login2ch.inc.php
    p2ex/trunk/lib/login_first.inc.php
    p2ex/trunk/lib/menu.inc.php
    p2ex/trunk/lib/read_header.inc.php
    p2ex/trunk/lib/read_header_k.inc.php
    p2ex/trunk/lib/read_res_hist.inc.php
    p2ex/trunk/lib/sb_header.inc.php
    p2ex/trunk/lib/sb_header_k.inc.php
    p2ex/trunk/lib/setfavita.inc.php
    p2ex/trunk/lib/startup.funcs.php
    p2ex/trunk/login.php
    p2ex/trunk/login2ch.php
    p2ex/trunk/menu_i.php
    p2ex/trunk/menu_k.php
    p2ex/trunk/post.php
    p2ex/trunk/post_form.php
    p2ex/trunk/read_async.php
    p2ex/trunk/read_copy_k.php
    p2ex/trunk/read_new.php
    p2ex/trunk/read_new_k.php
    p2ex/trunk/read_res_hist.php
    p2ex/trunk/read_rss.php
    p2ex/trunk/setting.php
    p2ex/trunk/spm_k.php
    p2ex/trunk/style/info_css.inc
    p2ex/trunk/style/login_first_css.inc
    p2ex/trunk/subject.php
    p2ex/trunk/subject_rss.php
    p2ex/trunk/title.php
    p2ex/trunk/viewtxt.php

Added Paths:
-----------
    p2ex/trunk/iui/redButton.png


-------------- next part --------------
Modified: p2ex/trunk/cli/fetch-subject-txt.php
===================================================================
--- p2ex/trunk/cli/fetch-subject-txt.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/cli/fetch-subject-txt.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -146,8 +146,8 @@
 // {{{ Œãˆ—
 
 // ƒGƒ‰[ƒƒbƒZ[ƒW‚̎擾
-if ($_info_msg_ht !== '') {
-    $errmsg = str_replace("\n", PHP_EOL, $_info_msg_ht);
+if (P2Util::hasInfoHtml()) {
+    $errmsg = str_replace("\n", PHP_EOL, P2Util::getInfoHtml());
 } else {
     $errmsg = null;
 }

Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/conf/conf.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -29,7 +29,7 @@
 
 // {{{ ƒOƒ[ƒoƒ‹•Ï”‚ð‰Šú‰»
 
-$_info_msg_ht = ''; // ƒ†[ƒU’Ê’m—p î•ñƒƒbƒZ[ƒWHTML
+$_info_msg_ht = null; // ƒ†[ƒU’Ê’m—p î•ñƒƒbƒZ[ƒWHTML
 
 $MYSTYLE    = array();
 $STYLE      = array();
@@ -66,7 +66,7 @@
 {
     global $MYSTYLE, $STYLE, $debug;
     global $skin, $skin_en, $skin_name, $skin_uniq;
-    global $_conf, $_info_msg_ht, $_login, $_p2session;
+    global $_conf, $_login, $_p2session;
 
     // ƒGƒ‰[o—͐ݒè
     if (defined('E_DEPRECATED')) {

Modified: p2ex/trunk/conf/conf_admin.inc.php
===================================================================
--- p2ex/trunk/conf/conf_admin.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/conf/conf_admin.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -69,8 +69,15 @@
 $_conf['cid_expire_day'] = 30;      // (30)
 
 // ƒlƒbƒgƒ[ƒNÚ‘±ƒ^ƒCƒ€ƒAƒEƒgŽžŠÔ (•b)
+// @deprecated use $_conf['http_conn_timeout'] and $_conf['http_read_timeout']
 $_conf['fsockopen_time_limit'] = 7; // (7)
 
+// HTTPÚ‘±ƒ^ƒCƒ€ƒAƒEƒgŽžŠÔ (•b)
+$_conf['http_conn_timeout'] = 1; // (1)
+
+// HTTP“Ǎžƒ^ƒCƒ€ƒAƒEƒgŽžŠÔ (•b)
+$_conf['http_read_timeout'] = 5; // (5)
+
 // p2‚̍ŐVƒo[ƒWƒ‡ƒ“‚ðŽ©“®ƒ`ƒFƒbƒN(‚·‚é:1, ‚µ‚È‚¢:0)
 $_conf['updatan_haahaa'] = 1;       // (1)
 

Modified: p2ex/trunk/conf/conf_ic2.inc.php
===================================================================
--- p2ex/trunk/conf/conf_ic2.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/conf/conf_ic2.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -134,7 +134,7 @@
 $_conf['expack.ic2.getter.title'] = "ImageCache2::Getter";
 
 // ƒT[ƒo‚ɐڑ±‚·‚éÛ‚Ƀ^ƒCƒ€ƒAƒEƒg‚·‚é‚Ü‚Å‚ÌŽžŠÔi•bj
-$_conf['expack.ic2.getter.conn_timeout'] = 60;
+$_conf['expack.ic2.getter.conn_timeout'] = 5;
 
 // ƒ_ƒEƒ“ƒ[ƒh‚ªƒ^ƒCƒ€ƒAƒEƒg‚·‚é‚Ü‚Å‚ÌŽžŠÔi•bj
 $_conf['expack.ic2.getter.read_timeout'] = 60;

Modified: p2ex/trunk/doc/iui/NOTICE.txt
===================================================================
--- p2ex/trunk/doc/iui/NOTICE.txt	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/doc/iui/NOTICE.txt	2010-01-25 07:01:16 UTC (rev 801)
@@ -1,12 +1,18 @@
 NOTICE.txt - iUI credits and copyright notices
 
    iUI is Copyright (c) 2007-2009 by the iUI project members: 
-           Joe  Hewitt
-           Christopher Allen 
-           M. Sean Gilligan 
+           M. Sean Gilligan (msgilligan)
        Past members:  	 
-           (none) 
+           Joe  Hewitt (joehewitt)
+           Christopher Allen (ChristopherA)
 
+CREDITS
+	schlueter - committed fixes for issues #9, #11, #63 -- added samples
+	???       - created iUI icon
+	kris.tate - named it "iUI", created Google Code project, initial checkin
+	others    - let us know if we missed you
+	iUI users - thanks for your patience, feedback, and bug reports
+
 THIRD PARTY COMPONENTS
 
    * iUI includes software developed by the Mozilla Project

Modified: p2ex/trunk/doc/iui/releaseNotes.txt
===================================================================
--- p2ex/trunk/doc/iui/releaseNotes.txt	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/doc/iui/releaseNotes.txt	2010-01-25 07:01:16 UTC (rev 801)
@@ -1,3 +1,18 @@
+REL-0.31 2009-10-05
+
+* Slide animation with CSS transitions is now on by default where enabled
+* Non-AJAX form subission when target="_self" (Issue #136)
+
+REL-0.30 2009-08-06
+
+* CSS transitions for slide animation (for backward compatibility disabled by default) (Issue 97)
+* Support javascript: URLs in links (Issue 134)
+* Support loading complete pages in "WebApp" mode using target="_webapp" (Issue 135)
+* Added Red Button .redButton CSS and border-image (Issue 46)
+* Allow outbound links to anchor tags (Issue 82)
+* If HTML page is loaded with anchor to a loaded page/fragment/view, scroll to it (Issue 107)
+* Fix problem with hash and URLs like http://[site]/[webapp]/page.php/pageName.htm (Issue 122)
+
 REL-0.20 2009-05-08
 
 * Use onorientationchange event for orientation with fallback to use of window.innerWidth. (Issue 84)
@@ -5,7 +20,7 @@
 * Add support for radio buttons and checkboxes (Issue 9)
 * Add support for textarea in forms (Issue 11)
 * Add support for static text in a panel using span tags (Issue 52)
-* More release notes TBD
+* Add isNativeUrl() function to let certain URLs (tel, Google Maps, etc) have default handling (Issue 63)
 
 REL-0.13 2007-11-04
 

Modified: p2ex/trunk/edit_aborn_word.php
===================================================================
--- p2ex/trunk/edit_aborn_word.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/edit_aborn_word.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -72,9 +72,9 @@
         $newdata .= $a_mode . $a_word . "\t" . $a_time . "\t" . $a_hits . "\n";
     }
     if (FileCtl::file_write_contents($path, $newdata) !== FALSE) {
-        $_info_msg_ht .= "<p>›Ý’è‚ðXV•Û‘¶‚µ‚Ü‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>›Ý’è‚ðXV•Û‘¶‚µ‚Ü‚µ‚½</p>');
     } else {
-        $_info_msg_ht .= "<p>~Ý’è‚ðXV•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>~Ý’è‚ðXV•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
     }
 
 // }}}
@@ -82,9 +82,9 @@
 
 } elseif (!empty($_POST['submit_default'])) {
     if (@unlink($path)) {
-        $_info_msg_ht .= "<p>›ƒŠƒXƒg‚ð‹ó‚É‚µ‚Ü‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>›ƒŠƒXƒg‚ð‹ó‚É‚µ‚Ü‚µ‚½</p>');
     } else {
-        $_info_msg_ht .= "<p>~ƒŠƒXƒg‚ð‹ó‚É‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>~ƒŠƒXƒg‚ð‹ó‚É‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
     }
 }
 
@@ -207,10 +207,7 @@
 }
 
 // î•ñƒƒbƒZ[ƒW•\Ž¦
-if (!empty($_info_msg_ht)) {
-    echo $_info_msg_ht;
-    $_info_msg_ht = "";
-}
+P2Util::printInfoHtml();
 
 if ($filename == 'p2_aborn_thread.txt') {
     $usage_ttitle = '<li>ƒXƒŒƒ^ƒC: u‚ ‚ځ[‚ñƒXƒŒƒbƒhƒ^ƒCƒgƒ‹v‚Å‚Í•sŽg—p</li>';

Modified: p2ex/trunk/edit_conf_user.php
===================================================================
--- p2ex/trunk/edit_conf_user.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/edit_conf_user.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -60,9 +60,9 @@
     // ƒVƒŠƒAƒ‰ƒCƒY‚µ‚Ä•Û‘¶
     FileCtl::make_datafile($_conf['conf_user_file'], $_conf['conf_user_perm']);
     if (FileCtl::file_write_contents($_conf['conf_user_file'], serialize($conf_save)) === false) {
-        $_info_msg_ht .= "<p>~Ý’è‚ðXV•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>~Ý’è‚ðXV•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
     } else {
-        $_info_msg_ht .= "<p>›Ý’è‚ðXV•Û‘¶‚µ‚Ü‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>›Ý’è‚ðXV•Û‘¶‚µ‚Ü‚µ‚½</p>');
         // •ÏX‚ª‚ ‚ê‚΁A“à•”ƒf[ƒ^‚àXV‚µ‚Ä‚¨‚­
         $_conf = array_merge($_conf, $conf_user_def, $conf_save);
     }
@@ -74,7 +74,7 @@
 
 } elseif (!empty($_POST['submit_default'])) {
     if (file_exists($_conf['conf_user_file']) and unlink($_conf['conf_user_file'])) {
-        $_info_msg_ht .= "<p>›Ý’è‚ðƒfƒtƒHƒ‹ƒg‚É–ß‚µ‚Ü‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>›Ý’è‚ðƒfƒtƒHƒ‹ƒg‚É–ß‚µ‚Ü‚µ‚½</p>');
         // •ÏX‚ª‚ ‚ê‚΁A“à•”ƒf[ƒ^‚àXV‚µ‚Ä‚¨‚­
         $_conf = array_merge($_conf, $conf_user_def);
         if (is_array($conf_save)) {
@@ -194,8 +194,7 @@
 }
 
 // î•ñƒƒbƒZ[ƒW•\Ž¦
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 echo <<<EOP
 <form id="edit_conf_user_form" method="POST" action="{$_SERVER['SCRIPT_NAME']}" target="_self" accept-charset="{$_conf['accept_charset']}">

Modified: p2ex/trunk/editfavita.php
===================================================================
--- p2ex/trunk/editfavita.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/editfavita.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -93,8 +93,7 @@
 $body_at = ($_conf['ktai']) ? $_conf['k_colors'] : ' onload="top.document.title=self.document.title;"';
 echo "</head><body{$body_at}>\n";
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 //================================================================
 // ƒƒCƒ“•”•ªHTML•\Ž¦

Modified: p2ex/trunk/editfile.php
===================================================================
--- p2ex/trunk/editfile.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/editfile.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -47,7 +47,7 @@
 //=========================================================
 if (isset($filecont)) {
     if (setFile($path, $filecont, $encode)) {
-        $_info_msg_ht .= "saved, OK.";
+        P2Util::pushInfoHtml('saved, OK.');
     }
 }
 
@@ -89,7 +89,7 @@
  */
 function editFile($path, $encode, $title)
 {
-    global $_conf, $modori_url, $_info_msg_ht, $rows, $cols, $csrfid;
+    global $_conf, $modori_url, $rows, $cols, $csrfid;
 
     if ($path == '') {
         p2die('path ‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ');
@@ -131,6 +131,8 @@
 <body onload="top.document.title=self.document.title;">
 EOHEADER;
 
+    $info_msg_ht = P2Util::getInfoHtml();
+
     echo $modori_url_ht;
     echo $ptitle;
     echo <<<EOFORM
@@ -142,7 +144,7 @@
     <input type="hidden" name="cols" value="{$cols}">
     <input type="hidden" name="csrfid" value="{$csrfid}">
     <input type="submit" name="submit" value="Save">
-    {$_info_msg_ht}<br>
+    {$info_msg_ht}<br>
     <textarea style="font-size:9pt;" id="filecont" name="filecont" wrap="off"{$rows_at}{$cols_at}>{$cont_area}</textarea>
     {$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']}
 </form>

Modified: p2ex/trunk/editpref.php
===================================================================
--- p2ex/trunk/editpref.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/editpref.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -158,10 +158,8 @@
     echo "<p id=\"pan_menu\">{$ptitle}</p>\n";
 }
 
+P2Util::printInfoHtml();
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
-
 // Ý’èƒvƒŠƒ“ƒg
 $aborn_thread_txt   = 'p2_aborn_thread.txt';
 $aborn_res_txt      = 'p2_aborn_res.txt';
@@ -649,7 +647,7 @@
  */
 function updateFavSetList()
 {
-    global $_conf, $_info_msg_ht;
+    global $_conf;
 
     if (file_exists($_conf['expack.misc.favset_file'])) {
         $setlist_titles = FavSetManager::getFavSetTitles();
@@ -679,7 +677,7 @@
 
     $newdata = serialize($setlist_titles);
     if (FileCtl::file_write_contents($_conf['expack.misc.favset_file'], $newdata) === FALSE) {
-        $_info_msg_ht .= "<p>p2 error: {$_conf['expack.misc.favset_file']} ‚É‚¨‹C‚É“ü‚èƒZƒbƒgÝ’è‚ð‘‚«ž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B";
+        P2Util::pushInfoHtml("<p>p2 error: {$_conf['expack.misc.favset_file']} ‚É‚¨‹C‚É“ü‚èƒZƒbƒgÝ’è‚ð‘‚«ž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B");
         return FALSE;
     }
 

Modified: p2ex/trunk/editrss.php
===================================================================
--- p2ex/trunk/editrss.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/editrss.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -8,7 +8,6 @@
 $_login->authorize(); // ƒ†[ƒU”FØ
 
 // •Ï” =============
-$_info_msg_ht = '';
 $editrss_php_ht = htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES);
 
 //================================================================
@@ -86,8 +85,7 @@
 <body>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 //================================================================
 // ƒƒCƒ“•”•ªHTML•\Ž¦

Modified: p2ex/trunk/ic2_getter.php
===================================================================
--- p2ex/trunk/ic2_getter.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/ic2_getter.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -169,7 +169,7 @@
     // URL‚ðŒŸØ
     $purl = @parse_url($params['uri']);
     if (!$purl || !preg_match('/^(https?)$/', $purl['scheme']) || empty($purl['host']) || empty($purl['path'])) {
-        $_info_msg_ht .= '<p>ƒGƒ‰[: •s³‚ÈURL</p>';
+        P2Util::pushInfoHtml('<p>ƒGƒ‰[: •s³‚ÈURL</p>');
         $execDL = FALSE;
         $isError = TRUE;
     }
@@ -203,14 +203,14 @@
         // ƒvƒŒ[ƒXƒzƒ‹ƒ_‚ƃ†[ƒUŽw’èƒpƒ‰ƒ[ƒ^
         if (strpos($params['uri'], '%s') !== false && !preg_match($serial_pattern, $params['uri'], $from_to)) {
             if (strpos(preg_replace('/%s/', ' ', $params['uri'], 1), '%s') !== false) {
-                $_info_msg_ht .= '<p>ƒGƒ‰[: URL‚ÉŠÜ‚ß‚ç‚ê‚éƒvƒŒ[ƒXƒzƒ‹ƒ_‚͈ê‚‚¾‚¯‚Å‚·B</p>';
+                P2Util::pushInfoHtml('<p>ƒGƒ‰[: URL‚ÉŠÜ‚ß‚ç‚ê‚éƒvƒŒ[ƒXƒzƒ‹ƒ_‚͈ê‚‚¾‚¯‚Å‚·B</p>');
                 $execDL = FALSE;
                 $isError = TRUE;
             } elseif (preg_match('/\\D/', $params['from']) || strlen($params['from']) == 0 ||
                       preg_match('/\\D/', $params['to'])   || strlen($params['to'])   == 0 ||
                       preg_match('/\\D/', $params['padding'])
             ) {
-                $_info_msg_ht .= '<p>ƒGƒ‰[: ˜A”Ôƒpƒ‰ƒ[ƒ^‚ÉŒë‚肪‚ ‚è‚Ü‚·B</p>';
+                P2Util::pushInfoHtml('<p>ƒGƒ‰[: ˜A”Ôƒpƒ‰ƒ[ƒ^‚ÉŒë‚肪‚ ‚è‚Ü‚·B</p>');
                 $execDL = FALSE;
                 $isError = TRUE;
             } else {
@@ -228,7 +228,7 @@
         } elseif (preg_match($serial_pattern, $params['uri'], $from_to) && strpos($params['uri'], '%s') === false) {
             $params['uri'] = preg_replace($serial_pattern, '%s', $params['uri'], 1);
             if (preg_match($serial_pattern, $params['uri'])) {
-                $_info_msg_ht .= '<p>ƒGƒ‰[: URL‚ÉŠÜ‚ß‚ç‚ê‚é˜A”Ôƒpƒ^[ƒ“‚͈ê‚‚¾‚¯‚Å‚·B</p>';
+                P2Util::pushInfoHtml('<p>ƒGƒ‰[: URL‚ÉŠÜ‚ß‚ç‚ê‚é˜A”Ôƒpƒ^[ƒ“‚͈ê‚‚¾‚¯‚Å‚·B</p>');
                 $execDL = FALSE;
                 $isError = TRUE;
             } else {
@@ -246,14 +246,14 @@
 
         // ‚Ç‚¿‚ç‚à–³‚¢‚©A—¼•û‚ª‚ ‚é
         } else {
-            $_info_msg_ht .= '<p>ƒGƒ‰[: URL‚ɘA”Ԃ̃vƒŒ[ƒXƒzƒ‹ƒ_(<samp>%s</samp>)‚Ü‚½‚̓pƒ^[ƒ“(<samp>[from-to]</samp>)‚ªŠÜ‚Ü‚ê‚Ä‚¢‚È‚¢‚©A—¼•û‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B</p>';
+            P2Util::pushInfoHtml('<p>ƒGƒ‰[: URL‚ɘA”Ԃ̃vƒŒ[ƒXƒzƒ‹ƒ_(<samp>%s</samp>)‚Ü‚½‚̓pƒ^[ƒ“(<samp>[from-to]</samp>)‚ªŠÜ‚Ü‚ê‚Ä‚¢‚È‚¢‚©A—¼•û‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B</p>');
             $execDL = FALSE;
             $isError = TRUE;
         }
 
         // ”ÍˆÍ‚ðŒŸØ
         if (isset($serial) && $serial['from'] >= $serial['to']) {
-            $_info_msg_ht .= '<p>ƒGƒ‰[: ˜A”Ԃ̏I‚è‚̔ԍ†‚ÍŽn‚Ü‚è‚̔ԍ†‚æ‚è‘å‚«‚­‚È‚¢‚Æ‚¢‚¯‚Ü‚¹‚ñB</p>';
+            P2Util::pushInfoHtml('<p>ƒGƒ‰[: ˜A”Ԃ̏I‚è‚̔ԍ†‚ÍŽn‚Ü‚è‚̔ԍ†‚æ‚è‘å‚«‚­‚È‚¢‚Æ‚¢‚¯‚Ü‚¹‚ñB</p>');
             $execDL = FALSE;
             $isError = TRUE;
             $serial = NULL;
@@ -262,7 +262,7 @@
     // ˜A”Ô‚È‚µ
     } else {
         if (strpos($params['uri'], '%s') !== false || preg_match($serial_pattern, $params['uri'], $from_to)) {
-            $_info_msg_ht .= '<p>ƒGƒ‰[: ˜A”ԂɃ`ƒFƒbƒN‚ª“ü‚Á‚Ä‚¢‚Ü‚¹‚ñ‚ªAURL‚ɘA”Ôƒ_ƒEƒ“ƒ[ƒh—p‚Ì•¶Žš—ñ‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B</p>';
+            P2Util::pushInfoHtml('<p>ƒGƒ‰[: ˜A”ԂɃ`ƒFƒbƒN‚ª“ü‚Á‚Ä‚¢‚Ü‚¹‚ñ‚ªAURL‚ɘA”Ôƒ_ƒEƒ“ƒ[ƒh—p‚Ì•¶Žš—ñ‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·B</p>');
             $execDL = FALSE;
             $isError = TRUE;
         }
@@ -398,7 +398,7 @@
 EOS;
 
 // •Ï”‚ðAssign
-$flexy->setData('info_msg', $_info_msg_ht);
+$flexy->setData('info_msg', P2Util::getInfoHtml());
 $flexy->setData('STYLE', $STYLE);
 $flexy->setData('js', $js);
 $flexy->setData('get', $qfObj);

Modified: p2ex/trunk/ic2_manager.php
===================================================================
--- p2ex/trunk/ic2_manager.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/ic2_manager.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -91,7 +91,7 @@
                 $where);
             $result = $db->getAll($sql, NULL, DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED);
             if (DB::isError($result)) {
-                $_info_msg_ht .= $result->getMessage();
+                P2Util::pushInfoHtml($result->getMessage());
                 break;
             }
             $target = $result[0];
@@ -108,10 +108,11 @@
             $removed_files = array_merge($result_files2['successed'], $result_files3['successed']);
             $failed_files = array_merge($result_files2['failed'], $result_files3['failed']);
             if (!empty($failed_files)) {
-                $_info_msg_ht .= '<p>ˆÈ‰º‚̃tƒ@ƒCƒ‹‚ªíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
-                $_info_msg_ht .= '<ul><li>';
-                $_info_msg_ht .= implode('</li><li>', array_map('htmlspecialchars', $failed_files));
-                $_info_msg_ht .= '</li></ul>';
+                $info_msg_ht = '<p>ˆÈ‰º‚̃tƒ@ƒCƒ‹‚ªíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
+                $info_msg_ht .= '<ul><li>';
+                $info_msg_ht .= implode('</li><li>', array_map('htmlspecialchars', $failed_files));
+                $info_msg_ht .= '</li></ul>';
+                P2Util::pushInfoHtml($info_msg_ht);
             }
             break;
 
@@ -122,9 +123,9 @@
                 $kvs = P2KeyValueStore::getStore($_conf['iv2_cache_db_path'],
                                                  P2KeyValueStore::CODEC_SERIALIZING);
                 if ($kvs->clear() === false) {
-                    $_info_msg_ht .= '<p>ˆê——•\Ž¦—p‚̃f[ƒ^ƒLƒƒƒbƒVƒ…‚ðÁ‹Ž‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
+                    P2Util::pushInfoHtml('<p>ˆê——•\Ž¦—p‚̃f[ƒ^ƒLƒƒƒbƒVƒ…‚ðÁ‹Ž‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>');
                 } else {
-                    $_info_msg_ht .= '<p>ˆê——•\Ž¦—p‚̃f[ƒ^ƒLƒƒƒbƒVƒ…‚ðÁ‹Ž‚µ‚Ü‚µ‚½B</p>';
+                    P2Util::pushInfoHtml('<p>ˆê——•\Ž¦—p‚̃f[ƒ^ƒLƒƒƒbƒVƒ…‚ðÁ‹Ž‚µ‚Ü‚µ‚½B</p>');
                 }
             }
 
@@ -132,10 +133,11 @@
             $result_files = P2Util::garbageCollection($flexy->options['compileDir'], -1, '', '', TRUE);
             $removed_files = $result_files['successed'];
             if (!empty($result_files['failed'])) {
-                $_info_msg_ht .= '<p>ˆÈ‰º‚̃Rƒ“ƒpƒCƒ‹Ï‚݃eƒ“ƒvƒŒ[ƒg‚ªíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
-                $_info_msg_ht .= '<ul><li>';
-                $_info_msg_ht .= implode('</li><li>', array_map('htmlspecialchars', $result_files['failed']));
-                $_info_msg_ht .= '</li></ul>';
+                $info_msg_ht = '<p>ˆÈ‰º‚̃Rƒ“ƒpƒCƒ‹Ï‚݃eƒ“ƒvƒŒ[ƒg‚ªíœ‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
+                $info_msg_ht .= '<ul><li>';
+                $info_msg_ht .= implode('</li><li>', array_map('htmlspecialchars', $result_files['failed']));
+                $info_msg_ht .= '</li></ul>';
+                P2Util::pushInfoHtml($info_msg_ht);
             }
             break;
 
@@ -143,9 +145,9 @@
         case 'clearErrorLog':
             $result = $db->query('DELETE FROM ' . $db->quoteIdentifier($ini['General']['error_table']));
             if (DB::isError($result)) {
-                $_info_msg_ht .= $result->getMessage();
+                P2Util::pushInfoHtml($result->getMessage());
             } else {
-                $_info_msg_ht .= '<p>ƒGƒ‰[ƒƒO‚ðÁ‹Ž‚µ‚Ü‚µ‚½B</p>';
+                P2Util::pushInfoHtml('<p>ƒGƒ‰[ƒƒO‚ðÁ‹Ž‚µ‚Ü‚µ‚½B</p>');
             }
             break;
 
@@ -153,9 +155,9 @@
         case 'clearBlackList':
             $result = $db->query('DELETE FROM ' . $db->quoteIdentifier($ini['General']['blacklist_table']));
             if (DB::isError($result)) {
-                $_info_msg_ht .= $result->getMessage();
+                P2Util::pushInfoHtml($result->getMessage());
             } else {
-                $_info_msg_ht .= '<p>ƒuƒ‰ƒbƒNƒŠƒXƒg‚ðÁ‹Ž‚µ‚Ü‚µ‚½B</p>';
+                P2Util::pushInfoHtml('<p>ƒuƒ‰ƒbƒNƒŠƒXƒg‚ðÁ‹Ž‚µ‚Ü‚µ‚½B</p>');
             }
             break;
 
@@ -165,9 +167,9 @@
             if ($db->dsn['phptype'] == 'sqlite') {
                 $result = $db->query('VACUUM');
                 if (DB::isError($result)) {
-                    $_info_msg_ht .= $result->getMessage();
+                    P2Util::pushInfoHtml($result->getMessage());
                 } else {
-                    $_info_msg_ht .= '<p>‰æ‘œƒf[ƒ^ƒx[ƒX‚ðÅ“K‰»‚µ‚Ü‚µ‚½B</p>';
+                    P2Util::pushInfoHtml('<p>‰æ‘œƒf[ƒ^ƒx[ƒX‚ðÅ“K‰»‚µ‚Ü‚µ‚½B</p>');
                 }
             }
 
@@ -177,13 +179,13 @@
                                                  P2KeyValueStore::CODEC_SERIALIZING);
                 $kvs->optimize();
                 unset($kvs);
-                $_info_msg_ht .= '<p>ˆê——•\Ž¦—p‚̃f[ƒ^ƒLƒƒƒbƒVƒ…‚ðÅ“K‰»‚µ‚Ü‚µ‚½B</p>';
+                P2Util::pushInfoHtml('<p>ˆê——•\Ž¦—p‚̃f[ƒ^ƒLƒƒƒbƒVƒ…‚ðÅ“K‰»‚µ‚Ü‚µ‚½B</p>');
             }
             break;
 
         // –¢’è‹`‚̃ŠƒNƒGƒXƒg
         default:
-            $_info_msg_ht .= '<p>–¢’è‹`‚̃ŠƒNƒGƒXƒg‚Å‚·B</p>';
+            P2Util::pushInfoHtml('<p>–¢’è‹`‚̃ŠƒNƒGƒXƒg‚Å‚·B</p>');
     }
 
     if (isset($removed_files)) {
@@ -196,7 +198,7 @@
 
 $flexy->setData('skin', $skin_en);
 $flexy->setData('php_self', $_SERVER['SCRIPT_NAME']);
-$flexy->setData('info_msg', $_info_msg_ht);
+$flexy->setData('info_msg', P2Util::getInfoHtml());
 $flexy->setData('pc', !$_conf['ktai']);
 $flexy->setData('iphone', $_conf['iphone']);
 $flexy->setData('doctype', $_conf['doctype']);

Modified: p2ex/trunk/ic2_setrank.php
===================================================================
--- p2ex/trunk/ic2_setrank.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/ic2_setrank.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -64,19 +64,16 @@
     }
 
     if ($remove) {
-        global $_info_msg_ht;
+        $orig_info_msg_ht = P2Util::getInfoHtml();
 
-        $orig_info_msg_ht = $_info_msg_ht;
-        $_info_msg_ht = '';
-
         $removed_files = IC2_DatabaseManager::remove(array($finder->id), $rank < 0);
-        if ($code != 0 && $_info_msg_ht === '') {
+        if ($code != 0 && !P2Util::hasInfoHtml()) {
             $code = 1;
         } else {
             $code = 0;
         }
 
-        $_info_msg_ht = $orig_info_msg_ht;
+        P2Util::pushInfoHtml($orig_info_msg_ht);
     }
 }
 

Modified: p2ex/trunk/ic2_setter.php
===================================================================
--- p2ex/trunk/ic2_setter.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/ic2_setter.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -80,7 +80,7 @@
     if (!empty($errors[UPLOAD_ERR_NO_TMP_DIR])) {
         p2die('ImageCache2 - ƒtƒ@ƒCƒ‹ƒAƒbƒvƒ[ƒh—p‚̃eƒ“ƒ|ƒ‰ƒŠƒtƒHƒ‹ƒ_‚ª‚ ‚è‚Ü‚¹‚ñB');
     } elseif (count($_FILES['upimg']['error']) == $errors[UPLOAD_ERR_NO_FILE]) {
-        $_info_msg_ht .= $err_fmt['none'];
+        P2Util::pushInfoHtml($err_fmt['none']);
     } else {
         // ƒTƒ€ƒlƒCƒ‹ì¬ƒNƒ‰ƒX‚̃Cƒ“ƒXƒ^ƒ“ƒX‚ðì¬
         $thumbnailer = new IC2_Thumbnailer(IC2_Thumbnailer::SIZE_DEFAULT);
@@ -113,7 +113,7 @@
             if (is_array($file)) {
                 $upfiles[] = $file;
             } else {
-                $_info_msg_ht .= $file;
+                P2Util::pushInfoHtml($file);
             }
         }
     }
@@ -133,10 +133,10 @@
 $flexy = new HTML_Template_Flexy($_flexy_options);
 $flexy->compile('ic2s.tpl.html');
 
-if (!$isPopUp && (!empty($upfiles) || $_info_msg_ht != '')) {
-    $showForm = FALSE;
+if (!$isPopUp && (!empty($upfiles) || P2Util::hasInfoHtml())) {
+    $showForm = false;
 } else {
-    $showForm = TRUE;
+    $showForm = true;
 }
 
 // ƒtƒH[ƒ€‚ðC³
@@ -164,7 +164,7 @@
 $view->hint     = $_conf['detect_hint'];
 $view->isPopUp  = $isPopUp;
 $view->showForm = $showForm;
-$view->info_msg = $_info_msg_ht;
+$view->info_msg = P2Util::getInfoHtml();
 $view->upfiles  = $upfiles;
 $view->maxfilesize = $maxsize_si;
 $view->maxpostsize = ini_get('post_max_size');

Modified: p2ex/trunk/ic2_viewtable.php
===================================================================
--- p2ex/trunk/ic2_viewtable.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/ic2_viewtable.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -82,7 +82,7 @@
 $flexy->setData('title', $title);
 $flexy->setData('mode', $mode);
 $flexy->setData('reload_js', $_SERVER['SCRIPT_NAME'] . '?nt=' . time() . '&table=' . $mode);
-$flexy->setData('info_msg', $_info_msg_ht);
+$flexy->setData('info_msg', P2Util::getInfoHtml());
 $flexy->setData('pc', !$_conf['ktai']);
 $flexy->setData('iphone', $_conf['iphone']);
 $flexy->setData('doctype', $_conf['doctype']);

Modified: p2ex/trunk/import.php
===================================================================
--- p2ex/trunk/import.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/import.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -26,11 +26,11 @@
         // ’l‚ÌŒŸØ
         if ($_POST['MAX_FILE_SIZE'] != $max_size) {
             $is_error = TRUE;
-            $_info_msg_ht .= '<p>Warning: ƒtƒH[ƒ€‚Ì MAX_FILE_SIZE ‚Ì’l‚ª‰ü‚´‚ñ‚³‚ê‚Ä‚¢‚Ü‚·B</p>';
+            P2Util::pushInfoHtml('<p>Warning: ƒtƒH[ƒ€‚Ì MAX_FILE_SIZE ‚Ì’l‚ª‰ü‚´‚ñ‚³‚ê‚Ä‚¢‚Ü‚·B</p>');
         }
         if (!preg_match('/^[1-9][0-9]+\.dat$/', $_FILES['dat_file']['name'])) {
             $is_error = TRUE;
-            $_info_msg_ht .= '<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽdat‚̃tƒ@ƒCƒ‹–¼‚ª•Ï‚Å‚·B</p>';
+            P2Util::pushInfoHtml('<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽdat‚̃tƒ@ƒCƒ‹–¼‚ª•Ï‚Å‚·B</p>');
         }
         $host = $_POST['host'];
         $bbs  = $_POST['bbs'];
@@ -40,11 +40,11 @@
             $key = $_POST['key'];
             if ($key != preg_replace('/\.(dat|html?)$/', '', $_FILES['dat_file']['name'])) {
                 $is_error = TRUE;
-                $_info_msg_ht .= '<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽdat‚̃tƒ@ƒCƒ‹–¼‚ƃXƒŒƒbƒhƒL[‚ªƒ}ƒbƒ`‚µ‚Ü‚¹‚ñB</p>';
+                P2Util::pushInfoHtml('<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽdat‚̃tƒ@ƒCƒ‹–¼‚ƃXƒŒƒbƒhƒL[‚ªƒ}ƒbƒ`‚µ‚Ü‚¹‚ñB</p>');
             }
         } else {
             $is_error = TRUE;
-            $_info_msg_ht .= '<p>Error: ƒXƒŒƒbƒhƒL[‚ÌŽw’肪•Ï‚Å‚·B</p>';
+            P2Util::pushInfoHtml('<p>Error: ƒXƒŒƒbƒhƒL[‚ÌŽw’肪•Ï‚Å‚·B</p>');
         }*/
         $dat_path = P2Util::datDirOfHostBbs($host, $bbs) . $key . '.dat';
 
@@ -54,19 +54,19 @@
         // ƒGƒ‰[ƒƒbƒZ[ƒW‚Í http://jp.php.net/manual/ja/features.file-upload.errors.php ‚©‚çƒRƒsƒy
         switch ($_FILES['dat_file']['error']) {
             case UPLOAD_ERR_INI_SIZE:
-                $_info_msg_ht .= '<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚́Aphp.ini ‚Ì upload_max_filesize ƒfƒBƒŒƒNƒeƒBƒu‚Ì’l‚ð’´‚¦‚Ä‚¢‚Ü‚·B</p>';
+                P2Util::pushInfoHtml('<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚́Aphp.ini ‚Ì upload_max_filesize ƒfƒBƒŒƒNƒeƒBƒu‚Ì’l‚ð’´‚¦‚Ä‚¢‚Ü‚·B</p>');
                 break;
             case UPLOAD_ERR_FORM_SIZE:
-                $_info_msg_ht .= '<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚́AHTMLƒtƒH[ƒ€‚ÅŽw’肳‚ꂽ MAX_FILE_SIZE ‚ð’´‚¦‚Ä‚¢‚Ü‚·B</p>';
+                P2Util::pushInfoHtml('<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚́AHTMLƒtƒH[ƒ€‚ÅŽw’肳‚ꂽ MAX_FILE_SIZE ‚ð’´‚¦‚Ä‚¢‚Ü‚·B</p>');
                 break;
             case UPLOAD_ERR_PARTIAL:
-                $_info_msg_ht .= '<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚͈ꕔ‚Ì‚Ý‚µ‚©ƒAƒbƒvƒ[ƒh‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB</p>';
+                P2Util::pushInfoHtml('<p>Error: ƒAƒbƒvƒ[ƒh‚³‚ꂽƒtƒ@ƒCƒ‹‚͈ꕔ‚Ì‚Ý‚µ‚©ƒAƒbƒvƒ[ƒh‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB</p>');
                 break;
             case UPLOAD_ERR_NO_FILE:
-                $_info_msg_ht .= '<p>Error: ƒtƒ@ƒCƒ‹‚̓Aƒbƒvƒ[ƒh‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
+                P2Util::pushInfoHtml('<p>Error: ƒtƒ@ƒCƒ‹‚̓Aƒbƒvƒ[ƒh‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B</p>');
                 break;
             default:
-                $_info_msg_ht .= '<p>Error: Œ´ˆö•s–¾‚̃Gƒ‰[B</p>';
+                P2Util::pushInfoHtml('<p>Error: Œ´ˆö•s–¾‚̃Gƒ‰[B</p>');
                 break;
         }
     }
@@ -89,7 +89,7 @@
     }
 
 } elseif (!empty($_POST['host']) || !empty($_POST['bbs']) || !empty($_POST['key']) || isset($_FILES['dat_file'])) {
-    $_info_msg_ht .= '<p>Error: ”ÂURL‚ªŽw’肳‚ê‚Ä‚¢‚È‚¢‚©Adat‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB</p>';
+    P2Util::pushInfoHtml('<p>Error: ”ÂURL‚ªŽw’肳‚ê‚Ä‚¢‚È‚¢‚©Adat‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB</p>');
 }
 
 //================================================================
@@ -112,8 +112,7 @@
 <body>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 //================================================================
 // ƒƒCƒ“•”•ªHTML•\Ž¦

Modified: p2ex/trunk/info.php
===================================================================
--- p2ex/trunk/info.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/info.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -330,8 +330,7 @@
 <body{$body_at}>
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 echo "<p>\n";
 echo "<b><a class=\"thre_title\" href=\"{$_conf['read_php']}?{$common_q}{$_conf['k_at_a']}\"{$target_read_at}>{$hd['ttitle_name']}</a></b>\n";
@@ -400,7 +399,7 @@
 
 if (!$_conf['ktai']) {
     if (!empty($info_msg)) {
-        echo "<span class=\"infomsg\">".$info_msg."</span>\n";
+        echo "<span class=\"info-msg\">{$info_msg}</span>\n";
     } else {
         echo "@\n";
     }

Modified: p2ex/trunk/iui/iui.css
===================================================================
--- p2ex/trunk/iui/iui.css	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/iui/iui.css	2010-01-25 07:01:16 UTC (rev 801)
@@ -18,6 +18,9 @@
     top: 45px;
     width: 100%;
     min-height: 372px;
+    -webkit-transition-duration: 300ms;
+    -webkit-transition-property: -webkit-transform;
+    -webkit-transform: translateX(0%);
 }
 
 body[orient="landscape"] > *:not(.toolbar) {
@@ -118,6 +121,7 @@
 }
 
 .whiteButton,
+.redButton,
 .grayButton {
     display: block;
     border-width: 0 12px;
@@ -134,6 +138,12 @@
     text-shadow: rgba(255, 255, 255, 0.7) 0 1px 0;
 }
 
+.redButton {
+    -webkit-border-image: url(redButton.png) 0 12 0 12;
+    color:#fff;
+    text-shadow: #7a0001 0 -1px 0;
+}
+
 .grayButton {
     -webkit-border-image: url(grayButton.png) 0 12 0 12;
     color: #FFFFFF;

Modified: p2ex/trunk/iui/iui.js
===================================================================
--- p2ex/trunk/iui/iui.js	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/iui/iui.js	2010-01-25 07:01:16 UTC (rev 801)
@@ -25,415 +25,491 @@
 
 window.iui =
 {
-    showPage: function(page, backwards)
-    {
-        if (page)
-        {
-            if (currentDialog)
-            {
-                currentDialog.removeAttribute("selected");
-                currentDialog = null;
-            }
+	animOn: true,	// Slide animation with CSS transition is now enabled by default where supported
 
-            if (hasClass(page, "dialog"))
-                showDialog(page);
-            else
-            {
-                var fromPage = currentPage;
-                currentPage = page;
+	showPage: function(page, backwards)
+	{
+		if (page)
+		{
+			if (currentDialog)
+			{
+				currentDialog.removeAttribute("selected");
+				currentDialog = null;
+			}
 
-                if (fromPage)
-                    setTimeout(slidePages, 0, fromPage, page, backwards);
-                else
-                    updatePage(page, fromPage);
-            }
-        }
-    },
+			if (hasClass(page, "dialog"))
+				showDialog(page);
+			else
+			{
+				var fromPage = currentPage;
+				currentPage = page;
 
-    showPageById: function(pageId)
-    {
-        var page = $(pageId);
-        if (page)
-        {
-            var index = pageHistory.indexOf(pageId);
-            var backwards = index != -1;
-            if (backwards)
-                pageHistory.splice(index, pageHistory.length);
+				if (fromPage)
+					setTimeout(slidePages, 0, fromPage, page, backwards);
+				else
+					updatePage(page, fromPage);
+			}
+		}
+	},
 
-            iui.showPage(page, backwards);
-        }
-    },
+	showPageById: function(pageId)
+	{
+		var page = $(pageId);
+		if (page)
+		{
+			var index = pageHistory.indexOf(pageId);
+			var backwards = index != -1;
+			if (backwards)
+				pageHistory.splice(index, pageHistory.length);
 
-    showPageByHref: function(href, args, method, replace, cb)
-    {
-        var req = new XMLHttpRequest();
-        req.onerror = function()
-        {
-            if (cb)
-                cb(false);
-        };
-        
-        req.onreadystatechange = function()
-        {
-            if (req.readyState == 4)
-            {
-                if (replace)
-                    replaceElementWithSource(replace, req.responseText);
-                else
-                {
-                    var frag = document.createElement("div");
-                    frag.innerHTML = req.responseText;
-                    iui.insertPages(frag.childNodes);
-                }
-                if (cb)
-                    setTimeout(cb, 1000, true);
-            }
-        };
+			iui.showPage(page, backwards);
+		}
+	},
 
-        if (args)
-        {
-            req.open(method || "GET", href, true);
-            req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-            req.setRequestHeader("Content-Length", args.length);
-            req.send(args.join("&"));
-        }
-        else
-        {
-            req.open(method || "GET", href, true);
-            req.send(null);
-        }
-    },
-    
-    insertPages: function(nodes)
-    {
-        var targetPage;
-        for (var i = 0; i < nodes.length; ++i)
-        {
-            var child = nodes[i];
-            if (child.nodeType == 1)
-            {
-                if (!child.id)
-                    child.id = "__" + (++newPageCount) + "__";
+	showPageByHref: function(href, args, method, replace, cb)
+	{
+		var req = new XMLHttpRequest();
+		req.onerror = function()
+		{
+			if (cb)
+				cb(false);
+		};
+		
+		req.onreadystatechange = function()
+		{
+			if (req.readyState == 4)
+			{
+				if (replace)
+					replaceElementWithSource(replace, req.responseText);
+				else
+				{
+					var frag = document.createElement("div");
+					frag.innerHTML = req.responseText;
+					iui.insertPages(frag.childNodes);
+				}
+				if (cb)
+					setTimeout(cb, 1000, true);
+			}
+		};
 
-                var clone = $(child.id);
-                if (clone)
-                    clone.parentNode.replaceChild(child, clone);
-                else
-                    document.body.appendChild(child);
+		if (args)
+		{
+			req.open(method || "GET", href, true);
+			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+			req.setRequestHeader("Content-Length", args.length);
+			req.send(args.join("&"));
+		}
+		else
+		{
+			req.open(method || "GET", href, true);
+			req.send(null);
+		}
+	},
+	
+	insertPages: function(nodes)
+	{
+		var targetPage;
+		for (var i = 0; i < nodes.length; ++i)
+		{
+			var child = nodes[i];
+			if (child.nodeType == 1)
+			{
+				if (!child.id)
+					child.id = "__" + (++newPageCount) + "__";
 
-                if (child.getAttribute("selected") == "true" || !targetPage)
-                    targetPage = child;
-                
-                --i;
-            }
-        }
+				var clone = $(child.id);
+				if (clone)
+					clone.parentNode.replaceChild(child, clone);
+				else
+					document.body.appendChild(child);
 
-        if (targetPage)
-            iui.showPage(targetPage);    
-    },
+				if (child.getAttribute("selected") == "true" || !targetPage)
+					targetPage = child;
+				
+				--i;
+			}
+		}
 
-    getSelectedPage: function()
-    {
-        for (var child = document.body.firstChild; child; child = child.nextSibling)
-        {
-            if (child.nodeType == 1 && child.getAttribute("selected") == "true")
-                return child;
-        }    
-    },
-    isNativeUrl: function(href)
-    {
-        for(var i = 0; i < iui.nativeUrlPatterns.length; i++)
-        {
-            if(href.match(iui.nativeUrlPatterns[i])) return true;
-        }
-        return false;
-    },
-    nativeUrlPatterns: [
-        new RegExp("^http:\/\/maps.google.com\/maps\?"),
-        new RegExp("^mailto:"),
-        new RegExp("^tel:"),
-        new RegExp("^http:\/\/www.youtube.com\/watch\\?v="),
-        new RegExp("^http:\/\/www.youtube.com\/v\/")
-    ]
+		if (targetPage)
+			iui.showPage(targetPage);	 
+	},
+
+	getSelectedPage: function()
+	{
+		for (var child = document.body.firstChild; child; child = child.nextSibling)
+		{
+			if (child.nodeType == 1 && child.getAttribute("selected") == "true")
+				return child;
+		}	 
+	},
+	isNativeUrl: function(href)
+	{
+		for(var i = 0; i < iui.nativeUrlPatterns.length; i++)
+		{
+			if(href.match(iui.nativeUrlPatterns[i])) return true;
+		}
+		return false;
+	},
+	nativeUrlPatterns: [
+		new RegExp("^http:\/\/maps.google.com\/maps\?"),
+		new RegExp("^mailto:"),
+		new RegExp("^tel:"),
+		new RegExp("^http:\/\/www.youtube.com\/watch\\?v="),
+		new RegExp("^http:\/\/www.youtube.com\/v\/"),
+		new RegExp("^javascript:"),
+
+	]
 };
 
 // *************************************************************************************************
 
 addEventListener("load", function(event)
 {
-    var page = iui.getSelectedPage();
-    if (page)
-        iui.showPage(page);
-
-    setTimeout(preloadImages, 0);
-    setTimeout(checkOrientAndLocation, 0);
-    checkTimer = setInterval(checkOrientAndLocation, 300);
+	var page = iui.getSelectedPage();
+	var locPage = getPageFromLoc();
+		
+	if (page)
+			iui.showPage(page);
+	
+	if (locPage && (locPage != page))
+		iui.showPage(locPage);
+	
+	setTimeout(preloadImages, 0);
+	if (typeof window.onorientationchange == "object")
+	{
+		window.onorientationchange=orientChangeHandler;
+		hasOrientationEvent = true;
+		setTimeout(orientChangeHandler, 0);
+	}
+	setTimeout(checkOrientAndLocation, 0);
+	checkTimer = setInterval(checkOrientAndLocation, 300);
 }, false);
 
 addEventListener("unload", function(event)
 {
 	return;
 }, false);
-    
+	
 addEventListener("click", function(event)
 {
-    var link = findParent(event.target, "a");
-    if (link)
-    {
-        function unselect() { link.removeAttribute("selected"); }
-        
-        if (link.href && link.hash && link.hash != "#")
-        {
-            link.setAttribute("selected", "true");
-            iui.showPage($(link.hash.substr(1)));
-            setTimeout(unselect, 500);
-        }
-        else if (link == $("backButton"))
-            history.back();
-        else if (link.getAttribute("type") == "submit")
-            submitForm(findParent(link, "form"));
-        else if (link.getAttribute("type") == "cancel")
-            cancelDialog(findParent(link, "form"));
-        else if (link.target == "_replace")
-        {
-            link.setAttribute("selected", "progress");
-            iui.showPageByHref(link.href, null, null, link, unselect);
-        }
-        else if (iui.isNativeUrl(link.href))
-        {
-            return;
-        }
-        else if (!link.target)
-        {
-            link.setAttribute("selected", "progress");
-            iui.showPageByHref(link.href, null, null, null, unselect);
-        }
-        else
-            return;
-        
-        event.preventDefault();        
-    }
+	var link = findParent(event.target, "a");
+	if (link)
+	{
+		function unselect() { link.removeAttribute("selected"); }
+		
+		if (link.href && link.hash && link.hash != "#" && !link.target)
+		{
+			link.setAttribute("selected", "true");
+			iui.showPage($(link.hash.substr(1)));
+			setTimeout(unselect, 500);
+		}
+		else if (link == $("backButton"))
+			history.back();
+		else if (link.getAttribute("type") == "submit")
+		{
+			var form = findParent(link, "form");
+			if (form.target == "_self")
+			{
+			    form.submit();
+			    return;  // return so we don't preventDefault
+			}
+			submitForm(form);
+		}
+		else if (link.getAttribute("type") == "cancel")
+			cancelDialog(findParent(link, "form"));
+		else if (link.target == "_replace")
+		{
+			link.setAttribute("selected", "progress");
+			iui.showPageByHref(link.href, null, null, link, unselect);
+		}
+		else if (iui.isNativeUrl(link.href))
+		{
+			return;
+		}
+		else if (link.target == "_webapp")
+		{
+			location.href = link.href;
+		}
+		else if (!link.target)
+		{
+			link.setAttribute("selected", "progress");
+			iui.showPageByHref(link.href, null, null, null, unselect);
+		}
+		else
+			return;
+		
+		event.preventDefault();		   
+	}
 }, true);
 
 addEventListener("click", function(event)
 {
-    var div = findParent(event.target, "div");
-    if (div && hasClass(div, "toggle"))
-    {
-        div.setAttribute("toggled", div.getAttribute("toggled") != "true");
-        event.preventDefault();        
-    }
+	var div = findParent(event.target, "div");
+	if (div && hasClass(div, "toggle"))
+	{
+		div.setAttribute("toggled", div.getAttribute("toggled") != "true");
+		event.preventDefault();		   
+	}
 }, true);
 
-function orientChangeHandler()
+function getPageFromLoc()
 {
-  var orientation=window.orientation;
-  switch(orientation)
-  {
-    case 0:
-        setOrientation(portraitVal);
-        break;  
-        
-    case 90:
-    case -90: 
-        setOrientation(landscapeVal);
-        break;
-  }
+	var page;
+	var result = location.hash.match(/#_([^\?_]+)/);
+	if (result)
+		page = result[1];
+	if (page)
+		page = $(page);
+	return page;
 }
 
-if (typeof window.onorientationchange == "object")
+function orientChangeHandler()
 {
-    window.onorientationchange=orientChangeHandler;
-    hasOrientationEvent = true;
-    setTimeout(orientChangeHandler, 0);
+	var orientation=window.orientation;
+	switch(orientation)
+	{
+	case 0:
+		setOrientation(portraitVal);
+		break;	
+		
+	case 90:
+	case -90: 
+		setOrientation(landscapeVal);
+		break;
+	}
 }
 
+
 function checkOrientAndLocation()
 {
-    if (!hasOrientationEvent)
-    {
-      if (window.innerWidth != currentWidth)
-      {   
-          currentWidth = window.innerWidth;
-          var orient = currentWidth == 320 ? portraitVal : landscapeVal;
-          setOrientation(orient);
-      }
-    }
+	if (!hasOrientationEvent)
+	{
+	  if (window.innerWidth != currentWidth)
+	  {	  
+		  currentWidth = window.innerWidth;
+		  var orient = currentWidth == 320 ? portraitVal : landscapeVal;
+		  setOrientation(orient);
+	  }
+	}
 
-    if (location.hash != currentHash)
-    {
-        var pageId = location.hash.substr(hashPrefix.length);
-        iui.showPageById(pageId);
-    }
+	if (location.hash != currentHash)
+	{
+		var pageId = location.hash.substr(hashPrefix.length);
+		iui.showPageById(pageId);
+	}
 }
 
 function setOrientation(orient)
 {
-    document.body.setAttribute("orient", orient);
-    setTimeout(scrollTo, 100, 0, 1);
+	document.body.setAttribute("orient", orient);
+	setTimeout(scrollTo, 100, 0, 1);
 }
 
 function showDialog(page)
 {
-    currentDialog = page;
-    page.setAttribute("selected", "true");
-    
-    if (hasClass(page, "dialog") && !page.target)
-        showForm(page);
+	currentDialog = page;
+	page.setAttribute("selected", "true");
+	
+	if (hasClass(page, "dialog") && !page.target)
+		showForm(page);
 }
 
 function showForm(form)
 {
-    form.onsubmit = function(event)
-    {
-        event.preventDefault();
-        submitForm(form);
-    };
-    
-    form.onclick = function(event)
-    {
-        if (event.target == form && hasClass(form, "dialog"))
-            cancelDialog(form);
-    };
+	form.onsubmit = function(event)
+	{
+		event.preventDefault();
+		submitForm(form);
+	};
+	
+	form.onclick = function(event)
+	{
+		if (event.target == form && hasClass(form, "dialog"))
+			cancelDialog(form);
+	};
 }
 
 function cancelDialog(form)
 {
-    form.removeAttribute("selected");
+	form.removeAttribute("selected");
 }
 
 function updatePage(page, fromPage)
 {
-    if (!page.id)
-        page.id = "__" + (++newPageCount) + "__";
+	if (!page.id)
+		page.id = "__" + (++newPageCount) + "__";
 
-    location.href = currentHash = hashPrefix + page.id;
-    pageHistory.push(page.id);
+	location.hash = currentHash = hashPrefix + page.id;
+	pageHistory.push(page.id);
 
-    var pageTitle = $("pageTitle");
-    if (page.title)
-        pageTitle.innerHTML = page.title;
+	var pageTitle = $("pageTitle");
+	if (page.title)
+		pageTitle.innerHTML = page.title;
 
-    if (page.localName.toLowerCase() == "form" && !page.target)
-        showForm(page);
-        
-    var backButton = $("backButton");
-    if (backButton)
-    {
-        var prevPage = $(pageHistory[pageHistory.length-2]);
-        if (prevPage && !page.getAttribute("hideBackButton"))
-        {
-            backButton.style.display = "inline";
-            backButton.innerHTML = prevPage.title ? prevPage.title : "Back";
-        }
-        else
-            backButton.style.display = "none";
-    }    
+	if (page.localName.toLowerCase() == "form" && !page.target)
+		showForm(page);
+		
+	var backButton = $("backButton");
+	if (backButton)
+	{
+		var prevPage = $(pageHistory[pageHistory.length-2]);
+		if (prevPage && !page.getAttribute("hideBackButton"))
+		{
+			backButton.style.display = "inline";
+			backButton.innerHTML = prevPage.title ? prevPage.title : "Back";
+		}
+		else
+			backButton.style.display = "none";
+	}	 
 }
 
 function slidePages(fromPage, toPage, backwards)
-{        
-    var axis = (backwards ? fromPage : toPage).getAttribute("axis");
-    if (axis == "y")
-        (backwards ? fromPage : toPage).style.top = "100%";
-    else
-        toPage.style.left = "100%";
+{		 
+	var axis = (backwards ? fromPage : toPage).getAttribute("axis");
 
-    toPage.setAttribute("selected", "true");
-    scrollTo(0, 1);
-    clearInterval(checkTimer);
-    
-    var percent = 100;
-    slide();
-    var timer = setInterval(slide, slideInterval);
+	clearInterval(checkTimer);
+	
+	if (canDoSlideAnim() && axis != 'y')
+	{
+	  slide2(fromPage, toPage, backwards, slideDone);
+	}
+	else
+	{
+	  slide1(fromPage, toPage, backwards, axis, slideDone);
+	}
 
-    function slide()
-    {
-        percent -= slideSpeed;
-        if (percent <= 0)
-        {
-            percent = 0;
-            if (!hasClass(toPage, "dialog"))
-                fromPage.removeAttribute("selected");
-            clearInterval(timer);
-            checkTimer = setInterval(checkOrientAndLocation, 300);
-            setTimeout(updatePage, 0, toPage, fromPage);
-        }
-    
-        if (axis == "y")
-        {
-            backwards
-                ? fromPage.style.top = (100-percent) + "%"
-                : toPage.style.top = percent + "%";
-        }
-        else
-        {
-            fromPage.style.left = (backwards ? (100-percent) : (percent-100)) + "%"; 
-            toPage.style.left = (backwards ? -percent : percent) + "%"; 
-        }
-    }
+	function slideDone()
+	{
+	  if (!hasClass(toPage, "dialog"))
+		  fromPage.removeAttribute("selected");
+	  checkTimer = setInterval(checkOrientAndLocation, 300);
+	  setTimeout(updatePage, 0, toPage, fromPage);
+	  fromPage.removeEventListener('webkitTransitionEnd', slideDone, false);
+	}
 }
 
+function canDoSlideAnim()
+{
+  return (iui.animOn) && (typeof WebKitCSSMatrix == "object");
+}
+
+function slide1(fromPage, toPage, backwards, axis, cb)
+{
+	if (axis == "y")
+		(backwards ? fromPage : toPage).style.top = "100%";
+	else
+		toPage.style.left = "100%";
+
+	scrollTo(0, 1);
+	toPage.setAttribute("selected", "true");
+	var percent = 100;
+	slide();
+	var timer = setInterval(slide, slideInterval);
+
+	function slide()
+	{
+		percent -= slideSpeed;
+		if (percent <= 0)
+		{
+			percent = 0;
+			clearInterval(timer);
+			cb();
+		}
+	
+		if (axis == "y")
+		{
+			backwards
+				? fromPage.style.top = (100-percent) + "%"
+				: toPage.style.top = percent + "%";
+		}
+		else
+		{
+			fromPage.style.left = (backwards ? (100-percent) : (percent-100)) + "%"; 
+			toPage.style.left = (backwards ? -percent : percent) + "%"; 
+		}
+	}
+}
+
+
+function slide2(fromPage, toPage, backwards, cb)
+{
+	toPage.style.webkitTransitionDuration = '0ms'; // Turn off transitions to set toPage start offset
+	// fromStart is always 0% and toEnd is always 0%
+	// iPhone won't take % width on toPage
+	var toStart = 'translateX(' + (backwards ? '-' : '') + window.innerWidth +	'px)';
+	var fromEnd = 'translateX(' + (backwards ? '100%' : '-100%') + ')';
+	toPage.style.webkitTransform = toStart;
+	toPage.setAttribute("selected", "true");
+	toPage.style.webkitTransitionDuration = '';	  // Turn transitions back on
+	function startTrans()
+	{
+		fromPage.style.webkitTransform = fromEnd;
+		toPage.style.webkitTransform = 'translateX(0%)'; //toEnd
+	}
+	fromPage.addEventListener('webkitTransitionEnd', cb, false);
+	setTimeout(startTrans, 0);
+}
+
 function preloadImages()
 {
-    var preloader = document.createElement("div");
-    preloader.id = "preloader";
-    document.body.appendChild(preloader);
+	var preloader = document.createElement("div");
+	preloader.id = "preloader";
+	document.body.appendChild(preloader);
 }
 
 function submitForm(form)
 {
-    iui.showPageByHref(form.action || "POST", encodeForm(form), form.method);
+	iui.showPageByHref(form.action || "POST", encodeForm(form), form.method);
 }
 
 function encodeForm(form)
 {
-    function encode(inputs)
-    {
-        for (var i = 0; i < inputs.length; ++i)
-        {
-            if (inputs[i].name)
-                args.push(inputs[i].name + "=" + escape(inputs[i].value));
-        }
-    }
+	function encode(inputs)
+	{
+		for (var i = 0; i < inputs.length; ++i)
+		{
+			if (inputs[i].name)
+				args.push(inputs[i].name + "=" + escape(inputs[i].value));
+		}
+	}
 
-    var args = [];
-    encode(form.getElementsByTagName("input"));
-    encode(form.getElementsByTagName("textarea"));
-    encode(form.getElementsByTagName("select"));
-    return args;    
+	var args = [];
+	encode(form.getElementsByTagName("input"));
+	encode(form.getElementsByTagName("textarea"));
+	encode(form.getElementsByTagName("select"));
+	return args;	
 }
 
 function findParent(node, localName)
 {
-    while (node && (node.nodeType != 1 || node.localName.toLowerCase() != localName))
-        node = node.parentNode;
-    return node;
+	while (node && (node.nodeType != 1 || node.localName.toLowerCase() != localName))
+		node = node.parentNode;
+	return node;
 }
 
 function hasClass(self, name)
 {
-    var re = new RegExp("(^|\\s)"+name+"($|\\s)");
-    return re.exec(self.getAttribute("class")) != null;
+	var re = new RegExp("(^|\\s)"+name+"($|\\s)");
+	return re.exec(self.getAttribute("class")) != null;
 }
 
 function replaceElementWithSource(replace, source)
 {
-    var page = replace.parentNode;
-    var parent = replace;
-    while (page.parentNode != document.body)
-    {
-        page = page.parentNode;
-        parent = parent.parentNode;
-    }
+	var page = replace.parentNode;
+	var parent = replace;
+	while (page.parentNode != document.body)
+	{
+		page = page.parentNode;
+		parent = parent.parentNode;
+	}
 
-    var frag = document.createElement(parent.localName);
-    frag.innerHTML = source;
+	var frag = document.createElement(parent.localName);
+	frag.innerHTML = source;
 
-    page.removeChild(parent);
+	page.removeChild(parent);
 
-    while (frag.firstChild)
-        page.appendChild(frag.firstChild);
+	while (frag.firstChild)
+		page.appendChild(frag.firstChild);
 }
 
 function $(id) { return document.getElementById(id); }

Added: p2ex/trunk/iui/redButton.png
===================================================================
(Binary files differ)


Property changes on: p2ex/trunk/iui/redButton.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Modified: p2ex/trunk/lib/BbsMap.php
===================================================================
--- p2ex/trunk/lib/BbsMap.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/BbsMap.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -32,7 +32,6 @@
      */
     static public function getCurrentHost($host, $bbs, $autosync = true)
     {
-        global $_info_msg_ht;
         static $synced = false;
 
         // ƒ}ƒbƒsƒ“ƒO“ǂݍž‚Ý
@@ -49,7 +48,7 @@
                 // ˆÚ“]‚ðŒŸo‚µ‚½‚炨‹C‚ɔA‚¨‹C‚ɃXƒŒAÅ‹ß“Ç‚ñ‚¾ƒXƒŒ‚ðŽ©“®‚Å“¯Šú
                 $msg_fmt = '<p>rep2 info: ƒzƒXƒg‚̈ړ]‚ðŒŸo‚µ‚Ü‚µ‚½B(%s/%s ¨ %s/%s)<br>';
                 $msg_fmt .= '‚¨‹C‚ɔA‚¨‹C‚ɃXƒŒAÅ‹ß“Ç‚ñ‚¾ƒXƒŒ‚ðŽ©“®‚Å“¯Šú‚µ‚Ü‚·B</p>';
-                $_info_msg_ht .= sprintf($msg_fmt, $host, $bbs, $new_host, $bbs);
+                P2Util::pushInfoHtml(sprintf($msg_fmt, $host, $bbs, $new_host, $bbs));
                 self::syncFav();
                 $synced = true;
             }
@@ -99,7 +98,7 @@
      */
     static public function syncBrd($brd_path)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
         static $done = array();
 
         // {{{ “Ǎž
@@ -158,9 +157,9 @@
         $brd_name = htmlspecialchars(basename($brd_path), ENT_QUOTES);
         if ($updated) {
             self::_writeData($brd_path, $neolines);
-            $_info_msg_ht .= sprintf('<p class="info-msg">rep2 info: %s ‚𓯊ú‚µ‚Ü‚µ‚½B</p>', $brd_name);
+            P2Util::pushInfoHtml(sprintf('<p class="info-msg">rep2 info: %s ‚𓯊ú‚µ‚Ü‚µ‚½B</p>', $brd_name));
         } else {
-            $_info_msg_ht .= sprintf('<p class="info-msg">rep2 info: %s ‚͕ύX‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B</p>', $brd_name);
+            P2Util::pushInfoHtml(sprintf('<p class="info-msg">rep2 info: %s ‚͕ύX‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B</p>'), $brd_name);
         }
         $done[$brd_path] = true;
 
@@ -178,7 +177,7 @@
      */
     static public function syncIdx($idx_path)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
         static $done = array();
 
         // {{{ “Ǎž
@@ -227,9 +226,9 @@
         $idx_name = htmlspecialchars(basename($idx_path), ENT_QUOTES);
         if ($updated) {
             self::_writeData($idx_path, $neolines);
-            $_info_msg_ht .= sprintf('<p class="info-msg">rep2 info: %s ‚𓯊ú‚µ‚Ü‚µ‚½B</p>', $idx_name);
+            P2Util::pushInfoHtml(sprintf('<p class="info-msg">rep2 info: %s ‚𓯊ú‚µ‚Ü‚µ‚½B</p>', $idx_name));
         } else {
-            $_info_msg_ht .= sprintf('<p class="info-msg">rep2 info: %s ‚͕ύX‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B</p>', $idx_name);
+            P2Util::pushInfoHtml(sprintf('<p class="info-msg">rep2 info: %s ‚͕ύX‚³‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B</p>', $idx_name));
         }
         $done[$idx_path] = true;
 
@@ -263,7 +262,7 @@
      */
     static private function _getMapping()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         // {{{ Ý’è
 
@@ -301,8 +300,8 @@
         }
 
         $params = array();
-        $params['timeout'] = $_conf['fsockopen_time_limit'];
-        //$params['readTimeout'] = array($_conf['fsockopen_time_limit'], 0);
+        $params['timeout'] = $_conf['http_conn_timeout'];
+        $params['readTimeout'] = array($_conf['http_read_timeout'], 0);
         if (isset($mtime)) {
             $params['requestHeaders'] = array('If-Modified-Since' => http_date($mtime));
         }
@@ -316,8 +315,8 @@
 
         // ƒGƒ‰[‚Ì‚Æ‚«A‘ã‚í‚è‚̃ƒjƒ…[‚ðŽg‚Á‚Ä‚Ý‚é
         if (PEAR::isError($err) && $use_alt) {
-            $_info_msg_ht .= sprintf($err_fmt, htmlspecialchars($err->getMessage(), ENT_QUOTES), htmlspecialchars($bbsmenu_url, ENT_QUOTES));
-            $_info_msg_ht .= sprintf("<p>‘ã‚í‚è‚É %s ‚ðƒ_ƒEƒ“ƒ[ƒh‚µ‚Ü‚·B</p>", htmlspecialchars($altmenu_url, ENT_QUOTES));
+            P2Util::pushInfoHtml(sprintf($err_fmt, htmlspecialchars($err->getMessage(), ENT_QUOTES), htmlspecialchars($bbsmenu_url, ENT_QUOTES)));
+            P2Util::pushInfoHtml(sprintf("<p>‘ã‚í‚è‚É %s ‚ðƒ_ƒEƒ“ƒ[ƒh‚µ‚Ü‚·B</p>", htmlspecialchars($altmenu_url, ENT_QUOTES)));
             $bbsmenu_url = $altmenu_url;
             unset ($req, $err);
             $req = new HTTP_Request($bbsmenu_url, $params);
@@ -327,7 +326,7 @@
 
         // ƒGƒ‰[‚ðŒŸØ
         if (PEAR::isError($err)) {
-            $_info_msg_ht .= sprintf($err_fmt, htmlspecialchars($err->getMessage(), ENT_QUOTES), htmlspecialchars($bbsmenu_url, ENT_QUOTES));
+            P2Util::pushInfoHtml(sprintf($err_fmt, htmlspecialchars($err->getMessage(), ENT_QUOTES), htmlspecialchars($bbsmenu_url, ENT_QUOTES)));
             if (file_exists($map_cache_path)) {
                 return unserialize(file_get_contents($map_cache_path));
             } else {
@@ -342,7 +341,7 @@
             self::$_map = unserialize($map_cahce);
             return self::$_map;
         } elseif ($code != 200) {
-            $_info_msg_ht .= sprintf($err_fmt, htmlspecialchars(strval($code), ENT_QUOTES), htmlspecialchars($bbsmenu_url, ENT_QUOTES));
+            P2Util::pushInfoHtml(sprintf($err_fmt, htmlspecialchars(strval($code), ENT_QUOTES), htmlspecialchars($bbsmenu_url, ENT_QUOTES)));
             if (file_exists($map_cache_path)) {
                 return unserialize(file_get_contents($map_cache_path));
             } else {

Modified: p2ex/trunk/lib/BrdCtl.php
===================================================================
--- p2ex/trunk/lib/BrdCtl.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/BrdCtl.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -30,8 +30,6 @@
      */
     static public function read_brd_dir()
     {
-        global $_info_msg_ht;
-
         $brd_menus = array();
         $brd_dir = './board';
 
@@ -49,7 +47,7 @@
                     $brd_menus[] = $aBrdMenu;
 
                 } else {
-                    $_info_msg_ht .= "<p>p2 error: ”ƒŠƒXƒg {$entry} ‚ª“ǂݍž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B</p>\n";
+                    P2Util::pushInfoHtml("<p>p2 error: ”ƒŠƒXƒg {$entry} ‚ª“ǂݍž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B</p>");
                 }
             }
             $cdir->close();
@@ -66,7 +64,7 @@
     */
     static public function read_brd_online()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         $brd_menus = array();
         $isNewDL = false;
@@ -146,11 +144,11 @@
                     if ($aBrdMenu->num) {
                         $brd_menus[] = $aBrdMenu;
                     } else {
-                        $_info_msg_ht .=  "<p>p2 ƒGƒ‰[: {$cache_brd} ‚©‚甃ƒjƒ…[‚𐶐¬‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>\n";
+                        P2Util::pushInfoHtml("<p>p2 error: {$cache_brd} ‚©‚甃ƒjƒ…[‚𐶐¬‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>");
                     }
                     unset($data, $aBrdMenu);
                 } else {
-                    $_info_msg_ht .=  "<p>p2 ƒGƒ‰[: {$cachefile} ‚͓ǂݍž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B</p>\n";
+                    P2Util::pushInfoHtml("<p>p2 error: {$cachefile} ‚͓ǂݍž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B</p>");
                 }
             }
         }

Modified: p2ex/trunk/lib/BrdMenu.php
===================================================================
--- p2ex/trunk/lib/BrdMenu.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/BrdMenu.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -171,7 +171,7 @@
     */
     public function makeBrdFile($cachefile)
     {
-        global $_conf, $_info_msg_ht, $word;
+        global $_conf, $word;
 
         $p2brdfile = $cachefile.".p2.brd";
         FileCtl::make_datafile($p2brdfile, $_conf['p2_perm']);
@@ -196,7 +196,7 @@
             return $p2brdfile;
         } else {
             if (!$word) {
-                $_info_msg_ht .=  "<p>p2 ƒGƒ‰[: {$cachefile} ‚©‚甃ƒjƒ…[‚𐶐¬‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>\n";
+                P2Util::pushInfoHtml("<p>p2 error: {$cachefile} ‚©‚甃ƒjƒ…[‚𐶐¬‚·‚邱‚Æ‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>");
             }
             return false;
         }

Modified: p2ex/trunk/lib/Login.php
===================================================================
--- p2ex/trunk/lib/Login.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/Login.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -234,7 +234,7 @@
      */
     private function _authCheck()
     {
-        global $_info_msg_ht, $_conf;
+        global $_conf;
         global $_login_failed_flag;
         global $_p2session;
 
@@ -246,7 +246,7 @@
 
             // ƒ†[ƒU–¼‚ªˆá‚Á‚½‚çA”FØŽ¸”s‚Å”²‚¯‚é
             if ($this->user_u != $rec_login_user_u) {
-                $_info_msg_ht .= '<p class="infomsg">p2 error: ƒƒOƒCƒ“ƒGƒ‰[</p>';
+                P2Util::pushInfoHtml('<p>p2 error: ƒƒOƒCƒ“ƒGƒ‰[</p>');
 
                 // ƒƒOƒCƒ“Ž¸”sƒƒO‚ð‹L˜^‚·‚é
                 if (!empty($_conf['login_log_rec'])) {
@@ -268,7 +268,7 @@
 
             // V‹K“o˜^‚Å‚È‚¯‚ê‚΃Gƒ‰[•\Ž¦
             if (empty($_POST['submit_new'])) {
-                $_info_msg_ht .= '<p class="infomsg">p2 error: ƒƒOƒCƒ“ƒGƒ‰[</p>';
+                P2Util::pushInfoHtml('<p>p2 error: ƒƒOƒCƒ“ƒGƒ‰[</p>');
             }
 
             return false;
@@ -296,7 +296,7 @@
             // ƒZƒbƒVƒ‡ƒ“‚ª—˜—p‚³‚ê‚Ä‚¢‚é‚È‚çAƒZƒbƒVƒ‡ƒ“‚̑Ó–«ƒ`ƒFƒbƒN
             if (isset($_p2session)) {
                 if ($msg = $_p2session->checkSessionError()) {
-                    $GLOBALS['_info_msg_ht'] .= '<p>p2 error: ' . htmlspecialchars($msg) . '</p>';
+                    P2Util::pushInfoHtml('<p>p2 error: ' . htmlspecialchars($msg) . '</p>');
                     //Session::unSession();
                     // ƒƒOƒCƒ“Ž¸”s
                     return false;
@@ -417,7 +417,7 @@
 
             // ƒtƒH[ƒ€ƒƒOƒCƒ“Ž¸”s‚È‚ç
             } else {
-                $_info_msg_ht .= '<p class="infomsg">p2 info: ƒƒOƒCƒ“‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B<br>ƒ†[ƒU–¼‚©ƒpƒXƒ[ƒh‚ªˆá‚¢‚Ü‚·B</p>';
+                P2Util::pushInfoHtml('<p>p2 info: ƒƒOƒCƒ“‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B<br>ƒ†[ƒU–¼‚©ƒpƒXƒ[ƒh‚ªˆá‚¢‚Ü‚·B</p>');
                 $_login_failed_flag = true;
 
                 // ƒƒOƒCƒ“Ž¸”sƒƒO‚ð‹L˜^‚·‚é
@@ -505,7 +505,7 @@
      */
     public function registKtaiId()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         $mobile = Net_UserAgent_Mobile::singleton();
 
@@ -523,7 +523,7 @@
                     if (($UID = $mobile->getUID()) !== null) {
                         $this->_registAuth('registed_imodeid', $UID, $_conf['auth_imodeid_file']);
                     } else {
-                        $_info_msg_ht .= '<p class="infomsg">~docomo iƒ‚[ƒhID‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>'."\n";
+                        P2Util::pushInfoHtml('<p>~docomo iƒ‚[ƒhID‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
                     }
                 } else {
                     $this->_registAuthOff($_conf['auth_imodeid_file']);
@@ -542,7 +542,7 @@
                     if (($SN = $mobile->getSerialNumber()) !== null) {
                         $this->_registAuth('registed_docomo', $SN, $_conf['auth_docomo_file']);
                     } else {
-                        $_info_msg_ht .= '<p class="infomsg">~docomo ’[––»‘¢”ԍ†‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>'."\n";
+                        P2Util::pushInfoHtml('<p>~docomo ’[––»‘¢”ԍ†‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
                     }
                 } else {
                     $this->_registAuthOff($_conf['auth_docomo_file']);
@@ -565,7 +565,7 @@
                 if (($UID = $mobile->getUID()) !== null) {
                     $this->_registAuth('registed_ez', $UID, $_conf['auth_ez_file']);
                 } else {
-                    $_info_msg_ht .= '<p class="infomsg">~EZweb ƒTƒuƒXƒNƒ‰ƒCƒoID‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>'."\n";
+                    P2Util::pushInfoHtml('<p>~EZweb ƒTƒuƒXƒNƒ‰ƒCƒoID‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
                 }
             } else {
                 $this->_registAuthOff($_conf['auth_ez_file']);
@@ -585,7 +585,7 @@
                 if (($SN = $mobile->getSerialNumber()) !== null) {
                     $this->_registAuth('registed_jp', $SN, $_conf['auth_jp_file']);
                 } else {
-                    $_info_msg_ht .= '<p class="infomsg">~SoftBank ’[––ƒVƒŠƒAƒ‹”ԍ†‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>'."\n";
+                    P2Util::pushInfoHtml('<p>~SoftBank ’[––ƒVƒŠƒAƒ‹”ԍ†‚Å‚Ì”FØ“o˜^‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½</p>');
                 }
             } else {
                 $this->_registAuthOff($_conf['auth_jp_file']);
@@ -604,7 +604,7 @@
      */
     private function _registAuth($key, $sub_id, $auth_file)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         $cont = <<<EOP
 <?php
@@ -614,7 +614,7 @@
         FileCtl::make_datafile($auth_file, $_conf['pass_perm']);
         $fp = fopen($auth_file, 'wb');
         if (!$fp) {
-            $_info_msg_ht .= "<p>Error: ƒf[ƒ^‚ð•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B”FØ“o˜^Ž¸”sB</p>";
+            P2Util::pushInfoHtml('<p>Error: ƒf[ƒ^‚ð•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B”FØ“o˜^Ž¸”sB</p>');
             return false;
         }
         flock($fp, LOCK_EX);

Modified: p2ex/trunk/lib/P2CommandRunner.php
===================================================================
--- p2ex/trunk/lib/P2CommandRunner.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/P2CommandRunner.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -65,7 +65,7 @@
 
         $command = implode(' ', $args);
 
-        //$GLOBALS['_info_msg_ht'] .= '<p>' . htmlspecialchars($command, ENT_QUOTES) . '</p>';
+        //P2Util::pushInfoHtml('<p>' . htmlspecialchars($command, ENT_QUOTES) . '</p>');
 
         // ŽÀs
         $pipe = popen($command, 'r');
@@ -80,14 +80,14 @@
 
         $status = pclose($pipe);
         if ($status != 0) {
-            $GLOBALS['_info_msg_ht'] .= sprintf('<p>%s(): ERROR(%d)</p>', __METHOD__, $status);
+            P2Util::pushInfoHtml(sprintf('<p>%s(): ERROR(%d)</p>', __METHOD__, $status));
         }
 
         if ($output !== '') {
             if ($status == 2) {
-                $GLOBALS['_info_msg_ht'] .= $output;
+                P2Util::pushInfoHtml($output);
             } else {
-                $GLOBALS['_info_msg_ht'] .= '<p>' . nl2br(htmlspecialchars($output, ENT_QUOTES)) . '</p>';
+                P2Util::pushInfoHtml('<p>' . nl2br(htmlspecialchars($output, ENT_QUOTES)) . '</p>');
             }
         }
 

Modified: p2ex/trunk/lib/P2HttpExt.php
===================================================================
--- p2ex/trunk/lib/P2HttpExt.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/P2HttpExt.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -243,11 +243,11 @@
         }
 
         if (!isset($options['connecttimeout'])) {
-            $options['connecttimeout'] = $_conf['fsockopen_time_limit'];
+            $options['connecttimeout'] = $_conf['http_conn_timeout'];
         }
 
         if (!isset($options['timeout'])) {
-            $options['timeout'] = $_conf['fsockopen_time_limit'] * 2;
+            $options['timeout'] = $_conf['http_read_timeout'];
         }
 
         if (!isset($options['compress'])) {
@@ -855,7 +855,7 @@
         }
 
         if ($err !== '') {
-            $GLOBALS['_info_msg_ht'] .= "<ul class=\"errors\">{$err}</ul>\n";
+            P2Util::pushInfoHtml("<ul class=\"errors\">{$err}</ul>\n");
         }
 
         if (P2HttpExt::DEBUG) {
@@ -863,9 +863,10 @@
                 $ph_dump = str_replace('  ', ' ', print_r($ph, true));
                 $ph_dump = preg_replace('/[\\r\\n]+/', "\n", $ph_dump);
                 $ph_dump = preg_replace('/(Array|Object)\\n *\(/', '$1(', $ph_dump);
-                $GLOBALS['_info_msg_ht'] .= "<pre>Persistent Handles:\n";
-                $GLOBALS['_info_msg_ht'] .= htmlspecialchars($ph_dump, ENT_QUOTES);
-                $GLOBALS['_info_msg_ht'] .= "</pre>\n";
+                $info_msg_ht = "<pre>Persistent Handles:\n";
+                $info_msg_ht .= htmlspecialchars($ph_dump, ENT_QUOTES);
+                $info_msg_ht .= "</pre>\n";
+                P2Util::pushInfoHtml($info_msg_ht);
             }
         }
     }

Modified: p2ex/trunk/lib/P2Util.php
===================================================================
--- p2ex/trunk/lib/P2Util.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/P2Util.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -243,7 +243,7 @@
                                         $disp_error = true,
                                         $trace_redirection = false)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         $perm = (isset($_conf['dl_perm'])) ? $_conf['dl_perm'] : 0606;
 
@@ -255,7 +255,7 @@
 
         // DL
         $wap_ua = new WapUserAgent();
-        $wap_ua->setTimeout($_conf['fsockopen_time_limit']);
+        $wap_ua->setTimeout($_conf['http_conn_timeout'], $_conf['http_read_timeout']);
         $wap_req = new WapRequest();
         $wap_req->setUrl($url);
         $wap_req->setModified($modified);
@@ -275,14 +275,15 @@
         // ƒGƒ‰[ƒƒbƒZ[ƒW‚ðÝ’è
         if ($wap_res->isError() && $disp_error) {
             $url_t = self::throughIme($wap_req->url);
-            $_info_msg_ht .= "<div>Error: {$wap_res->code} {$wap_res->message}<br>";
+            $info_msg_ht = "<p class=\"info-msg\">Error: {$wap_res->code} {$wap_res->message}<br>";
             if ($wap_res->isRedirect() && array_key_exists('Location', $wap_res->headers)) {
                 $location = $wap_res->headers['Location'];
                 $location_ht = htmlspecialchars($location, ENT_QUOTES);
                 $location_t = self::throughIme($location);
-                $_info_msg_ht .= "Location: <a href=\"{$location_t}\"{$_conf['ext_win_target_at']}>{$location_ht}</a><br>";
+                $info_msg_ht .= "Location: <a href=\"{$location_t}\"{$_conf['ext_win_target_at']}>{$location_ht}</a><br>";
             }
-            $_info_msg_ht .= "p2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$wap_req->url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</div>";
+            $info_msg_ht .= "rep2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$wap_req->url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+            self::pushInfoHtml($info_msg_ht);
         }
 
         // XV‚³‚ê‚Ä‚¢‚½‚ç
@@ -304,34 +305,37 @@
      */
     static public function checkDirWritable($aDir)
     {
-        global $_info_msg_ht, $_conf;
+        global $_conf;
 
         // ƒ}ƒ‹ƒ`ƒ†[ƒUƒ‚[ƒhŽž‚́Aî•ñƒƒbƒZ[ƒW‚ð—}§‚µ‚Ä‚¢‚éB
+        $info_msg_ht = '';
 
         if (!is_dir($aDir)) {
             /*
-            $_info_msg_ht .= '<p class="infomsg">';
-            $_info_msg_ht .= '’ˆÓ: ƒf[ƒ^•Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ª‚ ‚è‚Ü‚¹‚ñB<br>';
-            $_info_msg_ht .= $aDir."<br>";
+            $info_msg_ht .= '<p class="info-msg">';
+            $info_msg_ht .= '’ˆÓ: ƒf[ƒ^•Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ª‚ ‚è‚Ü‚¹‚ñB<br>';
+            $info_msg_ht .= $aDir."<br>";
             */
             if (is_dir(dirname(realpath($aDir))) && is_writable(dirname(realpath($aDir)))) {
-                //$_info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ÌŽ©“®ì¬‚ðŽŽ‚Ý‚Ü‚·...<br>";
+                //$info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ÌŽ©“®ì¬‚ðŽŽ‚Ý‚Ü‚·...<br>";
                 if (mkdir($aDir, $_conf['data_dir_perm'])) {
-                    //$_info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ÌŽ©“®ì¬‚ª¬Œ÷‚µ‚Ü‚µ‚½B";
+                    //$info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ÌŽ©“®ì¬‚ª¬Œ÷‚µ‚Ü‚µ‚½B";
                     chmod($aDir, $_conf['data_dir_perm']);
                 } else {
-                    //$_info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ðŽ©“®ì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B<br>Žè“®‚ŃfƒBƒŒƒNƒgƒŠ‚ðì¬‚µAƒp[ƒ~ƒbƒVƒ‡ƒ“‚ðÝ’肵‚ĉº‚³‚¢B";
+                    //$info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ðŽ©“®ì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B<br>Žè“®‚ŃfƒBƒŒƒNƒgƒŠ‚ðì¬‚µAƒp[ƒ~ƒbƒVƒ‡ƒ“‚ðÝ’肵‚ĉº‚³‚¢B";
                 }
             } else {
-                    //$_info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ðì¬‚µAƒp[ƒ~ƒbƒVƒ‡ƒ“‚ðÝ’肵‚ĉº‚³‚¢B";
+                    //$info_msg_ht .= "ƒfƒBƒŒƒNƒgƒŠ‚ðì¬‚µAƒp[ƒ~ƒbƒVƒ‡ƒ“‚ðÝ’肵‚ĉº‚³‚¢B";
             }
-            //$_info_msg_ht .= '</p>';
+            //$info_msg_ht .= '</p>';
 
         } elseif (!is_writable($aDir)) {
-            $_info_msg_ht .= '<p class="infomsg">’ˆÓ: ƒf[ƒ^•Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ɏ‘‚«ž‚ÝŒ ŒÀ‚ª‚ ‚è‚Ü‚¹‚ñB<br>';
-            //$_info_msg_ht .= $aDir.'<br>';
-            $_info_msg_ht .= 'ƒfƒBƒŒƒNƒgƒŠ‚̃p[ƒ~ƒbƒVƒ‡ƒ“‚ðŒ©’¼‚µ‚ĉº‚³‚¢B</p>';
+            $info_msg_ht .= '<p class="info-msg">’ˆÓ: ƒf[ƒ^•Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ɏ‘‚«ž‚ÝŒ ŒÀ‚ª‚ ‚è‚Ü‚¹‚ñB<br>';
+            //$info_msg_ht .= $aDir.'<br>';
+            $info_msg_ht .= 'ƒfƒBƒŒƒNƒgƒŠ‚̃p[ƒ~ƒbƒVƒ‡ƒ“‚ðŒ©’¼‚µ‚ĉº‚³‚¢B</p>';
         }
+
+        self::pushInfoHtml($info_msg_ht);
     }
 
     // }}}
@@ -1642,6 +1646,10 @@
     {
         global $_info_msg_ht;
 
+        // •\Ž¦ƒtƒH[ƒ}ƒbƒg‚𓝈ꂷ‚鎎‚Ý
+        $html = preg_replace('!^<p>!', '<p class="info-msg">', $html);
+        $html = preg_replace('!\\b(?:re)?p2(?:@| )+(error|info)(?: *[:\\-] *)!', 'rep2 $1: ', $html);
+
         if (!isset($_info_msg_ht)) {
             $_info_msg_ht = $html;
         } else {
@@ -1693,6 +1701,23 @@
     }
 
     // }}}
+    // {{{ hasInfoHtml()
+
+    /**
+     * @return  boolean
+     */
+    static public function hasInfoHtml()
+    {
+        global $_info_msg_ht;
+
+        if (isset($_info_msg_ht) && strlen($_info_msg_ht)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    // }}}
     // {{{ isNetFront()
 
     /**
@@ -1989,6 +2014,7 @@
 // }}}
 
 //register_shutdown_function(array('P2Util', 'debug'));
+register_shutdown_function(array('P2Util', 'printInfoHtml'));
 
 /*
  * Local Variables:

Modified: p2ex/trunk/lib/SettingTxt.php
===================================================================
--- p2ex/trunk/lib/SettingTxt.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/SettingTxt.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -71,7 +71,7 @@
      */
     public function downloadSettingTxt()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         // ‚Ü‚¿BBSE‚µ‚½‚ç‚Î ‚Í SETTING.TXT ‚ª‘¶Ý‚µ‚È‚¢‚à‚Ì‚Æ‚·‚é
         if (P2Util::isHostMachiBbs($this->_host) || P2Util::isHostJbbsShitaraba($this->_host)) {
@@ -101,7 +101,8 @@
         }
 
         $params = array();
-        $params['timeout'] = $_conf['fsockopen_time_limit'];
+        $params['timeout'] = $_conf['http_conn_timeout'];
+        $params['readTimeout'] = array($_conf['http_read_timeout'], 0);
         if ($_conf['proxy_use']) {
             $params['proxy_host'] = $_conf['proxy_host'];
             $params['proxy_port'] = $_conf['proxy_port'];
@@ -136,8 +137,9 @@
         // DLƒGƒ‰[
         if (isset($error_msg) && strlen($error_msg) > 0) {
             $url_t = P2Util::throughIme($this->_url);
-            $_info_msg_ht .= "<div>Error: {$error_msg}<br>";
-            $_info_msg_ht .= "p2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$this->_url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</div>";
+            $info_msg_ht = "<p class=\"info-msg\">Error: {$error_msg}<br>";
+            $info_msg_ht .= "rep2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$this->_url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+            P2Util::pushInfoHtml($info_msg_ht);
             touch($this->_setting_txt); // DLŽ¸”s‚µ‚½ê‡‚à touch
             return false;
 

Modified: p2ex/trunk/lib/ShowBrdMenuK.php
===================================================================
--- p2ex/trunk/lib/ShowBrdMenuK.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/ShowBrdMenuK.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -141,7 +141,7 @@
      */
     public function printItaSearch(array $categories)
     {
-        global $_conf, $_info_msg_ht, $word;
+        global $_conf, $word;
         global $list_navi_ht;
 
         if ($categories) {

Modified: p2ex/trunk/lib/ShowBrdMenuPc.php
===================================================================
--- p2ex/trunk/lib/ShowBrdMenuPc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/ShowBrdMenuPc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -29,7 +29,7 @@
      */
     public function printBrdMenu(array $categories)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         if ($categories) {
             $menu_php_ht = htmlspecialchars((isset($GLOBALS['menu_php_self'])) ? $GLOBALS['menu_php_self'] : $_SERVER['SCRIPT_NAME']);

Modified: p2ex/trunk/lib/SubjectTxt.php
===================================================================
--- p2ex/trunk/lib/SubjectTxt.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/SubjectTxt.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -87,7 +87,7 @@
      */
     public function downloadSubject()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         $perm = (isset($_conf['dl_perm'])) ? $_conf['dl_perm'] : 0606;
 
@@ -114,7 +114,8 @@
         }
 
         $params = array();
-        $params['timeout'] = $_conf['fsockopen_time_limit'];
+        $params['timeout'] = $_conf['http_conn_timeout'];
+        $params['readTimeout'] = array($_conf['http_read_timeout'], 0);
         if ($_conf['proxy_use']) {
             $params['proxy_host'] = $_conf['proxy_host'];
             $params['proxy_port'] = $_conf['proxy_port'];
@@ -146,8 +147,9 @@
 
         if (isset($error_msg) && strlen($error_msg) > 0) {
             $url_t = P2Util::throughIme($this->subject_url);
-            $_info_msg_ht .= "<div>Error: {$error_msg}<br>";
-            $_info_msg_ht .= "p2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$this->subject_url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</div>";
+            $info_msg_ht = "<p class=\"info-msg\">Error: {$error_msg}<br>";
+            $info_msg_ht .= "rep2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$this->subject_url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+            P2Util::pushInfoHtml($info_msg_ht);
             $body = '';
         } else {
             $body = $req->getResponseBody();

Modified: p2ex/trunk/lib/ThreadList.php
===================================================================
--- p2ex/trunk/lib/ThreadList.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/ThreadList.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -124,7 +124,7 @@
      */
     public function readList()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('readList()');
 
@@ -133,7 +133,7 @@
         // ƒ[ƒJƒ‹‚Ì—š—ðƒtƒ@ƒCƒ‹ “ǂݍž‚Ý
         case 'recent':
             if ($lines = FileCtl::file_read_lines($_conf['recent_idx'])) {
-                //$_info_msg_ht = '<p>—š—ð‚Í‹ó‚Á‚Û‚Å‚·</p>';
+                //P2Util::pushInfoHtml('<p>—š—ð‚Í‹ó‚Á‚Û‚Å‚·</p>');
                 //return false;
             }
             break;
@@ -141,7 +141,7 @@
         // ƒ[ƒJƒ‹‚̏‘‚«ž‚Ý—š—ðƒtƒ@ƒCƒ‹ “ǂݍž‚Ý
         case 'res_hist':
             if ($lines = FileCtl::file_read_lines($_conf['res_hist_idx'])) {
-                //$_info_msg_ht = '<p>‘‚«ž‚Ý—š—ð‚Í‹ó‚Á‚Û‚Å‚·</p>';
+                //P2Util::pushInfoHtml('<p>‘‚«ž‚Ý—š—ð‚Í‹ó‚Á‚Û‚Å‚·</p>');
                 //return false;
             }
             break;
@@ -149,7 +149,7 @@
         //ƒ[ƒJƒ‹‚Ì‚¨‹C‚Ƀtƒ@ƒCƒ‹ “ǂݍž‚Ý
         case 'fav':
             if ($lines = FileCtl::file_read_lines($_conf['favlist_idx'])) {
-                //$_info_msg_ht = '<p>‚¨‹C‚ɃXƒŒ‚Í‹ó‚Á‚Û‚Å‚·</p>';
+                //P2Util::pushInfoHtml('<p>‚¨‹C‚ɃXƒŒ‚Í‹ó‚Á‚Û‚Å‚·</p>');
                 //return false;
             }
             break;
@@ -273,8 +273,8 @@
         // ƒXƒŒ‚Ì“a“°‚̏ꍇ  // p2_palace.idx “ǂݍž‚Ý
         case 'palace':
             if ($lines = FileCtl::file_read_lines($_conf['palace_idx'])) {
-                // $_info_msg_ht = "<p>“a“°‚Í‚ª‚ç‚ñ‚Ç‚¤‚Å‚·</p>";
-                // return false;
+                //P2Util::pushInfoHtml('<p>“a“°‚Í‚ª‚ç‚ñ‚Ç‚¤‚Å‚·</p>');
+                //return false;
             }
             break;
 
@@ -321,7 +321,7 @@
      */
     public function sort($mode, $reverse = false)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         if (!$this->threads) {
             return;
@@ -373,8 +373,9 @@
             }
             break;
         default:
-            $_info_msg_ht .= sprintf('<p class="info-msg">ƒ\[ƒgŽw’肪•Ï‚Å‚·B(%s)</p>',
-                                     htmlspecialchars($mode, ENT_QUOTES));
+            $info_msg_ht = sprintf('<p class="info-msg">ƒ\[ƒgŽw’肪•Ï‚Å‚·B(%s)</p>',
+                                   htmlspecialchars($mode, ENT_QUOTES));
+            P2Util::pushInfoHtml($info_msg_ht);
         }
 
         if ($cmp) {
@@ -397,13 +398,13 @@
         if ($cmp && $do_benchmark) {
             $after = microtime(true);
             $count = count($this->threads);
-            $_info_msg_ht .= sprintf(
+            P2Util::pushInfoHtml(sprintf(
                 '<p class="info-msg" style="font-family:monospace">%s(%d thread%s)%s = %0.6f sec.</p>',
                 $cmp,
                 number_format($count),
                 ($count > 1) ? 's' : '',
                 $reverse ? '+reverse' : '',
-                $after - $before);
+                $after - $before));
         }
 
         //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('sort');

Modified: p2ex/trunk/lib/ThreadRead.php
===================================================================
--- p2ex/trunk/lib/ThreadRead.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/ThreadRead.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -120,7 +120,7 @@
      */
     protected function _downloadDat2ch($from_bytes)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
         global $debug;
 
         if (!($this->host && $this->bbs && $this->key)) {
@@ -189,26 +189,34 @@
         $request .= "\r\n";
 
         // WEBƒT[ƒo‚֐ڑ±
-        $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['fsockopen_time_limit']);
+        $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']);
         if (!$fp) {
-            $url_t = P2Util::throughIme($url);
-            $_info_msg_ht .= "<p>ƒT[ƒoÚ‘±ƒGƒ‰[: {$errstr} ({$errno})<br>p2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+            $this->_pushInfoConnectionTimedOut($url, $errno, $errstr);
             $this->diedat = true;
             return false;
         }
+        stream_set_timeout($fp, $_conf['http_read_timeout'], 0);
+
         $wr = "";
         fputs($fp, $request);
         $start_here = false;
-        while (!feof($fp)) {
+        while (!p2_stream_eof($fp, $timed_out)) {
 
             if ($start_here) {
 
                 if ($code == "200" || $code == "206") {
 
-                    while (!feof($fp)) {
+                    while (!p2_stream_eof($fp, $timed_out)) {
                         $wr .= fread($fp, 4096);
                     }
 
+                    if ($timed_out) {
+                        $this->_pushInfoReadTimedOut($url);
+                        $this->diedat = true;
+                        fclose($fp);
+                        return false;
+                    }
+
                     // ––”ö‚̉üs‚Å‚ ‚ځ[‚ñƒ`ƒFƒbƒN
                     if (!$zero_read) {
                         if (substr($wr, 0, 1) != "\n") {
@@ -236,7 +244,7 @@
                             fclose($fp);
                             unset($this->onbytes);
                             unset($this->modified);
-                            $_info_msg_ht .= "p2 info: $this->onbytes/$this->length ƒtƒ@ƒCƒ‹ƒTƒCƒY‚ª•Ï‚Ȃ̂ŁAdat‚ðÄŽæ“¾<br>";
+                            P2Util::pushInfoHtml("<p>rep2 info: {$this->onbytes}/{$this->length} ƒtƒ@ƒCƒ‹ƒTƒCƒY‚ª•Ï‚Ȃ̂ŁAdat‚ðÄŽæ“¾</p>");
                             //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection("dat_size_check");
                             return $this->_downloadDat2ch(0); //datƒTƒCƒY‚Í•s³B‘S•”Žæ‚è’¼‚µB
 
@@ -318,9 +326,16 @@
                 }
             }
         }
+
         fclose($fp);
-        $this->isonline = true;
-        return true;
+        if ($timed_out) {
+            $this->_pushInfoReadTimedOut($url);
+            $this->diedat = true;
+            return false;
+        } else {
+            $this->isonline = true;
+            return true;
+        }
     }
 
     // }}}
@@ -358,8 +373,6 @@
             return false;
         }
 
-        //unset($datgz_attayo, $start_here, $isGzip, $done_gunzip, $marudatlines, $code);
-
         $method = 'GET';
 
         //  GET /test/offlaw.cgi?bbs=”–¼&key=ƒXƒŒƒbƒh”ԍ†&sid=ƒZƒbƒVƒ‡ƒ“ID HTTP/1.1
@@ -404,86 +417,47 @@
         $request .= "\r\n";
 
         // WEBƒT[ƒo‚֐ڑ±
-        $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['fsockopen_time_limit']);
+        $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']);
         if (!$fp) {
-            $url_t = P2Util::throughIme($url);
-            P2Util::pushInfoHtml("<p>ƒT[ƒoÚ‘±ƒGƒ‰[: {$errstr} ({$errno})<br>p2 info - <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>");
+            $this->_pushInfoConnectionTimedOut($url, $errno, $errstr);
             $this->diedat = true;
             return false;
         }
+        stream_set_timeout($fp, $_conf['http_read_timeout'], 0);
 
         fputs($fp, $request);
         $body = '';
         $start_here = false;
-        while (!feof($fp)) {
+        while (!p2_stream_eof($fp, $timed_out)) {
 
             if ($start_here) {
 
                 if ($code == "200") {
 
-                    while (!feof($fp)) {
+                    while (!p2_stream_eof($fp, $timed_out)) {
                         $body .= fread($fp, 4096);
                     }
 
+                    if ($timed_out) {
+                        $this->_pushInfoReadTimedOut($url);
+                        //$this->diedat = true;
+                        fclose($fp);
+                        return false;
+                    }
+
                     // gzipˆ³k‚È‚ç
                     if ($isGzip) {
-                        // gzip tempƒtƒ@ƒCƒ‹‚É•Û‘¶
-                        $gztempfile = $this->keydat.".gz";
-                        FileCtl::mkdir_for($gztempfile);
-                        if (FileCtl::file_write_contents($gztempfile, $body) === false) {
-                            p2die('cannot write file. downloadDat2chMaru()');
+                        $body = $this->_decodeGzip($body, $url);
+                        if ($body === null) {
+                            //$this->diedat = true;
+                            fclose($fp);
+                            return false;
                         }
-
-                        // PHP‚ʼn𓀓ǂݍž‚Ý
-                        if (extension_loaded('zlib')) {
-                            $body = FileCtl::get_gzfile_contents($gztempfile);
-                        // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“‚ʼnð“€
-                        } else {
-                            // Šù‚É‘¶Ý‚·‚é‚È‚çˆêŽžƒoƒbƒNƒAƒbƒv‘Þ”ð
-                            if (file_exists($this->keydat)) {
-                                if (file_exists($this->keydat . ".bak")) {
-                                    unlink($this->keydat . ".bak");
-                                }
-                                rename($this->keydat, $this->keydat . ".bak");
-                            }
-                            $rcode = 1;
-                            // ‰ð“€‚·‚é
-                            system("gzip -d $gztempfile", $rcode);
-                            // ‰ð“€Ž¸”s‚È‚çƒoƒbƒNƒAƒbƒv‚ð–ß‚·
-                            if ($rcode != 0) {
-                                if (file_exists($this->keydat.".bak")) {
-                                    if (file_exists($this->keydat)) {
-                                        unlink($this->keydat);
-                                    }
-                                    rename($this->keydat.".bak", $this->keydat);
-                                }
-                                $this->getdat_error_msg_ht .= "<p>p2 info - 2‚¿‚á‚ñ‚Ë‚é‰ß‹ŽƒƒO‘qŒÉ‚©‚ç‚̃XƒŒƒbƒhŽæ‚荞‚݂́APHP‚Ì<a href=\"http://www.php.net/manual/ja/ref.zlib.php\">zlibŠg’£ƒ‚ƒWƒ…[ƒ‹</a>‚ª‚È‚¢‚©Asystem‚ÅgzipƒRƒ}ƒ“ƒh‚ªŽg—p‰Â”\‚Å‚È‚¯‚ê‚΂ł«‚Ü‚¹‚ñB</p>";
-                                // gztempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-                                if (file_exists($gztempfile)) {
-                                    unlink($gztempfile);
-                                }
-                                $this->diedat = true;
-                                return false;
-                            // ‰ð“€¬Œ÷‚È‚ç
-                            } else {
-                                if (file_exists($this->keydat.".bak")) {
-                                    unlink($this->keydat.".bak");
-                                }
-                                $done_gunzip = true;
-                            }
-
-                        }
-                        // gzip tempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-                        if (file_exists($gztempfile)) {
-                            unlink($gztempfile);
-                        }
                     }
 
-                    if (!$done_gunzip) {
-                        FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
-                        if (FileCtl::file_write_contents($this->keydat, $body) === false) {
-                            p2die('cannot write file. downloadDat2chMaru()');
-                        }
+                    FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
+                    if (FileCtl::file_write_contents($this->keydat, $body) === false) {
+                        p2die('cannot write file. downloadDat2chMaru()');
                     }
 
                     // ƒNƒŠ[ƒjƒ“ƒO =====
@@ -553,7 +527,7 @@
         fclose($fp);
         //$this->isonline = true;
         //$this->datochiok = 1;
-        return true;
+        return !$timed_out;
     }
 
     // }}}
@@ -573,7 +547,7 @@
         } else {
             $remarutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true&amp;relogin2ch=true\">ÄŽæ“¾‚ðŽŽ‚Ý‚é</a>]";
             $moritori_ht = $this->_generateMoritapoDatLink();
-            $this->getdat_error_msg_ht .= "<p>p2 info - œID‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B{$remarutori_ht}{$moritori_ht}</p>";
+            $this->getdat_error_msg_ht .= "<p>rep2 info: œID‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B{$remarutori_ht}{$moritori_ht}</p>";
             $this->diedat = true;
             return false;
         }
@@ -587,7 +561,7 @@
      */
     protected function _downloadDat2chKako($uri, $ext)
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         $url = $uri.$ext;
 
@@ -629,70 +603,45 @@
         $request .= "\r\n";
 
         // WEBƒT[ƒo‚֐ڑ±
-        $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['fsockopen_time_limit']);
+        $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']);
         if (!$fp) {
-            $url_t = P2Util::throughIme($url);
-            echo "<p>ƒT[ƒoÚ‘±ƒGƒ‰[: $errstr ($errno)<br>p2 info - <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>$url</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
-            $this->diedat = true;
+            $this->_pushInfoConnectionTimedOut($url, $errno, $errstr);
             return false;
         }
+        stream_set_timeout($fp, $_conf['http_read_timeout'], 0);
 
         fputs($fp, $request);
         $body = "";
         $start_here = false;
-        while (!feof($fp)) {
+        while (!p2_stream_eof($fp, $timed_out)) {
 
             if ($start_here) {
 
                 if ($code == "200") {
 
-                    while (!feof($fp)) {
+                    while (!p2_stream_eof($fp, $timed_out)) {
                         $body .= fread($fp, 4096);
                     }
 
+                    if ($timed_out) {
+                        $this->_pushInfoReadTimedOut($url);
+                        $this->diedat = true;
+                        fclose($fp);
+                        return false;
+                    }
+
                     if ($isGzip) {
-                        $gztempfile = $this->keydat.".gz";
-                        FileCtl::mkdir_for($gztempfile);
-                        if (FileCtl::file_write_contents($gztempfile, $body) === false) {
-                            p2die('cannot write file. downloadDat2chKako()');
+                        $body = $this->_decodeGzip($body, $url);
+                        if ($body === null) {
+                            $this->diedat = true;
+                            fclose($fp);
+                            return false;
                         }
-                        if (extension_loaded('zlib')) {
-                            $body = FileCtl::get_gzfile_contents($gztempfile);
-                        } else {
-                            // Šù‚É‘¶Ý‚·‚é‚È‚çˆêŽžƒoƒbƒNƒAƒbƒv‘Þ”ð
-                            if (file_exists($this->keydat)) {
-                                if (file_exists($this->keydat.".bak")) { unlink($this->keydat.".bak"); }
-                                rename($this->keydat, $this->keydat.".bak");
-                            }
-                            $rcode = 1;
-                            system("gzip -d $gztempfile", $rcode); // ‰ð“€
-                            if ($rcode != 0) {
-                                if (file_exists($this->keydat.".bak")) {
-                                    if (file_exists($this->keydat)) {
-                                        unlink($this->keydat);
-                                    }
-                                    // Ž¸”s‚È‚çƒoƒbƒNƒAƒbƒv–ß‚·
-                                    rename($this->keydat.".bak", $this->keydat);
-                                }
-                                $this->getdat_error_msg_ht = "<p>p2 info - 2‚¿‚á‚ñ‚Ë‚é‰ß‹ŽƒƒO‘qŒÉ‚©‚ç‚̃XƒŒƒbƒhŽæ‚荞‚݂́APHP‚Ì<a href=\"http://www.php.net/manual/ja/ref.zlib.php\">zlibŠg’£ƒ‚ƒWƒ…[ƒ‹</a>‚ª‚È‚¢‚©Asystem‚ÅgzipƒRƒ}ƒ“ƒh‚ªŽg—p‰Â”\‚Å‚È‚¯‚ê‚΂ł«‚Ü‚¹‚ñB</p>";
-                                // gztempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
-                                if (file_exists($gztempfile)) { unlink($gztempfile); }
-                                $this->diedat = true;
-                                return false;
-                            } else {
-                                if (file_exists($this->keydat.".bak")) { unlink($this->keydat.".bak"); }
-                                $done_gunzip = true;
-                            }
-
-                        }
-                        if (file_exists($gztempfile)) { unlink($gztempfile); } // tempƒtƒ@ƒCƒ‹‚ðŽÌ‚Ä‚é
                     }
 
-                    if (!$done_gunzip) {
-                        FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
-                        if (FileCtl::file_write_contents($this->keydat, $body) === false) {
-                            p2die('cannot write file. downloadDat2chKako()');
-                        }
+                    FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
+                    if (FileCtl::file_write_contents($this->keydat, $body) === false) {
+                        p2die('cannot write file. downloadDat2chKako()');
                     }
 
                 // ‚È‚©‚Á‚½‚Æ”»’f
@@ -732,7 +681,7 @@
         }
         fclose($fp);
         //$this->isonline = true;
-        return true;
+        return !$timed_out;
     }
 
     // }}}
@@ -752,7 +701,7 @@
         if ($_GET['kakolog']) {
             $kakolog_ht = "<p><a href=\"{$_GET['kakolog']}.html\"{$_conf['bbs_win_target_at']}>{$_GET['kakolog']}.html</a></p>";
         }
-        $this->getdat_error_msg_ht = "<p>p2 info - 2‚¿‚á‚ñ‚Ë‚é‰ß‹ŽƒƒO‘qŒÉ‚©‚ç‚̃XƒŒƒbƒhŽæ‚荞‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½B</p>";
+        $this->getdat_error_msg_ht = "<p>rep2 info: 2‚¿‚á‚ñ‚Ë‚é‰ß‹ŽƒƒO‘qŒÉ‚©‚ç‚̃XƒŒƒbƒhŽæ‚荞‚Ý‚ÉŽ¸”s‚µ‚Ü‚µ‚½B</p>";
         $this->getdat_error_msg_ht .= $kakolog_ht;
         $this->diedat = true;
         return false;
@@ -768,7 +717,7 @@
      */
     public function get2chDatError()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         // ƒzƒXƒgˆÚ“]ŒŸo‚ŕύX‚µ‚½ƒzƒXƒg‚ðŒ³‚É–ß‚·
         if (!empty($this->old_host)) {
@@ -783,7 +732,7 @@
         $read_response_html = '';
         $wap_ua = new WapUserAgent();
         $wap_ua->setAgent($_conf['p2ua']); // ‚±‚±‚́A"Monazilla/" ‚ð‚‚¯‚é‚ÆNG
-        $wap_ua->setTimeout($_conf['fsockopen_time_limit']);
+        $wap_ua->setTimeout($_conf['http_conn_timeout'], $_conf['http_read_timeout']);
         $wap_req = new WapRequest();
         $wap_req->setUrl($read_url);
         if ($_conf['proxy_use']) {
@@ -793,8 +742,9 @@
 
         if ($wap_res->isError()) {
             $url_t = P2Util::throughIme($wap_req->url);
-            $_info_msg_ht .= "<div>Error: {$wap_res->code} {$wap_res->message}<br>";
-            $_info_msg_ht .= "p2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$wap_req->url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</div>";
+            $info_msg_ht = "<p class=\"info-msg\">Error: {$wap_res->code} {$wap_res->message}<br>";
+            $info_msg_ht .= "rep2 info: <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$wap_req->url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+            P2Util::pushInfoHtml($info_msg_ht);
         } else {
             $read_response_html = $wap_res->content;
         }
@@ -823,7 +773,7 @@
         if (preg_match($kakosoko_match, $read_response_html, $matches)) {
             $dat_response_status = "‚±‚̃XƒŒƒbƒh‚͉ߋŽƒƒO‘qŒÉ‚ÉŠi”[‚³‚ê‚Ä‚¢‚Ü‚·B";
             //if (file_exists($_conf['idpw2ch_php']) || file_exists($_conf['sid2ch_php'])) {
-                $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+                $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Årep2‚ÉŽæ‚荞‚Þ</a>]";
             //} else {
             //    $marutori_ht = " [<a href=\"login2ch.php\" target=\"subject\">œIDƒƒOƒCƒ“</a>]";
             //}
@@ -840,11 +790,11 @@
                 $kakolog_uri = "http://{$this->host}/{$matches[1]}";
                 $kakolog_url_en = rawurlencode($kakolog_uri);
                 $read_kako_url = "{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;kakolog={$kakolog_url_en}&amp;kakoget=1";
-                $dat_response_msg = "<p>2ch info - ‘à’·! ‰ß‹ŽƒƒO‘qŒÉ‚ŁA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>ƒXƒŒƒbƒh {$matches[3]}.html</a> ‚ð”­Œ©‚µ‚Ü‚µ‚½B [<a href=\"{$read_kako_url}\">p2‚ÉŽæ‚荞‚ñ‚Å“Ç‚Þ</a>]</p>";
+                $dat_response_msg = "<p>2ch info - ‘à’·! ‰ß‹ŽƒƒO‘qŒÉ‚ŁA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>ƒXƒŒƒbƒh {$matches[3]}.html</a> ‚ð”­Œ©‚µ‚Ü‚µ‚½B [<a href=\"{$read_kako_url}\">rep2‚ÉŽæ‚荞‚ñ‚Å“Ç‚Þ</a>]</p>";
 
             } elseif (preg_match($waithtml_match, $read_response_html, $matches)) {
                 $dat_response_status = "‘à’·! ƒXƒŒƒbƒh‚Íhtml‰»‚³‚ê‚é‚Ì‚ð‘Ò‚Á‚Ä‚¢‚é‚悤‚Å‚·B";
-                $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+                $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Årep2‚ÉŽæ‚荞‚Þ</a>]";
                 $moritori_ht = $this->_generateMoritapoDatLink();
                 $dat_response_msg = "<p>2ch info - ‘à’·! ƒXƒŒƒbƒh‚Íhtml‰»‚³‚ê‚é‚Ì‚ð‘Ò‚Á‚Ä‚¢‚é‚悤‚Å‚·B{$marutori_ht}{$moritori_ht}</p>";
 
@@ -854,7 +804,7 @@
                     $kako_html_url = urldecode($_GET['kakolog']) . ".html";
                     $read_kako_url = "{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;kakolog={$_GET['kakolog']}&amp;kakoget=1";
                     $dat_response_msg = "<p>2ch info - ‚»‚ñ‚È”ÂorƒXƒŒƒbƒh‚È‚¢‚Å‚·B</p>";
-                    $dat_response_msg .= "<p><a href=\"{$kako_html_url}\"{$_conf['bbs_win_target_at']}>{$kako_html_url}</a> [<a href=\"{$read_kako_url}\">p2‚ɃƒO‚ðŽæ‚荞‚ñ‚Å“Ç‚Þ</a>]</p>";
+                    $dat_response_msg .= "<p><a href=\"{$kako_html_url}\"{$_conf['bbs_win_target_at']}>{$kako_html_url}</a> [<a href=\"{$read_kako_url}\">rep2‚ɃƒO‚ðŽæ‚荞‚ñ‚Å“Ç‚Þ</a>]</p>";
                 } else {
                     $dat_response_status = "‚»‚ñ‚È”ÂorƒXƒŒƒbƒh‚È‚¢‚Å‚·B";
                     $dat_response_msg = "<p>2ch info - ‚»‚ñ‚È”ÂorƒXƒŒƒbƒh‚È‚¢‚Å‚·B</p>";
@@ -866,7 +816,7 @@
             $dat_response_status = "";
             $kako_html_url = urldecode($_GET['kakolog']).".html";
             $read_kako_url = "{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;kakolog={$_GET['kakolog']}&amp;kakoget=1";
-            $dat_response_msg = "<p><a href=\"{$kako_html_url}\"{$_conf['bbs_win_target_at']}>{$kako_html_url}</a> [<a href=\"{$read_kako_url}\">p2‚ɃƒO‚ðŽæ‚荞‚ñ‚Å“Ç‚Þ</a>]</p>";
+            $dat_response_msg = "<p><a href=\"{$kako_html_url}\"{$_conf['bbs_win_target_at']}>{$kako_html_url}</a> [<a href=\"{$read_kako_url}\">rep2‚ɃƒO‚ðŽæ‚荞‚ñ‚Å“Ç‚Þ</a>]</p>";
 
         }
 
@@ -883,7 +833,7 @@
      */
     public function previewOne()
     {
-        global $_conf, $_info_msg_ht;
+        global $_conf;
 
         if (!($this->host && $this->bbs && $this->key)) { return false; }
 
@@ -949,17 +899,17 @@
             $request .= "\r\n";
 
             // WEBƒT[ƒo‚֐ڑ±
-            $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['fsockopen_time_limit']);
+            $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']);
             if (!$fp) {
-                $url_t = P2Util::throughIme($url);
-                $_info_msg_ht .= "<p>ƒT[ƒoÚ‘±ƒGƒ‰[: $errstr ($errno)<br>p2 info - <a href=\"{$url_t}\"{$_conf['ext_win_target_at']}>{$url}</a> ‚ɐڑ±‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+                $this->_pushInfoConnectionTimedOut($url, $errno, $errstr);
                 $this->diedat = true;
                 return false;
             }
+            stream_set_timeout($fp, $_conf['http_read_timeout'], 0);
 
             fputs($fp, $request);
             $start_here = false;
-            while (!feof($fp)) {
+            while (!p2_stream_eof($fp, $timed_out)) {
 
                 if ($start_here) {
 
@@ -1319,7 +1269,7 @@
     {
         global $_conf;
 
-        $diedat_msg = '<p><b>p2 info - ”ƒT[ƒo‚©‚çÅV‚̃XƒŒƒbƒhî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</b>';
+        $diedat_msg = '<p><b>rep2 info: ”ƒT[ƒo‚©‚çÅV‚̃XƒŒƒbƒhî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</b>';
         if ($hosts = $this->scanOriginalHosts()) {
             $common_q = '&amp;bbs=' . rawurldecode($this->bbs)
                       . '&amp;key=' . rawurldecode($this->key)
@@ -1354,7 +1304,7 @@
                                     . '&key=' . rawurldecode($this->key)
                                     . '&ls=' . rawurldecode($this->ls)
                                     . '&moritapodat=true&csrfid=' . $csrfid, ENT_QUOTES);
-            return " [<a href=\"{$_conf['read_php']}?{$query}\">ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+            return " [<a href=\"{$_conf['read_php']}?{$query}\">ƒ‚ƒŠƒ^ƒ|‚Årep2‚ÉŽæ‚荞‚Þ</a>]";
         } else {
             return '';
         }
@@ -1444,29 +1394,40 @@
 
         $csrfid = $this->_getCsrfIdForMoritapoDat();
 
-        $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+        $host_en = rawurlencode($this->host);
+        $bbs_en = rawurlencode($this->bbs);
+        $key_en = rawurlencode($this->key);
+        $ls_en = rawurlencode($this->ls);
 
+        $host_ht = htmlspecialchars($this->host, ENT_QUOTES);
+        $bbs_ht = htmlspecialchars($this->bbs, ENT_QUOTES);
+        $key_ht = htmlspecialchars($this->key, ENT_QUOTES);
+        $ls_ht = htmlspecialchars($this->ls, ENT_QUOTES);
+
+        $query_ht = htmlspecialchars("host={$host_en}&bbs={$bbs_en}&key={$key_en}&ls={$ls_en}&maru=true");
+        $marutori_ht = " [<a href=\"{$_conf['read_php']}?{$query_ht}\">œID‚Årep2‚ÉŽæ‚荞‚Þ</a>]";
+
         if ($hosts = $this->scanOriginalHosts()) {
-            $hosts_ht = '<br>dat‚©‚瑼‚̃zƒXƒgŒó•â‚ðŒŸo‚µ‚Ü‚µ‚½B';
+            $hostlist_ht = '<br>dat‚©‚瑼‚̃zƒXƒgŒó•â‚ðŒŸo‚µ‚Ü‚µ‚½B';
             foreach ($hosts as $host) {
-                $hosts_ht .= " [<a href=\"#\" onclick=\"this.parentNode.elements['host'].value='{$host}';return false;\">{$host}</a>]";
+                $hostlist_ht .= " [<a href=\"#\" onclick=\"this.parentNode.elements['host'].value='{$host}';return false;\">{$host}</a>]";
             }
         } else {
-            $hosts_ht = '';
+            $hostlist_ht = '';
         }
 
         $this->getdat_error_msg_ht .= <<<EOF
-<p>p2 info - ƒ‚ƒŠƒ^ƒ|‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B{$marutori_ht}</p>
+<p>rep2 info: ƒ‚ƒŠƒ^ƒ|‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B{$marutori_ht}</p>
 <form action="{$_conf['read_php']}" method="get">
     ƒzƒXƒg‚ð
-    <input type="text" name="host" value="{$this->host}" size="12">
-    <input type="hidden" name="bbs" value="{$this->bbs}">
-    <input type="hidden" name="key" value="{$this->key}">
-    <input type="hidden" name="ls" value="{$this->ls}">
+    <input type="text" name="host" value="{$host_ht}" size="12">
+    <input type="hidden" name="bbs" value="{$bbs_ht}">
+    <input type="hidden" name="key" value="{$key_ht}">
+    <input type="hidden" name="ls" value="{$ls_ht}">
     ‚É•Ï‚¦‚Ä
-    <input type="submit" name="moritapodat" value="ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚ñ‚Å‚Ý‚é">
+    <input type="submit" name="moritapodat" value="ƒ‚ƒŠƒ^ƒ|‚Årep2‚ÉŽæ‚荞‚ñ‚Å‚Ý‚é">
     <input type="hidden" name="csrfid" value="{$csrfid}">
-    {$hosts_ht}
+    {$hostlist_ht}
 </form>\n
 EOF;
         $this->diedat = true;
@@ -1489,6 +1450,114 @@
     }
 
     // }}}
+    // {{{ _decodeGzip()
+
+    /**
+     * Gzipˆ³k‚³‚ꂽƒŒƒXƒ|ƒ“ƒXƒ{ƒfƒB‚ðƒfƒR[ƒh‚·‚é
+     *
+     * @param   string  $body
+     * @param   string  $caller
+     * @return  string
+     */
+    protected function _decodeGzip($body, $url)
+    {
+        global $_conf;
+
+        if (function_exists('http_inflate')) {
+            // pecl_http ‚Ì http_inflate() ‚Å“WŠJ
+            $body = http_inflate($body);
+        } else {
+            // gzip tempƒtƒ@ƒCƒ‹‚É•Û‘¶EPHP‚ʼn𓀓ǂݍž‚Ý
+            if (!is_dir($_conf['tmp_dir'])) {
+                FileCtl::mkdir_r($_conf['tmp_dir']);
+            }
+
+            $gztempfile = tempnam($_conf['tmp_dir'], 'gz_');
+            if (false === $gztempfile) {
+                p2die('ˆêŽžƒtƒ@ƒCƒ‹‚ðì¬‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B');
+            }
+
+            if (false === file_put_contents($gztempfile, $body)) {
+                unlink($gztempfile);
+                p2die('ˆêŽžƒtƒ@ƒCƒ‹‚ɏ‘‚«ž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B');
+            }
+
+            $body = file_get_contents('compress.zlib://' . $gztempfile);
+            if (false === $body) {
+                $body = null;
+            }
+
+            unlink($gztempfile);
+        }
+
+        if (is_null($body)) {
+            $msg = '<p class="info-msg"><strong>gzip“WŠJƒGƒ‰[</strong><br>';
+            $msg .= sprintf('rep2 error: <a href="%s"%s>%s</a> ‚ðgzipƒfƒR[ƒh‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B',
+                            P2Util::throughIme($url),
+                            $_conf['ext_win_target_at'],
+                            htmlspecialchars($url, ENT_QUOTES, 'Shift_JIS', false));
+            $msg .= '</p>';
+
+            P2Util::pushInfoHtml($msg);
+        }
+
+        return $body;
+    }
+
+    // }}}
+    // {{{ _pushInfoConnectionTimedOut()
+
+    /**
+     * Ú‘±‚ªƒ^ƒCƒ€ƒAƒEƒg‚µ‚½Ž|‚̃ƒbƒZ[ƒW‚ðƒvƒbƒVƒ…‚·‚é
+     *
+     * @param   string  $url
+     * @param   int     $errno
+     * @param   string  $errstr
+     * @return  void
+     */
+    protected function _pushInfoConnectionTimedOut($url, $errno, $errstr)
+    {
+        global $_conf;
+
+        $msg = '<p class="info-msg"><strong>';
+        $msg .= sprintf('HTTPÚ‘±ƒGƒ‰[ (%d) %s',
+                        $errno,
+                        htmlspecialchars($errstr, ENT_QUOTES));
+        $msg .= '</strong><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);
+    }
+
+
+    // }}}
+    // {{{ _pushInfoReadTimedOut()
+
+    /**
+     * “ǂݍž‚Ý‚ªƒ^ƒCƒ€ƒAƒEƒg‚µ‚½Ž|‚̃ƒbƒZ[ƒW‚ðƒvƒbƒVƒ…‚·‚é
+     *
+     * @param   string  $url
+     * @return  void
+     */
+    protected function _pushInfoReadTimedOut($url)
+    {
+        global $_conf;
+
+        $msg = '<p class="info-msg"><strong>HTTPÚ‘±ƒ^ƒCƒ€ƒAƒEƒg</strong><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);
+    }
+
+    // }}}
 }
 
 // }}}

Modified: p2ex/trunk/lib/Wap.php
===================================================================
--- p2ex/trunk/lib/Wap.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/Wap.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -37,6 +37,13 @@
     private $_timeout = -1;
 
     /**
+     * fread() Žž‚̃^ƒCƒ€ƒAƒEƒg•b
+     *
+     * @var int
+     */
+    private $_readTimeout = -1;
+
+    /**
      * fsockopen() ‚É@‰‰ŽZŽq‚ð•t‚¯‚āAƒGƒ‰[‚ð—}§‚·‚é‚È‚çtrue
      *
      * @var bool
@@ -94,11 +101,13 @@
      * set timeout
      *
      * @param int $timeout
+     * @param int $readTimeout
      * @return void
      */
-    public function setTimeout($timeout)
+    public function setTimeout($timeout, $readTimeout)
     {
         $this->_timeout = $timeout;
+        $this->_readTimeout = $readTimeout;
     }
 
     // }}}
@@ -247,11 +256,15 @@
             return $res;
         }
 
+        if ($this->_readTimeout > 0) {
+            stream_set_timeout($fp, $this->_readTimeout, 0);
+        }
+
         fputs($fp, $request);
         $body = '';
 
         // header response
-        while (!feof($fp)) {
+        while (!p2_stream_eof($fp, $timed_out)) {
             $l = fgets($fp,128000);
             //echo $l."<br>"; //
             // ex) HTTP/1.1 304 Not Modified
@@ -268,7 +281,7 @@
 
         // body response
         if (!$req->onlyHeader) {
-            while (!feof($fp)) {
+            while (!p2_stream_eof($fp, $timed_out)) {
                 $body .= fread($fp, 4096);
             }
             $res->setContent($body);

Modified: p2ex/trunk/lib/bootstrap.php
===================================================================
--- p2ex/trunk/lib/bootstrap.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/bootstrap.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -19,7 +19,7 @@
     // ‰½‚ç‚©‚Ì——R‚ц[ƒU[Ý’èƒtƒ@ƒCƒ‹‚ª‰ó‚ê‚Ä‚¢‚½‚ç
     if (!is_array($conf_user)) {
         if (unlink($_conf['conf_user_file'])) {
-            $_info_msg_ht .= '<p>ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹‚ª‰ó‚ê‚Ä‚¢‚½‚̂ō폜‚µ‚Ü‚µ‚½B</p>';
+            P2Util::pushInfoHtml('<p>ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹‚ª‰ó‚ê‚Ä‚¢‚½‚̂ō폜‚µ‚Ü‚µ‚½B</p>');
             $conf_user = array();
         } else {
             $dispname = '$_conf[\'pref_dir\']/' . basename($_conf['conf_user_file']);

Modified: p2ex/trunk/lib/expack/ic2/DatabaseManager.php
===================================================================
--- p2ex/trunk/lib/expack/ic2/DatabaseManager.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/ic2/DatabaseManager.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -18,8 +18,7 @@
             return;
         }
         if (!is_array($updated)) {
-            global $_info_msg_ht;
-            $_info_msg_ht .= '<p>WARNING! IC2_DatabaseManager::update(): •s³‚Ȉø”</p>';
+            P2Util::pushInfoHtml('<p>WARNING! IC2_DatabaseManager::update(): •s³‚Ȉø”</p>');
             return;
         }
 
@@ -85,8 +84,7 @@
                     return $removed_files;
                 }
             } else {
-                global $_info_msg_ht;
-                $_info_msg_ht .= '<p>WARNING! IC2_DatabaseManager::remove(): •s³‚Ȉø”</p>';
+                P2Util::pushInfoHtml('<p>WARNING! IC2_DatabaseManager::remove(): •s³‚Ȉø”</p>');
                 return $removed_files;
             }
         }
@@ -194,8 +192,7 @@
                     return;
                 }
             } else {
-                global $_info_msg_ht;
-                $_info_msg_ht .= '<p>WARNING! IC2_DatabaseManager::setRank(): •s³‚Ȉø”</p>';
+                P2Util::pushInfoHtml('<p>WARNING! IC2_DatabaseManager::setRank(): •s³‚Ȉø”</p>');
                 return $removed_files;
             }
         }
@@ -228,8 +225,7 @@
                     return;
                 }
             } else {
-                global $_info_msg_ht;
-                $_info_msg_ht .= '<p>WARNING! IC2_DatabaseManager::addMemo(): •s³‚Ȉø”</p>';
+                P2Util::pushInfoHtml('<p>WARNING! IC2_DatabaseManager::addMemo(): •s³‚Ȉø”</p>');
                 return $removed_files;
             }
         }

Modified: p2ex/trunk/lib/expack/rss/common.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/common.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/common.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -12,7 +12,7 @@
  */
 function rss_get_save_path($remotefile)
 {
-    global $_conf, $_info_msg_ht;
+    global $_conf;
     static $finished = array();
 
     $remotefile = preg_replace('|^feed://|', 'http://', $remotefile);

Modified: p2ex/trunk/lib/expack/rss/parser.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/parser.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/parser.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -35,13 +35,13 @@
  */
 function p2GetRSS($remotefile, $atom = 0)
 {
-    global $_conf, $_info_msg_ht;
+    global $_conf;
 
     $refresh = (!empty($_GET['refresh']) || !empty($_POST['refresh']));
 
     $localpath = rss_get_save_path($remotefile);
     if (PEAR::isError($localpath)) {
-        $_info_msg_ht .= "<p>" . $localpath->getMessage() . "</p>\n";
+        P2Util::pushInfoHtml('<p>' . $localpath->getMessage() . '</p>');
         return $localpath;
     }
 
@@ -81,8 +81,6 @@
  */
 function p2ParseRSS($xmlpath, $atom=0)
 {
-    global $_info_msg_ht;
-
     // $atom‚ª^‚È‚çXSL‚ðŽg‚Á‚ÄRSS 1.0‚É•ÏŠ·
     // i•ÏŠ·Ï‚݃tƒ@ƒCƒ‹‚ª‘¶Ý‚µ‚È‚¢‚©A$atom==2‚Ì‚Æ‚«‚ÉŽÀs‚³‚ê‚éj
     // Œ³‚ÌXML(Atom)‚Åencoding‘®«‚ª³‚µ‚­Žw’肳‚ê‚Ä‚¢‚ê‚ÎXSLTƒvƒƒZƒbƒT‚ªŽ©“®‚Å
@@ -92,13 +90,13 @@
         $rsspath = $xmlpath . '.rss';
         if (file_exists($rsspath) && $atom != 2) {
             // OK
-        } elseif (extension_loaded('xslt') || extension_loaded('xsl')) {
+        } elseif (extension_loaded('xsl')) {
             if (!atom_to_rss($xmlpath, $xslpath, $rsspath)) {
                 $retval = false;
                 return $retval;
             }
         } else {
-            $_info_msg_ht = '<p>p2 error: AtomƒtƒB[ƒh‚ð“Ç‚Þ‚É‚ÍPHP‚ÌXSLT‹@”\Šg’£‚Ü‚½‚ÍXSL‹@”\Šg’£‚ª•K—v‚Å‚·B</p>';
+            P2Util::pushInfoHtml('<p>p2 error: AtomƒtƒB[ƒh‚ð“Ç‚Þ‚É‚ÍPHP‚ÌXSL‹@”\Šg’£‚ª•K—v‚Å‚·B</p>');
             $retval = false;
             return $retval;
         }
@@ -120,7 +118,7 @@
     $rss = new XML_RSS($rsspath, $srcenc, $tgtenc);*/
     $rss = new XML_RSS($rsspath);
     if (PEAR::isError($rss)) {
-        $_info_msg_ht = '<p>p2 error: RSS - ' . $rss->getMessage() . '</p>';
+        P2Util::pushInfoHtml('<p>p2 error: RSS - ' . $rss->getMessage() . '</p>');
         return $rss;
     }
     // ‰ðÍ‘Ώۂ̃^ƒO‚ðã‘‚«
@@ -150,7 +148,7 @@
     // RSS‚ðƒp[ƒX
     $result = $rss->parse();
     if (PEAR::isError($result)) {
-        $_info_msg_ht = '<p>p2 error: RSS - ' . $result->getMessage() . '</p>';
+        P2Util::pushInfoHtml('<p>p2 error: RSS - ' . $result->getMessage() . '</p>');
         return $result;
     }
 
@@ -165,7 +163,7 @@
  */
 function atom_to_rss($input, $stylesheet, $output)
 {
-    global $_conf, $_info_msg_ht;
+    global $_conf;
 
     // •Û‘¶—pƒfƒBƒŒƒNƒgƒŠ‚ª‚È‚¯‚ê‚΂‚­‚é
     if (!is_dir(dirname($output))) {
@@ -216,12 +214,10 @@
  */
 function atom_to_rss_by_xslt($input, $stylesheet, $output)
 {
-    global $_info_msg_ht;
-
     $xh = xslt_create();
     if (!@xslt_process($xh, $input, $stylesheet, $output)) {
         $errmsg = xslt_errno($xh) . ': ' . xslt_error($xh);
-        $_info_msg_ht = '<p>p2 error: XSLT - Atom‚ðRSS‚É•ÏŠ·‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B(' . $errmsg . ')</p>';
+        P2Util::pushInfoHtml('<p>p2 error: XSLT - Atom‚ðRSS‚É•ÏŠ·‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B(' . $errmsg . ')</p>');
         xslt_free($xh);
         return FALSE;
     }
@@ -238,8 +234,6 @@
  */
 function atom_to_rss_by_xsl($input, $stylesheet, $output)
 {
-    global $_info_msg_ht;
-
     $xmlDoc = new DomDocument;
     if ($xmlDoc->load(realpath($input))) {
         $xslDoc = new DomDocument;
@@ -257,7 +251,7 @@
     }
 
     if (!$rss_content) {
-        $_info_msg_ht = '<p>p2 error: XSL - Atom‚ðRSS‚É•ÏŠ·‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>';
+        P2Util::pushInfoHtml('<p>p2 error: XSL - Atom‚ðRSS‚É•ÏŠ·‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</p>');
         return FALSE;
     }
 

Modified: p2ex/trunk/lib/expack/rss/read.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/read.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/read.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -30,9 +30,10 @@
     </script>
 </head>
 <body onload="setWinTitle()">
-{$_info_msg_ht}
 EOH;
 
+P2Util::printInfoHtml();
+
 // RSS‚ªƒp[ƒX‚Å‚«‚È‚©‚Á‚½‚Æ‚«
 if (!$rss_parse_success) {
     echo '</body></html>';

Modified: p2ex/trunk/lib/expack/rss/read_k.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/read_k.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/read_k.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -6,6 +6,7 @@
 // {{{ ƒwƒbƒ_
 
 $ch_title = htmlspecialchars($channel['title'], ENT_QUOTES, 'Shift_JIS', false);
+$info_msg_ht = P2Util::getInfoHtml();
 
 echo <<<EOH
 <html lang="ja">
@@ -16,7 +17,7 @@
 <title>{$title}</title>
 </head>
 <body{$_conf['k_colors']}>
-{$_info_msg_ht}
+{$info_msg_ht}
 <h1>{$ch_title}</h1>
 <hr>
 EOH;

Modified: p2ex/trunk/lib/expack/rss/setrss.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/setrss.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/setrss.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -37,7 +37,7 @@
         flock($fp, LOCK_UN);
         fclose($fp);
 
-        $_info_msg_ht .= <<<EOJS
+        $script = <<<EOJS
 <script type="text/javascript">
 //<![CDATA[
 if (parent.menu) {
@@ -46,6 +46,7 @@
 //]]>
 </script>\n
 EOJS;
+        P2Util::pushInfoHtml($script);
 
         unset($site, $xml, $atom, $m, $matches, $fp);
         return;

Modified: p2ex/trunk/lib/expack/rss/subject.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/subject.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/subject.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -84,10 +84,10 @@
     </script>
 </head>
 <body onload="setWinTitle();">
-{$_info_msg_ht}
-
 EOH;
 
+P2Util::printInfoHtml();
+
 // RSS‚ªƒp[ƒX‚Å‚«‚È‚©‚Á‚½‚Æ‚«
 if (!$rss_parse_success) {
     echo "<h1>{$title}</h1></body></html>";

Modified: p2ex/trunk/lib/expack/rss/subject_k.inc.php
===================================================================
--- p2ex/trunk/lib/expack/rss/subject_k.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/expack/rss/subject_k.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -5,6 +5,8 @@
 
 // {{{ ƒwƒbƒ_
 
+$info_msg_ht = P2Util::getInfoHtml();
+
 echo <<<EOH
 <html lang="ja">
 <head>
@@ -14,7 +16,7 @@
 <title>{$title}</title>
 </head>
 <body{$_conf['k_colors']}>
-{$_info_msg_ht}
+{$info_msg_ht}
 <p><b>{$title}</b></p>
 <hr>\n
 EOH;

Modified: p2ex/trunk/lib/global.funcs.php
===================================================================
--- p2ex/trunk/lib/global.funcs.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/global.funcs.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -688,7 +688,28 @@
 }
 
 // }}}
+// {{{ p2_stream_eof()
 
+/**
+ * ƒ^ƒCƒ€ƒAƒEƒgƒ`ƒFƒbƒN‚‚«feof()
+ *
+ * @param   stream  $fp
+ * @param   boolean &$timed_out
+ * @return  boolean
+ */
+function p2_stream_eof($fp, &$timed_out = false)
+{
+    $info = stream_get_meta_data($fp);
+    $timed_out = $info['timed_out'];
+    if (feof($fp) || $timed_out) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+// }}}
+
 /*
  * Local Variables:
  * mode: php

Modified: p2ex/trunk/lib/index_print_k.inc.php
===================================================================
--- p2ex/trunk/lib/index_print_k.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/index_print_k.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -10,8 +10,10 @@
 */
 function index_print_k()
 {
-    global $_conf, $_login, $_info_msg_ht;
+    global $_conf, $_login;
 
+    $info_msg_ht = P2Util::getInfoHtml();
+
     $newtime = date('gis');
 
     $body = "";
@@ -59,7 +61,7 @@
 </head>
 <body{$_conf['k_colors']}>
 <h1>{$ptitle}</h1>
-{$_info_msg_ht}
+{$info_msg_ht}
 <div>
 <a href="subject.php?spmode=fav&amp;sb_view=shinchaku{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][1]}>{$_conf['k_accesskey_st'][1]}‚¨‹C‚ɽڂ̐V’…</a><br>
 <a href="subject.php?spmode=fav{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][2]}>{$_conf['k_accesskey_st'][2]}‚¨‹C‚ɽڂ̑S‚Ä</a><br>

Modified: p2ex/trunk/lib/login2ch.inc.php
===================================================================
--- p2ex/trunk/lib/login2ch.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/login2ch.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -251,7 +251,7 @@
 
     $wap_ua = new WapUserAgent;
     $wap_ua->setAgent($dolib2ch);
-    $wap_ua->setTimeout($_conf['fsockopen_time_limit']);
+    $wap_ua->setTimeout($_conf['http_conn_timeout'], $_conf['http_read_timeout']);
 
     $wap_req = new WapRequest;
     $wap_req->setMethod('POST');

Modified: p2ex/trunk/lib/login_first.inc.php
===================================================================
--- p2ex/trunk/lib/login_first.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/login_first.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -10,7 +10,7 @@
  */
 function printLoginFirst(Login $_login)
 {
-    global $_info_msg_ht, $STYLE, $_conf;
+    global $STYLE, $_conf;
     global $_login_failed_flag, $_p2session;
     global $skin_en;
 
@@ -263,7 +263,7 @@
         // {{{ “ü—̓Gƒ‰[‚ðƒ`ƒFƒbƒNA”»’è
 
         if (!preg_match('/^[0-9A-Za-z_]+$/', $_POST['form_login_id']) || !preg_match('/^[0-9A-Za-z_]+$/', $_POST['form_login_pass'])) {
-            $_info_msg_ht .= "<p class=\"infomsg\">rep2 error: u{$p_str['user']}v–¼‚Ɓu{$p_str['password']}v‚Í”¼Šp‰p”Žš‚Å“ü—Í‚µ‚ĉº‚³‚¢B</p>";
+            P2Util::pushInfoHtml("<p class=\"info-msg\">rep2 error: u{$p_str['user']}v–¼‚Ɓu{$p_str['password']}v‚Í”¼Šp‰p”Žš‚Å“ü—Í‚µ‚ĉº‚³‚¢B</p>");
             $show_login_form_flag = true;
 
         // }}}
@@ -275,7 +275,7 @@
 
             // V‹K“o˜^¬Œ÷
             $hd['form_login_id'] = htmlspecialchars($_POST['form_login_id'], ENT_QUOTES);
-            $body_ht .= "<p class=\"infomsg\">› ”FØ{$p_str['user']}u{$hd['form_login_id']}v‚ð“o˜^‚µ‚Ü‚µ‚½</p>";
+            $body_ht .= "<p class=\"info-msg\">› ”FØ{$p_str['user']}u{$hd['form_login_id']}v‚ð“o˜^‚µ‚Ü‚µ‚½</p>";
             $body_ht .= "<p><a href=\"{$myname}?form_login_id={$hd['form_login_id']}{$_conf['k_at_a']}\">rep2 start</a></p>";
 
             $_login->setUser($_POST['form_login_id']);
@@ -300,14 +300,15 @@
     } else {
 
         if (isset($_POST['form_login_id']) || isset($_POST['form_login_pass'])) {
-            $_info_msg_ht .= '<p class="infomsg">';
+            $info_msg_ht = '<p class="info-msg">';
             if (!$_POST['form_login_id']) {
-                $_info_msg_ht .= "rep2 error: u{$p_str['user']}v‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB"."<br>";
+                $info_msg_ht .= "rep2 error: u{$p_str['user']}v‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB<br>";
             }
             if (!$_POST['form_login_pass']) {
-                $_info_msg_ht .= "rep2 error: u{$p_str['password']}v‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB";
+                $info_msg_ht .= "rep2 error: u{$p_str['password']}v‚ª“ü—Í‚³‚ê‚Ä‚¢‚Ü‚¹‚ñB";
             }
-            $_info_msg_ht .= '</p>';
+            $info_msg_ht .= '</p>';
+            P2Util::pushInfoHtml($info_msg_ht);
         }
 
         $show_login_form_flag = true;
@@ -348,10 +349,7 @@
     echo "<h3>{$ptitle}</h3>\n";
 
     // î•ñ•\Ž¦
-    if (!empty($_info_msg_ht)) {
-        echo $_info_msg_ht;
-        $_info_msg_ht = '';
-    }
+    P2Util::printInfoHtml();
 
     echo $body_ht;
 

Modified: p2ex/trunk/lib/menu.inc.php
===================================================================
--- p2ex/trunk/lib/menu.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/menu.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -130,8 +130,7 @@
 <body>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 if (!empty($sidebar)) {
     echo <<<EOP
@@ -402,15 +401,14 @@
     }
     $msg_ht .= '</p>';
 
-    $_info_msg_ht .= $msg_ht;
+    P2Util::pushInfoHtml($msg_ht);
 } else {
     $match_cates = null;
 }
 
 // }}}
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 if ($_conf['menu_hide_brds'] && !$GLOBALS['ita_mikke']['num']) {
     $brd_menus_style = ' style="display:none"';

Modified: p2ex/trunk/lib/read_header.inc.php
===================================================================
--- p2ex/trunk/lib/read_header.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/read_header.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -275,8 +275,7 @@
 <body><div id="popUpContainer"></div>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 // ƒXƒŒ‚ª”ƒT[ƒo‚É‚È‚¯‚ê‚Î ============================
 if ($aThread->diedat) {

Modified: p2ex/trunk/lib/read_header_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_header_k.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/read_header_k.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -14,7 +14,7 @@
 $moto_thre_st = 'Œ³';
 $siml_thre_st = 'Ž—';
 $latest_st = 'V';
-$dores_st = '攴';
+$dores_st = '‘';
 $find_st = 'õ';
 
 $motothre_url = $aThread->getMotoThread(false, '1-10');
@@ -219,8 +219,7 @@
 <body{$_conf['k_colors']}>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 // ƒXƒŒ‚ª”ƒT[ƒo‚É‚È‚¯‚ê‚Î============================
 if ($aThread->diedat) {

Modified: p2ex/trunk/lib/read_res_hist.inc.php
===================================================================
--- p2ex/trunk/lib/read_res_hist.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/read_res_hist.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -40,7 +40,7 @@
         }
         $neolines = rmLine($rmnums, $reslines);
 
-        $_info_msg_ht .= "<p>p2 info: " . count($rmnums) . "Œ‚̃ŒƒX‹LŽ–‚ðíœ‚µ‚Ü‚µ‚½</p>";
+        P2Util::pushInfoHtml('<p>p2 info: ' . count($rmnums) . 'Œ‚̃ŒƒX‹LŽ–‚ðíœ‚µ‚Ü‚µ‚½</p>');
     }
 
     if (is_array($neolines)) {

Modified: p2ex/trunk/lib/sb_header.inc.php
===================================================================
--- p2ex/trunk/lib/sb_header.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/sb_header.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -330,8 +330,7 @@
 
 include P2_LIB_DIR . '/sb_toolbar.inc.php';
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 echo <<<EOP
 {$taborn_check_ht}{$check_form_ht}

Modified: p2ex/trunk/lib/sb_header_k.inc.php
===================================================================
--- p2ex/trunk/lib/sb_header_k.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/sb_header_k.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -170,8 +170,7 @@
 <body{$_conf['k_colors']}>
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 include P2_LIB_DIR . '/sb_toolbar_k.inc.php';
 

Modified: p2ex/trunk/lib/setfavita.inc.php
===================================================================
--- p2ex/trunk/lib/setfavita.inc.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/setfavita.inc.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -27,7 +27,7 @@
  */
 function setFavItaByRequest()
 {
-    global $_conf, $_info_msg_ht;
+    global $_conf;
 
     $setfavita = null;
     $host = null;
@@ -62,7 +62,7 @@
                 $bbs = $matches[2];
             } else {
                 $url_ht = htmlspecialchars($_POST['url'], ENT_QUOTES);
-                $_info_msg_ht .= "<p>p2 info: u{$url_ht}v‚͔‚ÌURL‚Æ‚µ‚Ä–³Œø‚Å‚·B</p>";
+                P2Util::pushInfoHtml("<p>p2 info: u{$url_ht}v‚͔‚ÌURL‚Æ‚µ‚Ä–³Œø‚Å‚·B</p>");
             }
         } elseif (!empty($_POST['submit_setfavita']) && $_POST['list']) {
             $list = $_POST['list'];
@@ -74,7 +74,7 @@
     } elseif ($list) {
         return setFavItaByList($list);
     } else {
-        $_info_msg_ht .= "<p>p2 info: ”‚̎w’肪•Ï‚Å‚·</p>";
+        P2Util::pushInfoHtml("<p>p2 info: ”‚̎w’肪•Ï‚Å‚·</p>");
         return false;
     }
 }
@@ -172,7 +172,7 @@
  */
 function setFavItaByList($list, $setnum = null)
 {
-    global $_conf, $_info_msg_ht;
+    global $_conf;
 
     // ‹L˜^ƒf[ƒ^Ý’è
     $rec_lines = array();
@@ -181,7 +181,7 @@
         $rec_lines[] = "\t{$host}\t{$bbs}\t" . UrlSafeBase64::decode($itaj_en);
     }
 
-    $_info_msg_ht .= <<<EOJS
+    $script = <<<EOJS
 <script type="text/javascript">
 //<![CDATA[
 if (parent.menu) {
@@ -191,6 +191,8 @@
 </script>\n
 EOJS;
 
+    P2Util::pushInfoHtml($script);
+
     $cont = '';
     if (!empty($rec_lines)) {
         foreach ($rec_lines as $l) {

Modified: p2ex/trunk/lib/startup.funcs.php
===================================================================
--- p2ex/trunk/lib/startup.funcs.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/lib/startup.funcs.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -12,8 +12,6 @@
  */
 function p2_check_environment($check_recommended)
 {
-    global $_info_msg_ht;
-
     include P2_CONF_DIR . '/setup_info.php';
 
     $php_version = phpversion();
@@ -68,7 +66,7 @@
                 $check_recommended = htmlspecialchars($check_recommended, ENT_QUOTES);
             }
             if (basename($_SERVER['PHP_SELF'], '.php') == 'title') {
-                $_info_msg_ht .= <<<EOP
+                $info_msg_ht = <<<EOP
 <p><strong>„§ƒo[ƒWƒ‡ƒ“‚æ‚èŒÃ‚¢PHP‚Å“®ì‚µ‚Ä‚¢‚Ü‚·B</strong>
 <em>(PHP {$php_version})</em><br>
 PHP {$recommended_version} ˆÈ~‚ɃAƒbƒvƒf[ƒg‚·‚邱‚Æ‚ð‚¨‚·‚·‚ß‚µ‚Ü‚·B</p>
@@ -78,6 +76,7 @@
 <samp>p2_check_environment(<strong>false</strong>);</samp> ‚ɏ‘‚«Š·‚¦‚Ä‚­‚¾‚³‚¢B</p>
 EOP;
             }
+            P2Util::pushInfoHtml($info_msg_ht);
             return false;
         }
     }

Modified: p2ex/trunk/login.php
===================================================================
--- p2ex/trunk/login.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/login.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -50,9 +50,9 @@
 
     // “ü—̓`ƒFƒbƒN
     if (!preg_match('/^[0-9A-Za-z_]+$/', $new_login_pass)) {
-        $_info_msg_ht .= "<p>rep2 error: {$p_str['password']}‚𔼊p‰p”Žš‚Å“ü—Í‚µ‚ĉº‚³‚¢B</p>";
+        P2Util::pushInfoHtml("<p>rep2 error: {$p_str['password']}‚𔼊p‰p”Žš‚Å“ü—Í‚µ‚ĉº‚³‚¢B</p>");
     } elseif ($new_login_pass != $_POST['form_new_login_pass2']) {
-        $_info_msg_ht .= "<p>rep2 error: {$p_str['password']} ‚Æ {$p_str['password']} (Šm”F) ‚ªˆê’v‚µ‚Ü‚¹‚ñ‚Å‚µ‚½B</p>";
+        P2Util::pushInfoHtml("<p>rep2 error: {$p_str['password']} ‚Æ {$p_str['password']} (Šm”F) ‚ªˆê’v‚µ‚Ü‚¹‚ñ‚Å‚µ‚½B</p>");
 
     // ƒpƒXƒ[ƒh•ÏX“o˜^ˆ—‚ðs‚¤
     } else {
@@ -73,7 +73,7 @@
         flock($fp, LOCK_UN);
         fclose($fp);
 
-        $_info_msg_ht .= '<p>›”FØƒpƒXƒ[ƒh‚ð•ÏX“o˜^‚µ‚Ü‚µ‚½</p>';
+        P2Util::pushInfoHtml('<p>›”FØƒpƒXƒ[ƒh‚ð•ÏX“o˜^‚µ‚Ü‚µ‚½</p>');
     }
 
 }
@@ -160,18 +160,20 @@
 
     if ($_login->checkUserPwWithCid($_COOKIE['cid'])) {
         if ($_REQUEST['regist_cookie'] == '1') {
-            $_info_msg_ht .= '<p>›cookie”FØ“o˜^Š®—¹</p>';
+            $info_msg_ht = '<p>›cookie”FØ“o˜^Š®—¹</p>';
         } else {
-            $_info_msg_ht .= '<p>~cookie”FØ‰ðœŽ¸”s</p>';
+            $info_msg_ht = '<p>~cookie”FØ‰ðœŽ¸”s</p>';
         }
 
     } else {
         if ($_REQUEST['regist_cookie'] == '1') {
-            $_info_msg_ht .= '<p>~cookie”FØ“o˜^Ž¸”s</p>';
+            $info_msg_ht = '<p>~cookie”FØ“o˜^Ž¸”s</p>';
         } else  {
-            $_info_msg_ht .= '<p>›cookie”FØ‰ðœŠ®—¹</p>';
+            $info_msg_ht = '<p>›cookie”FØ‰ðœŠ®—¹</p>';
         }
     }
+
+    P2Util::pushInfoHtml($info_msg_ht);
 }
 
 //====================================================
@@ -252,10 +254,7 @@
 }
 
 // î•ñ•\Ž¦
-if (!is_null($_info_msg_ht)) {
-    echo $_info_msg_ht;
-    $_info_msg_ht = "";
-}
+P2Util::printInfoHtml();
 
 echo '<p id="login_status">';
 echo <<<EOP

Modified: p2ex/trunk/login2ch.php
===================================================================
--- p2ex/trunk/login2ch.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/login2ch.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -116,8 +116,7 @@
 EOP;
 }
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 //================================================================
 // 2chœƒƒOƒCƒ“ƒtƒH[ƒ€

Modified: p2ex/trunk/menu_i.php
===================================================================
--- p2ex/trunk/menu_i.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/menu_i.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -141,7 +141,7 @@
 ?>
 
 <ul id="top" title="rep2" selected="true">
-<?php if ($_info_msg_ht) { ?>
+<?php if (P2Util::hasInfoHtml()) { ?>
     <li><a href="#info_msg" class="color-r">ƒGƒ‰[</a></li>
 <?php } ?>
     <li class="group">ƒŠƒXƒg</li>
@@ -183,8 +183,10 @@
 // }}}
 // {{{ ƒGƒ‰[
 
-if ($_info_msg_ht) { 
-    echo '<div id="info_msg" class="panel" title="ƒGƒ‰[">', $_info_msg_ht, '</div>';
+if (P2Util::hasInfoHtml()) { 
+    echo '<div id="info_msg" class="panel" title="ƒGƒ‰[">';
+    P2Util::printInfoHtml();
+    echo '</div>';
 }
 
 // }}}

Modified: p2ex/trunk/menu_k.php
===================================================================
--- p2ex/trunk/menu_k.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/menu_k.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -78,8 +78,7 @@
 <body{$_conf['k_colors']}>
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 //==============================================================
 // ‚¨‹C‚ɔ‚ðƒvƒŠƒ“ƒg‚·‚é
@@ -140,7 +139,7 @@
 
     }
     if (!$GLOBALS['ita_mikke']['num']) {
-        $_info_msg_ht .=  "<p>\"{$hd['word']}\"‚ðŠÜ‚ޔ‚͌©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B</p>\n";
+        P2Util::pushInfoHtml("<p>\"{$hd['word']}\"‚ðŠÜ‚ޔ‚͌©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½B</p>\n");
         unset($word);
     }
     $modori_url_ht = <<<EOP
@@ -176,8 +175,7 @@
 EOP;
 }
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 //==============================================================
 // ƒZƒbƒgØ‚è‘Ö‚¦ƒtƒH[ƒ€‚ð•\Ž¦

Modified: p2ex/trunk/post.php
===================================================================
--- p2ex/trunk/post.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/post.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -339,9 +339,9 @@
 
     // ‘‚«ž‚ݏˆ—
     if (FileCtl::file_write_contents($_conf['res_hist_dat'], $cont, FILE_APPEND) === false) {
-        trigger_error('p2 error: ‘‚«ž‚݃ƒO‚Ì•Û‘¶‚ÉŽ¸”s‚µ‚Ü‚µ‚½', E_USER_WARNING);
+        trigger_error('rep2 error: ‘‚«ž‚݃ƒO‚Ì•Û‘¶‚ÉŽ¸”s‚µ‚Ü‚µ‚½', E_USER_WARNING);
         // ‚±‚ê‚ÍŽÀÛ‚Í•\Ž¦‚³‚ê‚È‚¢‚¯‚ê‚Ç‚à
-        //$_info_msg_ht .= "<p>p2 error: ‘‚«ž‚݃ƒO‚Ì•Û‘¶‚ÉŽ¸”s‚µ‚Ü‚µ‚½</p>";
+        //P2Util::pushInfoHtml('<p>rep2 error: ‘‚«ž‚݃ƒO‚Ì•Û‘¶‚ÉŽ¸”s‚µ‚Ü‚µ‚½</p>');
     }
 }
 
@@ -435,20 +435,22 @@
     // }}}
 
     // WEBƒT[ƒo‚֐ڑ±
-    $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['fsockopen_time_limit']);
+    $fp = fsockopen($send_host, $send_port, $errno, $errstr, $_conf['http_conn_timeout']);
     if (!$fp) {
+        $errstr = htmlspecialchars($errstr, ENT_QUOTES);
         showPostMsg(false, "ƒT[ƒoÚ‘±ƒGƒ‰[: $errstr ($errno)<br>p2 Error: ”ƒT[ƒo‚ւ̐ڑ±‚ÉŽ¸”s‚µ‚Ü‚µ‚½", false);
         return false;
     }
+    stream_set_timeout($fp, $_conf['http_read_timeout'], 0);
 
     //echo '<h4>$request</h4><p>' . $request . "</p>"; //for debug
     fputs($fp, $request);
 
-    while (!feof($fp)) {
+    while (!p2_stream_eof($fp, $timed_out)) {
 
         if ($start_here) {
 
-            while (!feof($fp)) {
+            while (!p2_stream_eof($fp, $timed_out)) {
                 $wr .= fread($fp, 164000);
             }
             $response = $wr;
@@ -587,7 +589,6 @@
 {
     global $_conf, $location_ht, $popup, $ttitle, $ptitle;
     global $STYLE, $skin_en;
-    global $_info_msg_ht;
 
     // ƒvƒŠƒ“ƒg—p•Ï” ===============
     if (!$_conf['ktai']) {
@@ -659,8 +660,7 @@
     echo "</head>\n";
     echo "<body{$_conf['k_colors']}>\n";
 
-    echo $_info_msg_ht;
-    $_info_msg_ht = "";
+    P2Util::printInfoHtml();
 
     echo <<<EOP
 <p>{$ttitle_ht}</p>

Modified: p2ex/trunk/post_form.php
===================================================================
--- p2ex/trunk/post_form.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/post_form.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -118,8 +118,7 @@
 <body{$body_at}>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 // $htm['post_form'] ‚ðŽæ“¾
 require_once P2_LIB_DIR . '/post_form.inc.php';

Modified: p2ex/trunk/read_async.php
===================================================================
--- p2ex/trunk/read_async.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/read_async.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -15,8 +15,6 @@
 $newtime = date('gis'); // “¯‚¶ƒŠƒ“ƒN‚ðƒNƒŠƒbƒN‚µ‚Ä‚àÄ“Ǎž‚µ‚È‚¢Žd—l‚ɑ΍R‚·‚éƒ_ƒ~[ƒNƒGƒŠ[
 //$_today = date('y/m/d');
 
-$_info_msg_ht = '';
-
 if (empty($_GET['host']) || empty($_GET['bbs']) || empty($_GET['key']) || empty($_GET['ls'])) {
     p2die('ƒŒƒX‚ÌŽw’肪•Ï‚Å‚·B');
 }

Modified: p2ex/trunk/read_copy_k.php
===================================================================
--- p2ex/trunk/read_copy_k.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/read_copy_k.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -78,10 +78,10 @@
             $msg_txt = preg_replace('/ *<br[^>]*> */i', "\n", $msg_txt);
         }
     } else {
-        $_info_msg_ht .= '<p>p2 error: Ú½”ԍ†‚ÌŽw’肪•Ï‚Å‚·¡</p>';
+        P2Util::pushInfoHtml('<p>p2 error: Ú½”ԍ†‚ÌŽw’肪•Ï‚Å‚·¡</p>');
     }
 } else {
-    $_info_msg_ht .= '<p>p2 error: ½Ú¯ÄÞ‚ÌŽw’肪•Ï‚Å‚·B</p>';
+    P2Util::pushInfoHtml('<p>p2 error: ½Ú¯ÄÞ‚ÌŽw’肪•Ï‚Å‚·B</p>');
 }
 
 $msg_len = mb_strlen($msg_txt);
@@ -154,7 +154,7 @@
 <title><?php echo $ttitle_ht; ?>/<?php echo $resid; ?></title>
 </head>
 <body<?php echo $k_color_settings; ?>>
-<?php echo $_info_msg_ht; ?>
+<?php P2Util::printInfoHtml(); ?>
 <form action="<?php echo $action_ht; ?>" method="post">
 ƒXƒŒ:<br>
 <input type="text" name="ttitle_txt" value="<?php echo $ttitle_ht; ?>"><br>

Modified: p2ex/trunk/read_new.php
===================================================================
--- p2ex/trunk/read_new.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/read_new.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -192,8 +192,7 @@
 <body><div id="popUpContainer"></div>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 //echo $ptitle_ht."<br>";
 
@@ -316,8 +315,7 @@
 
     if ($aThread->isonline) { $online_num++; } // ¶‘¶”set
 
-    echo $_info_msg_ht;
-    $_info_msg_ht = '';
+    P2Util::printInfoHtml();
 
     $matomeCache->concat(ob_get_flush());
     flush();
@@ -349,7 +347,7 @@
 function readNew($aThread)
 {
     global $_conf, $newthre_num, $STYLE;
-    global $_info_msg_ht, $word;
+    global $word;
     static $favlist_titles = null;
 
     if ($_conf['expack.misc.multi_favs'] && is_null($favlist_titles)) {
@@ -443,8 +441,7 @@
     }
     $next_thre_ht = "<a id=\"ntta{$next_thre_num}\" href=\"#ntt{$next_thre_num}\">¥</a>";
 
-    echo $_info_msg_ht;
-    $_info_msg_ht = "";
+    P2Util::printInfoHtml();
 
     // ƒwƒbƒ_•”•ªHTML
     $read_header_ht = <<<EOP

Modified: p2ex/trunk/read_new_k.php
===================================================================
--- p2ex/trunk/read_new_k.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/read_new_k.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -175,8 +175,7 @@
 <a class="button" id="above" name="above" href="#bottom"{$_conf['k_accesskey_at']['bottom']}>{$_conf['k_accesskey_st']['bottom']}¥</a></div>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 //==============================================================
 // ‚»‚ꂼ‚ê‚̍s‰ðÍ
@@ -300,8 +299,7 @@
 
     if ($aThread->isonline) { $online_num++; } // ¶‘¶”set
 
-    echo $_info_msg_ht;
-    $_info_msg_ht = '';
+    P2Util::printInfoHtml();
 
     $matomeCache->concat(ob_get_flush());
     flush();
@@ -333,7 +331,7 @@
 function readNew($aThread)
 {
     global $_conf, $newthre_num, $STYLE;
-    global $_info_msg_ht, $spmode, $word;
+    global $spmode, $word;
 
     $newthre_num++;
 
@@ -416,8 +414,7 @@
         $read_header_itaj_ht = " ({$itaj_hd})";
     }
 
-    echo $_info_msg_ht;
-    $_info_msg_ht = "";
+    P2Util::printInfoHtml();
 
     $read_header_ht = <<<EOP
 <hr><div id="ntt{$newthre_num}" name="ntt{$newthre_num}"><font color="{$STYLE['mobile_read_ttitle_color']}"><b>{$aThread->ttitle_hd}</b></font>{$read_header_itaj_ht} {$next_thre_ht}</div>

Modified: p2ex/trunk/read_res_hist.php
===================================================================
--- p2ex/trunk/read_res_hist.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/read_res_hist.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -112,8 +112,7 @@
 <body{$body_at}>\n
 EOP;
 
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 // Œg‘Ñ—p•\Ž¦
 if ($_conf['ktai']) {

Modified: p2ex/trunk/read_rss.php
===================================================================
--- p2ex/trunk/read_rss.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/read_rss.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -20,7 +20,6 @@
 // •Ï”‚̏‰Šú‰»
 //============================================================
 
-$_info_msg_ht = '';
 $channel = array();
 $items = array();
 

Modified: p2ex/trunk/setting.php
===================================================================
--- p2ex/trunk/setting.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/setting.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -79,8 +79,7 @@
 }
 
 // ƒCƒ“ƒtƒHƒƒbƒZ[ƒW•\Ž¦
-echo $_info_msg_ht;
-$_info_msg_ht = "";
+P2Util::printInfoHtml();
 
 echo "<ul id=\"setting_menu\">";
 

Modified: p2ex/trunk/spm_k.php
===================================================================
--- p2ex/trunk/spm_k.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/spm_k.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -103,8 +103,7 @@
 
 echo "<body{$_conf['k_colors']}>";
 
-echo $_info_msg_ht;
-$_info_msg_ht = '';
+P2Util::printInfoHtml();
 
 echo "<p><a href=\"{$thread_url}\">{$ptitle_ht}</a></p>";
 echo '<hr>';

Modified: p2ex/trunk/style/info_css.inc
===================================================================
--- p2ex/trunk/style/info_css.inc	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/style/info_css.inc	2010-01-25 07:01:16 UTC (rev 801)
@@ -15,7 +15,7 @@
 }
 {$thre_title_underline_css}
 
-.infomsg{
+.info-msg{
 	font-size:{$STYLE['infowin_fontsize']};
 }
 

Modified: p2ex/trunk/style/login_first_css.inc
===================================================================
--- p2ex/trunk/style/login_first_css.inc	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/style/login_first_css.inc	2010-01-25 07:01:16 UTC (rev 801)
@@ -14,7 +14,7 @@
 	background-color:#ccc;
 }
 
-p.infomsg{
+p.info-msg{
 	color:#369;
 }
 

Modified: p2ex/trunk/subject.php
===================================================================
--- p2ex/trunk/subject.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/subject.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -894,8 +894,6 @@
  */
 function autoTAbornOff($aThreadList, $ta_keys)
 {
-    global $_info_msg_ht;
-
     //$GLOBALS['debug'] && $GLOBALS['profiler']->enterSection('abornoff');
 
     if (!$aThreadList->spmode && !empty($GLOBALS['word']) && !empty($GLOBALS['wakati_word']) && $aThreadList->threads && $ta_keys) {
@@ -903,13 +901,16 @@
         // echo sizeof($ta_keys)."*<br>";
         $ta_vkeys = array_keys($ta_keys);
         settaborn_off($aThreadList->host, $aThreadList->bbs, $ta_vkeys);
+        $ks = '';
         foreach ($ta_vkeys as $k) {
             $ta_num--;
             if ($k) {
-                $ks .= "key:$k ";
+                $ks .= "key:{$k} ";
             }
         }
-        $ks && $_info_msg_ht .= "<div class=\"info\">@p2 info: DAT—Ž‚¿‚µ‚½ƒXƒŒƒbƒh‚ ‚ځ[‚ñ‚ðŽ©“®‰ðœ‚µ‚Ü‚µ‚½ - $ks</div>";
+        if ($ks) {
+            P2Util::pushInfoHtml("<p>p2 info: DAT—Ž‚¿‚µ‚½ƒXƒŒƒbƒh‚ ‚ځ[‚ñ‚ðŽ©“®‰ðœ‚µ‚Ü‚µ‚½ - {$ks}</p>");
+        }
     }
 
     //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection('abornoff');

Modified: p2ex/trunk/subject_rss.php
===================================================================
--- p2ex/trunk/subject_rss.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/subject_rss.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -20,7 +20,6 @@
 // •Ï”‚̏‰Šú‰»
 //============================================================
 
-$_info_msg_ht = '';
 $channel = array();
 $items = array();
 

Modified: p2ex/trunk/title.php
===================================================================
--- p2ex/trunk/title.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/title.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -12,7 +12,7 @@
 //=========================================================
 
 if (!empty($GLOBALS['pref_dir_realpath_failed_msg'])) {
-    $_info_msg_ht .= '<p>'.$GLOBALS['pref_dir_realpath_failed_msg'].'</p>';
+    P2Util::pushInfoHtml('<p>' . $GLOBALS['pref_dir_realpath_failed_msg'] . '</p>');
 }
 
 $p2web_url_r = P2Util::throughIme($_conf['p2web_url']);
@@ -142,10 +142,7 @@
 EOP;
 
 // î•ñƒƒbƒZ[ƒW•\Ž¦
-if (!empty($_info_msg_ht)) {
-    echo $_info_msg_ht;
-    $_info_msg_ht = '';
-}
+P2Util::printInfoHtml();
 
 echo <<<EOP
 <br>

Modified: p2ex/trunk/viewtxt.php
===================================================================
--- p2ex/trunk/viewtxt.php	2010-01-24 10:24:33 UTC (rev 800)
+++ p2ex/trunk/viewtxt.php	2010-01-25 07:01:16 UTC (rev 801)
@@ -53,8 +53,6 @@
  */
 function viewTxtFile($file, $encode)
 {
-    global $_info_msg_ht;
-
     if ($file == '') {
         p2die('file ‚ªŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ');
     }
@@ -89,7 +87,7 @@
 <body onload="top.document.title=self.document.title;">\n
 EOHEADER;
 
-    echo $_info_msg_ht;
+    P2Util::printInfoHtml();
     echo "<pre>";
     echo $cont_area;
     echo "</pre>";



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