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

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 1月 27日 (水) 17:56:29 JST


Revision: 818
          http://sourceforge.jp/projects/p2-php/svn/view?view=rev&revision=818
Author:   rsk
Date:     2010-01-27 17:56:29 +0900 (Wed, 27 Jan 2010)

Log Message:
-----------
expack:
- タイトルページの携帯/iPhone用URLの横にブックマークレットを表示するようにした。
- E_NOTICE削減中。

Modified Paths:
--------------
    p2ex/trunk/lib/P2Util.php
    p2ex/trunk/lib/post_form_options.inc.php
    p2ex/trunk/menu_k.php
    p2ex/trunk/post.php
    p2ex/trunk/post_form.php
    p2ex/trunk/title.php

Added Paths:
-----------
    p2ex/trunk/style/title_css.inc


-------------- next part --------------
Modified: p2ex/trunk/lib/P2Util.php
===================================================================
--- p2ex/trunk/lib/P2Util.php	2010-01-27 02:26:56 UTC (rev 817)
+++ p2ex/trunk/lib/P2Util.php	2010-01-27 08:56:29 UTC (rev 818)
@@ -1071,6 +1071,13 @@
         // •Ï”Ý’è
         $date = date('Y/m/d (D) G:i:s');
 
+        // IPƒAƒhƒŒƒX‚ðŽæ“¾
+        if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
+            $remote_addr = $_SERVER['REMOTE_ADDR'];
+        } else {
+            $remote_addr = '';
+        }
+
         // HOST‚ðŽæ“¾
         if (array_key_exists('REMOTE_HOST', $_SERVER)) {
             $remote_host = $_SERVER['REMOTE_HOST'];
@@ -1084,12 +1091,24 @@
             $remote_host = '';
         }
 
+        // UA‚ðŽæ“¾
+        if (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
+            $user_agent = $_SERVER['HTTP_USER_AGENT'];
+        } else {
+            $user_agent = '';
+        }
+
+        // ƒŠƒtƒ@ƒ‰‚ðŽæ“¾
+        if (array_key_exists('HTTP_REFERER', $_SERVER)) {
+            $referrer = $_SERVER['HTTP_REFERER'];
+        } else {
+            $referrer = '';
+        }
+
         $user = (isset($_login->user_u)) ? $_login->user_u : '';
 
         // V‚µ‚¢ƒƒOs‚ðÝ’è
-        $newdata = implode('<>', array($date, $_SERVER['REMOTE_ADDR'], $remote_host,
-                                       $_SERVER['HTTP_USER_AGENT'], $_SERVER['HTTP_REFERER'],
-                                       '', $user));
+        $newdata = implode('<>', array($date, $remote_addr, $remote_host, $user_agent, $referrer, '', $user));
         //$newdata = htmlspecialchars($newdata, ENT_QUOTES);
 
         // ‚Ü‚¸ƒ^ƒu‚ð‘S‚ÄŠO‚µ‚Ä

Modified: p2ex/trunk/lib/post_form_options.inc.php
===================================================================
--- p2ex/trunk/lib/post_form_options.inc.php	2010-01-27 02:26:56 UTC (rev 817)
+++ p2ex/trunk/lib/post_form_options.inc.php	2010-01-27 08:56:29 UTC (rev 818)
@@ -135,6 +135,10 @@
 // ŽQl ƒNƒ‰ƒVƒbƒN COLS='60' ROWS='8'
 $mobile = Net_UserAgent_Mobile::singleton();
 $wrap_at = ''; // wrap‘®«‚ÍW3C HTML 4.01Žd—l‚É‘¶Ý‚µ‚È‚¢
+$name_size_at = '';
+$mail_size_at = '';
+$msg_cols_at = '';
+
 // PC
 if (!$_conf['ktai']) {
     $name_size_at = ' size="19"';
@@ -146,7 +150,6 @@
 // Œg‘Ñ
 } else {
     $STYLE['post_msg_rows'] = 5;
-    $msg_cols_at = '';
     $wrap_at = ' wrap="soft"';
 }
 

