[P2-php-svn] [901] p2/ be.2ch. netの仕様変更に対応した。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 1月 16日 (日) 16:42:18 JST


Revision: 901
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=901
Author:   akid
Date:     2011-01-16 16:42:18 +0900 (Sun, 16 Jan 2011)

Log Message:
-----------
p2/ be.2ch.netの仕様変更に対応した。
携帯とiPhoneで、新着まとめ読みの新着レスがなかった時、前回キャッシュへのリンクを表示するようにした。

Modified Paths:
--------------
    p2/trunk/conf/conf_user_def.inc.php
    p2/trunk/edit_conf_user.php
    p2/trunk/edit_conf_user_i.php
    p2/trunk/editpref.php
    p2/trunk/editpref_i.php
    p2/trunk/iphone/post_options_loader_popup.inc.php
    p2/trunk/lib/BbsMap.php
    p2/trunk/lib/P2Util.php
    p2/trunk/lib/P2View.php
    p2/trunk/lib/ThreadRead.php
    p2/trunk/lib/login_first.inc.php
    p2/trunk/lib/post_options_loader.inc.php
    p2/trunk/login.php
    p2/trunk/post.php
    p2/trunk/read_new.php
    p2/trunk/read_new_i.php
    p2/trunk/read_new_k.php
    p2/trunk/style/login_css.inc

Added Paths:
-----------
    p2/trunk/lib/edit_conf_user.funcs.php


-------------- next part --------------
Modified: p2/trunk/conf/conf_user_def.inc.php
===================================================================
--- p2/trunk/conf/conf_user_def.inc.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/conf/conf_user_def.inc.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -16,6 +16,13 @@
 // be.2ch.net‚Ì“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX
 $conf_user_def['be_2ch_mail'] = ""; // ("")
 
+// be.2ch.net‚Ì“o˜^ƒpƒXƒ[ƒh
+$conf_user_def['be_2ch_password'] = ""; // ("")
+
+// be.2ch.net DMDM MDMD Žè“®Žw’è
+//$conf_user_def['be_2ch_DMDM'] = ""; // ("")
+//$conf_user_def['be_2ch_MDMD'] = ""; // ("")
+
 // }}}
 // {{{ ¡PATH
 

Modified: p2/trunk/edit_conf_user.php
===================================================================
--- p2/trunk/edit_conf_user.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/edit_conf_user.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -1,11 +1,15 @@
 <?php
 /*
     p2 - ƒ†[ƒUÝ’è•ÒWUI
+
+    ¦‚±‚̃XƒNƒŠƒvƒgˆÈŠO‚Å‚àÝ’肳‚ê‚郆[ƒUÝ’è’l‚ª‚ ‚ê‚΁A
+    ‚»‚Ìkey‚ð_getConfSave()“à‚Ì$remain_keys‚É“o˜^‚µ‚Ä‚¨‚­B
 */
 
 require_once './conf/conf.inc.php';
 
 require_once P2_LIB_DIR . '/DataPhp.php';
+require_once P2_LIB_DIR . '/edit_conf_user.funcs.php';
 
 $_login->authorize(); // ƒ†[ƒU”FØ
 
@@ -30,28 +34,14 @@
     $_POST['conf_edit'] = array_map('trim', $_POST['conf_edit']);
     
     // ‘I‘ðŽˆ‚É‚È‚¢‚à‚Ì ¨ ƒfƒtƒHƒ‹ƒg‹¸³
-    notSelToDef();
+    _notSelToDef();
     
     // ƒ‹[ƒ‹‚ð“K—p‚·‚é
-    applyRules();
+    _applyRules();
 
-    /**
-     * ƒfƒtƒHƒ‹ƒg’l $conf_user_def ‚ƕύX’l $_POST['conf_edit'] ‚Ì—¼•û‚ª‘¶Ý‚µ‚Ä‚¢‚āA
-     * ƒfƒtƒHƒ‹ƒg’l‚ƕύX’l‚ªˆÙ‚È‚éê‡‚̂ݐݒè•Û‘¶‚·‚éi‚»‚Ì‘¼‚̃f[ƒ^‚Í•Û‘¶‚³‚ꂸA”jŠü‚³‚ê‚éj
-     */
-    $conf_save = array();
-    foreach ($conf_user_def as $k => $v) {
-        if (isset($conf_user_def[$k]) && isset($_POST['conf_edit'][$k])) {
-            if ($conf_user_def[$k] != $_POST['conf_edit'][$k]) {
-                $conf_save[$k] = $_POST['conf_edit'][$k];
-            }
-            
-        // “Á•Ê‚ȍ€–ځiedit_conf_user.php ˆÈŠO‚Å‚àÝ’肳‚ꂤ‚é‚à‚Ì‚Í”jŠü‚¹‚¸‚É‚»‚Ì‚Ü‚ÜŽc‚·j
-        // ƒL[‚É–½–¼‹K‘¥iprefixj‚ð‚‚¯‚½•û‚ª‚¢‚¢‚©‚à ¨ ƒL[–¼•ÏX‚Ì•K—v‚ª‚ ‚é‚̂łЂƂ܂¸•Û—¯
-        } elseif (in_array($k, array('k_use_aas', 'maru_kakiko', 'index_menu_k', 'index_menu_k_from1'))) {
-            $conf_save[$k] = $_conf[$k];
-        }
-    }
+    // ƒfƒtƒHƒ‹ƒg’l $conf_user_def ‚ƕύX’l $_POST['conf_edit'] ‚Ì—¼•û‚ª‘¶Ý‚µ‚Ä‚¢‚āA
+    // ƒfƒtƒHƒ‹ƒg’l‚ƕύX’l‚ªˆÙ‚È‚éê‡‚̂ݐݒè•Û‘¶‚·‚éi‚»‚Ì‘¼‚̃f[ƒ^‚Í•Û‘¶‚³‚ꂸA”jŠü‚³‚ê‚éj
+    $conf_save = _getConfSave();
 
     // ƒVƒŠƒAƒ‰ƒCƒY‚µ‚Ä•Û‘¶
     FileCtl::make_datafile($_conf['conf_user_file'], $_conf['conf_user_perm']);
@@ -62,8 +52,7 @@
     } else {
         P2Util::pushInfoHtml("<p>›Ý’è‚ðXV•Û‘¶‚µ‚Ü‚µ‚½</p>");
         // •ÏX‚ª‚ ‚ê‚΁A“à•”ƒf[ƒ^‚àXV‚µ‚Ä‚¨‚­
-        $_conf = array_merge($_conf, $conf_user_def);
-        $_conf = array_merge($_conf, $conf_save);
+        $_conf = array_merge($_conf, $conf_user_def, $conf_save);
     }
 
 // }}}
@@ -79,6 +68,13 @@
 
 // }}}
 
+/*
+// be‚Ì”FØŠm”F
+if (false === P2Util::getBe2chCodeWithUserConf()) {
+    P2Util::pushInfoHtml('<p>~ b2.2ch.net‚̃AƒJƒEƒ“ƒg‚ðŠm”F‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX‚©ƒpƒXƒ[ƒh‚ª³‚µ‚­‚È‚¢‚悤‚Å‚·B</p>');
+}
+*/
+
 //=====================================================================
 // ƒvƒŠƒ“ƒgÝ’è
 //=====================================================================
@@ -165,9 +161,13 @@
 
 echo getGroupSepaHtml('be.2ch.net ƒAƒJƒEƒ“ƒg');
 
