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[bZ[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Êmp îñbZ[WHTML +$_info_msg_ht = null; // [UÊmp îñbZ[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) // lbg[NÚ±^CAEgÔ (b) +// @deprecated use $_conf['http_conn_timeout'] and $_conf['http_read_timeout'] $_conf['fsockopen_time_limit'] = 7; // (7) +// HTTPÚ±^CAEgÔ (b) +$_conf['http_conn_timeout'] = 1; // (1) + +// HTTPÇ^CAEgÔ (b) +$_conf['http_read_timeout'] = 5; // (5) + // p2ÌÅVo[Wð©®`FbN(·é: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ÉÚ±·éÛÉ^CAEg·éÜÅÌÔibj -$_conf['expack.ic2.getter.conn_timeout'] = 60; +$_conf['expack.ic2.getter.conn_timeout'] = 5; // _E[hª^CAEg·éÜÅÌÔibj $_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>ÝèðXVÛ¶µÜµ½</p>"; + P2Util::pushInfoHtml('<p>ÝèðXVÛ¶µÜµ½</p>'); } else { - $_info_msg_ht .= "<p>~ÝèðXV۶ūܹñŵ½</p>"; + P2Util::pushInfoHtml('<p>~ÝèðXV۶ūܹñŵ½</p>'); } // }}} @@ -82,9 +82,9 @@ } elseif (!empty($_POST['submit_default'])) { if (@unlink($path)) { - $_info_msg_ht .= "<p>Xgðóɵܵ½</p>"; + P2Util::pushInfoHtml('<p>Xgðóɵܵ½</p>'); } else { - $_info_msg_ht .= "<p>~XgðóÉūܹñŵ½</p>"; + P2Util::pushInfoHtml('<p>~XgðóÉūܹñŵ½</p>'); } } @@ -207,10 +207,7 @@ } // îñbZ[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 Ú[ñXbh^CgvÅÍsgp</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 @@ // VACYµÄÛ¶ 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>~ÝèðXV۶ūܹñŵ½</p>"; + P2Util::pushInfoHtml('<p>~ÝèðXV۶ūܹñŵ½</p>'); } else { - $_info_msg_ht .= "<p>ÝèðXVÛ¶µÜµ½</p>"; + P2Util::pushInfoHtml('<p>ÝèðXVÛ¶µÜµ½</p>'); // ÏXª êÎAàf[^àXVµÄ¨ $_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>ÝèðftHgÉߵܵ½</p>"; + P2Util::pushInfoHtml('<p>ÝèðftHgÉߵܵ½</p>'); // ÏXª êÎAàf[^àXVµÄ¨ $_conf = array_merge($_conf, $conf_user_def); if (is_array($conf_save)) { @@ -194,8 +194,7 @@ } // îñbZ[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 = ''; - // Ýèvg $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ÉüèZbgÝèð«ßܹñŵ½B"; + P2Util::pushInfoHtml("<p>p2 error: {$_conf['expack.misc.favset_file']} ɨCÉüèZbgÝèð«ßܹñŵ½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(); // [UFØ // Ï ============= -$_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[Xz_Æ[Uwè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[Xz_Í꾯ŷB</p>'; + P2Util::pushInfoHtml('<p>G[: URLÉÜßçêév[Xz_Í꾯ŷ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[Xz_(<samp>%s</samp>)ܽÍp^[(<samp>[from-to]</samp>)ªÜÜêĢȢ©A¼ûªÜÜêĢܷB</p>'; + P2Util::pushInfoHtml('<p>G[: URLÉAÔÌv[Xz_(<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ÔÉ`FbNªüÁĢܹñªAURLÉAÔ_E[hp̶ñªÜÜêĢܷB</p>'; + P2Util::pushInfoHtml('<p>G[: AÔÉ`FbNªüÁĢܹñªAURLÉAÔ_E[hp̶ñªÜÜêĢܷ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[^LbV ðÁūܹñŵ½B</p>'; + P2Util::pushInfoHtml('<p>ê\¦pÌf[^LbV ðÁūܹñŵ½B</p>'); } else { - $_info_msg_ht .= '<p>ê\¦pÌf[^LbV ðÁµÜµ½B</p>'; + P2Util::pushInfoHtml('<p>ê\¦pÌf[^LbV ðÁµÜµ½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>ȺÌRpCÏÝev[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>ȺÌRpCÏÝev[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>ubNXgðÁµÜµ½B</p>'; + P2Util::pushInfoHtml('<p>ubNXgðÁµÜµ½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[^LbV ðÅK»µÜµ½B</p>'; + P2Util::pushInfoHtml('<p>ê\¦pÌf[^LbV ðÅK»µÜµ½B</p>'); } break; // ¢è`ÌNGXg default: - $_info_msg_ht .= '<p>¢è`ÌNGXgÅ·B</p>'; + P2Util::pushInfoHtml('<p>¢è`ÌNGXgÅ·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@CAbv[hpÌe|tH_ª èܹñB'); } elseif (count($_FILES['upimg']['error']) == $errors[UPLOAD_ERR_NO_FILE]) { - $_info_msg_ht .= $err_fmt['none']; + P2Util::pushInfoHtml($err_fmt['none']); } else { // TlCì¬NXÌCX^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; } // tH[ð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: tH[Ì MAX_FILE_SIZE Ìlªü´ñ³êĢܷB</p>'; + P2Util::pushInfoHtml('<p>Warning: tH[Ì 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: Abv[h³ê½datÌt@C¼ªÏÅ·B</p>'; + P2Util::pushInfoHtml('<p>Error: Abv[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: Abv[h³ê½datÌt@C¼ÆXbhL[ª}b`µÜ¹ñB</p>'; + P2Util::pushInfoHtml('<p>Error: Abv[h³ê½datÌt@C¼ÆXbhL[ª}b`µÜ¹ñB</p>'); } } else { $is_error = TRUE; - $_info_msg_ht .= '<p>Error: XbhL[ÌwèªÏÅ·B</p>'; + P2Util::pushInfoHtml('<p>Error: XbhL[ÌwèªÏÅ·B</p>'); }*/ $dat_path = P2Util::datDirOfHostBbs($host, $bbs) . $key . '.dat'; @@ -54,19 +54,19 @@ // G[bZ[WÍ http://jp.php.net/manual/ja/features.file-upload.errors.php ©çRsy switch ($_FILES['dat_file']['error']) { case UPLOAD_ERR_INI_SIZE: - $_info_msg_ht .= '<p>Error: Abv[h³ê½t@CÍAphp.ini Ì upload_max_filesize fBNeBuÌlð´¦Ä¢Ü·B</p>'; + P2Util::pushInfoHtml('<p>Error: Abv[h³ê½t@CÍAphp.ini Ì upload_max_filesize fBNeBuÌlð´¦Ä¢Ü·B</p>'); break; case UPLOAD_ERR_FORM_SIZE: - $_info_msg_ht .= '<p>Error: Abv[h³ê½t@CÍAHTMLtH[Åwè³ê½ MAX_FILE_SIZE ð´¦Ä¢Ü·B</p>'; + P2Util::pushInfoHtml('<p>Error: Abv[h³ê½t@CÍAHTMLtH[Åwè³ê½ MAX_FILE_SIZE ð´¦Ä¢Ü·B</p>'); break; case UPLOAD_ERR_PARTIAL: - $_info_msg_ht .= '<p>Error: Abv[h³ê½t@CÍêÌݵ©Abv[h³êĢܹñB</p>'; + P2Util::pushInfoHtml('<p>Error: Abv[h³ê½t@CÍêÌݵ©Abv[h³êĢܹñB</p>'); break; case UPLOAD_ERR_NO_FILE: - $_info_msg_ht .= '<p>Error: t@CÍAbv[h³êܹñŵ½B</p>'; + P2Util::pushInfoHtml('<p>Error: t@CÍAbv[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; // }bsOÇÝÝ @@ -49,7 +48,7 @@ // Ú]ðoµ½ç¨CÉÂA¨CÉXAÅßÇñ¾Xð©®Å¯ú $msg_fmt = '<p>rep2 info: zXgÌÚ]ðoµÜµ½B(%s/%s ¨ %s/%s)<br>'; $msg_fmt .= '¨CÉÂA¨CÉXAÅßÇñ¾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: ÂXg {$entry} ªÇÝßܹñŵ½B</p>\n"; + P2Util::pushInfoHtml("<p>p2 error: ÂXg {$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¼ªáÁ½çAFظsŲ¯é if ($this->user_u != $rec_login_user_u) { - $_info_msg_ht .= '<p class="infomsg">p2 error: OCG[</p>'; + P2Util::pushInfoHtml('<p>p2 error: OCG[</p>'); // OC¸sOðL^·é if (!empty($_conf['login_log_rec'])) { @@ -268,7 +268,7 @@ // VKo^ÅȯêÎG[\¦ if (empty($_POST['submit_new'])) { - $_info_msg_ht .= '<p class="infomsg">p2 error: OCG[</p>'; + P2Util::pushInfoHtml('<p>p2 error: OCG[</p>'); } return false; @@ -296,7 +296,7 @@ // ZbVªp³êÄ¢éÈçAZbVÌë`FbN 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(); // OC¸s return false; @@ -417,7 +417,7 @@ // tH[OC¸sÈç } else { - $_info_msg_ht .= '<p class="infomsg">p2 info: OCūܹñŵ½B<br>[U¼©pX[hªá¢Ü·B</p>'; + P2Util::pushInfoHtml('<p>p2 info: OCūܹñŵ½B<br>[U¼©pX[hªá¢Ü·B</p>'); $_login_failed_flag = true; // OC¸sOð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 TuXNCoIDÅÌFØo^Íūܹñŵ½</p>'."\n"; + P2Util::pushInfoHtml('<p>~EZweb TuXNCoIDÅÌ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 [VAÔÅÌFØo^Íūܹñŵ½</p>'."\n"; + P2Util::pushInfoHtml('<p>~SoftBank [VAÔÅÌ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[^ð۶ūܹñŵ½BFØo^¸sB</p>"; + P2Util::pushInfoHtml('<p>Error: f[^ð۶ūܹñŵ½BFØo^¸sB</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[bZ[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); } // XV³êÄ¢½ç @@ -304,34 +305,37 @@ */ static public function checkDirWritable($aDir) { - global $_info_msg_ht, $_conf; + global $_conf; // }`[U[hÍAîñbZ[Wð}§µÄ¢éB + $info_msg_ht = ''; if (!is_dir($aDir)) { /* - $_info_msg_ht .= '<p class="infomsg">'; - $_info_msg_ht .= 'Ó: f[^Û¶pfBNgª èܹñB<br>'; - $_info_msg_ht .= $aDir."<br>"; + $info_msg_ht .= '<p class="info-msg">'; + $info_msg_ht .= 'Ó: f[^Û¶pfBNgª èܹñB<br>'; + $info_msg_ht .= $aDir."<br>"; */ if (is_dir(dirname(realpath($aDir))) && is_writable(dirname(realpath($aDir)))) { - //$_info_msg_ht .= "fBNgÌ©®ì¬ðÝÜ·...<br>"; + //$info_msg_ht .= "fBNgÌ©®ì¬ðÝÜ·...<br>"; if (mkdir($aDir, $_conf['data_dir_perm'])) { - //$_info_msg_ht .= "fBNgÌ©®ì¬ª¬÷µÜµ½B"; + //$info_msg_ht .= "fBNgÌ©®ì¬ª¬÷µÜµ½B"; chmod($aDir, $_conf['data_dir_perm']); } else { - //$_info_msg_ht .= "fBNgð©®ì¬Å«Ü¹ñŵ½B<br>è®ÅfBNgð쬵Ap[~bVðÝèµÄº³¢B"; + //$info_msg_ht .= "fBNgð©®ì¬Å«Ü¹ñŵ½B<br>è®ÅfBNgð쬵Ap[~bVðÝèµÄº³¢B"; } } else { - //$_info_msg_ht .= "fBNgð쬵Ap[~bVðÝèµÄº³¢B"; + //$info_msg_ht .= "fBNgð쬵Ap[~bVðÝèµÄº³¢B"; } - //$_info_msg_ht .= '</p>'; + //$info_msg_ht .= '</p>'; } elseif (!is_writable($aDir)) { - $_info_msg_ht .= '<p class="infomsg">Ó: f[^Û¶pfBNgÉ«Ý Àª èܹñB<br>'; - //$_info_msg_ht .= $aDir.'<br>'; - $_info_msg_ht .= 'fBNgÌp[~bV𩼵ĺ³¢B</p>'; + $info_msg_ht .= '<p class="info-msg">Ó: f[^Û¶pfBNgÉ«Ý Àª èܹñB<br>'; + //$info_msg_ht .= $aDir.'<br>'; + $info_msg_ht .= 'fBNgÌp[~bV𩼵ĺ³¢B</p>'; } + + self::pushInfoHtml($info_msg_ht); } // }}} @@ -1642,6 +1646,10 @@ { global $_info_msg_ht; + // \¦tH[}bgðê·éÝ + $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; // Ü¿BBSEµ½çÎ Í 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 @@ // DLG[ 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">\[gwèªÏÅ·B(%s)</p>', - htmlspecialchars($mode, ENT_QUOTES)); + $info_msg_ht = sprintf('<p class="info-msg">\[gwèªÏÅ·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"; // WEBT[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Å Ú[ñ`FbN 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@CTCYªÏÈÌÅAdatðÄæ¾<br>"; + P2Util::pushInfoHtml("<p>rep2 info: {$this->onbytes}/{$this->length} t@CTCYªÏÈÌÅAdatðÄæ¾</p>"); //$GLOBALS['debug'] && $GLOBALS['profiler']->leaveSection("dat_size_check"); return $this->_downloadDat2ch(0); //datTCYÍs³BSæè¼µ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=XbhÔ&sid=ZbVID HTTP/1.1 @@ -404,86 +417,47 @@ $request .= "\r\n"; // WEBT[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 tempt@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ÅðÇÝÝ - if (extension_loaded('zlib')) { - $body = FileCtl::get_gzfile_contents($gztempfile); - // R}hCÅð - } else { - // ùɶݷéÈçêobNAbvÞð - 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ÈçobNAbvðß· - 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¿áñËéßOqÉ©çÌXbhæèÝÍAPHPÌ<a href=\"http://www.php.net/manual/ja/ref.zlib.php\">zlibg£W [</a>ªÈ¢©AsystemÅgzipR}hªgpÂ\ÅȯêÎūܹñB</p>"; - // gztempt@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 tempt@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[jO ===== @@ -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}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true&relogin2ch=true\">Äæ¾ðÝé</a>]"; $moritori_ht = $this->_generateMoritapoDatLink(); - $this->getdat_error_msg_ht .= "<p>p2 info - IDÅÌXbhæ¾É¸sµÜµ½B{$remarutori_ht}{$moritori_ht}</p>"; + $this->getdat_error_msg_ht .= "<p>rep2 info: IDÅÌXbhæ¾É¸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"; // WEBT[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 { - // ùɶݷéÈçêobNAbvÞð - 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ÈçobNAbvß· - rename($this->keydat.".bak", $this->keydat); - } - $this->getdat_error_msg_ht = "<p>p2 info - 2¿áñËéßOqÉ©çÌXbhæèÝÍAPHPÌ<a href=\"http://www.php.net/manual/ja/ref.zlib.php\">zlibg£W [</a>ªÈ¢©AsystemÅgzipR}hªgpÂ\ÅȯêÎūܹñB</p>"; - // gztempt@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); } // tempt@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¿áñËéßOqÉ©çÌXbhæèÝɸsµÜµ½B</p>"; + $this->getdat_error_msg_ht = "<p>rep2 info: 2¿áñËéßOqÉ©çÌXbhæèÝɸ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; // zXgÚ]oÅÏXµ½zXgð³Éß· 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 = "±ÌXbhÍßOqÉÉi[³êĢܷB"; //if (file_exists($_conf['idpw2ch_php']) || file_exists($_conf['sid2ch_php'])) { - $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true\">IDÅp2ÉæèÞ</a>]"; + $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true\">IDÅrep2ÉæèÞ</a>]"; //} else { // $marutori_ht = " [<a href=\"login2ch.php\" target=\"subject\">IDOC</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}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$kakolog_url_en}&kakoget=1"; - $dat_response_msg = "<p>2ch info - à·! ßOqÉÅA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>Xbh {$matches[3]}.html</a> ð©µÜµ½B [<a href=\"{$read_kako_url}\">p2ÉæèñÅÇÞ</a>]</p>"; + $dat_response_msg = "<p>2ch info - à·! ßOqÉÅA<a href=\"{$kakolog_uri}.html\"{$_conf['bbs_win_target_at']}>Xbh {$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 = "à·! XbhÍhtml»³êéÌðÒÁÄ¢éæ¤Å·B"; - $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true\">IDÅp2ÉæèÞ</a>]"; + $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&maru=true\">IDÅrep2ÉæèÞ</a>]"; $moritori_ht = $this->_generateMoritapoDatLink(); $dat_response_msg = "<p>2ch info - à·! XbhÍ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}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$_GET['kakolog']}&kakoget=1"; $dat_response_msg = "<p>2ch info - »ñÈÂorXbhȢŷ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 = "»ñÈÂorXbhȢŷB"; $dat_response_msg = "<p>2ch info - »ñÈÂorXbhȢŷ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}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&kakolog={$_GET['kakolog']}&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"; // WEBT[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ÌXbhîñðæ¾Å«Ü¹ñŵ½B</b>'; + $diedat_msg = '<p><b>rep2 info: ÂT[o©çÅVÌXbhîñðæ¾Å«Ü¹ñŵ½B</b>'; if ($hosts = $this->scanOriginalHosts()) { $common_q = '&bbs=' . rawurldecode($this->bbs) . '&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}&bbs={$this->bbs}&key={$this->key}&ls={$this->ls}&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©ç¼ÌzXgóâðoµÜµ½B'; + $hostlist_ht = '<br>dat©ç¼ÌzXgóâð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 - ^|ÅÌXbhæ¾É¸sµÜµ½B{$marutori_ht}</p> +<p>rep2 info: ^|ÅÌXbhæ¾É¸sµÜµ½B{$marutori_ht}</p> <form action="{$_conf['read_php']}" method="get"> zXgð - <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{fBðfR[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() ÅWJ + $body = http_inflate($body); + } else { + // gzip tempt@CÉÛ¶EPHPÅðÇÝÝ + 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>gzipWJG[</strong><br>'; + $msg .= sprintf('rep2 error: <a href="%s"%s>%s</a> ðgzipfR[hūܹñŵ½B', + P2Util::throughIme($url), + $_conf['ext_win_target_at'], + htmlspecialchars($url, ENT_QUOTES, 'Shift_JIS', false)); + $msg .= '</p>'; + + P2Util::pushInfoHtml($msg); + } + + return $body; + } + + // }}} + // {{{ _pushInfoConnectionTimedOut() + + /** + * Ú±ª^CAEgµ½|ÌbZ[WðvbV ·é + * + * @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() + + /** + * ÇÝݪ^CAEgµ½|ÌbZ[WðvbV ·é + * + * @param string $url + * @return void + */ + protected function _pushInfoReadTimedOut($url) + { + global $_conf; + + $msg = '<p class="info-msg"><strong>HTTPÚ±^CAEg</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() Ì^CAEgb + * + * @var int + */ + private $_readTimeout = -1; + + /** * fsockopen() É@Zqðt¯ÄAG[ð}§·éÈç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è³êÄ¢êÎXSLTvZbTª©®Å @@ -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: AtomtB[hðÇÞÉÍPHPÌXSLT@\g£Ü½ÍXSL@\g£ªKvÅ·B</p>'; + P2Util::pushInfoHtml('<p>p2 error: AtomtB[hðÇÞÉÍPHPÌXSL@\g£ªKvÅ·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; // Û¶pfBNgªÈ¯êÎÂé 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 @@ // {{{ wb_ $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 @@ // {{{ wb_ +$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() +/** + * ^CAEg`FbN«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&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[ð`FbNA»è 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ͼppÅü͵ĺ³¢B</p>"; + P2Util::pushInfoHtml("<p class=\"info-msg\">rep2 error: u{$p_str['user']}v¼Æu{$p_str['password']}vͼppÅü͵ĺ³¢B</p>"); $show_login_form_flag = true; // }}} @@ -275,7 +275,7 @@ // VKo^¬÷ $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) . "ÌXLðíµÜµ½</p>"; + P2Util::pushInfoHtml('<p>p2 info: ' . count($rmnums) . 'ÌXLðíµÜµ½</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ƵijøÅ·B</p>"; + P2Util::pushInfoHtml("<p>p2 info: u{$url_ht}vÍÂÌURLƵijøÅ·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} È~ÉAbvf[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 @@ // üÍ`FbN if (!preg_match('/^[0-9A-Za-z_]+$/', $new_login_pass)) { - $_info_msg_ht .= "<p>rep2 error: {$p_str['password']}ð¼ppÅü͵ĺ³¢B</p>"; + P2Util::pushInfoHtml("<p>rep2 error: {$p_str['password']}ð¼ppÅü͵ĺ³¢B</p>"); } elseif ($new_login_pass != $_POST['form_new_login_pass2']) { - $_info_msg_ht .= "<p>rep2 error: {$p_str['password']} Æ {$p_str['password']} (mF) ªêvµÜ¹ñŵ½B</p>"; + P2Util::pushInfoHtml("<p>rep2 error: {$p_str['password']} Æ {$p_str['password']} (mF) ªêvµÜ¹ñŵ½B</p>"); // pX[hÏXo^ðs¤ } else { @@ -73,7 +73,7 @@ flock($fp, LOCK_UN); fclose($fp); - $_info_msg_ht .= '<p>FØpX[hðÏXo^µÜµ½</p>'; + P2Util::pushInfoHtml('<p>FØpX[hðÏXo^µÜµ½</p>'); } } @@ -160,18 +160,20 @@ if ($_login->checkUserPwWithCid($_COOKIE['cid'])) { if ($_REQUEST['regist_cookie'] == '1') { - $_info_msg_ht .= '<p>cookieFØo^®¹</p>'; + $info_msg_ht = '<p>cookieFØo^®¹</p>'; } else { - $_info_msg_ht .= '<p>~cookieFØð¸s</p>'; + $info_msg_ht = '<p>~cookieFØð¸s</p>'; } } else { if ($_REQUEST['regist_cookie'] == '1') { - $_info_msg_ht .= '<p>~cookieFØo^¸s</p>'; + $info_msg_ht = '<p>~cookieFØo^¸s</p>'; } else { - $_info_msg_ht .= '<p>cookieFØð®¹</p>'; + $info_msg_ht = '<p>cookieFØð®¹</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(); //================================================================ // 2chOCtH[ 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">Xg</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ÉÂðvg·é @@ -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(); //============================================================== // ZbgØèÖ¦tH[ð\¦ 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 @@ // }}} // WEBT[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; // vgpÏ =============== 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ðNbNµÄàÄǵȢdlÉÎR·é_~[NG[ //$_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(); // wb_ª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 @@ } // CtHbZ[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¿µ½Xbh Ú[ñð©®ðµÜµ½ - $ks</div>"; + if ($ks) { + P2Util::pushInfoHtml("<p>p2 info: DAT¿µ½Xbh Ú[ñð©®ðµÜµ½ - {$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; // îñbZ[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>";