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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 24日 (日) 19:24:33 JST


Revision: 800
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=800
Author:   rsk
Date:     2010-01-24 19:24:33 +0900 (Sun, 24 Jan 2010)

Log Message:
-----------
expack:
- 携帯・iPhoneモードでは名前欄の串焼きマークも短縮するようにした。
- バージョンアップ判定と移行スクリプト関連のバグを修正。

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/conf/ip_iphone.php
    p2ex/trunk/edit_conf_user.php
    p2ex/trunk/lib/ShowThreadK.php
    p2ex/trunk/lib/bootstrap.php
    p2ex/trunk/lib/migrators/100120_0700.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2010-01-23 15:04:30 UTC (rev 799)
+++ p2ex/trunk/conf/conf.inc.php	2010-01-24 10:24:33 UTC (rev 800)
@@ -51,11 +51,6 @@
 // Šî–{Ý’菈—‚ðŽÀs
 p2_init();
 
-// ƒNƒŠ[ƒ“ƒAƒbƒv
-if (basename($_SERVER['SCRIPT_NAME']) != 'edit_conf_user.php') {
-    unset($conf_user_def, $conf_user_rules, $conf_user_rad, $conf_user_sel);
-}
-
 // E_NOTICE ‚¨‚æ‚шÖق̔z—ñ‰Šú‰»œ‚¯
 $_conf['filtering'] = false;
 $hd = array('word' => null);
@@ -72,7 +67,6 @@
     global $MYSTYLE, $STYLE, $debug;
     global $skin, $skin_en, $skin_name, $skin_uniq;
     global $_conf, $_info_msg_ht, $_login, $_p2session;
