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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 22日 (金) 21:22:01 JST


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

Log Message:
-----------
expack:
- iモードブラウザ2.xの判定を修正。
- その他、少し変更。

Modified Paths:
--------------
    p2ex/trunk/ic2.php
    p2ex/trunk/lib/UA.php
    p2ex/trunk/lib/index_print_k.inc.php
    p2ex/trunk/title.php


-------------- next part --------------
Modified: p2ex/trunk/ic2.php
===================================================================
--- p2ex/trunk/ic2.php	2010-01-22 08:57:56 UTC (rev 797)
+++ p2ex/trunk/ic2.php	2010-01-22 12:22:01 UTC (rev 798)
@@ -244,7 +244,6 @@
 }
 
 // ‰æ‘œ‚ªƒuƒ‰ƒbƒNƒŠƒXƒg‚É‚ ‚é‚©Šm”F
-require_once P2EX_LIB_DIR . '/ic2/DataObject/BlackList.php';
 $blacklist = new IC2_DataObject_BlackList;
 if ($blacklist->get($uri)) {
     switch ($blacklist->type) {
@@ -265,7 +264,6 @@
 
 // ‰æ‘œ‚ªƒGƒ‰[ƒƒO‚É‚ ‚é‚©Šm”F
 if (!$force && $ini['Getter']['checkerror']) {
-    require_once P2EX_LIB_DIR . '/ic2/DataObject/Errors.php';
     $errlog = new IC2_DataObject_Errors;
     if ($errlog->get($uri)) {
         ic2_error($errlog->errcode, '', false);
@@ -932,7 +930,6 @@
     }
 
     if ($write_log) {
-        require_once P2EX_LIB_DIR . '/ic2/DataObject/Errors.php';
         $logger = new IC2_DataObject_Errors;
         $logger->uri     = isset($uri) ? $uri : (isset($id) ? $id : $file);
         $logger->errcode = $code;

Modified: p2ex/trunk/lib/UA.php
===================================================================
--- p2ex/trunk/lib/UA.php	2010-01-22 08:57:56 UTC (rev 797)
+++ p2ex/trunk/lib/UA.php	2010-01-22 12:22:01 UTC (rev 798)
@@ -514,12 +514,18 @@
      */
     static public function isIModeBrowser2($ua = null)
     {
-        $nuam = self::getNet_UserAgent_Mobile($ua);
-        if ($nuam->isDoCoMo() && preg_match('!^DoCoMo/2\\.!', $nuam->getUserAgent())) {
-            return true;
-        } else {
-            return false;
+        if (is_null($ua) and isset($_SERVER['HTTP_USER_AGENT'])) {
+            $ua = $_SERVER['HTTP_USER_AGENT'];
         }
+
+        if (preg_match('!^DoCoMo/2\\.\\d \\w+\\(c(\\d+)!', $ua, $matches)) {
+            // ƒLƒƒƒbƒVƒ…500KBˆÈã‚È‚çiƒ‚[ƒhƒuƒ‰ƒEƒU2.x‚Æ‚Ý‚È‚·
+            if (500 <= (int)$matches[1]) {
+                return true;
+            }
+        }
+
+        return false;
     }
 
     // }}}

Modified: p2ex/trunk/lib/index_print_k.inc.php
===================================================================
--- p2ex/trunk/lib/index_print_k.inc.php	2010-01-22 08:57:56 UTC (rev 797)
+++ p2ex/trunk/lib/index_print_k.inc.php	2010-01-22 12:22:01 UTC (rev 798)
@@ -35,11 +35,6 @@
         }
     }
 
-    // ŒÃ‚¢ƒZƒbƒVƒ‡ƒ“ID‚ªƒLƒƒƒbƒVƒ…‚³‚ê‚Ä‚¢‚邱‚Æ‚ðl—¶‚µ‚āAƒ†[ƒUî•ñ‚ð•t‰Á‚µ‚Ä‚¨‚­
-    // iƒŠƒtƒ@ƒ‰‚ðl—¶‚µ‚āA‚‚¯‚È‚¢‚Ù‚¤‚ª‚¢‚¢ê‡‚à‚ ‚é‚Ì‚Å’ˆÓj
-    $user_at_a = '&amp;user='.$_login->user_u;
-    $user_at_q = '?user='.$_login->user_u;
-
     $rss_k_ht = '';
     $iv2_k_ht = '';
     if ($_conf['expack.rss.enabled']) {
@@ -66,16 +61,16 @@
 <h1>{$ptitle}</h1>
 {$_info_msg_ht}
 <div>
-<a href="subject.php?spmode=fav&amp;sb_view=shinchaku{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][1]}>{$_conf['k_accesskey_st'][1]}‚¨‹C‚ɽڂ̐V’…</a><br>
-<a href="subject.php?spmode=fav{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][2]}>{$_conf['k_accesskey_st'][2]}‚¨‹C‚ɽڂ̑S‚Ä</a><br>
-<a href="menu_k.php?view=favita{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][3]}>{$_conf['k_accesskey_st'][3]}‚¨‹C‚É”Â</a><br>
-<a href="menu_k.php?view=cate{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][4]}>{$_conf['k_accesskey_st'][4]}”ÂؽÄ</a><br>
-<a href="subject.php?spmode=recent&amp;sb_view=shinchaku{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][5]}>{$_conf['k_accesskey_st'][5]}Å‹ß“Ç‚ñ‚¾½Ú‚̐V’…</a><br>
-<a href="subject.php?spmode=recent{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][6]}>{$_conf['k_accesskey_st'][6]}Å‹ß“Ç‚ñ‚¾½Ú‚Ì‘S‚Ä</a><br>
-<a href="subject.php?spmode=res_hist{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][7]}>{$_conf['k_accesskey_st'][7]}‘ž—š—ð</a> <a href="read_res_hist.php?nt={$newtime}{$_conf['k_at_a']}">Û¸Þ</a><br>
-<a href="subject.php?spmode=palace&amp;norefresh=1{$_conf['k_at_a']}{$user_at_a}"{$_conf['k_accesskey_at'][8]}>{$_conf['k_accesskey_st'][8]}½Ú‚Ì“a“°</a><br>
-<a href="setting.php?dummy=1{$user_at_a}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][9]}>{$_conf['k_accesskey_st'][9]}۸޲݊Ǘ</a><br>
-<a href="editpref.php?dummy=1{$user_at_a}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][0]}>{$_conf['k_accesskey_st'][0]}Ý’èŠÇ—</a><br>
+<a href="subject.php?spmode=fav&amp;sb_view=shinchaku{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][1]}>{$_conf['k_accesskey_st'][1]}‚¨‹C‚ɽڂ̐V’…</a><br>
+<a href="subject.php?spmode=fav{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][2]}>{$_conf['k_accesskey_st'][2]}‚¨‹C‚ɽڂ̑S‚Ä</a><br>
+<a href="menu_k.php?view=favita{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][3]}>{$_conf['k_accesskey_st'][3]}‚¨‹C‚É”Â</a><br>
+<a href="menu_k.php?view=cate{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][4]}>{$_conf['k_accesskey_st'][4]}”ÂؽÄ</a><br>
+<a href="subject.php?spmode=recent&amp;sb_view=shinchaku{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][5]}>{$_conf['k_accesskey_st'][5]}Å‹ß“Ç‚ñ‚¾½Ú‚̐V’…</a><br>
+<a href="subject.php?spmode=recent{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][6]}>{$_conf['k_accesskey_st'][6]}Å‹ß“Ç‚ñ‚¾½Ú‚Ì‘S‚Ä</a><br>
+<a href="subject.php?spmode=res_hist{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][7]}>{$_conf['k_accesskey_st'][7]}‘ž—š—ð</a> <a href="read_res_hist.php?nt={$newtime}{$_conf['k_at_a']}">Û¸Þ</a><br>
+<a href="subject.php?spmode=palace&amp;norefresh=1{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][8]}>{$_conf['k_accesskey_st'][8]}½Ú‚Ì“a“°</a><br>
+<a href="setting.php?nt={$newtime}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][9]}>{$_conf['k_accesskey_st'][9]}۸޲݊Ǘ</a><br>
+<a href="editpref.php?nt={$newtime}{$_conf['k_at_a']}"{$_conf['k_accesskey_at'][0]}>{$_conf['k_accesskey_st'][0]}Ý’èŠÇ—</a><br>
 {$rss_k_ht}
 <a href="tgrepc.php{$_conf['k_at_q']}">½ÚÀ²ŒŸõ</a><br>
 {$iv2_k_ht}

Modified: p2ex/trunk/title.php
===================================================================
--- p2ex/trunk/title.php	2010-01-22 08:57:56 UTC (rev 797)
+++ p2ex/trunk/title.php	2010-01-22 12:22:01 UTC (rev 798)
@@ -62,13 +62,15 @@
 $htm['auth_user'] = "<p>ƒƒOƒCƒ“ƒ†[ƒU: {$_login->user_u} - " . date("Y/m/d (D) G:i") . "</p>\n";
 
 // iŒg‘сjƒƒOƒCƒ“—pURL
-$url_b = htmlspecialchars(rtrim(dirname(P2Util::getMyUrl()), '/') . '/?b=', ENT_QUOTES);
+$base_url = rtrim(dirname(P2Util::getMyUrl()), '/');
+$url_b = $base_url . '?user=' . rawurlencode($_login->user_u) . '&b=';
+$url_b_ht = htmlspecialchars($url_b, ENT_QUOTES);
 
 $htm['ktai_url'] = <<<EOT
 <table border="0" cellspacing="0" cellpadding="1">
     <tbody>
-        <tr><th>Œg‘Ñ—pURL:</th><td><a href="{$url_b}k" target="_blank">{$url_b}k</a></td></tr>
-        <tr><th>iPhone—pURL:</th><td><a href="{$url_b}i" target="_blank">{$url_b}i</a></td></tr>
+        <tr><th>Œg‘Ñ—pURL:</th><td><a href="{$url_b_ht}k" target="_blank">{$url_b_ht}k</a></td></tr>
+        <tr><th>iPhone—pURL:</th><td><a href="{$url_b_ht}i" target="_blank">{$url_b_ht}i</a></td></tr>
     </tbody>
 </table>
 EOT;



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