-echo getEditConfHtml('be_2ch_code', '<a href="http://be.2ch.net/" target="_blank">be.2ch.net</a>‚Ì”FØƒR[ƒh(<a href="http://be.2ch.net/test/editprof.php" target="_blank">”FØƒR[ƒh‚ÌŠm”F</a>)');
-echo getEditConfHtml('be_2ch_mail', 'be.2ch.net‚Ì“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX');
+//echo getEditConfHtml('be_2ch_code', '<a href="http://be.2ch.net/" target="_blank">be.2ch.net</a>‚Ì”FØƒR[ƒh(<a href="http://be.2ch.net/test/editprof.php" target="_blank">”FØƒR[ƒh‚ÌŠm”F</a>)');
+echo getEditConfHtml('be_2ch_mail', 'be.2ch.net‚Ì“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX(<a href="http://be.2ch.net/test/login.php" target="_blank">BeƒƒOƒCƒ“</a>)');
+echo getEditConfHtml('be_2ch_password', 'be.2ch.net‚Ì“o˜^ƒpƒXƒ[ƒh(<a href="http://be.2ch.net/test/pass.php" target="_blank">ƒpƒXƒ[ƒh‚ÌŠm”F</a>)');
 
+//echo getEditConfHtml('be_2ch_DMDM', '<a href="http://be.2ch.net/" target="_blank">be.2ch.net</a> DMDM Žè“®Žw’è');
+//echo getEditConfHtml('be_2ch_MDMD', 'be.2ch.net MDMD Žè“®Žw’è');
+
 echo getGroupSepaHtml('PATH');
 
 //echo getEditConfHtml('first_page', '‰E‰º•”•ª‚ɍŏ‰‚É•\Ž¦‚³‚ê‚éƒy[ƒWBƒIƒ“ƒ‰ƒCƒ“URL‚à‰ÂB');
@@ -189,6 +189,7 @@
 echo getEditConfHtml('sb_show_motothre', 'ƒXƒŒƒbƒhˆê——‚Å–¢Žæ“¾ƒXƒŒ‚ɑ΂µ‚ÄŒ³ƒXƒŒ‚ւ̃Šƒ“ƒNiEj‚ð•\Ž¦');
 echo getEditConfHtml('sb_show_one', 'PC‰{——ŽžAƒXƒŒƒbƒhˆê——i”•\Ž¦j‚Å>>1‚ð•\Ž¦');
 echo getEditConfHtml('k_sb_show_first', 'Œg‘т̃XƒŒƒbƒhˆê——i”•\Ž¦j‚©‚珉‚߂ẴXƒŒ‚ðŠJ‚­Žž‚Ì•\Ž¦•û–@');
+
 echo getEditConfHtml('sb_show_spd', 'ƒXƒŒƒbƒhˆê——‚Å‚·‚΂₳iƒŒƒXŠÔŠuj‚ð•\Ž¦');
 echo getEditConfHtml('sb_show_ikioi', 'ƒXƒŒƒbƒhˆê——‚Ő¨‚¢i1“ú‚ ‚½‚è‚̃ŒƒX”j‚ð•\Ž¦');
 echo getEditConfHtml('sb_show_fav', 'ƒXƒŒƒbƒhˆê——‚Å‚¨‹C‚ɃXƒŒƒ}[ƒNš‚ð•\Ž¦');
@@ -220,7 +221,6 @@
 echo getEditConfHtml('bottom_res_form', 'ƒXƒŒƒbƒh‰º•”‚ɏ‘‚«ž‚݃tƒH[ƒ€‚ð•\Ž¦');
 echo getEditConfHtml('quote_res_view', 'ˆø—pƒŒƒX‚ðiƒ|ƒbƒvƒAƒbƒvj•\Ž¦');
 
-
 echo getEditConfHtml('enable_headbar', 'PC ƒwƒbƒhƒo[‚ð•\Ž¦');
 echo getEditConfHtml('enable_spm', 'ƒŒƒX”ԍ†‚©‚çƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[(SPM)‚ð•\Ž¦');
 //echo getEditConfHtml('spm_kokores', 'ƒXƒ}[ƒgƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚Łu‚±‚ê‚ɃŒƒXv‚ð•\Ž¦');
@@ -238,7 +238,9 @@
 echo getEditConfHtml('k_motothre_external', 'Œg‘щ{——ŽžAŒ³ƒXƒŒURL‚̃JƒXƒ^ƒ}ƒCƒYŽw’è‚ðŠO•””‚łà—LŒø‚É‚·‚é');
 
 echo getEditConfHtml('k_bbs_noname_name', 'Œg‘щ{——ŽžAƒfƒtƒHƒ‹ƒg‚Ì–¼–³‚µ–¼‚ð•\Ž¦');
+
 echo getEditConfHtml('k_clip_unique_id', 'Œg‘щ{——ŽžAd•¡‚µ‚È‚¢ID‚Í––”ö‚݂̂̏ȗª•\Ž¦');
+
 echo getEditConfHtml('k_date_zerosuppress', 'Œg‘щ{——ŽžA“ú•t‚Ì0‚ðÈ—ª•\Ž¦');
 echo getEditConfHtml('k_clip_time_sec', 'Œg‘щ{——ŽžAŽž‚Ì•b‚ðÈ—ª•\Ž¦');
 echo getEditConfHtml('mobile.id_underline', 'Œg‘щ{——ŽžAID––”ö‚Ì"O"iƒI[j‚ɉºü‚ð’ljÁ');
@@ -305,27 +307,6 @@
 //=====================================================================
 // ŠÖ” i‚±‚̃tƒ@ƒCƒ‹“à‚Å‚Ì‚Ý—˜—pj
 //=====================================================================
-/**
- * ƒ‹[ƒ‹Ý’èi$conf_user_rulesj‚ÉŠî‚¢‚āAƒtƒBƒ‹ƒ^ˆ—iƒfƒtƒHƒ‹ƒgƒZƒbƒgj‚ðs‚¤
- * 2007/10/10 $conf_user_rules ‚Í $conf_user_filters ‚ɉü–¼‚µ‚½‚¢
- *
- * @return  void
- */
-function applyRules()
-{
-    global $conf_user_rules, $conf_user_def;
-    
-    if (is_array($conf_user_rules)) {
-        foreach ($conf_user_rules as $k => $v) {
-            if (isset($_POST['conf_edit'][$k])) {
-                $def = isset($conf_user_def[$k]) ? $conf_user_def[$k] : null;
-                foreach ($v as $func) {
-                    $_POST['conf_edit'][$k] = call_user_func($func, $_POST['conf_edit'][$k], $def);
-                }
-            }
-        }
-    }
-}
 
 // emptyToDef() ‚Ȃǂ̃tƒBƒ‹ƒ^‚ÍEditConfFiterƒNƒ‰ƒX‚È‚Ç‚É‚Ü‚Æ‚ß‚é—\’è
 