-    global $conf_user_def, $conf_user_rules, $conf_user_rad, $conf_user_sel;
 
     // ƒGƒ‰[o—͐ݒè
     if (defined('E_DEPRECATED')) {
@@ -269,6 +263,7 @@
     // {{{ •Ï”Ý’è
 
     $preferences = array(
+        'conf_user_file'    => 'conf_user.srd.cgi',     // ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹ (ƒVƒŠƒAƒ‰ƒCƒYƒhƒf[ƒ^)
         'favita_brd'        => 'p2_favita.brd',         // ‚¨‹C‚ɔ (brd)
         'favlist_idx'       => 'p2_favlist.idx',        // ‚¨‹C‚ɃXƒŒ (idx)
         'recent_idx'        => 'p2_recent.idx',         // Å‹ß“Ç‚ñ‚¾ƒXƒŒ (idx)

Modified: p2ex/trunk/conf/ip_iphone.php
===================================================================
--- p2ex/trunk/conf/ip_iphone.php	2010-01-23 15:04:30 UTC (rev 799)
+++ p2ex/trunk/conf/ip_iphone.php	2010-01-24 10:24:33 UTC (rev 800)
@@ -2,13 +2,32 @@
 
 /**
  * iPhone‚̃Šƒ‚[ƒgƒzƒXƒg³‹K•\Œ»‚ÆIPƒAƒhƒŒƒX‘шæ
+ *
+ * 126.240.0.0/12 ‚ð /16 ‚²‚Æ‚É’²‚ׂĂ݂é‚Æ...
+ * 126.240.*.* -> pw126240*.0.tik.panda-world.ne.jp
+ * 126.241.*.* -> pw126241*.1.tik.panda-world.ne.jp
+ * 126.242.*.* -> ai126242*.tss.access-internet.ne.jp
+ * 126.243.*.* -> om126243*.openmobile.ne.jp
+ * 126.244.*.* -> pw126244*.4.tik.panda-world.ne.jp
+ * 126.245.*.* -> pw126245*.5.tik.panda-world.ne.jp
+ * 126.246.*.* -> pw126246*.6.tik.panda-world.ne.jp
+ * 126.247.*.* -> pw126247*.7.tik.panda-world.ne.jp
+ * 126.247.*.* -> pw126247*.7.tik.panda-world.ne.jp
+ * 126.248.*.* -> pw126248*.8.tss.panda-world.ne.jp
+ * 126.249.*.* -> pw126249*.9.tss.panda-world.ne.jp
+ * 126.250.*.* -> pw126250*.10.tss.panda-world.ne.jp
+ * 126.251.*.* -> pw126251*.11.tss.panda-world.ne.jp
+ * 126.252.*.* -> pw126252*.12.tss.panda-world.ne.jp
+ * 126.253.*.* -> pw126253*.13.tss.panda-world.ne.jp
+ * 126.254.*.* -> pw126254*.14.tss.panda-world.ne.jp
+ * 126.255.*.* -> pw126255*.15.tss.panda-world.ne.jp
  */
 
-$reghost = '/\\.(?:[0-9]|1[0-5])\\.tik\\.panda-world\\.ne\\.jp$/';
+$reghost = '/\\.panda-world\\.ne\\.jp$/';
 
 $bands = array(
-    '126.240.0.0/12', // ƒ\ƒtƒgƒoƒ“ƒNBB‚ª 126.0.0.0/8 ‚È‚Ì‚Å
-                      // iPhone‚ÉŒÀ’è‚Å‚«‚È‚¢‚¨‚»‚ê‚ ‚è
+    '126.240.0.0/12', // ƒ\ƒtƒgƒoƒ“ƒNBB‚ª 126.0.0.0/8 ‚ðŽ‚Á‚Ä‚¨‚èA
+                      // iPhoneˆÈŠO‚̃Xƒ}[ƒgƒtƒHƒ“—p‚̑шæ‚àŠÜ‚Þ
 );
 
 /*

Modified: p2ex/trunk/edit_conf_user.php
===================================================================
--- p2ex/trunk/edit_conf_user.php	2010-01-23 15:04:30 UTC (rev 799)
+++ p2ex/trunk/edit_conf_user.php	2010-01-24 10:24:33 UTC (rev 800)
@@ -4,7 +4,6 @@
  */
 
 require_once './conf/conf.inc.php';
-require_once P2_CONF_DIR . '/conf_user_def.inc.php';
 
 $_login->authorize(); // ƒ†[ƒU”FØ
 
@@ -25,6 +24,8 @@
 define('P2_EDIT_CONF_FILE_ADMIN',    1024);
 define('P2_EDIT_CONF_FILE_ADMIN_EX', 2048);
 
+include P2_CONF_DIR . '/conf_user_def.inc.php';
+
 //=====================================================================
 // ‘Oˆ—
 //=====================================================================
@@ -45,7 +46,7 @@
     applyRules();
 
     // ƒ|ƒXƒg‚³‚ꂽ’l > Œ»Ý‚Ì’l > ƒfƒtƒHƒ‹ƒg’l ‚̏‡‚ŐV‚µ‚¢Ý’è‚ðì¬‚·‚é
-    $conf_save = array('.' => P2_VERSION_ID);
+    $conf_save = array('.' => $_conf['p2expack']);
     foreach ($conf_user_def as $k => $v) {
         if (array_key_exists($k, $_POST['conf_edit'])) {
             $conf_save[$k] = $_POST['conf_edit'][$k];

Modified: p2ex/trunk/lib/ShowThreadK.php
===================================================================
--- p2ex/trunk/lib/ShowThreadK.php	2010-01-23 15:04:30 UTC (rev 799)
+++ p2ex/trunk/lib/ShowThreadK.php	2010-01-24 10:24:33 UTC (rev 800)
@@ -17,8 +17,6 @@
 
     static private $_spm_objects = array();
 
-    public $BBS_NONAME_NAME = '';
-
     public $am_autong = false; // Ž©“®AA—ª‚ð‚·‚é‚©”Û‚©
 
     public $aas_rotate = '90‹‰ñ“]'; // AAS ‰ñ“]ƒŠƒ“ƒN•¶Žš—ñ
@@ -34,6 +32,9 @@
 
     //private $_lineBreaksReplace; // ˜A‘±‚·‚é‰üs‚Ì’uŠ·•¶Žš—ñ
 
+    private $_nanashiName = null;   // ƒfƒtƒHƒ‹ƒg‚Ì–¼‘O
+    private $_kushiYakiName = null; // BBQ‚ɏĂ©‚ê‚Ä‚¢‚é‚Æ‚«‚Ì–¼‘OÚ“ªŽ«
+
     // }}}
     // {{{ constructor
 
@@ -66,15 +67,21 @@
         }
         $this->_url_handlers[] = 'plugin_linkURL';
 
-        $this->BBS_NONAME_NAME = null;
         if (!$_conf['mobile.bbs_noname_name']) {
             $st = new SettingTxt($this->thread->host, $this->thread->bbs);
             $st->setSettingArray();
-            if (!empty($st->setting_array['BBS_NONAME_NAME'])) {
-                $this->BBS_NONAME_NAME = $st->setting_array['BBS_NONAME_NAME'];
+            if (array_key_exists('BBS_NONAME_NAME', $st->setting_array)) {
+                $BBS_NONAME_NAME = $st->setting_array['BBS_NONAME_NAME'];
+                if (strlen($BBS_NONAME_NAME)) {
+                    $this->_nanashiName = $BBS_NONAME_NAME;
+                }
             }
         }
 
+        if (P2Util::isHost2chs($aThread->host)) {
+            $this->_kushiYakiName = ' </b>[\{}@{}@{}-]<b> ';
+        }
+
         if ($_conf['mobile.date_zerosuppress']) {
             $this->_dateIdPattern = '~^(?:' . date('Y|y') . ')/(?:0(\\d)|(\\d\\d))?(?:(/)0)?~';
             $this->_dateIdReplace = '$1$2$3';
@@ -154,11 +161,6 @@
             $idstr = null;
         }
 
-        // ƒfƒtƒHƒ‹ƒg‚Ì–¼‘O‚Æ“¯‚¶‚È‚çÈ—ª
-        if ($name === $this->BBS_NONAME_NAME) {
-            $name = '';
-        }
-
         // {{{ ƒtƒBƒ‹ƒ^ƒŠƒ“ƒO
 
         if (isset($_REQUEST['word']) && strlen($_REQUEST['word']) > 0) {
@@ -182,7 +184,6 @@
             $res_id = "r{$i}";
         }
 
-
         // NG‚ ‚ځ[‚ñƒ`ƒFƒbƒN
         $nong = !empty($_GET['nong']);
         $ng_type = $this->_ngAbornCheck($i, strip_tags($name), $mail, $date_id, $id, $msg, $nong, $ng_info);
@@ -203,8 +204,22 @@
             $ngaborns_body_hits = self::$_ngaborns_body_hits;
         }
 
-        // {{{ “ú•tEID‚𒲐®
+        // {{{ –¼‘O‚Æ“ú•tEID‚𒲐®
 
+        // ‹øÄ‚«ƒ}[ƒN‚ð’Zk
+        if ($this->_kushiYakiName !== null && strpos($name, $this->_kushiYakiName) === 0) {
+            $name = substr($name, strlen($this->_kushiYakiName));
+            // ƒfƒtƒHƒ‹ƒg‚Ì–¼‘O‚͏ȗª
+            if ($name === $this->_nanashiName) {
+                $name = '[‹ø]';
+            } else {
+                $name = '[‹ø]' . $name;
+            }
+        // ƒfƒtƒHƒ‹ƒg‚Ì–¼‘O‚Æ“¯‚¶‚È‚çÈ—ª
+        } elseif ($name === $this->_nanashiName) {
+            $name = '';
+        }
+
         // Œ»Ý‚Ì”N†‚͏ȗªƒJƒbƒg‚·‚éBŒŽ“ú‚̐擪0‚àƒJƒbƒgB
         $date_id = preg_replace($this->_dateIdPattern, $this->_dateIdReplace, $date_id);
 

Modified: p2ex/trunk/lib/bootstrap.php
===================================================================
--- p2ex/trunk/lib/bootstrap.php	2010-01-23 15:04:30 UTC (rev 799)
+++ p2ex/trunk/lib/bootstrap.php	2010-01-24 10:24:33 UTC (rev 800)
@@ -8,9 +8,6 @@
 
 // {{{ ƒ†[ƒU[Ý’è “Çž
 
-// ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹
-$_conf['conf_user_file'] = $_conf['pref_dir'] . '/conf_user.srd.cgi';
-
 // ƒ†[ƒU[Ý’肪‚ ‚ê‚Γǂݍž‚Þ
 if (file_exists($_conf['conf_user_file'])) {
     if ($cont = file_get_contents($_conf['conf_user_file'])) {
@@ -48,26 +45,28 @@
         // ƒfƒtƒHƒ‹ƒgÝ’è‚ð“ǂݍž‚݁Aƒ†[ƒU[Ý’è‚Æ‚Æ‚à‚Ƀ}[ƒW
         include P2_CONF_DIR . '/conf_user_def.inc.php';
         $_conf = array_merge($_conf, $conf_user_def, $conf_user);
-        $creae_config_cache = true;
+        $save_conf_user = true;
     } else {
         // ƒLƒƒƒbƒVƒ…‚³‚ê‚Ä‚¢‚½ƒ†[ƒU[Ý’è‚ðƒ}[ƒW
         $_conf = array_merge($_conf, $conf_user);
-        $creae_config_cache = false;
+        $save_conf_user = false;
     }
 } else {
     // ƒfƒtƒHƒ‹ƒgÝ’è‚ð“ǂݍž‚݁Aƒ}[ƒW
     include P2_CONF_DIR . '/conf_user_def.inc.php';
     $_conf = array_merge($_conf, $conf_user_def);
-    $creae_config_cache = true;
+    $save_conf_user = true;
 }
 
-// V‚µ‚¢ƒ†[ƒU[Ý’è‚ðƒLƒƒƒbƒVƒ…
-if ($creae_config_cache) {
-    $conf_user = array('.' => $_conf['p2expack']);
+// V‚µ‚¢ƒ†[ƒU[Ý’è‚ðƒVƒŠƒAƒ‰ƒCƒY‚µ‚Ä•Û‘¶
+if ($save_conf_user) {
+    $conf_save = array('.' => $_conf['p2expack']);
     foreach ($conf_user_def as $k => $v) {
-        $conf_user[$k] = $_conf[$k];
+        $conf_save[$k] = $_conf[$k];
     }
-    $cont = serialize($conf_user);
+
+    $cont = serialize($conf_save);
+    FileCtl::make_datafile($_conf['conf_user_file'], $_conf['conf_user_perm']);
     if (FileCtl::file_write_contents($_conf['conf_user_file'], $cont) === false) {
         $dispname = '$_conf[\'pref_dir\']/' . basename($_conf['conf_user_file']);
         p2die("ƒ†[ƒU[Ý’èƒtƒ@ƒCƒ‹ {$dispname} ‚ɏ‘‚«ž‚ß‚Ü‚¹‚ñ‚Å‚µ‚½B");

Modified: p2ex/trunk/lib/migrators/100120_0700.php
===================================================================
--- p2ex/trunk/lib/migrators/100120_0700.php	2010-01-23 15:04:30 UTC (rev 799)
+++ p2ex/trunk/lib/migrators/100120_0700.php	2010-01-24 10:24:33 UTC (rev 800)
@@ -92,6 +92,9 @@
     if ($oldKvs->getTableName() != $newKvs->getTableName()) {
         $oldKvs->prepare('DROP TABLE $__table')->execute();
     }
+
+    // ƒvƒŠƒyƒA[ƒhƒXƒe[ƒgƒƒ“ƒg‚ð”jŠü‚·‚邽‚ß‚É optimize()
+    $newKvs->optimize();
 }
 
 // }}}



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