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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 9月 26日 (月) 01:23:46 JST


Revision: 922
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=922
Author:   rsk
Date:     2011-09-26 01:23:46 +0900 (Mon, 26 Sep 2011)

Log Message:
-----------
expack:
- rev.110926.0050.
- ImageCache2画像のRetina対応(アイコン表示に一部不備あり)
- E_NOTICE削減

Modified Paths:
--------------
    p2ex/trunk/conf/conf.inc.php
    p2ex/trunk/lib/P2Util.php
    p2ex/trunk/lib/ShowThreadK.php
    p2ex/trunk/lib/ShowThreadPc.php
    p2ex/trunk/lib/expack/ExpackLoader.php
    p2ex/trunk/lib/menu.inc.php
    p2ex/trunk/login2ch.php


-------------- next part --------------
Modified: p2ex/trunk/conf/conf.inc.php
===================================================================
--- p2ex/trunk/conf/conf.inc.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/conf/conf.inc.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -7,7 +7,7 @@
 // ƒo[ƒWƒ‡ƒ“î•ñ
 $_conf = array(
     'p2version' => '1.7.29+1.8.x',  // rep2‚̃o[ƒWƒ‡ƒ“
-    'p2expack'  => '101010.2210',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
+    'p2expack'  => '110926.0050',   // Šg’£ƒpƒbƒN‚̃o[ƒWƒ‡ƒ“
     'p2name'    => 'expack',        // rep2‚Ì–¼‘O
 );
 

Modified: p2ex/trunk/lib/P2Util.php
===================================================================
--- p2ex/trunk/lib/P2Util.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/lib/P2Util.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -1268,18 +1268,19 @@
     /**
      * 2chœƒƒOƒCƒ“‚ÌID‚ÆPASS‚ÆŽ©“®ƒƒOƒCƒ“Ý’è‚ð•Û‘¶‚·‚é
      */
