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£pbNÌo[W + 'p2expack' => '110926.0050', // g£pbNÌ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 @@ /** * 2chOCÌIDÆPASSÆ©®OCÝèðÛ¶·é */ - 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']; - // pXð¡» - 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; + } + + // pX[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}&t=1&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 .= '&d=' . $dpr; + $aShowThread->img_dpr_query = '&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; //=============================================================== // OCÈçAIDÆPWðo^Û¶µÄAOC·é @@ -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 @@ } // itH[üÍpÉjID, PWÝèðÇÝÞ -if ($array = P2Util::readIdPw2ch()) { - list($login2chID, $login2chPW, $autoLogin2ch) = $array; -} +list($login2chID, $login2chPW, $autoLogin2ch) = P2Util::readIdPw2ch(); //============================================================== // 2chOC @@ -151,7 +149,9 @@ } if ($autoLogin2ch) { - $autoLogin2ch_checked = " checked=\"true\""; + $autoLogin2ch_checked = ' checked="checked"'; +} else { + $autoLogin2ch_checked = ''; } $tora3_url = "http://2ch.tora3.net/";