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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 1日 (金) 03:52:35 JST


Revision: 755
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=755
Author:   rsk
Date:     2010-01-01 03:52:34 +0900 (Fri, 01 Jan 2010)

Log Message:
-----------
expack:
- A Happy New Year!
- rev.100101.0345.
- ホストの移転逆検出ができるようになった。
  (datを走査してオリジナルと思われるホストを抽出する)
- 公式p2からdatをダウンロードできるようになった。
-- dat取得権限のないスレッドでは自動的にモリタポを消費して
   権限を購入するので注意してください。
   ダウンロードに失敗したり、意図せず大量のモリタポを
   使ってしまっても自己責任です。
-- 有効にする方法は公式p2を使っての書き込みと同じ。

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/lib/P2Client.php
    p2ex/trunk/lib/P2Util.php
    p2ex/trunk/lib/ThreadRead.php
    p2ex/trunk/lib/read_header.inc.php
    p2ex/trunk/lib/read_header_k.inc.php
    p2ex/trunk/post.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/conf/conf.inc.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -7,7 +7,7 @@
 // ƒo[ƒWƒ‡ƒ“î•ñ
 $_conf = array(
     'p2version' => '1.7.29+1.8.x',  // rep2‚̃o[ƒWƒ‡ƒ“
-    'p2expack'  => '091231.1900',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
+    'p2expack'  => '100101.0345',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
     'p2name'    => 'expack',        // rep2‚Ì–¼‘O
 );
 

Modified: p2ex/trunk/lib/P2Client.php
===================================================================
--- p2ex/trunk/lib/P2Client.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/lib/P2Client.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -260,6 +260,7 @@
 
         // uƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚ށvƒŠƒ“ƒN‚Ì—L–³‚𒲂ׂéB
         // –³‚¢ê‡‚ÍdatŽæ“¾Œ ŒÀ‚ª‚ ‚é‚à‚Ì‚Æ‚·‚éB
+        // datŽæ“¾Œ ŒÀ‚ª‚È‚¢ê‡‚⃂ƒŠƒ^ƒ|’Ê’ ‚ÌŽc‚‚ª‘«‚è‚È‚¢ê‡‚̏ˆ—‚Í’[Ü‚éB
         $dom = new P2DOM($html);
         $expression = './/a[contains(@href, "' . self::SCRIPT_NAME_READ . '")'
                     . ' and contains(@href, "&moritapodat=")]';
@@ -272,7 +273,6 @@
         }
 
         // dat‚ðŽæ“¾‚·‚éB
-        // datŽæ“¾Œ ŒÀ‚ª‚È‚¢ê‡‚⃂ƒŠƒ^ƒ|’Ê’ ‚ÌŽc‚‚ª‘«‚è‚È‚¢ê‡‚̏ˆ—‚Í’[Ü‚éB
         $getData = array(
             self::REQUEST_PARAMETER_HOST => (string)$host,
             self::REQUEST_PARAMETER_BBS  => (string)$bbs,

Modified: p2ex/trunk/lib/P2Util.php
===================================================================
--- p2ex/trunk/lib/P2Util.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/lib/P2Util.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -1782,6 +1782,30 @@
     }
 
     // }}}