@@ -388,26 +369,6 @@
 }
 
 /**
- * ‘I‘ðŽˆ‚É‚È‚¢’l‚̓fƒtƒHƒ‹ƒgƒZƒbƒg‚·‚é
- */
-function notSelToDef()
-{
-    global $conf_user_def, $conf_user_sel;
-    
-    $names = array_keys($conf_user_sel);
-    
-    if (is_array($names)) {
-        foreach ($names as $n) {
-            if (isset($_POST['conf_edit'][$n])) {
-                if (!array_key_exists($_POST['conf_edit'][$n], $conf_user_sel[$n])) {
-                    $_POST['conf_edit'][$n] = $conf_user_def[$n];
-                }
-            }
-        }
-    }
-}
-
-/**
  * ƒOƒ‹[ƒv•ª‚¯—p‚ÌHTML‚𓾂éiŠÖ”“à‚ÅPCAŒg‘Ñ—p•\Ž¦‚ðU‚蕪‚¯j
  *
  * @return  string
@@ -417,7 +378,7 @@
     global $_conf;
     
     // PC—p
-    if (empty($_conf['ktai'])) {
+    if (UA::isPC()) {
         $ht = <<<EOP
         <tr class="group">
             <td colspan="4"><h4 style="display:inline;">{$title}</h4></td>
@@ -446,7 +407,7 @@
     }
 
     // Œg‘тł͕ҏW•\Ž¦‚µ‚È‚¢€–Ú
-    if ($_conf['ktai']) {
+    if (UA::isK()) {
         $noKtais = array(
             'enable_headbar', 'enable_spm', 'spm_kokores',
             'frame_menu_width', 'frame_subject_width', 'frame_read_width'
@@ -461,7 +422,7 @@
     
     $name_view_hs = hs($_conf[$name]);
     
-    if (empty($_conf['ktai'])) {
+    if (UA::isPC()) {
         $input_size_at = ' size="38"';
     } else {
         $input_size_at = '';
@@ -475,8 +436,12 @@
         
     // input “ü—ÍŽ®‚È‚ç
     } else {
+        $type = 'text';
+        if (strstr($name, 'password')) {
+            $type = 'password';
+        }
         $form_ht = <<<EOP
-<input type="text" name="conf_edit[{$name}]" value="{$name_view_hs}"{$input_size_at}>\n
+<input type="${type}" name="conf_edit[{$name}]" value="{$name_view_hs}"{$input_size_at}>\n
 EOP;
         $def_views[$name] = htmlspecialchars($conf_user_def[$name], ENT_QUOTES);
     }

Modified: p2/trunk/edit_conf_user_i.php
===================================================================
--- p2/trunk/edit_conf_user_i.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/edit_conf_user_i.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -1,12 +1,16 @@
 <?php
 /*
     p2 - ƒ†[ƒUÝ’è•ÒWUI
+
+    ¦‚±‚̃XƒNƒŠƒvƒgˆÈŠO‚Å‚àÝ’肳‚ê‚郆[ƒUÝ’è’l‚ª‚ ‚ê‚΁A
+    ‚»‚Ìkey‚ð_getConfSave()“à‚Ì$remain_keys‚É“o˜^‚µ‚Ä‚¨‚­B
 */
 /* 2008/7/25 iPhone—p‚ɃJƒXƒ^ƒ}ƒCƒY*/
 
 require_once './conf/conf.inc.php';
 
 require_once P2_LIB_DIR . '/DataPhp.php';
+require_once P2_LIB_DIR . '/edit_conf_user.funcs.php';
 
 $_login->authorize(); // ƒ†[ƒU”FØ
 
@@ -31,28 +35,16 @@
     $_POST['conf_edit'] = array_map('trim', $_POST['conf_edit']);
     
     // ‘I‘ðŽˆ‚É‚È‚¢‚à‚Ì ¨ ƒfƒtƒHƒ‹ƒg‹¸³
-    notSelToDef();
+    _notSelToDef();
     
     // ƒ‹[ƒ‹‚ð“K—p‚·‚é
-    applyRules();
+    _applyRules();
 
     /**
      * ƒfƒtƒHƒ‹ƒg’l $conf_user_def ‚ƕύX’l $_POST['conf_edit'] ‚Ì—¼•û‚ª‘¶Ý‚µ‚Ä‚¢‚āA
      * ƒfƒtƒHƒ‹ƒg’l‚ƕύX’l‚ªˆÙ‚È‚éê‡‚̂ݐݒè•Û‘¶‚·‚éi‚»‚Ì‘¼‚̃f[ƒ^‚Í•Û‘¶‚³‚ꂸA”jŠü‚³‚ê‚éj
      */
-    $conf_save = array();
-    foreach ($conf_user_def as $k => $v) {
-        if (isset($conf_user_def[$k]) && isset($_POST['conf_edit'][$k])) {
-            if ($conf_user_def[$k] != $_POST['conf_edit'][$k]) {
-                $conf_save[$k] = $_POST['conf_edit'][$k];
-            }
-            
-        // “Á•Ê‚ȍ€–ځiedit_conf_user.php ˆÈŠO‚Å‚àÝ’肳‚ꂤ‚é‚à‚Ì‚Í”jŠü‚¹‚¸‚É‚»‚Ì‚Ü‚ÜŽc‚·j
-        // ƒL[‚É–½–¼‹K‘¥iprefixj‚ð‚‚¯‚½•û‚ª‚¢‚¢‚©‚à ¨ ƒL[–¼•ÏX‚Ì•K—v‚ª‚ ‚é‚Ì‚Å‹p‰º
-        } elseif (in_array($k, array('k_use_aas', 'maru_kakiko', 'index_menu_k', 'index_menu_k_from1'))) {
-            $conf_save[$k] = $_conf[$k];
-        }
-    }
+    $conf_save = _getConfSave();
 
     // ƒVƒŠƒAƒ‰ƒCƒY‚µ‚Ä•Û‘¶
     FileCtl::make_datafile($_conf['conf_user_file'], $_conf['conf_user_perm']);
@@ -80,6 +72,13 @@
 
 // }}}
 
+/*
+// be‚Ì”FØŠm”F
+if (false === P2Util::getBe2chCodeWithUserConf()) {
+    P2Util::pushInfoHtml('<p>~ b2.2ch.net‚̃AƒJƒEƒ“ƒg‚ðŠm”F‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX‚©ƒpƒXƒ[ƒh‚ª³‚µ‚­‚È‚¢‚悤‚Å‚·B</p>');
+}
+*/
+
 //=====================================================================
 // ƒvƒŠƒ“ƒgÝ’è
 //=====================================================================
@@ -132,9 +131,13 @@
 
 echo getGroupSepaHtml('be.2ch.net ƒAƒJƒEƒ“ƒg');
 
-echo getEditConfHtml('be_2ch_code', '<a href="http://be.2ch.net/" target="_blank">be.2ch.net</a>‚Ì”FØƒR[ƒh(ƒpƒXƒ[ƒh‚Å‚Í‚ ‚è‚Ü‚¹‚ñ)');
-echo getEditConfHtml('be_2ch_mail', 'be.2ch.net‚Ì“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX');
+//echo getEditConfHtml('be_2ch_code', '<a href="http://be.2ch.net/" target="_blank">be.2ch.net</a>‚Ì”FØƒR[ƒh(ƒpƒXƒ[ƒh‚Å‚Í‚ ‚è‚Ü‚¹‚ñ)');
+echo getEditConfHtml('be_2ch_mail', 'be.2ch.net‚Ì“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX(<a href="http://be.2ch.net/test/login.php" target="_blank">BeƒƒOƒCƒ“</a>)');
+echo getEditConfHtml('be_2ch_password', 'be.2ch.net‚Ì“o˜^ƒpƒXƒ[ƒh(<a href="http://be.2ch.net/test/pass.php" target="_blank">ƒpƒXƒ[ƒh‚ÌŠm”F</a>)');
 
+//echo getEditConfHtml('be_2ch_DMDM', '<a href="http://be.2ch.net/" target="_blank">be.2ch.net</a> DMDM Žè“®Žw’è');
+//echo getEditConfHtml('be_2ch_MDMD', 'be.2ch.net MDMD Žè“®Žw’è');
+
 echo getGroupSepaHtml('PATH');
 
 //echo getEditConfHtml('first_page', '‰E‰º•”•ª‚ɍŏ‰‚É•\Ž¦‚³‚ê‚éƒy[ƒWBƒIƒ“ƒ‰ƒCƒ“URL‚à‰ÂB');
@@ -263,26 +266,6 @@
 //=====================================================================
 // ŠÖ” i‚±‚̃tƒ@ƒCƒ‹“à‚Å‚Ì‚Ý—˜—pj
 //=====================================================================
