From: arino Date: Sun, 13 Apr 2003 06:28:52 +0000 (+0900) Subject: BugTrack/281: separate sequence number for each page. X-Git-Tag: r1_5_0_rc1~1704 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=926f3f31f6c14a7cc0a4c27684441c2cb4e0a5df;p=pukiwiki%2Fpukiwiki.git BugTrack/281: separate sequence number for each page. --- diff --git a/plugin/article.inc.php b/plugin/article.inc.php index 1bad37c..4d78aea 100644 --- a/plugin/article.inc.php +++ b/plugin/article.inc.php @@ -19,7 +19,7 @@ -Åê¹ÆÆâÍƤΥ᡼¥ë¼«Æ°ÇÛ¿®Àè ¤òÀßÄê¤Î¾å¡¢¤´»ÈÍѤ¯¤À¤µ¤¤¡£ - $Id: article.inc.php,v 1.11 2003/04/08 09:51:11 arino Exp $ + $Id: article.inc.php,v 1.12 2003/04/13 06:28:52 arino Exp $ */ @@ -102,7 +102,6 @@ function plugin_article_action() $postdata = ''; $postdata_old = get_source($post['refer']); - $article_no = 0; if ($post['name'] != '') { @@ -125,7 +124,6 @@ function plugin_article_action() $article .= "\n\n#comment\n"; } - foreach($postdata_old as $line) { if (!ARTICLE_INS) { $postdata .= $line; @@ -200,7 +198,13 @@ function plugin_article_convert() { global $script,$vars,$digest; global $_btn_article,$_btn_name,$_btn_subject; - static $article_no = 0; + static $numbers = array(); + + if (!array_key_exists($vars['page'],$numbers)) + { + $numbers[$vars['page']] = 0; + } + $article_no = $numbers[$vars['page']]++; $s_page = htmlspecialchars($vars['page']); $s_digest = htmlspecialchars($digest); @@ -222,8 +226,6 @@ function plugin_article_convert() EOD; - - $article_no++; return $string; } diff --git a/plugin/comment.inc.php b/plugin/comment.inc.php index 0cfceff..627676a 100644 --- a/plugin/comment.inc.php +++ b/plugin/comment.inc.php @@ -1,5 +1,5 @@ EOD; - $comment_no_list_array[$vars['page']] = ++$comment_no; - return $string; } ?> diff --git a/plugin/insert.inc.php b/plugin/insert.inc.php index 7b3e88b..e60bff1 100644 --- a/plugin/insert.inc.php +++ b/plugin/insert.inc.php @@ -1,5 +1,5 @@ EOD; - $insert_no++; - return $string; } ?> diff --git a/plugin/memo.inc.php b/plugin/memo.inc.php index 62e6eaa..2da1ef5 100644 --- a/plugin/memo.inc.php +++ b/plugin/memo.inc.php @@ -1,5 +1,5 @@ EOD; - $memo_no++; - return $string; } ?> diff --git a/plugin/paint.inc.php b/plugin/paint.inc.php index f8f8313..6d5f6bf 100644 --- a/plugin/paint.inc.php +++ b/plugin/paint.inc.php @@ -2,7 +2,7 @@ ///////////////////////////////////////////////// // PukiWiki - Yet another WikiWikiWeb clone. // -// $Id: paint.inc.php,v 1.5 2003/03/03 07:07:28 panda Exp $ +// $Id: paint.inc.php,v 1.6 2003/04/13 06:28:52 arino Exp $ // /* @@ -95,7 +95,7 @@ function plugin_paint_action() $HTTP_POST_FILES['attach_file']['name'] = $attachname; $retval = do_plugin_action('attach'); - $retval = insert_ref($HTTP_POST_FILES['attach_file']['name']); + $retval = paint_insert_ref($HTTP_POST_FILES['attach_file']['name']); } else { @@ -176,13 +176,17 @@ function plugin_paint_convert() { global $script,$vars,$digest; global $_paint_messages; - static $paint_no = 0; + static $numbers = array(); + + if (!array_key_exists($vars['page'],$numbers)) + { + $numbers[$vars['page']] = 0; + } + $paint_no = $numbers[$vars['page']]++; //Ìá¤êÃÍ $ret = ''; - $paint_no++; - //ʸ»úÎó¤ò¼èÆÀ $width = $height = 0; $args = func_get_args(); @@ -222,7 +226,7 @@ function plugin_paint_convert() EOD; return $ret; } -function insert_ref($filename) +function paint_insert_ref($filename) { global $script,$vars,$now,$do_backup; global $_paint_messages; @@ -261,9 +265,13 @@ function insert_ref($filename) { $postdata .= $line; } - if (preg_match('/^#paint/',$line) and (++$paint_no == $vars['paint_no'])) + if (preg_match('/^#paint/',$line)) { + if ($paint_no == $vars['paint_no']) + { $postdata .= $msg; + } + $paint_no++; } if (PAINT_INSERT_INS) { diff --git a/plugin/vote.inc.php b/plugin/vote.inc.php index e0e7d2d..89bd69c 100644 --- a/plugin/vote.inc.php +++ b/plugin/vote.inc.php @@ -1,5 +1,5 @@