+    // {{{ getP2Client()
+
+    /**
+     * P2ClientƒNƒ‰ƒX‚̃Cƒ“ƒXƒ^ƒ“ƒX‚𐶐¬‚·‚é
+     *
+     * @param void
+     * @return P2Client
+     */
+    static public function getP2Client()
+    {
+        global $_conf;
+
+        if (!class_exists('P2Client', false)) {
+            require P2_LIB_DIR . '/P2Client.php';
+        }
+
+        try {
+            return new P2Client($_conf['p2_2ch_mail'], $_conf['p2_2ch_pass'], $_conf['cookie_dir']);
+        } catch (P2Exception $e) {
+            p2die($e->getMessage());
+        }
+    }
+
+    // }}}
     // {{{ debug()
     /*
     static public function debug()

Modified: p2ex/trunk/lib/ThreadRead.php
===================================================================
--- p2ex/trunk/lib/ThreadRead.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/lib/ThreadRead.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -84,6 +84,12 @@
                 include $_conf['sid2ch_php'];
                 $this->_downloadDat2chMaru($uaMona, $SID2ch);
 
+            // 2ch bbspink ƒ‚ƒŠƒ^ƒ|“Ç‚Ý
+            } elseif (P2Util::isHost2chs($this->host) && !empty($_GET['moritapodat']) &&
+                      $_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass'])
+            {
+                $this->_downloadDat2chMoritapo();
+
             // 2ch‚̉ߋŽƒƒO‘qŒÉ“Ç‚Ý
             } elseif (!empty($_GET['kakolog']) && !empty($_GET['kakoget'])) {
                 if ($_GET['kakoget'] == 1) {
@@ -110,7 +116,7 @@
      *
      * @return mix Žæ“¾‚Å‚«‚½‚©AXV‚ª‚È‚©‚Á‚½ê‡‚Ítrue‚ð•Ô‚·
      */
-    private function _downloadDat2ch($from_bytes)
+    protected function _downloadDat2ch($from_bytes)
     {
         global $_conf, $_info_msg_ht;
         global $debug;
@@ -245,8 +251,7 @@
                 // ƒXƒŒƒbƒh‚ª‚È‚¢‚Æ”»’f
                 } else {
                     fclose($fp);
-                    $this->_downloadDat2chNotFound();
-                    return false;
+                    return $this->_downloadDat2chNotFound();
                 }
 
             } else {
@@ -270,8 +275,7 @@
                             return $this->_downloadDat2ch($from_bytes);
                         } else {
                             fclose($fp);
-                            $this->_downloadDat2chNotFound();
-                            return false;
+                            return $this->_downloadDat2chNotFound();
                         }
 
                     } elseif ($code == "304") { // Not Modified
@@ -288,8 +292,7 @@
 
                     } else {
                         fclose($fp);
-                        $this->_downloadDat2chNotFound();
-                        return false;
+                        return $this->_downloadDat2chNotFound();
                     }
                 }
 
@@ -325,7 +328,7 @@
     /**
      * 2ch DAT‚ðƒ_ƒEƒ“ƒ[ƒh‚Å‚«‚È‚©‚Á‚½‚Æ‚«‚ɌĂяo‚³‚ê‚é
      */