-/**
- * ƒ‹[ƒ‹Ý’èi$conf_user_rulesj‚ÉŠî‚¢‚āAƒtƒBƒ‹ƒ^ˆ—iƒfƒtƒHƒ‹ƒgƒZƒbƒgj‚ðs‚¤
- *
- * @return  void
- */
-function applyRules()
-{
-    global $conf_user_rules, $conf_user_def;
-    
-    if (is_array($conf_user_rules)) {
-        foreach ($conf_user_rules as $k => $v) {
-            if (isset($_POST['conf_edit'][$k])) {
-                $def = isset($conf_user_def[$k]) ? $conf_user_def[$k] : null;
-                foreach ($v as $func) {
-                    $_POST['conf_edit'][$k] = call_user_func($func, $_POST['conf_edit'][$k], $def);
-                }
-            }
-        }
-    }
-}
 
 // emptyToDef() ‚Ȃǂ̃tƒBƒ‹ƒ^‚ÍEditConfFiterƒNƒ‰ƒX‚È‚Ç‚É‚Ü‚Æ‚ß‚é—\’è
 
@@ -345,26 +328,6 @@
 }
 
 /**
- * ‘I‘ðŽˆ‚É‚È‚¢’l‚̓fƒtƒHƒ‹ƒgƒZƒbƒg‚·‚é
- */
-function notSelToDef()
-{
-    global $conf_user_def, $conf_user_sel;
-    
-    $names = array_keys($conf_user_sel);
-    
-    if (is_array($names)) {
-        foreach ($names as $n) {
-            if (isset($_POST['conf_edit'][$n])) {
-                if (!array_key_exists($_POST['conf_edit'][$n], $conf_user_sel[$n])) {
-                    $_POST['conf_edit'][$n] = $conf_user_def[$n];
-                }
-            }
-        }
-    }
-}
-
-/**
  * ƒOƒ‹[ƒv•ª‚¯—p‚ÌHTML‚𓾂éiŠÖ”“à‚ÅPCAŒg‘Ñ—p•\Ž¦‚ðU‚蕪‚¯j
  *
  * @return  string
@@ -393,7 +356,7 @@
     }
 
     // Œg‘тł͕ҏW•\Ž¦‚µ‚È‚¢€–Ú
-    if ($_conf['ktai']) {
+    if (UA::isK()) {
         $noKtais = array(
             'enable_headbar', 'enable_spm', 'spm_kokores',
             'frame_menu_width', 'frame_subject_width', 'frame_read_width'
@@ -408,7 +371,7 @@
     
     $name_view_hs = hs($_conf[$name]);
     
-    if (!$_conf['ktai']) {
+    if (UA::isPC()) {
         $input_size_at = ' size="38"';
     } else {
         $input_size_at = '';
@@ -419,10 +382,15 @@
         $form_ht = getEditConfSelHtml($name);
         $key = $conf_user_def[$name];
         $def_views[$name] = htmlspecialchars($conf_user_sel[$name][$key], ENT_QUOTES);
+        
     // input “ü—ÍŽ®‚È‚ç
     } else {
+        $type = 'text';
+        if (strstr($name, 'password')) {
+            $type = 'password';
+        }
         $form_ht = <<<EOP
-<input type="text" name="conf_edit[{$name}]" value="{$name_view_hs}"{$input_size_at}>\n
+<input type="{$type}" name="conf_edit[{$name}]" value="{$name_view_hs}"{$input_size_at}>\n
 EOP;
         $def_views[$name] = htmlspecialchars($conf_user_def[$name], ENT_QUOTES);
     }

Modified: p2/trunk/editpref.php
===================================================================
--- p2/trunk/editpref.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/editpref.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -147,7 +147,7 @@
 <?php
 
 // Œg‘Ñ—p•\Ž¦
-if ($_conf['ktai']) {
+if (UA::isK()) {
     echo $hr;
 }
 
@@ -266,12 +266,14 @@
 }
 
 // V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒNHTML‚ð•\Ž¦‚·‚é
-_printMatomeCacheLinksHtml();
+echo P2View::getMatomeCacheLinksHtml();
+if (UA::isK()) {
+    echo $hr;
+}
 
-
 // PC - ƒzƒXƒg‚Ì“¯Šú HTML‚ð•\Ž¦ 
 
-if (!$_conf['ktai']) {
+if (UA::isPC()) {
 
     $sync_htm = <<<EOP
 <table><tr><td>
@@ -646,44 +648,6 @@
     exit;
 }
 
-/**
- * V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒNHTML‚ð•\Ž¦‚·‚é
- *
- * @return  void
- */
-function _printMatomeCacheLinksHtml()
-{
-    global $_conf;
-    
-    $max = $_conf['matome_cache_max'];
-    $links = array();
-    for ($i = 0; $i <= $max; $i++) {
-        $dnum = $i ? '.' . $i : '';
-        $file = $_conf['matome_cache_path'] . $dnum . $_conf['matome_cache_ext'];
-        //echo '<!-- ' . $file . ' -->';
-        if (file_exists($file)) {
-            $filemtime = filemtime($file);
-            $date = date('Y/m/d G:i:s', $filemtime);
-            $b = filesize($file) / 1024;
-            $kb = round($b, 0);
-            $atag = P2View::tagA(
-                UriUtil::buildQueryUri('read_new.php', array('cview' => '1', 'cnum' => "$i", 'filemtime' => $filemtime)),
-                hs($date),
-                array('target' => 'read')
-            );
-            $links[] = sprintf('%s %dKB', $atag, $kb);
-        }
-    }
-    if ($links) {
-        echo '<p>V’…‚Ü‚Æ‚ß“Ç‚Ý‚Ì‘O‰ñƒLƒƒƒbƒVƒ…‚ð•\Ž¦<br>' . implode('<br>', $links) . '</p>' . "\n";
-        
-        if ($_conf['ktai']) {
-            $hr = P2View::getHrHtmlK();
-            echo $hr . "\n";
-        }
-    }
-}
-
 /*
  * Local Variables:
  * mode: php

Modified: p2/trunk/editpref_i.php
===================================================================
--- p2/trunk/editpref_i.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/editpref_i.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -164,24 +164,10 @@
 
 // }}}
 
-/*/ V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒNHTML‚ð•\Ž¦‚·‚é
-echo <<<EOP
-<ul><li class="group">V’…‚Ü‚Æ‚ß</li></ul>
-<div id="usage" class="panel">
-<h2>‘O‰ñƒLƒƒƒbƒVƒ…•\Ž¦</h2>
-<filedset>
-EOP;
+// V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒNHTML‚ð•\Ž¦‚·‚é
+echo P2View::getMatomeCacheLinksHtml();
 
-printMatomeCacheLinksHtml();
 
-echo <<<EOP
-</filedset>
-</div>
-EOP;
-*/
-_printMatomeCacheLinksHtml();
-
-
 // PC - ƒzƒXƒg‚Ì“¯Šú HTML‚ð•\Ž¦ 
 $sync_htm = "<ul><li class=\"group\">ƒzƒXƒg‚Ì“¯Šú</li></ul>\n<div id=\"usage\" class=\"panel\"><felidset>2ch‚̔ˆړ]‚ɑΉž‚µ‚Ü‚·B<br>’ʏí‚ÍŽ©“®‚ōs‚í‚ê‚é‚̂ŁA‚±‚Ì‘€ì‚Í“Á‚É•K—v‚ ‚è‚Ü‚¹‚ñj\n";
 $exist_sync_flag = false;
@@ -373,40 +359,6 @@
     return $ht;
 }
 
