OSDN Git Service

-BugTrack/456: &new対応
authorarino <arino>
Wed, 1 Oct 2003 07:00:37 +0000 (16:00 +0900)
committerarino <arino>
Wed, 1 Oct 2003 07:00:37 +0000 (16:00 +0900)
-コメントの挿入フォーマット書式を統一

plugin/comment.inc.php
plugin/paint.inc.php
plugin/pcomment.inc.php

index dac3302..9620749 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: comment.inc.php,v 1.20 2003/07/10 03:21:12 arino Exp $
+// $Id: comment.inc.php,v 1.21 2003/10/01 07:00:36 arino Exp $
 //
 
 /////////////////////////////////////////////////
@@ -15,7 +15,7 @@ define('COMMENT_COLS',70);
 // ¥³¥á¥ó¥È¤ÎÁÞÆþ¥Õ¥©¡¼¥Þ¥Ã¥È
 define('COMMENT_NAME_FORMAT','[[$name]]');
 define('COMMENT_MSG_FORMAT','$msg');
-define('COMMENT_NOW_FORMAT','SIZE(10){$now}');
+define('COMMENT_NOW_FORMAT','&new{$now};');
 /////////////////////////////////////////////////
 // ¥³¥á¥ó¥È¤ÎÁÞÆþ¥Õ¥©¡¼¥Þ¥Ã¥È(¥³¥á¥ó¥ÈÆâÍÆ)
 define('COMMENT_FORMAT',"\x08MSG\x08 -- \x08NAME\x08 \x08NOW\x08");
