svnno****@sourc*****
svnno****@sourc*****
2010年 1月 16日 (土) 04:28:32 JST
Revision: 783 http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=783 Author: akid Date: 2010-01-16 04:28:32 +0900 (Sat, 16 Jan 2010) Log Message: ----------- rep2 version 1.8.60 conf.inc.phpããåé¢ãã¦ãconf_system.inc.phpãæ°ãã«è¿½å ããã ä»ãç´°ããªæ´æ°ã Modified Paths: -------------- p2/trunk/conf/conf.inc.php p2/trunk/conf/conf_user_def.inc.php p2/trunk/conf/conf_user_style.inc.php p2/trunk/doc/ChangeLog.txt p2/trunk/edit_aborn_word.php p2/trunk/edit_conf_user.php p2/trunk/edit_conf_user_i.php p2/trunk/iphone/read_footer_k.inc.php p2/trunk/iphone/sb_footer_k.inc.php p2/trunk/iphone/sb_header_k.inc.php p2/trunk/iui/iuix.css p2/trunk/js/post_form.js p2/trunk/lib/Login.php p2/trunk/lib/P2Util.php p2/trunk/lib/P2View.php p2/trunk/lib/login_first.inc.php p2/trunk/post.php p2/trunk/read_new_i.php p2/trunk/setting.php Added Paths: ----------- p2/trunk/conf/conf_system.inc.php -------------- next part -------------- Modified: p2/trunk/conf/conf.inc.php =================================================================== --- p2/trunk/conf/conf.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/conf/conf.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -4,108 +4,18 @@ ±Ìt@CÍVXeàÝèpÅ·BÁÉR̳¢ÀèÏXµÈ¢Åº³¢B [UÝèÍAuEUã©çu[UÝèÒWvÅÏXÂ\Å·B - ÇÒü¯ÝèÍ conf/conf_admin.inc.php ð¼Ú«·¦Äº³¢B + ÇÒü¯ÝèÍt@C conf/conf_admin.inc.php ð¼Ú«·¦Äº³¢B */ -$_conf['p2version'] = '1.8.59'; // rep2Ìo[W -$_conf['p2name'] = 'rep2'; // rep2̼OB - -$_conf['p2uaname'] = 'r e p 2'; // UApÌrep2̼O - -//====================================================================== -// î{Ýè -//====================================================================== -// G[oÍÝè -_setErrorReporting(); // error_reporting() - -// {{{ î{Ï - -$_conf['p2web_url'] = 'http://akid.s17.xrea.com/'; -$_conf['p2ime_url'] = 'http://akid.s17.xrea.com/p2ime.phtml'; -$_conf['favrank_url'] = 'http://akid.s17.xrea.com/favrank/favrank.php'; -$_conf['menu_php'] = 'menu.php'; -$_conf['subject_php'] = 'subject.php'; // subject_i.php -$_conf['read_php'] = 'read.php'; -$_conf['read_new_php'] = 'read_new.php'; -$_conf['read_new_k_php'] = 'read_new_k.php'; -$_conf['post_php'] = 'post.php'; -$_conf['cookie_file_name'] = 'p2_cookie.txt'; -$_conf['menu_k_php'] = 'menu_k.php'; // menu_i.php -$_conf['editpref_php'] = 'editpref.php'; // editpref_i.php - -// info.php ÍJavaScriptt@CÉ©êÄ¢é̪ï - -// }}} - -// fobOpÏðÝè -_setDebug(); // void $GLOBALS['debug'], $GLOBALS['profiler'] - -// PHPÌ®ì«ðmF -_checkPHPInstalled(); // void|die - -// PHPÌ«Ýè -_setPHPEnvironments(); - -// p2ÌfBNgpXèðÝè·é -_setP2DirConstants(); // P2_LIB_DIR - -require_once P2_LIB_DIR . '/global.funcs.php'; - -// õpXðZbg -_iniSetIncludePath(); // void - -// PEARCuðÇÝÞ -_includePears(); // void|die - -// PEAR::PHP_CompatÅPHP5Ý·ÌÖðÇÝÞ -_loadPHPCompat(); - -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'P2Util.php'; -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'DataPhp.php'; -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'Session.php'; -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'Login.php'; -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'UA.php'; -require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'P2View.php'; - -// }}} - -// tH[©çÌüÍiPOST, GETjðêŶR[hÏ·Tj^CY -_convertEncodingAndSanitizePostGet(); - -// ÇÒpÝèðÇÝÝ -if (!include_once './conf/conf_admin.inc.php') { - P2Util::printSimpleHtml("p2 error: ÇÒpÝèt@CðÇÝßܹñŵ½B"); - die; +// VXeÝèðÇÝÝ +if (!include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'conf_system.inc.php') { + die("p2 error: ÇÒpÝèt@CðÇÝßܹñŵ½B"); } -ini_set('default_socket_timeout', $_conf['fsockopen_time_limit']); +// ȺA[UÎÛÌÝè +//iconf_user.inc.phpðìÁÄÜÆß½¢ªAÌgÁÄ¢½t@C¼Æ©ÔéÌÅÀÁÄ¢éj -// ÇpÛ¶fBNg (p[~bVÍ707) -$_conf['admin_dir'] = $_conf['data_dir'] . '/admin'; - -// cache Û¶fBNg (p[~bVÍ707) -$_conf['cache_dir'] = $_conf['data_dir'] . '/cache'; // 2005/6/29 $_conf['pref_dir'] . '/p2_cache' æèÏX - -// e|fBNg (p[~bVÍ707) -$_conf['tmp_dir'] = $_conf['data_dir'] . '/tmp'; - -$_conf['accesskey_for_k'] = 'accesskey'; - -// [»è -_checkBrowser(); // $_conf, UA::setForceMode() - -// b=pc ÍܾSÄÌNÖÌÇÁª®¹µÄ¨ç¸A@\µÄ¢È¢Óª éBn¹É®õµÄ¢«½¢B -// output_add_rewrite_var() ÍÖ¾ªAoͪobt@³êÄÌ´¬xª¿é̪ï_BB -// Ì´¬xðƳȢǢû@È¢©ÈH -_setOldStyleKtaiQuery(); // $_conf['ktai'] ðZbg - -// $_conf['expack.use_pecl_http'] ̲® -_adjustConfUsePeclHttp(); // UA::isK() - -//====================================================================== -// [todo]VXeÝèªÆ[UÉÖíéªÌÝèÍt@Cª£µ½¢ - // {{{ [UÝè Ç // ftHgÝèiconf_user_def.inc.phpjðÇÝÞ @@ -218,12 +128,14 @@ //====================================================================== // ÏÝè //====================================================================== +$_conf['cookie_dir'] = $_conf['pref_dir'] . '/p2_cookie'; // cookie Û¶fBNg + // ÅßÇñ¾X $_conf['recent_file'] = $_conf['pref_dir'] . '/p2_recent.idx'; // Ý·p -$_conf['recent_idx'] = $_conf['recent_file']; +$_conf['recent_idx'] = $_conf['recent_file']; -$_conf['res_hist_idx'] = $_conf['pref_dir'] . '/p2_res_hist.idx'; // «ÝO (idx) +$_conf['res_hist_idx'] = $_conf['pref_dir'] . '/p2_res_hist.idx'; // «ÝO (idx) // «ÝOt@Cidatj $_conf['p2_res_hist_dat'] = $_conf['pref_dir'] . '/p2_res_hist.dat'; @@ -234,8 +146,6 @@ // «ÝOt@Cidatj ZL eBÊñp $_conf['p2_res_hist_dat_secu'] = $_conf['pref_dir'] . '/p2_res_hist.secu.cgi'; -$_conf['cookie_dir'] = $_conf['pref_dir'] . '/p2_cookie'; // cookie Û¶fBNg - $_conf['favlist_file'] = $_conf['pref_dir'] . '/p2_favlist.idx'; // Ý·p $_conf['favlist_idx'] = $_conf['favlist_file']; @@ -285,6 +195,8 @@ $_p2session = _startSession(); // OCNXÌCX^X¶¬iOC[Uªwè³êĢȯêÎA±Ì_ÅOCtH[\¦Éj +// i[todo]±ÌðãÉÁÄs«½¢ªA[U[OC©VKo^Ǥ©ÌæʪūÈÈéB +// login_first.inc.phpÌfile_exists($_conf['auth_user_file']) ÅVKo^©Ç¤©ð»èµÄ¢éÌðüßéKvª é) $_login = new Login; // ±Ìt@CàÅÌͱ±ÜÅ @@ -295,348 +207,8 @@ //============================================================================= /** - * ÄAIÉstripslashesð©¯é - * GET/POST/COOKIEÏpÈÌÅIuWFNgÌvpeBÉÍεȢ - * (ExUtil) - * - * @return array|string - */ -function stripslashesR($var, $r = 0) -{ - $rlimit = 10; - if (is_array($var) && $r < $rlimit) { - foreach ($var as $key => $value) { - $var[$key] = stripslashesR($value, ++$r); - } - } elseif (is_string($var)) { - $var = stripslashes($var); - } - return $var; -} - -/** - * ÄAIÉk¶ðí·é - * mbstringÅÏ·e[uÉÈ¢(?)OðÏ··éÆ - * NULL(0x00)ÉÈÁĵܤ±Æª éÌÅÁ·é - * (ExUtil) - * - * @return array|string - */ -function nullfilterR($var, $r = 0) -{ - $rlimit = 10; - if (is_array($var) && $r < $rlimit) { - foreach ($var as $key => $value) { - $var[$key] = nullfilterR($value, ++$r); - } - } elseif (is_string($var)) { - $var = str_replace(chr(0), '', $var); - } - return $var; -} - -/** - * ÌgpÊð\¦·é - * * @return void */ -function printMemoryUsage() -{ - $kb = memory_get_usage() / 1024; - $kb = number_format($kb, 2, '.', ''); - - echo 'Memory Usage: ' . $kb . 'KB'; -} - -/** - * G[oÍÝèBerror_reporting() - * iNOTICEÍí¸¾ªAܾcÁÄ¢éÆv¤j - * - * @return void - */ -function _setErrorReporting() -{ - $except = E_NOTICE; - if (defined('E_STRICT')) { - $except = $except | E_STRICT; - } - if (defined('E_DEPRECATED')) { - $except = $except | E_DEPRECATED; - } - error_reporting(E_ALL & ~$except); -} - -/** - * §Àl̺ÀÝè(M) - * Ýèlªwèl¢ÈçwèlÉø«ã°ÄÝè·é - * - * @return void - */ -function _setMemoryLimit($least_memory_limit_m = 32) -{ - if (preg_match('/^(\\d+)M$/', ini_get('memory_limit'), $m)) { - if ($m[1] < $least_memory_limit_m) { - ini_set('memory_limit', $least_memory_limit_m . 'M'); - } - } -} - -/** - * XNvgÌÀsÔ§À̺ÀÝè(b) - * Ýèlªwèb¢ÈçwèbÉø«ã°ÄÝè·é - * - * @return void - */ -function _setTimeLimit($least_time_limit = 60) -{ - if ($t = ini_get('max_execution_time') and 0 < $t && $t < $least_time_limit) { - if (!ini_get('safe_mode')) { - set_time_limit($least_time_limit); - } - } -} - -/** - * @return void $GLOBALS['debug'], $GLOBALS['profiler'] - */ -function _setDebug($debug = null) -{ - if (is_null($debug)) { - $GLOBALS['debug'] = isset($_GET['debug']) ? intval($_GET['debug']) : 0; - } else { - $GLOBALS['debug'] = $debug; - } - if ($GLOBALS['debug']) { - require_once 'Benchmark/Profiler.php'; - $GLOBALS['profiler'] = new Benchmark_Profiler(true); - - // 2007/08/03 Benchmark_Profiler 1.2.7 Å _Benchmark_Profiler ÌPEAR®fXgN^ªÈÈÁÄA - // close() Ìè®\bhÉÈÁ½HÌÅAè®Åo^µÄÝéBÈñ©ÏÈCª·é¯ÇB - if (!method_exists($GLOBALS['profiler'], '_Benchmark_Profiler') && method_exists($GLOBALS['profiler'], 'close')) { - register_shutdown_function(array($GLOBALS['profiler'], 'close')); - } - - // printMemoryUsage(); - register_shutdown_function('printMemoryUsage'); - } -} - -/** - * ¶R[hÌwè - * - * @return void - */ -function _setEncodings() -{ - // mb_detect_order("SJIS-win,eucJP-win,ASCII"); - mb_internal_encoding('SJIS-win'); - mb_http_output('pass'); - mb_substitute_character(63); // ¶R[hϷɸsµ½¶ª "?" ÉÈé - //mb_substitute_character(0x3013); // ¬ - - ini_set('default_mimetype', 'text/html'); - ini_set('default_charset', 'Shift_JIS'); - - if (function_exists('mb_ereg_replace')) { - define('P2_MBREGEX_AVAILABLE', 1); - @mb_regex_encoding('SJIS-win'); - } else { - define('P2_MBREGEX_AVAILABLE', 0); - } -} - -/** - * õpXðZbg·é - * P2_PEAR_HACK_DIR, P2_PEAR_DIR - * - * @return void - */ -function _iniSetIncludePath() -{ - $include_path = '.'; - if (is_dir(P2_PEAR_HACK_DIR)) { - $include_path .= PATH_SEPARATOR . realpath(P2_PEAR_HACK_DIR); - } - $include_path .= PATH_SEPARATOR . ini_get('include_path'); - if (is_dir(P2_PEAR_DIR)) { - $include_path .= PATH_SEPARATOR . realpath(P2_PEAR_DIR); - } - //$include_path .= PATH_SEPARATOR . realpath(P2_LIB_DIR); - ini_set('include_path', $include_path); -} - -/** - * PHPÌ®ì«ðmF - * - * @return void|die - */ -function _checkPHPInstalled() -{ - $errmsgs = array(); - if (version_compare(phpversion(), '4.3.0', 'lt')) { - $errmsgs[] = 'PHPÌo[Wª4.3.0¢ÅÍg¦Ü¹ñB'; - } - if (ini_get('safe_mode')) { - $errmsgs[] = 'Z[t[hÅ®ì·éPHPÅÍg¦Ü¹ñB'; - } - if (!extension_loaded('mbstring')) { - $errmsgs[] = 'PHPÌCXg[ªs\ªÅ·BPHPÌmbstringg£W [ª[h³êĢܹñB'; - } - if ($errmsgs) { - $errmsgHtmls = array_map('htmlspecialchars', $errmsgs); - die(sprintf( - '<html><body><h3>p2 install error</h3><p>%s</p></body></html>', - implode('<br>', $errmsgHtmls) - )); - } -} - -/** - * PHPÌ«Ýè - * - * @return void - */ -function _setPHPEnvironments() -{ - // ^C][ðZbg - _setTimezone(); - - // §Àl̺ÀÝè(M) - // Ýèlªwèl¢ÈçwèlÉø«ã°ÄÝè·é - _setMemoryLimit(32); - - // XNvgÌÀsÔ§À̺ÀÝè(b) - // Ýèlªwèb¢ÈçwèbÉø«ã°ÄÝè·é - _setTimeLimit(60); - - // ©®tbV ðItÉ·é - ob_implicit_flush(0); - - // NCAg©çÚ±ðØçêÄàð±s·é - // ignore_user_abort(1); - - // session.trans_sidLø â output_add_rewrite_var(), http_build_query() Ŷ¬EÏX³êé - // URLÌGETp[^æØè¶(ñ)ð"&"É·éBiftHgÍ"&"j - ini_set('arg_separator.output', '&'); - - // NGXgIDðÝè - define('P2_REQUEST_ID', substr($_SERVER['REQUEST_METHOD'], 0, 1) . md5(serialize($_REQUEST))); - - // OSÊÌèðâ®Zbg·éBPATH_SEPARATOR, DIRECTORY_SEPARATOR - _setOSDefine(); - - // ¶R[hÌwè - _setEncodings(); -} - -/** - * p2ÌfBNgpXèðÝè·é - * - * @return void - */ -function _setP2DirConstants() -{ - define('P2_CONF_DIR', dirname(__FILE__)); // __DIR__ @php-5.3 - - define('P2_BASE_DIR', dirname(P2_CONF_DIR)); - - // î{IÈ@\ðñ·éCu - define('P2_LIB_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'lib'); - - // ¨Ü¯IÈ@\ðñ·éCu - define('P2EX_LIB_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'expack'); - - // X^CV[g - define('P2_STYLE_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'style'); - - // XL - define('P2_SKIN_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'skin'); - - // PEARCXg[fBNgAõpXÉÇÁ³êé - define('P2_PEAR_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'includes'); - - // PEARðnbNµ½t@CpfBNgAÊíÌPEARæèDæIÉõpXÉÇÁ³êé - // Cache/Container/db.php(PEAR::Cache)ªMySQLè¾Á½ÌÅAÄpIɵ½àÌðu¢Ä¢é - define('P2_PEAR_HACK_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'pear_hack'); -} - -/** - * @return void - */ -function _setTimezone() -{ - if (function_exists('date_default_timezone_set')) { - date_default_timezone_set('Asia/Tokyo'); - } else { - @putenv('TZ=JST-9'); - } -} - -/** - * PEARCuðÇÝÞ - * - * @return void|die - */ -function _includePears() -{ - global $_conf; - - $requiredPears = array( - 'File/Util.php' => 'File', - 'Net/UserAgent/Mobile.php' => 'Net_UserAgent_Mobile', - 'PHP/Compat.php' => 'PHP_Compat', - 'HTTP/Request.php' => 'HTTP_Request' - ); - foreach ($requiredPears as $pear_file => $pear_pkg) { - if (!include_once($pear_file)) { - $url = 'http://akid.s17.xrea.com/p2puki/pukiwiki.php?PEAR%A4%CE%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB'; - $url_t = $_conf['p2ime_url'] . '?enc=1&url=' . rawurlencode($url); - die(sprintf( - '<html><body> - <h3>p2 install error: PEAR Ìu%svªCXg[³êĢܹñ</h3> - <p><a href="%s" target="_blank">p2Wiki: PEARÌCXg[</a></p> - </body></html>', - hs($pear_pkg), hs($url_t) - )); - } - } -} - -/** - * @return void - */ -function _loadPHPCompat() -{ - if (version_compare(phpversion(), '5.0.0', '<')) { - PHP_Compat::loadFunction('file_put_contents'); - //PHP_Compat::loadFunction('clone'); - PHP_Compat::loadFunction('scandir'); - //PHP_Compat::loadFunction('http_build_query'); // æ3øÉηéÜÅÍg¦È¢ - //PHP_Compat::loadFunction('array_walk_recursive'); - } -} - -/** - * OSÊÌèðâ®Zbg·é - * - * @return void - */ -function _setOSDefine() -{ - // OS»è - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - // Windows - defined('PATH_SEPARATOR') or define('PATH_SEPARATOR', ';'); - defined('DIRECTORY_SEPARATOR') or define('DIRECTORY_SEPARATOR', '\\'); - } else { - defined('PATH_SEPARATOR') or define('PATH_SEPARATOR', ':'); - defined('DIRECTORY_SEPARATOR') or define('DIRECTORY_SEPARATOR', '/'); - } -} - -/** - * @return void - */ function _setStyle() { global $_conf, $STYLE, $MYSTYLE; @@ -669,30 +241,6 @@ } /** - * tH[©çÌüÍðêÅNH[g¶R[hÏ· - * tH[Ìaccept-encoding®«ðUTF-8(Safarin) or Shift_JIS(»Ì¼)ɵA - * ³çÉhiddenvfÅüûe[u̶ðdÞ±ÆÅë»èð¸ç· - * Ï·³óâÉeucJP-winª éÌÍHTTPüÍ̶R[hªEUCÉ©®Ï·³êéT[oÌ½ß - */ -function _convertEncodingAndSanitizePostGet() -{ - if (!empty($_POST)) { - if (get_magic_quotes_gpc()) { - $_POST = array_map('stripslashesR', $_POST); - } - mb_convert_variables('SJIS-win', 'UTF-8,eucJP-win,SJIS-win', $_POST); - $_POST = array_map('nullfilterR', $_POST); - } - if (!empty($_GET)) { - if (get_magic_quotes_gpc()) { - $_GET = array_map('stripslashesR', $_GET); - } - mb_convert_variables('SJIS-win', 'UTF-8,eucJP-win,SJIS-win', $_GET); - $_GET = array_map('nullfilterR', $_GET); - } -} - -/** * 2006-02-27 `®t@Cª êÎÏ·µÄRs[ * * @return void @@ -710,144 +258,6 @@ } /** - * [»è - * - * @return void - */ -function _checkBrowser() -{ - global $_conf; - - // î{iPCj - $_conf['ktai'] = false; - $_conf['disable_cookie'] = false; - - if (UA::isSafariGroup()) { - $_conf['accept_charset'] = 'UTF-8'; - } else { - $_conf['accept_charset'] = 'Shift_JIS'; - } - - $mobile = &Net_UserAgent_Mobile::singleton(); - if (PEAR::isError($mobile)) { - trigger_error($mobile->toString(), E_USER_WARNING); - - // UAªgÑÈç - } elseif ($mobile and !$mobile->isNonMobile()) { - - $_conf['ktai'] = true; - $_conf['disable_cookie'] = false; - $_conf['accept_charset'] = 'Shift_JIS'; - - // x_»è - // docomo i-Mode - if ($mobile->isDoCoMo()) { - // [todo] docomoÌVµ¢ÌÍCookieàg¦éc - $_conf['disable_cookie'] = true; - - // EZweb (au or Tu-Ka) - } elseif ($mobile->isEZweb()) { - $_conf['disable_cookie'] = false; - - // SoftBank(Vodafone Live!) - } elseif ($mobile->isSoftBank()) { - //$_conf['accesskey_for_k'] = 'DIRECTKEY'; - // W^[Æ3GC^[ÍCookieªg¦é - if ($mobile->isTypeW() || $mobile->isType3GC()) { - $_conf['disable_cookie'] = false; - } else { - $_conf['disable_cookie'] = true; - } - - // WILLCOMiAirH"Phonej - } elseif ($mobile->isWillcom()) { - $_conf['disable_cookie'] = false; - } - } - - // iPhonewè - if (UA::isIPhoneGroup()) { - $_conf['ktai'] = true; - UA::setForceMode(UA::getMobileQuery()); - - define('P2_IPHONE_LIB_DIR', './iphone'); - - $_conf['subject_php'] = 'subject_i.php'; - $_conf['read_new_k_php'] = 'read_new_i.php'; - $_conf['menu_k_php'] = 'menu_i.php'; - $_conf['editpref_php'] = 'editpref_i.php'; - } -} - -/** - * X^CÌgÑr [Ï $_conf['ktai'] ðZbg - * - * @return void - */ -function _setOldStyleKtaiQuery() -{ - global $_conf; - - $b = UA::getQueryKey(); - - // ?k=1ÍdlB?b=kªVµ¢B - // ãûÝ·p[u - if (!empty($_GET['k']) || !empty($_POST['k'])) { - $_REQUEST[$b] = $_GET[$b] = 'k'; - } - - // $_conf[$b]i$_conf['b']j àgíÈ¢æ¤ÉµÄAUA::getQueryValue()ðp·éûüB - $_conf[$b] = UA::getQueryValue(); - - // $_conf['ktai'] ÍgíÈ¢ûüB - // UA::isK(), UA::isPC() ðp·éB - - // §PCr [wèib=pcj - if (UA::isPCByQuery()) { - $_conf['ktai'] = false; - - // §gÑr [wèib=kj - } elseif (UA::isMobileByQuery()) { - $_conf['ktai'] = true; - } - - // «k_at_a, k_at_q, k_input_ht ÍgíÈ¢ûüB - // UA::getQueryKey(), UA::getQueryValue(), P2View::getInputHiddenKTag() ðp·éB - $_conf['k_at_a'] = ''; - $_conf['k_at_q'] = ''; - $_conf['k_input_ht'] = ''; - if ($_conf[$b]) { - //output_add_rewrite_var($b, htmlspecialchars($_conf[$b], ENT_QUOTES)); - - $b_hs = hs($_conf[$b]); - $_conf['k_at_a'] = "&{$b}={$b_hs}"; - $_conf['k_at_q'] = "?{$b}={$b_hs}"; - $_conf['k_input_ht'] = P2View::getInputHiddenKTag(); - } -} - -/** - * $_conf['expack.use_pecl_http'] ̲® - * - * @return void - */ -function _adjustConfUsePeclHttp() -{ - global $_conf; - - if ( - version_compare(phpversion(), '5.0.0', '<') - or $_conf['expack.use_pecl_http'] && !extension_loaded('http') - ) { - //if (!($_conf['expack.use_pecl_http'] == 2 && $_conf['expack.dl_pecl_http'])) { - $_conf['expack.use_pecl_http'] = 0; - //} - } elseif ($_conf['expack.use_pecl_http'] == 3 && UA::isK()) { - $_conf['expack.use_pecl_http'] = 1; - } -} - -/** * @return Session|null|die */ function _startSession() @@ -897,11 +307,9 @@ return new Session; } - return null; } - /* * Local Variables: * mode: php Added: p2/trunk/conf/conf_system.inc.php =================================================================== --- p2/trunk/conf/conf_system.inc.php (rev 0) +++ p2/trunk/conf/conf_system.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -0,0 +1,610 @@ +<?php +// p2 VXeÝè +// ±Ìt@CÍAÁÉR̳¢ÀèÏXµÈ¢Åº³¢B +// include from conf.inc.php + +$_conf['p2version'] = '1.8.60'; // rep2Ìo[W + +$_conf['p2name'] = 'rep2'; // rep2̼OB + +$_conf['p2uaname'] = 'r e p 2'; // UApÌrep2̼O + +//====================================================================== +// î{Ýè +//====================================================================== +// G[oÍÝè +_setErrorReporting(); // error_reporting() + +// {{{ î{Ï + +$_conf['p2web_url'] = 'http://akid.s17.xrea.com/'; +$_conf['p2ime_url'] = 'http://akid.s17.xrea.com/p2ime.phtml'; +$_conf['favrank_url'] = 'http://akid.s17.xrea.com/favrank/favrank.php'; +$_conf['menu_php'] = 'menu.php'; +$_conf['subject_php'] = 'subject.php'; // subject_i.php +$_conf['read_php'] = 'read.php'; +$_conf['read_new_php'] = 'read_new.php'; +$_conf['read_new_k_php'] = 'read_new_k.php'; +$_conf['post_php'] = 'post.php'; +$_conf['cookie_file_name'] = 'p2_cookie.txt'; +$_conf['menu_k_php'] = 'menu_k.php'; // menu_i.php +$_conf['editpref_php'] = 'editpref.php'; // editpref_i.php + +// info.php ÍJavaScriptt@CÉ©êÄ¢é̪ï + +// }}} + +// fobOpÏðÝè +_setDebug(); // void $GLOBALS['debug'], $GLOBALS['profiler'] + +// PHPÌ®ì«ðmF +_checkPHPInstalled(); // void|die + +// PHPÌ«Ýè +_setPHPEnvironments(); + +// p2ÌfBNgpXèðÝè·é +_setP2DirConstants(); // P2_LIB_DIR + +require_once P2_LIB_DIR . '/global.funcs.php'; + +// õpXðZbg +_iniSetIncludePath(); // void + +// PEARCuðÇÝÞ +_includePears(); // void|die + +// PEAR::PHP_CompatÅPHP5Ý·ÌÖðÇÝÞ +_loadPHPCompat(); + +require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'P2Util.php'; +require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'DataPhp.php'; +require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'Session.php'; +require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'Login.php'; +require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'UA.php'; +require_once P2_LIB_DIR . DIRECTORY_SEPARATOR . 'P2View.php'; + +// }}} + +// tH[©çÌüÍiPOST, GETjðêŶR[hÏ·Tj^CY +_convertEncodingAndSanitizePostGet(); + +// ÇÒpÝèðÇÝÝ +if (!include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'conf_admin.inc.php') { + P2Util::printSimpleHtml("p2 error: ÇÒpÝèt@CðÇÝßܹñŵ½B"); + die; +} + +ini_set('default_socket_timeout', $_conf['fsockopen_time_limit']); + +// ÇpÛ¶fBNg (p[~bVÍ707) +$_conf['admin_dir'] = $_conf['data_dir'] . '/admin'; + +// cache Û¶fBNg (p[~bVÍ707) +$_conf['cache_dir'] = $_conf['data_dir'] . '/cache'; // 2005/6/29 $_conf['pref_dir'] . '/p2_cache' æèÏX + +// e|fBNg (p[~bVÍ707) +$_conf['tmp_dir'] = $_conf['data_dir'] . '/tmp'; + +$_conf['accesskey_for_k'] = 'accesskey'; + +// [»è +_checkBrowser(); // $_conf, UA::setForceMode() + +// b=pc ÍܾSÄÌNÖÌÇÁª®¹µÄ¨ç¸A@\µÄ¢È¢Óª éBn¹É®õµÄ¢«½¢B +// output_add_rewrite_var() ÍÖ¾ªAoͪobt@³êÄÌ´¬xª¿é̪ï_BB +// Ì´¬xðƳȢǢû@È¢©ÈH +_setOldStyleKtaiQuery(); // $_conf['ktai'] ðZbg + +// $_conf['expack.use_pecl_http'] ̲® +_adjustConfUsePeclHttp(); // UA::isK() + + +// ±Ìt@CàÅÌͱ±ÜÅ + + +//============================================================================= +// Öi±Ìt@CàÅÌÝpj +//============================================================================= + +/** + * ÄAIÉstripslashesð©¯é + * GET/POST/COOKIEÏpÈÌÅIuWFNgÌvpeBÉÍεȢ + * (ExUtil) + * + * @return array|string + */ +function stripslashesR($var, $r = 0) +{ + $rlimit = 10; + if (is_array($var) && $r < $rlimit) { + foreach ($var as $key => $value) { + $var[$key] = stripslashesR($value, ++$r); + } + } elseif (is_string($var)) { + $var = stripslashes($var); + } + return $var; +} + +/** + * ÄAIÉk¶ðí·é + * mbstringÅÏ·e[uÉÈ¢(?)OðÏ··éÆ + * NULL(0x00)ÉÈÁĵܤ±Æª éÌÅÁ·é + * (ExUtil) + * + * @return array|string + */ +function nullfilterR($var, $r = 0) +{ + $rlimit = 10; + if (is_array($var) && $r < $rlimit) { + foreach ($var as $key => $value) { + $var[$key] = nullfilterR($value, ++$r); + } + } elseif (is_string($var)) { + $var = str_replace(chr(0), '', $var); + } + return $var; +} + +/** + * ÌgpÊð\¦·é + * + * @return void + */ +function printMemoryUsage() +{ + $kb = memory_get_usage() / 1024; + $kb = number_format($kb, 2, '.', ''); + + echo 'Memory Usage: ' . $kb . 'KB'; +} + +/** + * G[oÍÝèBerror_reporting() + * iNOTICEÍí¸¾ªAܾcÁÄ¢éÆv¤j + * + * @return void + */ +function _setErrorReporting() +{ + $except = E_NOTICE; + if (defined('E_STRICT')) { + $except = $except | E_STRICT; + } + if (defined('E_DEPRECATED')) { + $except = $except | E_DEPRECATED; + } + error_reporting(E_ALL & ~$except); +} + +/** + * @return void $GLOBALS['debug'], $GLOBALS['profiler'] + */ +function _setDebug($debug = null) +{ + if (is_null($debug)) { + $GLOBALS['debug'] = isset($_GET['debug']) ? intval($_GET['debug']) : 0; + } else { + $GLOBALS['debug'] = $debug; + } + if ($GLOBALS['debug']) { + require_once 'Benchmark/Profiler.php'; + $GLOBALS['profiler'] = new Benchmark_Profiler(true); + + // 2007/08/03 Benchmark_Profiler 1.2.7 Å _Benchmark_Profiler ÌPEAR®fXgN^ªÈÈÁÄA + // close() Ìè®\bhÉÈÁ½HÌÅAè®Åo^µÄÝéBÈñ©ÏÈCª·é¯ÇB + if (!method_exists($GLOBALS['profiler'], '_Benchmark_Profiler') && method_exists($GLOBALS['profiler'], 'close')) { + register_shutdown_function(array($GLOBALS['profiler'], 'close')); + } + + // printMemoryUsage(); + register_shutdown_function('printMemoryUsage'); + } +} + +/** + * PHPÌ®ì«ðmF + * + * @return void|die + */ +function _checkPHPInstalled() +{ + $errmsgs = array(); + if (version_compare(phpversion(), '4.3.0', 'lt')) { + $errmsgs[] = 'PHPÌo[Wª4.3.0¢ÅÍg¦Ü¹ñB'; + } + if (ini_get('safe_mode')) { + $errmsgs[] = 'Z[t[hÅ®ì·éPHPÅÍg¦Ü¹ñB'; + } + if (!extension_loaded('mbstring')) { + $errmsgs[] = 'PHPÌCXg[ªs\ªÅ·BPHPÌmbstringg£W [ª[h³êĢܹñB'; + } + if ($errmsgs) { + $errmsgHtmls = array_map('htmlspecialchars', $errmsgs); + die(sprintf( + '<html><body><h3>p2 install error</h3><p>%s</p></body></html>', + implode('<br>', $errmsgHtmls) + )); + } +} + +/** + * PHPÌ«Ýè + * + * @return void + */ +function _setPHPEnvironments() +{ + // ^C][ðZbg + _setTimezone(); + + // §Àl̺ÀÝè(M) + // Ýèlªwèl¢ÈçwèlÉø«ã°ÄÝè·é + _setMemoryLimit(32); + + // XNvgÌÀsÔ§À̺ÀÝè(b) + // Ýèlªwèb¢ÈçwèbÉø«ã°ÄÝè·é + _setTimeLimit(60); + + // ©®tbV ðItÉ·é + ob_implicit_flush(0); + + // NCAg©çÚ±ðØçêÄàð±s·é + // ignore_user_abort(1); + + // session.trans_sidLø â output_add_rewrite_var(), http_build_query() Ŷ¬EÏX³êé + // URLÌGETp[^æØè¶(ñ)ð"&"É·éBiftHgÍ"&"j + ini_set('arg_separator.output', '&'); + + // NGXgIDðÝè + define('P2_REQUEST_ID', substr($_SERVER['REQUEST_METHOD'], 0, 1) . md5(serialize($_REQUEST))); + + // OSÊÌèðâ®Zbg·éBPATH_SEPARATOR, DIRECTORY_SEPARATOR + _setOSDefine(); + + // ¶R[hÌwè + _setEncodings(); +} + +/** + * @return void + */ +function _setTimezone() +{ + if (function_exists('date_default_timezone_set')) { + date_default_timezone_set('Asia/Tokyo'); + } else { + @putenv('TZ=JST-9'); + } +} + +/** + * §Àl̺ÀÝè(M) + * Ýèlªwèl¢ÈçwèlÉø«ã°ÄÝè·é + * + * @return void + */ +function _setMemoryLimit($least_memory_limit_m = 32) +{ + if (preg_match('/^(\\d+)M$/', ini_get('memory_limit'), $m)) { + if ($m[1] < $least_memory_limit_m) { + ini_set('memory_limit', $least_memory_limit_m . 'M'); + } + } +} + +/** + * XNvgÌÀsÔ§À̺ÀÝè(b) + * Ýèlªwèb¢ÈçwèbÉø«ã°ÄÝè·é + * + * @return void + */ +function _setTimeLimit($least_time_limit = 60) +{ + if ($t = ini_get('max_execution_time') and 0 < $t && $t < $least_time_limit) { + if (!ini_get('safe_mode')) { + set_time_limit($least_time_limit); + } + } +} + +/** + * OSÊÌèðâ®Zbg·é + * + * @return void + */ +function _setOSDefine() +{ + // OS»è + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + // Windows + defined('PATH_SEPARATOR') or define('PATH_SEPARATOR', ';'); + defined('DIRECTORY_SEPARATOR') or define('DIRECTORY_SEPARATOR', '\\'); + } else { + defined('PATH_SEPARATOR') or define('PATH_SEPARATOR', ':'); + defined('DIRECTORY_SEPARATOR') or define('DIRECTORY_SEPARATOR', '/'); + } +} + +/** + * ¶R[hÌwè + * + * @return void + */ +function _setEncodings() +{ + // mb_detect_order("SJIS-win,eucJP-win,ASCII"); + mb_internal_encoding('SJIS-win'); + mb_http_output('pass'); + mb_substitute_character(63); // ¶R[hϷɸsµ½¶ª "?" ÉÈé + //mb_substitute_character(0x3013); // ¬ + + ini_set('default_mimetype', 'text/html'); + ini_set('default_charset', 'Shift_JIS'); + + if (function_exists('mb_ereg_replace')) { + define('P2_MBREGEX_AVAILABLE', 1); + @mb_regex_encoding('SJIS-win'); + } else { + define('P2_MBREGEX_AVAILABLE', 0); + } +} + +/** + * p2ÌfBNgpXèðÝè·é + * + * @return void + */ +function _setP2DirConstants() +{ + define('P2_CONF_DIR', dirname(__FILE__)); // __DIR__ @php-5.3 + + define('P2_BASE_DIR', dirname(P2_CONF_DIR)); + + // î{IÈ@\ðñ·éCu + define('P2_LIB_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'lib'); + + // ¨Ü¯IÈ@\ðñ·éCu + define('P2EX_LIB_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'expack'); + + // X^CV[g + define('P2_STYLE_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'style'); + + // XL + define('P2_SKIN_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'skin'); + + // PEARCXg[fBNgAõpXÉÇÁ³êé + define('P2_PEAR_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'includes'); + + // PEARðnbNµ½t@CpfBNgAÊíÌPEARæèDæIÉõpXÉÇÁ³êé + // Cache/Container/db.php(PEAR::Cache)ªMySQLè¾Á½ÌÅAÄpIɵ½àÌðu¢Ä¢é + define('P2_PEAR_HACK_DIR', P2_BASE_DIR . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'pear_hack'); +} + +/** + * õpXðZbg·é + * P2_PEAR_HACK_DIR, P2_PEAR_DIR + * + * @return void + */ +function _iniSetIncludePath() +{ + $include_path = '.'; + if (is_dir(P2_PEAR_HACK_DIR)) { + $include_path .= PATH_SEPARATOR . realpath(P2_PEAR_HACK_DIR); + } + $include_path .= PATH_SEPARATOR . ini_get('include_path'); + if (is_dir(P2_PEAR_DIR)) { + $include_path .= PATH_SEPARATOR . realpath(P2_PEAR_DIR); + } + //$include_path .= PATH_SEPARATOR . realpath(P2_LIB_DIR); + ini_set('include_path', $include_path); +} + +/** + * PEARCuðÇÝÞ + * + * @return void|die + */ +function _includePears() +{ + global $_conf; + + $requiredPears = array( + 'File/Util.php' => 'File', + 'Net/UserAgent/Mobile.php' => 'Net_UserAgent_Mobile', + 'PHP/Compat.php' => 'PHP_Compat', + 'HTTP/Request.php' => 'HTTP_Request' + ); + foreach ($requiredPears as $pear_file => $pear_pkg) { + if (!include_once($pear_file)) { + $url = 'http://akid.s17.xrea.com/p2puki/pukiwiki.php?PEAR%A4%CE%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB'; + $url_t = $_conf['p2ime_url'] . '?enc=1&url=' . rawurlencode($url); + die(sprintf( + '<html><body> + <h3>p2 install error: PEAR Ìu%svªCXg[³êĢܹñ</h3> + <p><a href="%s" target="_blank">p2Wiki: PEARÌCXg[</a></p> + </body></html>', + hs($pear_pkg), hs($url_t) + )); + } + } +} + +/** + * @return void + */ +function _loadPHPCompat() +{ + if (version_compare(phpversion(), '5.0.0', '<')) { + PHP_Compat::loadFunction('file_put_contents'); + //PHP_Compat::loadFunction('clone'); + PHP_Compat::loadFunction('scandir'); + //PHP_Compat::loadFunction('http_build_query'); // æ3øÉηéÜÅÍg¦È¢ + //PHP_Compat::loadFunction('array_walk_recursive'); + } +} + +/** + * tH[©çÌüÍðêÅNH[g¶R[hÏ· + * tH[Ìaccept-encoding®«ðUTF-8(Safarin) or Shift_JIS(»Ì¼)ɵA + * ³çÉhiddenvfÅüûe[u̶ðdÞ±ÆÅë»èð¸ç· + * Ï·³óâÉeucJP-winª éÌÍHTTPüÍ̶R[hªEUCÉ©®Ï·³êéT[oÌ½ß + */ +function _convertEncodingAndSanitizePostGet() +{ + if (!empty($_POST)) { + if (get_magic_quotes_gpc()) { + $_POST = array_map('stripslashesR', $_POST); + } + mb_convert_variables('SJIS-win', 'UTF-8,eucJP-win,SJIS-win', $_POST); + $_POST = array_map('nullfilterR', $_POST); + } + if (!empty($_GET)) { + if (get_magic_quotes_gpc()) { + $_GET = array_map('stripslashesR', $_GET); + } + mb_convert_variables('SJIS-win', 'UTF-8,eucJP-win,SJIS-win', $_GET); + $_GET = array_map('nullfilterR', $_GET); + } +} + +/** + * [»è + * + * @return void + */ +function _checkBrowser() +{ + global $_conf; + + // î{iPCj + $_conf['ktai'] = false; + $_conf['disable_cookie'] = false; + + if (UA::isSafariGroup()) { + $_conf['accept_charset'] = 'UTF-8'; + } else { + $_conf['accept_charset'] = 'Shift_JIS'; + } + + $mobile = &Net_UserAgent_Mobile::singleton(); + if (PEAR::isError($mobile)) { + trigger_error($mobile->toString(), E_USER_WARNING); + + // UAªgÑÈç + } elseif ($mobile and !$mobile->isNonMobile()) { + + $_conf['ktai'] = true; + $_conf['disable_cookie'] = false; + $_conf['accept_charset'] = 'Shift_JIS'; + + // x_»è + // docomo i-Mode + if ($mobile->isDoCoMo()) { + // [todo] docomoÌVµ¢ÌÍCookieàg¦éc + $_conf['disable_cookie'] = true; + + // EZweb (au or Tu-Ka) + } elseif ($mobile->isEZweb()) { + $_conf['disable_cookie'] = false; + + // SoftBank(Vodafone Live!) + } elseif ($mobile->isSoftBank()) { + //$_conf['accesskey_for_k'] = 'DIRECTKEY'; + // W^[Æ3GC^[ÍCookieªg¦é + if ($mobile->isTypeW() || $mobile->isType3GC()) { + $_conf['disable_cookie'] = false; + } else { + $_conf['disable_cookie'] = true; + } + + // WILLCOMiAirH"Phonej + } elseif ($mobile->isWillcom()) { + $_conf['disable_cookie'] = false; + } + } + + // iPhonewè + if (UA::isIPhoneGroup()) { + $_conf['ktai'] = true; + UA::setForceMode(UA::getMobileQuery()); + + define('P2_IPHONE_LIB_DIR', './iphone'); + + $_conf['subject_php'] = 'subject_i.php'; + $_conf['read_new_k_php'] = 'read_new_i.php'; + $_conf['menu_k_php'] = 'menu_i.php'; + $_conf['editpref_php'] = 'editpref_i.php'; + } +} + +/** + * X^CÌgÑr [Ï $_conf['ktai'] ðZbg + * + * @return void + */ +function _setOldStyleKtaiQuery() +{ + global $_conf; + + $b = UA::getQueryKey(); + + // ?k=1ÍdlB?b=kªVµ¢B + // ãûÝ·p[u + if (!empty($_GET['k']) || !empty($_POST['k'])) { + $_REQUEST[$b] = $_GET[$b] = 'k'; + } + + // $_conf[$b]i$_conf['b']j àgíÈ¢æ¤ÉµÄAUA::getQueryValue()ðp·éûüB + $_conf[$b] = UA::getQueryValue(); + + // $_conf['ktai'] ÍgíÈ¢ûüB + // UA::isK(), UA::isPC() ðp·éB + + // §PCr [wèib=pcj + if (UA::isPCByQuery()) { + $_conf['ktai'] = false; + + // §gÑr [wèib=kj + } elseif (UA::isMobileByQuery()) { + $_conf['ktai'] = true; + } + + // «k_at_a, k_at_q, k_input_ht ÍgíÈ¢ûüB + // UA::getQueryKey(), UA::getQueryValue(), P2View::getInputHiddenKTag() ðp·éB + $_conf['k_at_a'] = ''; + $_conf['k_at_q'] = ''; + $_conf['k_input_ht'] = ''; + if ($_conf[$b]) { + //output_add_rewrite_var($b, htmlspecialchars($_conf[$b], ENT_QUOTES)); + + $b_hs = hs($_conf[$b]); + $_conf['k_at_a'] = "&{$b}={$b_hs}"; + $_conf['k_at_q'] = "?{$b}={$b_hs}"; + $_conf['k_input_ht'] = P2View::getInputHiddenKTag(); + } +} + +/** + * $_conf['expack.use_pecl_http'] ̲® + * + * @return void + */ +function _adjustConfUsePeclHttp() +{ + global $_conf; + + if ( + version_compare(phpversion(), '5.0.0', '<') + or $_conf['expack.use_pecl_http'] && !extension_loaded('http') + ) { + //if (!($_conf['expack.use_pecl_http'] == 2 && $_conf['expack.dl_pecl_http'])) { + $_conf['expack.use_pecl_http'] = 0; + //} + } elseif ($_conf['expack.use_pecl_http'] == 3 && UA::isK()) { + $_conf['expack.use_pecl_http'] = 1; + } +} Modified: p2/trunk/conf/conf_user_def.inc.php =================================================================== --- p2/trunk/conf/conf_user_def.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/conf/conf_user_def.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -4,7 +4,8 @@ ±Ìt@CÍftHglÌÝèÈÌÅAÁÉÏX·éKvÍ èܹñ - $conf_user_def ÍÇglobalÏƵÄpµÄµÜÁÄ¢é + $conf_user_def, $conf_user_rules, $conf_user_sel ÌÝè + i$conf_user_def ÍÇglobalÏƵÄpµÄµÜÁÄ¢éj */ // {{{ ¡be.2ch.netAJEg @@ -308,7 +309,7 @@ $conf_user_def['res_write_rec'] = 1; // (1) $conf_user_sel['res_write_rec'] = array('1' => '·é', '0' => 'µÈ¢'); -// OURLWv·éÛÉÊ·Q[gB +// OURLWv·éÛÉÊ·NbVy[W $conf_user_def['through_ime'] = "p2pm"; // ("p2pm") $conf_user_sel['through_ime'] = array( '' => '¼Ú', 'p2' => 'p2 ime(©®])', 'p2m' => 'p2 ime(è®])', 'p2pm' => 'p2 ime(pÌÝè®])', '2ch' => '2ch ime' Modified: p2/trunk/conf/conf_user_style.inc.php =================================================================== --- p2/trunk/conf/conf_user_style.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/conf/conf_user_style.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -6,6 +6,7 @@ ÝèÍ style/*_css.inc ÆA® ±Ìt@CàÅÌÝèÍA¨DÝɶÄÏXµÄ¾³¢ + iPhoneÌX\¦ÌÝèÍAiui/read.cssð¼ÚÒW */ // _setStyle() Modified: p2/trunk/doc/ChangeLog.txt =================================================================== --- p2/trunk/doc/ChangeLog.txt 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/doc/ChangeLog.txt 2010-01-15 19:28:32 UTC (rev 783) @@ -1,13 +1,25 @@ +2010/01/16 + * rep2 version 1.8.60 + + [C³] PC\¦Ì^Cgy[WÉLÚÌgÑOCpURLÉuserøª²¯Ä¢½Ìð¼µ½B + [C³] iPhone[hÌÝèÇÅ\L~Xª Á½ÌðC³µ½B + iNG:[ ¨ NG:bZ[Wj + [C³] u>ÊvÅXbhURLª¨©µÈÁÄ¢½ÌðC³µ½B + [üÇ] b=iÅNæURLªÅè³êÄ¢½ÓðAÅèµÈ¢æ¤Éµ½B + [XV] WILLCOMÌIPAhXÑæðXVµ½B + [àXV] ¯«PEARÌHTTP_RequestðXVµ½B(1.4.4) + [àXV] conf.inc.php©çª£µÄAconf_system.inc.phpðV½ÉÇÁµ½B + 2009/09/17 * rep2 version 1.8.59 - [C³] iPhoneŨCÉÂÌÒWðµæ¤Æ·éÆAG[ªoéÌðC³µ½B - [üÇ] DATeʪ500KBðz¦éêÍAX\¦ºÅ²\¦·éæ¤Éµ½B - [üÇ] read.cgiÌX\¦ªread.htmliJavaScriptjÉÈÁÄ¢éÌßOæ¾Éàε½B - [üÇ] Ü¿BBSÌONWvy[Wihttp://machi.to/bbs/link.cgi?URL=jðXLbv·éæ¤Éµ½B - [üÇ] Ü¿BBSÌPATH_INFO`®URLÌàNÉε½B - [ÏX] XêÌuBirthdayvðuX§ÄúvÆ\LÏXµ½B - [ÏX] ÝèÒWÅAu\[gvÆ¢¤¾tÍgí¸ÉuÀÑvÆ\LÏXµ½B + [C³] iPhoneŨCÉÂÌÒWðµæ¤Æ·éÆAG[ÆÈéÌðC³µ½B + [üÇ] DATeʪ500KBðz¦éêÍAX\¦ºÅ²\¦·éæ¤Éµ½B + [üÇ] read.cgiÌX\¦ªread.htmliJavaScriptjÉÈÁÄ¢éÌßOæ¾Éàε½B + [üÇ] Ü¿BBSÌONWvy[Wihttp://machi.to/bbs/link.cgi?URL=jðXLbv·éæ¤Éµ½B + [üÇ] Ü¿BBSÌPATH_INFO`®URLÌàNÉε½B + [ÏX] XêÌuBirthdayvðuX§ÄúvÆ\LÏXµ½B + [ÏX] ÝèÒWÅAu\[gvÆ¢¤¾tÍgí¸ÉuÀÑvÆ\LÏXµ½B 2009/07/31 * rep2 version 1.8.58 Modified: p2/trunk/edit_aborn_word.php =================================================================== --- p2/trunk/edit_aborn_word.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/edit_aborn_word.php 2010-01-15 19:28:32 UTC (rev 783) @@ -332,12 +332,13 @@ <?php // gÑÈç -if ($_conf['ktai']) { - $hr = P2View::getHrHtmlK(); - echo <<<EOP -$hr -<a {$_conf['accesskey_for_k']}="{$_conf['k_accesskey']['up']}" href="{$_conf['editpref_php']}{$_conf['k_at_q']}">{$_conf['k_accesskey']['up']}.ÝèÒW</a> -EOP; +if (UA::isK()) { + echo P2View::getHrHtmlK(); + echo P2View::tagA( + P2Util::buildQueryUri($_conf['editpref_php'], array(UA::getQueryKey() => UA::getQueryValue())), + hs(sprintf('%s.ÝèÒW', $_conf['k_accesskey']['up'])), + array($_conf['accesskey_for_k'] => $_conf['k_accesskey']['up']) + ); echo P2View::getBackToIndexKATag(); } Modified: p2/trunk/edit_conf_user.php =================================================================== --- p2/trunk/edit_conf_user.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/edit_conf_user.php 2010-01-15 19:28:32 UTC (rev 783) @@ -47,7 +47,7 @@ } // ÁÊÈÚiedit_conf_user.php ÈOÅàÝè³ê¤éàÌÍjü¹¸É»ÌÜÜc·j - // L[ɽ¼K¥iprefixjð¯½ûª¢¢©à ¨ L[¼ÏXÌKvª éÌÅpº + // L[ɽ¼K¥iprefixjð¯½ûª¢¢©à ¨ L[¼ÏXÌKvª éÌÅÐÆܸۯ } elseif (in_array($k, array('k_use_aas', 'maru_kakiko', 'index_menu_k', 'index_menu_k_from1'))) { $conf_save[$k] = $_conf[$k]; } @@ -269,7 +269,7 @@ echo getEditConfHtml('rct_rec_num', 'ÅßÇñ¾XÌL^'); echo getEditConfHtml('res_hist_rec_num', '«ÝðÌL^'); echo getEditConfHtml('res_write_rec', '«ÝàeOðL^'); -echo getEditConfHtml('through_ime', 'OURLWv·éÛÉÊ·Q[g'); +echo getEditConfHtml('through_ime', 'OURLWv·éÛÉÊ·NbVy[W'); echo getEditConfHtml('join_favrank', '<a href="http://akid.s17.xrea.com/favrank/favrank.html" target="_blank">¨CÉX¤L</a>ÉQÁ'); echo getEditConfHtml('enable_menu_new', 'Âj [ÉV ð\¦'); echo getEditConfHtml('menu_refresh_time', 'Âj [ªÌ©®XVÔu (ªwèB0Èç©®XVµÈ¢B)'); Modified: p2/trunk/edit_conf_user_i.php =================================================================== --- p2/trunk/edit_conf_user_i.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/edit_conf_user_i.php 2010-01-15 19:28:32 UTC (rev 783) @@ -234,7 +234,7 @@ echo getEditConfHtml('rct_rec_num', 'ÅßÇñ¾XÌL^'); echo getEditConfHtml('res_hist_rec_num', '«ÝðÌL^'); echo getEditConfHtml('res_write_rec', '«ÝàeOðL^'); -echo getEditConfHtml('through_ime', 'OURLWv·éÛÉÊ·Q[g'); +echo getEditConfHtml('through_ime', 'OURLWv·éÛÉÊ·NbVy[W'); echo getEditConfHtml('join_favrank', '<a href="http://akid.s17.xrea.com/favrank/favrank.html" target="_blank">¨CÉX¤L</a>ÉQÁ'); echo getEditConfHtml('enable_menu_new', 'Âj [ÉV ð\¦'); echo getEditConfHtml('menu_refresh_time', 'Âj [ªÌ©®XVÔu (ªwèB0Èç©®XVµÈ¢B)'); Modified: p2/trunk/iphone/read_footer_k.inc.php =================================================================== --- p2/trunk/iphone/read_footer_k.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/iphone/read_footer_k.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -140,7 +140,7 @@ echo "<p>$motothre_atag</p>"; } } -//echo "<hr>" . $_conf['k_to_index_ht'] . "\n"; +//echo "<hr>" . P2View::getBackToIndexKATag() . "\n"; /* 080726 tb^ÏX̽ßíµ½àÌ <ul><li class="group">{$hs['read_range']}</li></ul> Modified: p2/trunk/iphone/sb_footer_k.inc.php =================================================================== --- p2/trunk/iphone/sb_footer_k.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/iphone/sb_footer_k.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -119,7 +119,13 @@ echo "</p>"; echo '<p>'. $htm['change_sort'] . '</p>'; //echo "<hr>"; -echo "<p><a {$_conf['accesskey_for_k']}=\"0\" href=\"index.php{$_conf['k_at_q']}\">TOP</a></p>"; +printf('<p>%s</p>', + P2View::tagA( + P2Util::buildQueryUri('index.php', array(UA::getQueryKey() => UA::getQueryValue())), + hs('TOP'), + array($_conf['accesskey_for_k'] => '0') + ) +); echo '</body></html>'; */ /* Modified: p2/trunk/iphone/sb_header_k.inc.php =================================================================== --- p2/trunk/iphone/sb_header_k.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/iphone/sb_header_k.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -25,7 +25,7 @@ // «Ýð } elseif ($aThreadList->spmode == 'res_hist') { - $ptitle_url = "./read_res_hist.php{$_conf['k_at_q']}"; + $ptitle_url = P2Util::buildQueryUri('read_res_hist.php', array(UA::getQueryKey() => UA::getQueryValue())); // Êí  } elseif (!$aThreadList->spmode) { Modified: p2/trunk/iui/iuix.css =================================================================== --- p2/trunk/iui/iuix.css 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/iui/iuix.css 2010-01-15 19:28:32 UTC (rev 783) @@ -1,3 +1,5 @@ +/* 2010/01/14 aki ±Ìt@CÍp2ÅÍgÁĢȢݽ¢ */ + body{ margin:0; font-family:Helvetica; Modified: p2/trunk/js/post_form.js =================================================================== --- p2/trunk/js/post_form.js 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/js/post_form.js 2010-01-15 19:28:32 UTC (rev 783) @@ -43,12 +43,12 @@ val = escape(val); - ex = new Date(); + var ex = new Date(); ex = new Date(ex.getTime() + (1000 * sec)); - y = ex.getYear(); if (y < 1900) y += 1900; - hms = ex.getHours() + ":" + ex.getMinutes() + ":" + ex.getSeconds(); - p = String(ex).split(" "); - ex = p[0] + ", " + p[2] + "-" + p[1] + "-" + y + " " + hms + " GMT;"; + var y = ex.getYear(); if (y < 1900) y += 1900; + var hms = ex.getHours() + ":" + ex.getMinutes() + ":" + ex.getSeconds(); + var p = String(ex).split(" "); + var ex = p[0] + ", " + p[2] + "-" + p[1] + "-" + y + " " + hms + " GMT;"; document.cookie = cn + "=" + val +"; expires=" + ex; } Modified: p2/trunk/lib/Login.php =================================================================== --- p2/trunk/lib/Login.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/lib/Login.php 2010-01-15 19:28:32 UTC (rev 783) @@ -191,7 +191,7 @@ // indexy[WÉ] $url = rtrim(dirname(P2Util::getMyUrl()), '/') . '/'; // . $user_u_q; - header('Location: '.$url); + header('Location: ' . $url); exit; } @@ -397,6 +397,7 @@ // OCOðL^·é $this->logLoginSuccess(); + if (isset($_p2session)) { $_p2session->regenerateId(); $_p2session->updateSecure(); @@ -690,6 +691,7 @@ global $_conf; $pass_x = sha1($pass); + $auth_user_cont = <<<EOP <?php \$rec_login_user_u = '{$user_u}'; @@ -776,7 +778,7 @@ $_COOKIE = array(); return $r; - } + } /** * CIDðcookieÉZbg·é @@ -917,7 +919,6 @@ $time = $ar[1]; $md5_utpx = $ar[2]; - return ($md5_utpx == md5($this->user_u . ':' . $time . ':' . $this->pass_x)); } Modified: p2/trunk/lib/P2Util.php =================================================================== --- p2/trunk/lib/P2Util.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/lib/P2Util.php 2010-01-15 19:28:32 UTC (rev 783) @@ -117,21 +117,23 @@ // k1 ÌwèÅ k1[k2] ÍÁ¦È¢ÌÅA±Ì\bhÅεĢéB // $keyªzñƵÄwè³êÄ¢½Èç - $ckey = null; // $_COOKIEpÌL[ + $cakey = null; // $_COOKIEpÌL[ if (preg_match('/\]$/', $key)) { // ÅÌL[ð[]ÅÍÞ - $ckey = preg_replace('/^([^\[]+)/', '[$1]', $key); + $cakey = preg_replace('/^([^\[]+)/', '[$1]', $key); // []ÌL[ð''ÅÍÞ - $ckey = preg_replace('/\[([^\[\]]+)\]/', "['$1']", $ckey); - //var_dump($ckey); + $cakey = preg_replace('/\[([^\[\]]+)\]/', "['$1']", $cakey); + //var_dump($cakey); } // ÎÛCookielªzñÅ êÎÄAðs¤ $cArray = null; - if ($ckey) { - eval("isset(\$_COOKIE{$ckey}) && is_array(\$_COOKIE{$ckey}) and \$cArray = \$_COOKIE{$ckey};"); + if ($cakey) { + eval("isset(\$_COOKIE{$cakey}) && is_array(\$_COOKIE{$cakey}) and \$cArray = \$_COOKIE{$cakey};"); } else { - isset($_COOKIE[$key]) && is_array($_COOKIE[$key]) and $cArray = $_COOKIE[$key]; + if (isset($_COOKIE[$key]) && is_array($_COOKIE[$key])) { + $cArray = $_COOKIE[$key]; + } } if (is_array($cArray)) { foreach ($cArray as $k => $v) { @@ -143,8 +145,8 @@ } if (is_array($cArray) or setcookie("$key", '', time() - 3600, $path, $domain)) { - if ($ckey) { - eval("unset(\$_COOKIE{$ckey});"); + if ($cakey) { + eval("unset(\$_COOKIE{$cakey});"); } else { unset($_COOKIE[$key]); } @@ -1573,9 +1575,9 @@ return false; } - $rec_login2chID = NULL; - $login2chPW = NULL; - $rec_autoLogin2ch = NULL; + $rec_login2chID = null; + $login2chPW = null; + $rec_autoLogin2ch = null; include $_conf['idpw2ch_php']; Modified: p2/trunk/lib/P2View.php =================================================================== --- p2/trunk/lib/P2View.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/lib/P2View.php 2010-01-15 19:28:32 UTC (rev 783) @@ -5,7 +5,7 @@ class P2View { /** - * 2008/09/28 $_conf['k_to_index_ht'] ãå»æ¢ãã¦ããã¡ããå©ç¨ + * 2008/09/28 $_conf['k_to_index_ht'] ãå»æ¢ãã¦ããã¡ããå©ç¨ãã * * @static * @access public Modified: p2/trunk/lib/login_first.inc.php =================================================================== --- p2/trunk/lib/login_first.inc.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/lib/login_first.inc.php 2010-01-15 19:28:32 UTC (rev 783) @@ -289,7 +289,7 @@ echo $login_form_ht; if (empty($GLOBALS['brazil']) and !(HostCheck::isAddrLocal() || HostCheck::isAddrPrivate())) { ?><p> - <font style="font-size:9pt" color="gray">¦vCx[gp̽ßÌVXeÅ·B<br> + <font size="-1" color="gray">¦±Ìy[WÍvCx[gp̽ßÌVXeÅ·B<br> OÒÉæéOCsÍA<br> s³ANZXƵÄL^³êÜ·B<br> ±Ìy[WÖÌANZXURLðOÒª<br> Modified: p2/trunk/post.php =================================================================== --- p2/trunk/post.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/post.php 2010-01-15 19:28:32 UTC (rev 783) @@ -832,6 +832,8 @@ // NbL[Ì«Ý©®Û¶ðÁ·é if (isset($_COOKIE['post_msg'])) { + P2Util::unsetCookie('post_msg'); + // hCwèȵàüêĨ± setcookie('post_msg', '', time() - 3600); } Modified: p2/trunk/read_new_i.php =================================================================== --- p2/trunk/read_new_i.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/read_new_i.php 2010-01-15 19:28:32 UTC (rev 783) @@ -588,7 +588,7 @@ EOP; } //{$sb_ht_btm}Ì -//echo '<hr>' . $_conf['k_to_index_ht'] . "\n"; +//echo '<hr>' . P2View::getBackToIndexKATag() . "\n"; //iphone 080801 ?> </ul> Modified: p2/trunk/setting.php =================================================================== --- p2/trunk/setting.php 2010-01-15 19:27:58 UTC (rev 782) +++ p2/trunk/setting.php 2010-01-15 19:28:32 UTC (rev 783) @@ -29,6 +29,9 @@ $logout_st = 'OAEg'; } +$login_uri = P2Util::buildQueryUri('login.php', array(UA::getQueryKey() => UA::getQueryValue())); +$login2ch_uri = P2Util::buildQueryUri('login2ch.php', array(UA::getQueryKey() => UA::getQueryValue())); + $body_onload = ''; if (UA::isPC()) { $body_onload = ' onLoad="setWinTitle();"'; @@ -72,9 +75,9 @@ ?><ul id="setting_menu"> <li> - <a href="login.php<?php eh($_conf['k_at_q']); ?>">rep2OCÇ</a> + <a href="<?php eh($login_uri); ?>">rep2OCÇ</a> </li> - <li><a href="login2ch.php<?php eh($_conf['k_at_q']); ?>">2chOCÇ</a>i¢íäéj</li> + <li><a href="<?php eh($login2ch_uri); ?>">2chOCÇ</a>i¢íäéj</li> </ul> [<a href="./index.php?logout=1" target="_parent">rep2©ç<?php eh($logout_st); ?>·é</a>]