Modified: p2ex/trunk/menu_k.php
===================================================================
--- p2ex/trunk/menu_k.php	2010-01-27 02:26:56 UTC (rev 817)
+++ p2ex/trunk/menu_k.php	2010-01-27 08:56:29 UTC (rev 818)
@@ -12,7 +12,9 @@
 //==============================================================
 $_conf['ktai'] = 1;
 $brd_menus = array();
-$GLOBALS['menu_show_ita_num'] = 0;
+$menu_show_ita_num = 0;
+$list_navi_ht = '';
+$modori_url_ht = '';
 
 // {{{ ”ÂŒŸõ‚Ì‚½‚߂̐ݒè
 

Modified: p2ex/trunk/post.php
===================================================================
--- p2ex/trunk/post.php	2010-01-27 02:26:56 UTC (rev 817)
+++ p2ex/trunk/post.php	2010-01-27 08:56:29 UTC (rev 818)
@@ -595,6 +595,8 @@
     // ƒvƒŠƒ“ƒg—p•Ï” ===============
     if (!$_conf['ktai']) {
         $class_ttitle = ' class="thre_title"';
+    } else {
+        $class_ttitle = '';
     }
     $ttitle_ht = "<b{$class_ttitle}>{$ttitle}</b>";
     // 2005/03/01 aki: jigƒuƒ‰ƒEƒU‚ɑΉž‚·‚邽‚߁A&amp; ‚Å‚Í‚È‚­ & ‚Å

Modified: p2ex/trunk/post_form.php
===================================================================
--- p2ex/trunk/post_form.php	2010-01-27 02:26:56 UTC (rev 817)
+++ p2ex/trunk/post_form.php	2010-01-27 08:56:29 UTC (rev 818)
@@ -43,6 +43,10 @@
     $class_ttitle = ' class="thre_title"';
     $target_read = ' target="read"';
     $sub_size_at = ' size="40"';
+} else {
+    $class_ttitle = '';
+    $target_read = '';
+    $sub_size_at = '';
 }
 
 // {{{ ƒXƒŒ—§‚Ä‚È‚ç