-    private function _downloadDat2chNotFound()
+    protected function _downloadDat2chNotFound()
     {
         // 2ch, bbspink ‚È‚çread.cgi‚ÅŠm”F
         if (P2Util::isHost2chs($this->host)) {
@@ -346,7 +349,7 @@
      * @return bool
      * @see lib/login2ch.inc.php
      */
-    private function _downloadDat2chMaru($uaMona, $SID2ch)
+    protected function _downloadDat2chMaru($uaMona, $SID2ch)
     {
         global $_conf;
 
@@ -558,7 +561,7 @@
     /**
      * œID‚ł̎擾‚ª‚Å‚«‚È‚©‚Á‚½‚Æ‚«‚ɌĂяo‚³‚ê‚é
      */
-    private function _downloadDat2chMaruNotFound()
+    protected function _downloadDat2chMaruNotFound()
     {
         global $_conf;
 
@@ -567,8 +570,9 @@
             $_REQUEST['relogin2ch'] = true;
             return $this->downloadDat();
         } else {
-            $remarutori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true&amp;relogin2ch=true\">ÄŽæ“¾‚ðŽŽ‚Ý‚é</a>";
-            $this->getdat_error_msg_ht .= "<p>p2 info - œID‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B[{$remarutori_ht}]</p>";
+            $remarutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true&amp;relogin2ch=true\">ÄŽæ“¾‚ðŽŽ‚Ý‚é</a>]";
+            $moritori_ht = $this->_generateMoritapoDatLink();
+            $this->getdat_error_msg_ht .= "<p>p2 info - œID‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B{$remarutori_ht}{$moritori_ht}</p>";
             $this->diedat = true;
             return false;
         }
@@ -580,7 +584,7 @@
     /**
      * 2ch‚̉ߋŽƒƒO‘qŒÉ‚©‚çdat.gz‚ðƒ_ƒEƒ“ƒ[ƒh•‰ð“€‚·‚é
      */
-    private function _downloadDat2chKako($uri, $ext)
+    protected function _downloadDat2chKako($uri, $ext)
     {
         global $_conf, $_info_msg_ht;
 
@@ -735,10 +739,8 @@
 
     /**
      * ‰ß‹ŽƒƒO‚ðŽæ“¾‚Å‚«‚È‚©‚Á‚½‚Æ‚«‚ɌĂяo‚³‚ê‚é
-     *
-     * @private
      */
-    private function _downloadDat2chKakoNotFound($uri, $ext)
+    protected function _downloadDat2chKakoNotFound($uri, $ext)
     {
         global $_conf;
 
@@ -823,11 +825,12 @@
         if (preg_match($kakosoko_match, $read_response_html, $matches)) {
             $dat_response_status = "‚±‚̃XƒŒƒbƒh‚͉ߋŽƒƒO‘qŒÉ‚ÉŠi”[‚³‚ê‚Ä‚¢‚Ü‚·B";
             //if (file_exists($_conf['idpw2ch_php']) || file_exists($_conf['sid2ch_php'])) {
-                $marutori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>";
+                $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
             //} else {
-            //    $marutori_ht = "<a href=\"login2ch.php\" target=\"subject\">œIDƒƒOƒCƒ“</a>";
+            //    $marutori_ht = " [<a href=\"login2ch.php\" target=\"subject\">œIDƒƒOƒCƒ“</a>]";
             //}
-            $dat_response_msg = "<p>2ch info - ‚±‚̃XƒŒƒbƒh‚͉ߋŽƒƒO‘qŒÉ‚ÉŠi”[‚³‚ê‚Ä‚¢‚Ü‚·B [{$marutori_ht}]</p>";
+            $moritori_ht = $this->_generateMoritapoDatLink();
+            $dat_response_msg = "<p>2ch info - ‚±‚̃XƒŒƒbƒh‚͉ߋŽƒƒO‘qŒÉ‚ÉŠi”[‚³‚ê‚Ä‚¢‚Ü‚·B{$marutori_ht}{$moritori_ht}</p>";
 
         //
         // <title>‚ª‚»‚ñ‚È”ÂorƒXƒŒƒbƒh‚È‚¢‚Å‚·Bor error 3939
@@ -843,8 +846,9 @@
 
             } elseif (preg_match($waithtml_match, $read_response_html, $matches)) {
                 $dat_response_status = "‘à’·! ƒXƒŒƒbƒh‚Íhtml‰»‚³‚ê‚é‚Ì‚ð‘Ò‚Á‚Ä‚¢‚é‚悤‚Å‚·B";
-                $marutori_ht = "<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>";
-                $dat_response_msg = "<p>2ch info - ‘à’·! ƒXƒŒƒbƒh‚Íhtml‰»‚³‚ê‚é‚Ì‚ð‘Ò‚Á‚Ä‚¢‚é‚悤‚Å‚·B [{$marutori_ht}]</p>";
+                $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+                $moritori_ht = $this->_generateMoritapoDatLink();
+                $dat_response_msg = "<p>2ch info - ‘à’·! ƒXƒŒƒbƒh‚Íhtml‰»‚³‚ê‚é‚Ì‚ð‘Ò‚Á‚Ä‚¢‚é‚悤‚Å‚·B{$marutori_ht}{$moritori_ht}</p>";
 
             } else {
                 if ($_GET['kakolog']) {
@@ -1229,7 +1233,7 @@
     /**
      * ˆê‚‚̃XƒŒ“à‚Å‚ÌIDoŒ»”‚ðƒZƒbƒg‚·‚é
      */
-    private function _setIdCount()
+    protected function _setIdCount()
     {
         if (!$this->datlines) {
             return;
@@ -1276,6 +1280,192 @@
     }
 
     // }}}
+    // {{{ scanOriginalHosts()
+
+    /**
+     * dat‚𑖍¸‚µ‚ăXƒŒ—§‚ÄŽž‚̃zƒXƒgŒó•â‚ðŒŸo‚·‚é
+     *
+     * @param void
+     * @return array
+     */
+    public function scanOriginalHosts()
+    {
+        if (file_exists($this->keydat) && $dat = file_get_contents($this->keydat)) {
+            $bbs_re = preg_quote($this->bbs, '@');
+            if (preg_match_all("@/(\\w+\\.(?:2ch\\.net|bbspink\\.com))(?:/test/read\\.cgi)?/{$bbs_re}\\b@", $dat, $matches, PREG_PATTERN_ORDER)) {
+                $hosts = array_unique($matches[1]);
+                $arKey = array_search($this->host, $hosts);
+                if ($arKey !== false && array_key_exists($arKey, $hosts)) {
+                    unset($hosts[$arKey]);
+                }
+
+                return $hosts;
+            }
+        }
+
+        return array();
+    }
+
+    // }}}
+    // {{{ getDefaultGetDatErrorMessageHTML()
+
+    /**
+     * ƒfƒtƒHƒ‹ƒg‚ÌdatŽæ“¾Ž¸”sƒGƒ‰[ƒƒbƒZ[ƒWHTML‚ðŽæ“¾‚·‚é
+     *
+     * @param void
+     * @return string
+     */
+    public function getDefaultGetDatErrorMessageHTML()
+    {
+        global $_conf;
+
+        $diedat_msg = '<p><b>p2 info - ”ƒT[ƒo‚©‚çÅV‚̃XƒŒƒbƒhî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</b>';
+        if ($hosts = $this->scanOriginalHosts()) {
+            $common_q = '&amp;bbs=' . rawurldecode($this->bbs)
+                      . '&amp;key=' . rawurldecode($this->key)
+                      . '&amp;ls=' . rawurldecode($this->ls);
+            $diedat_msg .= '<br>dat‚©‚瑼‚̃zƒXƒgŒó•â‚ðŒŸo‚µ‚Ü‚µ‚½B';
+            foreach ($hosts as $host) {
+                $diedat_msg .= " [<a href=\"{$_conf['read_php']}?host={$host}{$common_q}\">{$host}</a>]";
+            }
+        }
+        $diedat_msg .= '</p>';
+
+        return $diedat_msg;
+    }
+
+    // }}}
+    // {{{ _generateMoritapoDatLink()
+
+    /**
+     * ŒöŽ®p2‚Å(datŽæ“¾Œ ŒÀ‚ª‚È‚¢ê‡‚̓‚ƒŠƒ^ƒ|‚ðÁ”‚Ä)dat‚ðŽæ“¾‚·‚邽‚߂̃Šƒ“ƒN‚𐶐¬‚·‚éB
+     *
+     * @param void
+     * @return string
+     */
+    protected function _generateMoritapoDatLink()
+    {
+        global $_conf;
+
+        if ($_conf['p2_2ch_mail'] && $_conf['p2_2ch_pass']) {
+            return " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;moritapodat=true\">ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+        } else {
+            return '';
+        }
+    }
+
+    // }}}
+    // {{{ _downloadDat2chMoritapo()
+
+    /**
+     * ŒöŽ®p2‚Å(datŽæ“¾Œ ŒÀ‚ª‚È‚¢ê‡‚̓‚ƒŠƒ^ƒ|‚ðÁ”‚Ä)dat‚ðŽæ“¾‚·‚é
+     *
+     * @param void
+     * @return bool
+     */
+    protected function _downloadDat2chMoritapo()
+    {
+         global $_conf;
+
+        // dat‚ðƒ_ƒEƒ“ƒ[ƒh
+        try {
+            $client = P2Util::getP2Client();
+            $body = $client->downloadDat($this->host, $this->bbs, $this->key, $response);
+            // DEBUG
+            /*
+            $GLOBALS['_downloadDat2chMoritapo_response_dump'] = '<pre>' . htmlspecialchars(print_r($response, true)) . '</pre>';
+            register_shutdown_function(create_function('', 'echo $GLOBALS[\'_downloadDat2chMoritapo_response_dump\'];'));
+            */
+        } catch (P2Exception $e) {
+            p2die($e->getMessage());
+        }
+
+        // ƒf[ƒ^ŒŸØ‚»‚Ì1
+        if (!$body || (strpos($body, '<>') === false && strpos($body, ',') === false)) {
+            return $this->_downloadDat2chMoritapoNotFound();
+        }
+
+        // ‰üsˆÊ’u‚ðŒŸo
+        $posCR = strpos($body, "\r");
+        $posLF = strpos($body, "\n");
+        if ($posCR === false && $posLF === false) {
+            $pos = strlen($body);
+        } elseif ($posCR === false) {
+            $pos = $posLF;
+        } elseif ($posLF === false) {
+            $pos = $posCR;
+        } else {
+            $pos = min($posLF, $posCR);
+        }
+
+        // 1s–ڂ̎擾‚ƃf[ƒ^ŒŸØ‚»‚Ì2
+        $firstLine = rtrim(substr($body, 0, $pos));
+        if (strpos($firstLine, '<>') !== false) {
+            $this->dat_type = '2ch';
+        } elseif (strpos($firstLine, ',') !== false) {
+            $this->dat_type = '2ch_old';
+        } else {
+            return $this->_downloadDat2chMoritapoNotFound();
+        }
+
+        // ƒf[ƒ^ŒŸØ‚»‚Ì3 (ƒ^ƒCƒgƒ‹ = $ar[4])
+        $ar = $this->explodeDatLine($firstLine);
+        if (count($ar) < 5) {
+            return $this->_downloadDat2chMoritapoNotFound();
+        }
+
+        // ƒ[ƒJƒ‹dat‚ɏ‘‚«ž‚Ý
+        FileCtl::make_datafile($this->keydat, $_conf['dat_perm']);
+        if (FileCtl::file_write_contents($this->keydat, $body) === false) {
+            p2die('cannot write file. downloadDat2chMoritapo()');
+        }
+
+        return true;
+   }
+
+    // }}}
+    // {{{ _downloadDat2chMoritapoNotFound()
+
+    /**
+     * ƒ‚ƒŠƒ^ƒ|‚ł̎擾‚ª‚Å‚«‚È‚©‚Á‚½‚Æ‚«‚ɌĂяo‚³‚ê‚é
+     *
+     * @param void
+     * @return bool
+     */
+    protected function _downloadDat2chMoritapoNotFound()
+    {
+        global $_conf;
+
+        $marutori_ht = " [<a href=\"{$_conf['read_php']}?host={$this->host}&amp;bbs={$this->bbs}&amp;key={$this->key}&amp;ls={$this->ls}&amp;maru=true\">œID‚Åp2‚ÉŽæ‚荞‚Þ</a>]";
+
+        if ($hosts = $this->scanOriginalHosts()) {
+            $hosts_ht = '<br>dat‚©‚瑼‚̃zƒXƒgŒó•â‚ðŒŸo‚µ‚Ü‚µ‚½B';
+            foreach ($hosts as $host) {
+                $hosts_ht .= " [<a href=\"#\" onclick=\"this.parentNode.elements['host'].value='{$host}';return false;\">{$host}</a>]";
+            }
+        } else {
+            $hosts_ht = '';
+        }
+
+        $this->getdat_error_msg_ht .= <<<EOF
+<p>p2 info - ƒ‚ƒŠƒ^ƒ|‚ł̃XƒŒƒbƒhŽæ“¾‚ÉŽ¸”s‚µ‚Ü‚µ‚½B{$marutori_ht}</p>
+<form action="{$_conf['read_php']}" method="get">
+    ƒzƒXƒg‚ð
+    <input type="text" name="host" value="{$this->host}" size="12">
+    <input type="hidden" name="bbs" value="{$this->bbs}">
+    <input type="hidden" name="key" value="{$this->key}">
+    <input type="hidden" name="ls" value="{$this->ls}">
+    ‚É•Ï‚¦‚Ä
+    <input type="submit" name="moritapodat" value="ƒ‚ƒŠƒ^ƒ|‚Åp2‚ÉŽæ‚荞‚ñ‚Å‚Ý‚é">
+    {$hosts_ht}
+</form>\n
+EOF;
+        $this->diedat = true;
+
+        return false;
+    }
+
+    // }}}
 }
 
 // }}}

Modified: p2ex/trunk/lib/read_header.inc.php
===================================================================
--- p2ex/trunk/lib/read_header.inc.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/lib/read_header.inc.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -283,7 +283,7 @@
     if ($aThread->getdat_error_msg_ht) {
         $diedat_msg = $aThread->getdat_error_msg_ht;
     } else {
-        $diedat_msg = "<p><b>p2 info - ”ƒT[ƒo‚©‚çÅV‚̃XƒŒƒbƒhî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</b></p>";
+        $diedat_msg = $aThread->getDefaultGetDatErrorMessageHTML();
     }
 
     $motothre_popup = " onmouseover=\"showHtmlPopUp('{$motothre_url}',event,{$_conf['iframe_popup_delay']})\" onmouseout=\"offHtmlPopUp()\"";

Modified: p2ex/trunk/lib/read_header_k.inc.php
===================================================================
--- p2ex/trunk/lib/read_header_k.inc.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/lib/read_header_k.inc.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -225,7 +225,7 @@
     if ($aThread->getdat_error_msg_ht) {
         $diedat_msg = $aThread->getdat_error_msg_ht;
     } else {
-        $diedat_msg = "<p><b>p2 info - ”ƒT[ƒo‚©‚çÅV‚̃XƒŒƒbƒhî•ñ‚ðŽæ“¾‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B</b></p>";
+        $diedat_msg = $aThread->getDefaultGetDatErrorMessageHTML();
     }
 
     $motothre_ht = "<a href=\"{$motothre_url}\" target=\"_blank\">{$motothre_url}</a>";

Modified: p2ex/trunk/post.php
===================================================================
--- p2ex/trunk/post.php	2009-12-31 15:42:37 UTC (rev 754)
+++ p2ex/trunk/post.php	2009-12-31 18:52:34 UTC (rev 755)
@@ -538,9 +538,6 @@
 {
     global $_conf;
 
-    if (!class_exists('P2Client', false)) {
-        include P2_LIB_DIR . '/P2Client.php';
-    }
     if (!is_dir($_conf['cookie_dir'])) {
         FileCtl::mkdir_r($_conf['cookie_dir']);
     }
@@ -552,8 +549,9 @@
     }
 
     try {
-        $client = new P2Client($_conf['p2_2ch_mail'], $_conf['p2_2ch_pass'], $_conf['cookie_dir']);
-        $posted = $client->post($host, $bbs, $key, $FROM, $mail, $MESSAGE, $beRes, $response);
+        $posted = P2Util::getP2Client()->post($host, $bbs, $key,
+                                              $FROM, $mail, $MESSAGE,
+                                              $beRes, $response);
     } catch (P2Exception $e) {
         p2die('ŒöŽ®p2ƒ|ƒXƒgŽ¸”s', $e->getMessage());
     }



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