-    static public function saveIdPw2ch($login2chID, $login2chPW, $autoLogin2ch = '')
+    static public function saveIdPw2ch($login2chID, $login2chPW, $autoLogin2ch = false)
     {
         global $_conf;
 
         $md5_crypt_key = self::getAngoKey();
+        $escaped_login2chID = addslashes($login2chID);
         $crypted_login2chPW = MD5Crypt::encrypt($login2chPW, $md5_crypt_key, 32);
+        $boolstr_autoLogin2ch = $autoLogin2ch ? 'true' : 'false';
         $idpw2ch_cont = <<<EOP
 <?php
-\$rec_login2chID = '{$login2chID}';
+\$rec_login2chID = '{$escaped_login2chID}';
 \$rec_login2chPW = '{$crypted_login2chPW}';
-\$rec_autoLogin2ch = '{$autoLogin2ch}';
-?>
+\$rec_autoLogin2ch = {$boolstr_autoLogin2ch};\n
 EOP;
         FileCtl::make_datafile($_conf['idpw2ch_php'], $_conf['pass_perm']);    // ƒtƒ@ƒCƒ‹‚ª‚È‚¯‚ê‚ΐ¶¬
         $fp = @fopen($_conf['idpw2ch_php'], 'wb');
@@ -1304,23 +1305,33 @@
     {
         global $_conf;
 
-        if (!file_exists($_conf['idpw2ch_php'])) {
-            return false;
-        }
+        $login2chID = null;
+        $login2chPW = null;
+        $autoLogin2ch = false;
 
-        $rec_login2chID = NULL;
-        $login2chPW = NULL;
-        $rec_autoLogin2ch = NULL;
+        if (file_exists($_conf['idpw2ch_php'])) {
+            $rec_login2chID = null;
+            $rec_login2chPW = null;
+            $rec_autoLogin2ch = false;
 
-        include $_conf['idpw2ch_php'];
+            include $_conf['idpw2ch_php'];
 
-        // ƒpƒX‚𕡍‡‰»
-        if (!is_null($rec_login2chPW)) {
-            $md5_crypt_key = self::getAngoKey();
-            $login2chPW = MD5Crypt::decrypt($rec_login2chPW, $md5_crypt_key, 32);
+            if (is_string($rec_login2chID)) {
+                $login2chID = $rec_login2chID;
+            }
+
+            // ƒpƒXƒ[ƒh‚𕜍†‰»
+            if (is_string($login2chID) && is_string($rec_login2chPW)) {
+                $md5_crypt_key = self::getAngoKey();
+                $login2chPW = MD5Crypt::decrypt($rec_login2chPW, $md5_crypt_key, 32);
+            } else {
+                $login2chPW = null;
+            }
+
+            $autoLogin2ch = (bool)$rec_autoLogin2ch;
         }
 
-        return array($rec_login2chID, $login2chPW, $rec_autoLogin2ch);
+        return array($login2chID, $login2chPW, $autoLogin2ch);
     }
 
     // }}}

Modified: p2ex/trunk/lib/ShowThreadK.php
===================================================================
--- p2ex/trunk/lib/ShowThreadK.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/lib/ShowThreadK.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -1013,7 +1013,14 @@
                             } else {
                                 $prv_url = "ic2.php?r={$r_type}&amp;t=1&amp;uri={$url_en}";
                             }
-                            $img_str = "<img src=\"{$prv_url}\">";
+                            $prv_url .= $this->img_dpr_query;
+                            if ($this->img_dpr === 1.5 || $this->img_dpr === 2.0) {
+                                $prv_onload = " onload=\"this.width=parseInt((this.width/{$this->img_dpr}).toString());"
+                                            . "this.height=parseInt((this.height/{$this->img_dpr}).toString());\"";
+                            } else {
+                                $prv_onload = '';
+                            }
+                            $img_str = "<img src=\"{$prv_url}\"{$prv_onload}>";
                         }
                         $inline_preview_done = true;
                     } else {

Modified: p2ex/trunk/lib/ShowThreadPc.php
===================================================================
--- p2ex/trunk/lib/ShowThreadPc.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/lib/ShowThreadPc.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -1281,7 +1281,6 @@
 
                 $cached = false;
 
-
                 $orig_img_url   = $img_url;
                 $orig_thumb_url = $thumb_url;
                 $img_url .= $this->img_memo_query;

Modified: p2ex/trunk/lib/expack/ExpackLoader.php
===================================================================
--- p2ex/trunk/lib/expack/ExpackLoader.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/lib/expack/ExpackLoader.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -162,7 +162,7 @@
         } else {
             $preview_size = IC2_Thumbnailer::SIZE_PC;
             $thumb_size = IC2_Thumbnailer::SIZE_MOBILE;
-            if (!empty($_SESSION['device_pixel_ratio'])) {
+            if ($_conf['iphone'] && !empty($_SESSION['device_pixel_ratio'])) {
                 $dpr = $_SESSION['device_pixel_ratio'];
                 if ($dpr === 1.5) {
                     $preview_size |= IC2_Thumbnailer::DPR_1_5;
@@ -187,8 +187,11 @@
             $aShowThread->img_memo_query = '';
         }
 
+        $aShowThread->img_dpr = $dpr;
         if ($dpr === 1.5 || $dpr === 2.0) {
-            $aShowThread->img_memo_query .= '&amp;d=' . $dpr;
+            $aShowThread->img_dpr_query = '&amp;d=' . $dpr;
+        } else {
+            $aShowThread->img_dpr_query = '';
         }
 
         self::loadClass('IC2_Switch', 'ic2/Switch.php');

Modified: p2ex/trunk/lib/menu.inc.php
===================================================================
--- p2ex/trunk/lib/menu.inc.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/lib/menu.inc.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -26,6 +26,7 @@
 }
 $hd = array('word' => '');
 $GLOBALS['ita_mikke'] = array('num' => 0);
+$msg_ht = '';
 
 // ”ÂŒŸõ
 if (isset($word) && strlen($word) > 0) {

Modified: p2ex/trunk/login2ch.php
===================================================================
--- p2ex/trunk/login2ch.php	2011-07-13 20:52:04 UTC (rev 921)
+++ p2ex/trunk/login2ch.php	2011-09-25 16:23:46 UTC (rev 922)
@@ -10,9 +10,9 @@
 //================================================================
 // •Ï”
 //================================================================
-if (isset($_POST['login2chID']))   { $login2chID = $_POST['login2chID']; }
-if (isset($_POST['login2chPW']))   { $login2chPW = $_POST['login2chPW']; }
-if (isset($_POST['autoLogin2ch'])) { $autoLogin2ch = $_POST['autoLogin2ch']; }
+$login2chID = null;
+$login2chPW = null;
+$autoLogin2ch = false;
 
 //===============================================================
 // ƒƒOƒCƒ“‚È‚çAID‚ÆPW‚ð“o˜^•Û‘¶‚µ‚āAƒƒOƒCƒ“‚·‚é
@@ -20,9 +20,9 @@
 if (isset($_POST['login2chID']) && isset($_POST['login2chPW'])) {
 
     if (isset($_POST['autoLogin2ch'])) {
-        $autoLogin2ch = $_POST['autoLogin2ch'];
+        $autoLogin2ch = ($_POST['autoLogin2ch'] === '1') ? true : false;
     } else {
-        $autoLogin2ch = 0;
+        $autoLogin2ch = false;
     }
 
     P2Util::saveIdPw2ch($_POST['login2chID'], $_POST['login2chPW'], $autoLogin2ch);
@@ -32,9 +32,7 @@
 }
 
 // iƒtƒH[ƒ€“ü—Í—p‚ɁjID, PWÝ’è‚ð“ǂݍž‚Þ
-if ($array = P2Util::readIdPw2ch()) {
-    list($login2chID, $login2chPW, $autoLogin2ch) = $array;
-}
+list($login2chID, $login2chPW, $autoLogin2ch) = P2Util::readIdPw2ch();
 
 //==============================================================
 // 2chƒƒOƒCƒ“ˆ—
@@ -151,7 +149,9 @@
 }
 
 if ($autoLogin2ch) {
-    $autoLogin2ch_checked = " checked=\"true\"";
+    $autoLogin2ch_checked = ' checked="checked"';
+} else {
+    $autoLogin2ch_checked = '';
 }
 
 $tora3_url = "http://2ch.tora3.net/";



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