Added: p2ex/trunk/style/title_css.inc
===================================================================
--- p2ex/trunk/style/title_css.inc	                        (rev 0)
+++ p2ex/trunk/style/title_css.inc	2010-01-27 08:56:29 UTC (rev 818)
@@ -0,0 +1,42 @@
+<?php
+/**
+ * rep2 - ƒXƒ^ƒCƒ‹Ý’è
+ * for title.php ƒ^ƒCƒgƒ‹ƒy[ƒW
+ */
+
+echo <<<EOSTYLE
+
+table caption {
+    text-align: left;
+    font-size: {$STYLE['fontsize']};
+}
+
+table th {
+	padding-right: 0.25em;
+	text-align: right;
+	vertical-align: top;
+	white-space: nowrap;
+	line-height: 100%;
+	font-weight: normal;
+	font-size: {$STYLE['fontsize']};
+}
+
+table td {
+	text-align: left;
+	vertical-align: top;
+	line-height: 100%;
+	font-size: {$STYLE['fontsize']};
+}
+
+EOSTYLE;
+
+/*
+ * Local Variables:
+ * mode: php
+ * coding: cp932
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
+// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:

Modified: p2ex/trunk/title.php
===================================================================
--- p2ex/trunk/title.php	2010-01-27 02:26:56 UTC (rev 817)
+++ p2ex/trunk/title.php	2010-01-27 08:56:29 UTC (rev 818)
@@ -66,16 +66,58 @@
 $url_b = $base_url . '?user=' . rawurlencode($_login->user_u) . '&b=';
 $url_b_ht = htmlspecialchars($url_b, ENT_QUOTES);
 
+// Œg‘Ñ—pƒrƒ…[‚ðŠJ‚­ƒuƒbƒNƒ}[ƒNƒŒƒbƒg
+$bookmarklet = <<<JS
+(function (u, w, v, x, y) {
+    var t;
+    if (typeof window.outerHeight === 'number') {
+        t = y + window.outerHeight;
+        if (v < t){
+            v = t;
+        }
+    }
+    t = window.open(u, '', 'width=' + w + ',height=' + v + ',' +
+        'scrollbars=yes,resizable=yes,toolbar=no,menubar=no,status=no'
+    );
+    if (t) {
+        t.resizeTo(w, v);
+        t.focus();
+        return false;
+    } else {
+        return true;
+    }
+})
+JS;
+$bookmarklet = preg_replace('/\\b(var|return|typeof) +/', '$1{%space%}', $bookmarklet);
+$bookmarklet = preg_replace('/\\s+/', '', $bookmarklet);
+$bookmarklet = str_replace('{%space%}', ' ', $bookmarklet);
+
+$bookmarklet_k = $bookmarklet . "('{$url_b}k',240,320,20,-100)";
+$bookmarklet_i = $bookmarklet . "('{$url_b}i',320,480,20,-100)";
+$bookmarklet_k_ht = htmlspecialchars($bookmarklet_k, ENT_QUOTES);
+$bookmarklet_i_ht = htmlspecialchars($bookmarklet_i, ENT_QUOTES);
+$bookmarklet_k_en = rawurlencode($bookmarklet_k);
+$bookmarklet_i_en = rawurlencode($bookmarklet_i);
+
 $htm['ktai_url'] = <<<EOT
 <table border="0" cellspacing="0" cellpadding="1">
     <tbody>
-        <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>
+        <tr>
+            <th>Œg‘Ñ—pURL:</th>
+            <td><a href="{$url_b_ht}k" target="_blank" onclick="return {$bookmarklet_k_ht};">{$url_b_ht}k</a></td>
+            <td>[<a href="javascript:{$bookmarklet_k_en};">bookmarklet</a>]</td>
+        </tr>
+        <tr>
+            <th>iPhone—pURL:</th>
+            <td><a href="{$url_b_ht}i" target="_blank" onclick="return {$bookmarklet_i_ht};">{$url_b_ht}i</a></td>
+            <td>[<a href="javascript:{$bookmarklet_i_en};">bookmarklet</a>]</td>
+        </tr>
     </tbody>
 </table>
 EOT;
 
 // ‘O‰ñ‚̃ƒOƒCƒ“î•ñ
+$htm['log'] = '';
 $htm['last_login'] = '';
 if ($_conf['login_log_rec'] && $_conf['last_login_log_show']) {
     if (($log = P2Util::getLastAccessLog($_conf['login_log_file'])) !== false) {
@@ -99,7 +141,7 @@
 //=========================================================
 // HTMLƒvƒŠƒ“ƒg
 //=========================================================
-$ptitle = "rep2 - title";
+$ptitle = 'rep2 - title';
 
 echo $_conf['doctype'];
 echo <<<EOP
@@ -113,30 +155,8 @@
     <title>{$ptitle}</title>
     <base target="read">
     <link rel="stylesheet" type="text/css" href="css.php?css=style&amp;skin={$skin_en}">
+    <link rel="stylesheet" type="text/css" href="css.php?css=title&amp;skin={$skin_en}">
     <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
-    <style type="text/css">
-    /* <![CDATA[ */
-    table caption {
-        text-align: left;
-        font-size: {$STYLE['fontsize']};
-    }
-    table th {
-        padding-right: 0.25em;
-        text-align: right;
-        vertical-align: top;
-        white-space: nowrap;
-        line-height: 100%;
-        font-weight: normal;
-        font-size: {$STYLE['fontsize']};
-    }
-    table td {
-        text-align: left;
-        vertical-align: top;
-        line-height: 100%;
-        font-size: {$STYLE['fontsize']};
-    }
-    /* ]]> */
-    </style>
 </head>
 <body>\n
 EOP;



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