index ffc3443..1d8ae1e 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: paint.inc.php,v 1.11 2003/07/27 14:15:29 arino Exp $
+// $Id: paint.inc.php,v 1.12 2003/10/01 07:00:37 arino Exp $
 //
 
 /*
@@ -37,13 +37,13 @@ define('PAINT_APPLET_WIDTH',800);
 define('PAINT_APPLET_HEIGHT',300);
 //
 //¥³¥á¥ó¥È¤ÎÁÞÆþ¥Õ¥©¡¼¥Þ¥Ã¥È
-define('PAINT_FORMAT_NAME','[[%s]]');
-define('PAINT_FORMAT_MSG','%s');
-define('PAINT_FORMAT_DATE','SIZE(10){%s}');
+define('PAINT_NAME_FORMAT','[[$name]]');
+define('PAINT_MSG_FORMAT','$msg');
+define('PAINT_NOW_FORMAT','&new{$now};');
 //¥á¥Ã¥»¡¼¥¸¤¬¤¢¤ë¾ì¹ç
-define('PAINT_FORMAT',"\x08MSG\x08 -- \x08NAME\x08 \x08DATE\x08");
+define('PAINT_FORMAT',"\x08MSG\x08 -- \x08NAME\x08 \x08NOW\x08");
 //¥á¥Ã¥»¡¼¥¸¤¬¤Ê¤¤¾ì¹ç
-define('PAINT_FORMAT_NOMSG',"\x08NAME\x08 \x08DATE\x08"); 
+define('PAINT_FORMAT_NOMSG',"\x08NAME\x08 \x08NOW\x08"); 
 
 function plugin_paint_action()
 {
@@ -56,8 +56,7 @@ function plugin_paint_action()
        $retval['body'] = '';
        
        if (array_key_exists('attach_file',$_FILES)
-               and array_key_exists('refer',$vars)
-               and is_page($vars['refer']))
+               and array_key_exists('refer',$vars))
        {
                $file = $_FILES['attach_file'];
                //BBSPaiter.jar¤Ï¡¢shift-jis¤ÇÆâÍƤòÁ÷¤Ã¤Æ¤¯¤ë¡£ÌÌÅݤʤΤǥڡ¼¥¸Ì¾¤Ï¥¨¥ó¥³¡¼¥É¤·¤Æ¤«¤éÁ÷¿®¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
@@ -215,27 +214,24 @@ EOD;
 function paint_insert_ref($filename)
 {
        global $script,$vars,$now,$do_backup;
-       global $_paint_messages;
+       global $_paint_messages,$_no_name;
        
        $ret['msg'] = $_paint_messages['msg_title'];
+
+       $msg = mb_convert_encoding(rtrim($vars['msg']),SOURCE_ENCODING,'auto');
+       $name = mb_convert_encoding($vars['yourname'],SOURCE_ENCODING,'auto');
        
-       $msg = sprintf(PAINT_FORMAT_MSG, rtrim($vars['msg']));
-       
-       if ($vars['yourname'] != '')
-       {
-               $name = sprintf(PAINT_FORMAT_NAME, $vars['yourname']);
-       }
-       $date = sprintf(PAINT_FORMAT_DATE, $now);
-       
-       $msg = mb_convert_encoding($msg,SOURCE_ENCODING,'auto');
-       $name = mb_convert_encoding($name,SOURCE_ENCODING,'auto');
+       $msg  = str_replace('$msg',$msg,PAINT_MSG_FORMAT);
+       $name = ($name == '') ? $_no_name : $vars['yourname'];
+       $name = ($name == '') ? '' : str_replace('$name',$name,PAINT_NAME_FORMAT);
+       $now  = str_replace('$now',$now,PAINT_NOW_FORMAT);
        
        $msg = trim($msg);
        $msg = ($msg == '') ?
                PAINT_FORMAT_NOMSG :
                str_replace("\x08MSG\x08", $msg, PAINT_FORMAT);
        $msg = str_replace("\x08NAME\x08",$name, $msg);
-       $msg = str_replace("\x08DATE\x08",$date, $msg);
+       $msg = str_replace("\x08NOW\x08",$now, $msg);
        //¥Ö¥í¥Ã¥¯¤Ë¿©¤ï¤ì¤Ê¤¤¤è¤¦¤Ë¡¢#img¤ÎľÁ°¤Ë\n¤ò2¸Ä½ñ¤¤¤Æ¤ª¤¯¡£
        $msg = "#ref($filename,wrap,around)\n".trim($msg)."\n\n#img(,clear)\n";
        
index 1fc9c17..51bfe48 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: pcomment.inc.php,v 1.25 2003/09/29 02:59:50 arino Exp $
+// $Id: pcomment.inc.php,v 1.26 2003/10/01 07:00:34 arino Exp $
 //
 
 /*
@@ -44,9 +44,9 @@ define('PCMT_COLS_COMMENT',70);
 define('PCMT_INSERT_INS',1);
 //
 //¥³¥á¥ó¥È¤ÎÁÞÆþ¥Õ¥©¡¼¥Þ¥Ã¥È
-define('PCMT_FORMAT_NAME','[[%s]]');
-define('PCMT_FORMAT_MSG','%s');
-define('PCMT_FORMAT_DATE','SIZE(10){%s}');
+define('PCMT_NAME_FORMAT','[[$name]]');
+define('PCMT_MSG_FORMAT','$msg');
+define('PCMT_NOW_FORMAT','&new{$now};');
 // \x08¤Ï¡¢Åê¹Æ¤µ¤ì¤¿Ê¸»úÎóÃæ¤Ë¸½¤ì¤Ê¤¤Ê¸»ú¤Ç¤¢¤ì¤Ð¤Ê¤ó¤Ç¤â¤¤¤¤¡£
 define('PCMT_FORMAT',"\x08MSG\x08 -- \x08NAME\x08 \x08DATE\x08");
 //
@@ -198,10 +198,10 @@ function pcmt_insert()
        );
        
        //¥³¥á¥ó¥È¥Õ¥©¡¼¥Þ¥Ã¥È¤òŬÍÑ
-       $msg = sprintf(PCMT_FORMAT_MSG,rtrim($post['msg']));
+       $msg = str_replace('$msg',rtrim($post['msg']),PCMT_MSG_FORMAT);
        $name = $post['name'] == '' ? $_no_name : $post['name'];
-       $name = ($name == '') ? '' : sprintf(PCMT_FORMAT_NAME,$name);
-       $date = ($post['nodate'] == '1') ? '' : sprintf(PCMT_FORMAT_DATE,$now);
+       $name = ($name == '') ? '' : str_replace('$name',$name,PCMT_NAME_FORMAT);
+       $date = ($post['nodate'] == '1') ? '' : str_replace('$now',$now,PCMT_NOW_FORMAT);
        if ($date != '' or $name != '')
        {
                $msg = str_replace("\x08MSG\x08", $msg,  PCMT_FORMAT);