-/**
- * V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒNHTML‚ð•\Ž¦‚·‚é
- *
- * @return  void
- */
-function _printMatomeCacheLinksHtml()
-{
-    global $_conf;
-    
-    $max = $_conf['matome_cache_max'];
-    $links = array();
-    for ($i = 0; $i <= $max; $i++) {
-        $dnum = $i ? '.' . $i : '';
-        $file = $_conf['matome_cache_path'] . $dnum . $_conf['matome_cache_ext'];
-        //echo '<!-- ' . $file . ' -->';
-        if (file_exists($file)) {
-            $filemtime = filemtime($file);
-            $date = date('Y/m/d G:i:s', $filemtime);
-            $b = filesize($file) / 1024;
-            $kb = round($b, 0);
-            $atag = P2View::tagA(
-                UriUtil::buildQueryUri('read_new.php', array('cview' => '1', 'cnum' => "$i", 'filemtime' => $filemtime)),
-                hs($date),
-                array('target' => 'read')
-            );
-            $links[] = sprintf('%s %dKB', $atag, $kb);
-        }
-    }
-    if ($links) {
-        echo '<ul><li class="group">V’…‚Ü‚Æ‚ß“Ç‚Ý‚Ì‘O‰ñƒLƒƒƒbƒVƒ…</li></ul><div id="usage" class="panel"><filedset>' . implode('<br>', $links)  .'</fildset></div>'. "\n";
-        
-    }
-}
-
 /*
  * Local Variables:
  * mode: php

Modified: p2/trunk/iphone/post_options_loader_popup.inc.php
===================================================================
--- p2/trunk/iphone/post_options_loader_popup.inc.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/iphone/post_options_loader_popup.inc.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -70,7 +70,7 @@
 
 // Be‘‚«ž‚Ý
 $htm['be2ch'] = '';
-if (P2Util::isHost2chs($host) and $_conf['be_2ch_code'] && $_conf['be_2ch_mail']) {
+if (P2Util::isHost2chs($host) and P2Util::enableBe2ch()) {
     $htm['be2ch'] = '<input id="submit_beres" type="submit" name="submit_beres" value="BE‚ŏ‘‚«ž‚Þ" onClick="setHiddenValue(this); popUpFootbarFormIPhone(1, 1);"><br>';
 }
 
@@ -79,7 +79,7 @@
 if (P2Util::isBbsBe2chNet($host, $bbs)) {
     // ‚â‚Á‚Ï‚è–³Œø‚É‚µ‚È‚¢B‘‚«ž‚ÝŽ¸”sŽž‚ɁA2ch‘¤‚ÅBeƒƒOƒCƒ“‚Ö‚Ì—U“±‚ª‚ ‚é‚̂ŁB
     //$res_disabled_at = ' disabled';
-    if ($_conf['be_2ch_code'] && $_conf['be_2ch_mail']) {
+    if (P2Util::enableBe2ch()) {
         $htm['title_need_be'] = ' title="Be”‚ɂ‚«AŽ©“®Be‘‚«ž‚Ý‚µ‚Ü‚·"';
     } else {
         $htm['title_need_be'] = ' title="‘‚«ž‚Þ‚É‚ÍBeƒƒOƒCƒ“‚ª•K—v‚Å‚·"';

Modified: p2/trunk/lib/BbsMap.php
===================================================================
--- p2/trunk/lib/BbsMap.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/lib/BbsMap.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -339,7 +339,7 @@
         }
         $req = new HTTP_Request($bbsmenu_url, $params);
         $req->setMethod('GET');
-        $err = $req->sendRequest(true);
+        $err = $req->sendRequest(true); // $saveBody = true
 
         // ƒGƒ‰[‚ðŒŸØ
         if (PEAR::isError($err)) {

Modified: p2/trunk/lib/P2Util.php
===================================================================
--- p2/trunk/lib/P2Util.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/lib/P2Util.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -9,6 +9,180 @@
  */
 class P2Util
 {
+    /**
+     * @access  public
+     * @return  boolean
+     */
+    function enableBe2ch()
+    {
+        global $_conf;
+        
+        if (
+            strlen($_conf['be_2ch_password']) && $_conf['be_2ch_mail']
+            //|| isset($_COOKIE['DMDM']) && isset($_COOKIE['MDMD'])
+        ) {
+            return true;
+        }
+        return false;
+    }
+    
+    /**
+     * ƒ†[ƒU[Ý’肵‚½ƒAƒJƒEƒ“ƒg‚ŁAbe.2ch.net‚ɃƒOƒCƒ“‚µ‚ÄDMDM, MDMD‚ðŽæ“¾‚·‚é
+     * i”FØƒR[ƒh‚Íurlencode‚³‚ꂽ‚܂܂̏ó‘ԁj
+     *
+     * @access  public
+     * @return  array|false|null  ”FØƒR[ƒh”z—ñ|”FØ‚Å‚«‚È‚©‚Á‚½|–³Ý’肾‚Á‚½
+     */
+    function getBe2chCodeWithUserConf()
+    {
+        global $_conf;
+
+        if ($_conf['be_2ch_mail'] && strlen($_conf['be_2ch_password'])) {
+            $r = P2Util::getBe2chCodeByMailPass($_conf['be_2ch_mail'], $_conf['be_2ch_password']);
+            if (is_array($r)) {
+                return $r;
+            }
+            return false;
+        }
+        return null;
+    }
+    
+    /**
+     * be.2ch.net‚ɃƒOƒCƒ“‚µ‚ÄDMDM, MDMD‚ðŽæ“¾‚·‚é
+     * i”FØƒR[ƒh‚Íurlencode‚³‚ꂽ‚܂܂̏ó‘ԁj
+     *
+     * @access  private
+     * @return  array|string ¬Œ÷|ƒGƒ‰[ƒƒbƒZ[ƒW
+     */
+    function getBe2chCodeByMailPass($mail, $pass)
+    {
+        global $_conf;
+        
+        require_once 'HTTP/Request.php';
+    
+        $params = array('timeout' => $_conf['fsockopen_time_limit']);
+        
+        if (!empty($GLOBALS['_conf']['proxy_use'])) {
+            $params['proxy_host'] = $GLOBALS['_conf']['proxy_host'];
+            $params['proxy_port'] = $GLOBALS['_conf']['proxy_port'];
+        }
+        
+        $req = new HTTP_Request('http://be.2ch.net/test/login.php', $params);
+        
+        $req->setMethod(HTTP_REQUEST_METHOD_POST);
+        $req->addPostData('m', $mail);
+        $be2chEncoding = 'eucJP-win';
+        $req->addPostData('p', mb_convert_encoding($pass, $be2chEncoding, mb_internal_encoding()));
+        $req->addPostData('submit', mb_convert_encoding('“o˜^', $be2chEncoding, mb_internal_encoding()));
+        
+        //var_dump($req);
+        // If-Modified-Since => gmdate('D, d M Y H:i:s', time()) . ' GMT';
+        
+        /*
+        if ($headers) {
+            foreach ($headers as $k => $v) {
+                $req->addHeader($k, $v);
+            }
+        }
+        */
+        
+        // 2011/01/11 ³”Û‚ÍSet-Cookie‚Å”»•Ê‚·‚ê‚΂¢‚¢
+        // ‘Ê–Ú‚È‚Æ‚«‚́u•s³‚ȃŠƒNƒGƒXƒgv‚Æ‚©uƒpƒXƒ[ƒh‚©ƒ[ƒ‹ƒAƒhƒŒƒX‚ª³‚µ‚­‚È‚¢‚悤‚Å‚·Bv‚ª•Ô‚é
+        // ¬Œ÷Žž
+        /*
+<html><head> 
+<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" /> 
+<title>BeƒƒOƒCƒ“</title> 
+<script type="text/javascript"><!--
+ 
+var exp = new Date();
+exp.setTime(exp.getTime() + 5 * 365 * 86400 * 1000);
+exp = exp.toUTCString();
+ 
+document.cookie = "DMDM=1127232; expires=" + exp + "; path=/; domain=.2ch.net";
+document.cookie = "MDMD=jy7MPa%2Bu0r7mScKRop3YBoPZ0HH6Is00; expires=" + exp + "; path=/; domain=.2ch.net";
+ 
+//--></script> 
+</head><body> 
+ƒƒOƒCƒ“Š®—¹
+<hr />‚±‚¿‚ç‚©‚ç<a href="/">ŒfŽ¦”Â</a>‚É“ü‚Á‚Ä‚­‚¾‚³‚¢B
+</body></html>
+*/
+        $response = $req->sendRequest(); // $saveBody = true
+//var_dump($req->getResponseHeader());
+//var_dump($req->getResponseCookies());
+//var_dump($req->getResponseCode());
+//var_dump(mb_convert_encoding($req->getResponseBody(), 'SJIS-win', 'eucJP-win'));
+
+        if (PEAR::isError($response)) {
+            $error_msg = $response->getMessage();
+            
+        } else {
+            $code = $req->getResponseCode();
+            // ¬Œ÷‚Æ‚Ý‚È‚·ƒR[ƒh
+            if ($code == 200 || $code == 206) {
+                //return $req->getResponseBody();
+                if ($cookies = $req->getResponseCookies()) { // urlencode‚³‚ꂽó‘Ô
+                    $r = array();
+                    foreach ($cookies as $cookie) {
+                        if (in_array($cookie['name'], array('DMDM', 'MDMD'))) {
+                            $r[$cookie['name']] = $cookie['value'];
+                        }
+                    }
+                    if (!empty($r['DMDM']) && !empty($r['MDMD'])) {
+                        return $r;
+                    }
+                }
+                
+                //$error_msg = mb_convert_encoding($req->getResponseBody(), 'SJIS-win', 'eucJP-win');
+                
+            /*
+            // XV‚ª‚È‚¯‚ê‚Înull‚ð•Ô‚·
+            } elseif ($code == 304) {
+                // 304‚ÌŽž‚́A$req->getResponseBody() ‚͋󕶎š""‚Æ‚È‚é
+                return null;
+            */
+            } else {
+                //var_dump($req->getResponseHeader());
+                $error_msg = $code;
+            }
+        }
+        
+        return false; // $error_msg
+    }
+    
+    /**
+     * V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒN‚ðŽæ“¾‚·‚é
+     *
+     * @access  private
+     * @return  array
+     */
+    function getMatomeCacheLinks()
+    {
+        global $_conf;
+    
+        $max = $_conf['matome_cache_max'];
+        $links = array();
+        for ($i = 0; $i <= $max; $i++) {
+            $dnum = $i ? '.' . $i : '';
+            $file = $_conf['matome_cache_path'] . $dnum . $_conf['matome_cache_ext'];
+            //echo '<!-- ' . $file . ' -->';
+            if (file_exists($file)) {
+                $filemtime = filemtime($file);
+                $date = date('Y/m/d G:i:s', $filemtime);
+                $b = filesize($file) / 1024;
+                $kb = round($b, 0);
+                $atag = P2View::tagA(
+                    UriUtil::buildQueryUri('read_new.php', array('cview' => '1', 'cnum' => "$i", 'filemtime' => $filemtime)),
+                    hs($date),
+                    array('target' => 'read')
+                );
+                $links[] = sprintf('%s %dKB', $atag, $kb);
+            }
+        }
+        return $links;
+    }
+    
     // {{{ @deprecated 2010/01/26
     
     function getMyHost()

Modified: p2/trunk/lib/P2View.php
===================================================================
--- p2/trunk/lib/P2View.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/lib/P2View.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -5,8 +5,27 @@
 class P2View
 {
     /**
-     * 2008/09/28 $_conf['k_to_index_ht'] を廃止して、こちらを利用する
+     * V’…‚܂Ƃߓǂ݂̃LƒƒƒbƒVƒ…ƒŠƒ“ƒNHTML‚ð•Ô‚·
      *
+     * @return  string  HTML
+     */
+    function getMatomeCacheLinksHtml()
+    {
+        $html = '';
+        if ($links = P2Util::getMatomeCacheLinks()) {
+            if (UA::isIPhoneGroup()) {
+                $html .= '<ul><li class="group">V’…‚Ü‚Æ‚ß“Ç‚Ý‚Ì‘O‰ñƒLƒƒƒbƒVƒ…</li></ul>';
+                $html .= '<div id="usage" class="panel"><filedset>' . implode('<br>', $links)  .'</fildset></div>'. "\n";
+            } else {
+                $html .= '<p>V’…‚Ü‚Æ‚ß“Ç‚Ý‚Ì‘O‰ñƒLƒƒƒbƒVƒ…‚ð•\Ž¦<br>' . implode('<br>', $links) . '</p>' . "\n";
+            }
+        }
+        return $html;
+    }
+    
+    /**
+     * 2008/09/28 $_conf['k_to_index_ht'] ‚ð”pŽ~‚µ‚āA‚±‚¿‚ç‚ð—˜—p‚·‚é
+     *
      * @static
      * @access  public
      * @return  string
@@ -37,16 +56,16 @@
     }
     
     /**
-     * HTMLタグ <a href="$url">$html</a> を生成する
+     * HTMLƒ^ƒO <a href="$url">$html</a> ‚𐶐¬‚·‚é
      *
      * @static
      * @access  public
-     * @param   string  $url   自動で htmlspecialchars() される。
-     *                  2007/10/04 http_build_query() は セパレータとして arg_separator.output の設定値を参照するが、
-     *                  PHP5.1.2から引数で指定できるようになったので、自動でhtmlspecialchars()をかけるように変更した。
-     *                  PEARのcompatのは、まだ第三引数を取れないようだ。。!
-     * @param   string  $html  リンク文字列やHTML。文字列であれば手動で htmlspecialchars() しておくこと。
-     * @param   array   $attr  a要素の追加属性。自動で htmlspecialchars() がかけられる(keyも念のため)
+     * @param   string  $url   Ž©“®‚Å htmlspecialchars() ‚³‚ê‚éB
+     *                  2007/10/04 http_build_query() ‚Í ƒZƒpƒŒ[ƒ^‚Æ‚µ‚Ä arg_separator.output ‚̐ݒè’l‚ðŽQÆ‚·‚邪A
+     *                  PHP5.1.2‚©‚çˆø”‚ÅŽw’è‚Å‚«‚é‚悤‚É‚È‚Á‚½‚̂ŁAŽ©“®‚Åhtmlspecialchars()‚ð‚©‚¯‚é‚悤‚ɕύX‚µ‚½B
+     *                  PEAR‚Ìcompat‚̂́A‚Ü‚¾‘æŽOˆø”‚ðŽæ‚ê‚È‚¢‚悤‚¾BBI
+     * @param   string  $html  ƒŠƒ“ƒN•¶Žš—ñ‚âHTMLB•¶Žš—ñ‚Å‚ ‚ê‚ÎŽè“®‚Å htmlspecialchars() ‚µ‚Ä‚¨‚­‚±‚ƁB
+     * @param   array   $attr  a—v‘f‚̒ljÁ‘®«BŽ©“®‚Å htmlspecialchars() ‚ª‚©‚¯‚ç‚ê‚éikey‚à”O‚Ì‚½‚߁j
      * @return  string
      */
     function tagA($url, $html = null, $attr = array())
@@ -69,7 +88,7 @@
     /**
      * @static
      * @access  public
-     * @return  void  HTMLタグ出力
+     * @return  void  HTMLƒ^ƒOo—Í
      */
     function printDoctypeTag()
     {
@@ -141,7 +160,7 @@
     /**
      * @static
      * @access  public
-     * @return  void  HTML出力
+     * @return  void  HTMLo—Í
      */
     function printIncludeCssHtml($css)
     {
@@ -160,7 +179,7 @@
     /**
      * @static
      * @access  public
-     * @return  void  HTML出力
+     * @return  void  HTMLo—Í
      */
     function printExtraHeadersHtml($frameset = false)
     {
@@ -170,7 +189,7 @@
     /**
      * @static
      * @access  public
-     * @return  void  HTML出力
+     * @return  void  HTMLo—Í
      */
     function printHeadMetasHtml($frameset = false)
     {
@@ -185,7 +204,7 @@
             ),
         );
         /*
-        // 省略
+        // È—ª
         if (UA::isPC() || UA::isIPhoneGroup()) {
             $metas[] = array(
                 'http-equiv' => 'Content-Style-Type',
@@ -204,7 +223,7 @@
                 
                 // <meta name="viewport" content="width=device-width, initial-scale=1.0">
                 // initial-scale=1.0, maximum-scale=1.0
-                // initial-scale=1.0 とすると、縦→横と向きを変えた時に、拡大率が大きい状態になってしまう。
+                // initial-scale=1.0 ‚Æ‚·‚é‚ƁAc¨‰¡‚ÆŒü‚«‚ð•Ï‚¦‚½Žž‚ɁAŠg‘å—¦‚ª‘å‚«‚¢ó‘Ô‚É‚È‚Á‚Ä‚µ‚Ü‚¤B
                 $metas[] = array(
                     'name'    => 'viewport',
                     'content' => 'width=device-width'
@@ -227,10 +246,10 @@
     }
     
     /**
-     * [todo] 今はまだ使っていない。$_conf['templateDir'] の設定をしてから。
+     * [todo] ¡‚Í‚Ü‚¾Žg‚Á‚Ä‚¢‚È‚¢B$_conf['templateDir'] ‚̐ݒè‚ð‚µ‚Ä‚©‚çB
      * @static
      * @access  public
-     * @return  void  HTML出力
+     * @return  void  HTMLo—Í
      */
     function render($template, $params)
     {

Modified: p2/trunk/lib/ThreadRead.php
===================================================================
--- p2/trunk/lib/ThreadRead.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/lib/ThreadRead.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -347,7 +347,7 @@
                 }
                 $req = new HTTP_Request($url, $params);
                 $req->setMethod('GET');
-                $err = $req->sendRequest(true);
+                $err = $req->sendRequest(true); // $saveBody = true
                 
                 if (PEAR::isError($err)) {
                     //var_dump('error');

Added: p2/trunk/lib/edit_conf_user.funcs.php
===================================================================
--- p2/trunk/lib/edit_conf_user.funcs.php	                        (rev 0)
+++ p2/trunk/lib/edit_conf_user.funcs.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -0,0 +1,74 @@
+<?php
+//=============================================================
+// edit_conf_user.php, edit_conf_user_i.php ‚Å‚Ì‚Ý—˜—p‚·‚éŠÖ”
+//=============================================================
+
+/**
+ * ƒtƒHƒ‹ƒg’l $conf_user_def ‚ƕύX’l $_POST['conf_edit'] ‚Ì—¼•û‚ª‘¶Ý‚µ‚Ä‚¢‚āA
+ * ƒfƒtƒHƒ‹ƒg’l‚ƕύX’l‚ªˆÙ‚È‚éê‡‚̂ݐݒè•Û‘¶‘ΏۂƂȂéi‚»‚Ì‘¼‚̃f[ƒ^‚Í•Û‘¶‚³‚ꂸA”jŠü‚³‚ê‚éj
+ *
+ * @return  array
+ */
+function _getConfSave()
+{
+    global $_conf, $conf_user_def;
+    
+    // ¦“Á•Ê‚Èkeyiedit_conf_user.php ˆÈŠO‚Å‚àÝ’肳‚ꂤ‚é‚à‚Ì‚Í”jŠü‚¹‚¸‚É‚»‚Ì‚Ü‚ÜŽc‚·j
+    // ƒL[‚É–½–¼‹K‘¥iprefixj‚ð‚‚¯‚½•û‚ª‚¢‚¢‚©‚à ¨ ƒL[–¼•ÏX‚Ì•K—v‚ª‚ ‚é‚̂łЂƂ܂¸•Û—¯
+    $remain_keys = array('k_use_aas', 'maru_kakiko', 'index_menu_k', 'index_menu_k_from1');
+    
+    $conf_save = array();
+    foreach ($conf_user_def as $k => $v) {
+        if (isset($conf_user_def[$k]) && isset($_POST['conf_edit'][$k])) {
+            if ($conf_user_def[$k] != $_POST['conf_edit'][$k]) {
+                $conf_save[$k] = $_POST['conf_edit'][$k];
+            }
+            
+        } elseif (in_array($k, $remain_keys)) {
+            $conf_save[$k] = $_conf[$k];
+        }
+    }
+    return $conf_save;
+}
+
+/**
+ * ƒ‹[ƒ‹Ý’èi$conf_user_rulesj‚ÉŠî‚¢‚āAƒtƒBƒ‹ƒ^ˆ—iƒfƒtƒHƒ‹ƒgƒZƒbƒgj‚ðs‚¤
+ * 2007/10/10 $conf_user_rules ‚Í $conf_user_filters ‚ɉü–¼‚µ‚½‚¢
+ *
+ * @return  void
+ */
+function _applyRules()
+{
+    global $conf_user_rules, $conf_user_def;
+    
+    if (is_array($conf_user_rules)) {
+        foreach ($conf_user_rules as $k => $v) {
+            if (isset($_POST['conf_edit'][$k])) {
+                $def = isset($conf_user_def[$k]) ? $conf_user_def[$k] : null;
+                foreach ($v as $func) {
+                    $_POST['conf_edit'][$k] = call_user_func($func, $_POST['conf_edit'][$k], $def);
+                }
+            }
+        }
+    }
+}
+
+/**
+ * ‘I‘ðŽˆ‚É‚È‚¢’l‚̓fƒtƒHƒ‹ƒgƒZƒbƒg‚·‚é
+ */
+function _notSelToDef()
+{
+    global $conf_user_def, $conf_user_sel;
+    
+    $names = array_keys($conf_user_sel);
+    
+    if (is_array($names)) {
+        foreach ($names as $n) {
+            if (isset($_POST['conf_edit'][$n])) {
+                if (!array_key_exists($_POST['conf_edit'][$n], $conf_user_sel[$n])) {
+                    $_POST['conf_edit'][$n] = $conf_user_def[$n];
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

Modified: p2/trunk/lib/login_first.inc.php
===================================================================
--- p2/trunk/lib/login_first.inc.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/lib/login_first.inc.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -112,8 +112,8 @@
         $submit_ht = '<input type="submit" name="submit_newuser" value="V‹K“o˜^">';
     }
     
-    $login_form_ht = <<<EOP
-{$docomo_utn_ht}
+    $login_form_ht = $docomo_utn_ht;
+    $login_form_ht .= <<<EOP
 <form id="login" method="POST" action="{$REQUEST_URI_hs}" target="_self" utn>
     {$_conf['k_input_ht']}
     {$p_str['user']}: <input type="text" name="form_login_id" value="{$form_login_id_hs}" istyle="3" size="32" autocorrect="off" autocapitalize="off"><br>
@@ -243,6 +243,7 @@
 
     if ($show_login_form_flag) {
         echo $login_form_ht;
+        
         if (empty($GLOBALS['brazil']) and !(HostCheck::isAddrLocal() || HostCheck::isAddrPrivate())) {
         ?><p>
 	<font size="-1" color="gray">¦‚±‚̃y[ƒW‚̓vƒ‰ƒCƒx[ƒg—˜—p‚Ì‚½‚߂̃VƒXƒeƒ€‚Å‚·B<br>

Modified: p2/trunk/lib/post_options_loader.inc.php
===================================================================
--- p2/trunk/lib/post_options_loader.inc.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/lib/post_options_loader.inc.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -80,7 +80,7 @@
 
 // Be‘‚«ž‚Ý
 $htm['be2ch'] = '';
-if (P2Util::isHost2chs($host) and $_conf['be_2ch_code'] && $_conf['be_2ch_mail']) {
+if (P2Util::isHost2chs($host) and P2Util::enableBe2ch()) {
     $htm['be2ch'] = '<input id="submit_beres" type="submit" name="submit_beres" value="BE‚ŏ‘‚«ž‚Þ" onClick="setHiddenValue(this);">';
 }
 
@@ -89,7 +89,7 @@
 if (P2Util::isBbsBe2chNet($host, $bbs)) {
     // ‚â‚Á‚Ï‚è–³Œø‚É‚µ‚È‚¢B‘‚«ž‚ÝŽ¸”sŽž‚ɁA2ch‘¤‚ÅBeƒƒOƒCƒ“‚Ö‚Ì—U“±‚ª‚ ‚é‚̂ŁB
     //$res_disabled_at = ' disabled';
-    if ($_conf['be_2ch_code'] && $_conf['be_2ch_mail']) {
+    if (P2Util::enableBe2ch()) {
         $htm['title_need_be'] = ' title="Be”‚ɂ‚«AŽ©“®Be‘‚«ž‚Ý‚µ‚Ü‚·"';
     } else {
         $htm['title_need_be'] = ' title="‘‚«ž‚Þ‚É‚ÍBeƒƒOƒCƒ“‚ª•K—v‚Å‚·"';

Modified: p2/trunk/login.php
===================================================================
--- p2/trunk/login.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/login.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -230,12 +230,12 @@
 
 P2Util::printInfoHtml();
 ?>
-<p id="login_status">
+<div id="login_status">
 <?php eh($p_str['autho_user']) ?>: <?php eh($_login->user_u) ?><br>
 <?php echo $auth_ctl_html, $auth_cookie_html ?>
 <br>
 [<a href="./index.php?logout=1" target="_parent">rep2‚©‚ç<?php eh($p_str['logout']); ?>‚·‚é</a>]
-</p>
+</div>
 
 <?php
 // ”FØƒ†[ƒU“o˜^ƒtƒH[ƒ€

Modified: p2/trunk/post.php
===================================================================
--- p2/trunk/post.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/post.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -685,21 +685,32 @@
     }
     
     // be.2ch ”FØƒNƒbƒL[
+    // ŠO•”ƒc[ƒ‹(p2proxy)—p
     if (isset($_POST['MDMD']) && isset($_POST['DMDM'])) {
-        // ŠO•”ƒc[ƒ‹(p2proxy)—p
-        $cookies_to_send .= sprintf(' MDMD=%s;', $_POST['MDMD']);
-        $cookies_to_send .= sprintf(' DMDM=%s;', $_POST['DMDM']);
-    // be”‚ł͎©“®Be‘‚«ž‚Ý‚ðŽŽ‚Ý‚é
+        $cookies_to_send .= sprintf(' MDMD=%s;', urlencode($_POST['MDMD']));
+        $cookies_to_send .= sprintf(' DMDM=%s;', urlencode($_POST['DMDM']));
+        
+    // be‘‚«ž‚݁Bbe”‚ł͎©“®Be‘‚«ž‚Ý‚ðŽŽ‚Ý‚éB
     } elseif (P2Util::isBbsBe2chNet($host, $bbs) || !empty($_REQUEST['submit_beres'])) {
-        $cookies_to_send .= sprintf(' MDMD=%s;', $_conf['be_2ch_code']); // be.2ch.net‚Ì”FØƒR[ƒh
-        $cookies_to_send .= sprintf(' DMDM=%s;', $_conf['be_2ch_mail']); // be.2ch.net‚Ì“o˜^ƒ[ƒ‹ƒAƒhƒŒƒX
+        /*
+        if ($_conf['be_2ch_DMDM'] && $_conf['be_2ch_MDMD']) {
+            $cookies_to_send .= sprintf(' DMDM=%s;', urlencode(urldecode($_conf['be_2ch_DMDM'])));
+            $cookies_to_send .= sprintf(' MDMD=%s;', urlencode(urldecode($_conf['be_2ch_MDMD'])));
+        } else {
+        */
+            $ar = P2Util::getBe2chCodeWithUserConf(); // urlencode‚³‚ꂽ‚܂܂̏ó‘Ô
+            if (is_array($ar)) {
+                $cookies_to_send .= sprintf(' DMDM=%s;', $ar['DMDM']);
+                $cookies_to_send .= sprintf(' MDMD=%s;', $ar['MDMD']);
+            }
+        //}
     }
     
-    !$cookies_to_send and $cookies_to_send = ' ;';
+    if ($cookies_to_send) {
+        $request .= 'Cookie:' . $cookies_to_send . "\r\n";
+        //$request .= 'Cookie: PON='.$SPID.'; NAME='.$FROM.'; MAIL='.$mail."\r\n";
+    }
     
-    $request .= 'Cookie:' . $cookies_to_send . "\r\n";
-    //$request .= 'Cookie: PON='.$SPID.'; NAME='.$FROM.'; MAIL='.$mail."\r\n";
-    
     $request .= 'Connection: Close' . "\r\n";
     
     // {{{ POST‚ÌŽž‚̓wƒbƒ_‚ð’ljÁ‚µ‚Ä––”ö‚ÉURLƒGƒ“ƒR[ƒh‚µ‚½ƒf[ƒ^‚ð“Y•t

Modified: p2/trunk/read_new.php
===================================================================
--- p2/trunk/read_new.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/read_new.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -619,6 +619,9 @@
 ?>
 <div id="ntt<?php eh($_newthre_num); ?>" align="center">
     <?php echo $sb_ht; ?> ‚Ì <?php echo $atag; ?>
+    <?php if (!empty($GLOBALS['_is_matome_shinchaku_naipo'])) {
+        printf('<div align="right">%s</div>', P2View::getMatomeCacheLinksHtml());
+    } ?>
 </div>
 
 </body></html>

Modified: p2/trunk/read_new_i.php
===================================================================
--- p2/trunk/read_new_i.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/read_new_i.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -555,7 +555,8 @@
 
 if (!$aThreadList->num) {
     $GLOBALS['_is_matome_shinchaku_naipo'] = true;
-    ?>V’…ƒŒƒX‚Í‚È‚¢‚Û<?php
+    ?><br>V’…ƒŒƒX‚Í‚È‚¢‚Û<br><br><?php
+    echo P2View::getMatomeCacheLinksHtml();
 }
 
 $index_uri = UriUtil::buildQueryUri('index.php', array(UA::getQueryKey() => UA::getQueryValue()));

Modified: p2/trunk/read_new_k.php
===================================================================
--- p2/trunk/read_new_k.php	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/read_new_k.php	2011-01-16 07:42:18 UTC (rev 901)
@@ -490,7 +490,15 @@
 }
 
 ?>
-<div><?php echo $ptitle_btm_atag; ?>‚Ì<?php echo $read_new_atag; ?></div>
+<div>
+<?php echo $ptitle_btm_atag; ?>‚Ì<?php echo $read_new_atag; ?>
+<?php
+if (!empty($GLOBALS['_is_matome_shinchaku_naipo'])) {
+    echo P2View::getHrHtmlK();
+    echo P2View::getMatomeCacheLinksHtml();
+}
+?>
+</div>
 
 <?php echo $hr . P2View::getBackToIndexKATag(); ?>
 </body></html>

Modified: p2/trunk/style/login_css.inc
===================================================================
--- p2/trunk/style/login_css.inc	2011-01-10 14:49:28 UTC (rev 900)
+++ p2/trunk/style/login_css.inc	2011-01-16 07:42:18 UTC (rev 901)
@@ -12,7 +12,7 @@
 	border-bottom: solid 1px #ccc;
 }
 
-p#login_status{
+div#login_status{
 	padding:8px 12px 8px 12px;
 }
 



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