OSDN Git Service

make_related関係を修正
authorpanda <panda>
Mon, 3 Feb 2003 12:46:56 +0000 (21:46 +0900)
committerpanda <panda>
Mon, 3 Feb 2003 12:46:56 +0000 (21:46 +0900)
convert_html.php
html.php
pukiwiki.ini.php

index 96558ab..8fcefca 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: convert_html.php,v 1.10 2003/02/03 11:56:28 panda Exp $
+// $Id: convert_html.php,v 1.11 2003/02/03 12:46:56 panda Exp $
 //
 
 function &convert_html(&$lines)
@@ -768,7 +768,8 @@ class Body extends Block
                $text = preg_replace("/<p>#contents<\/p>/",$this->getContents(),$text);
                
                // ´ØÏ¢¤¹¤ë¥Ú¡¼¥¸
-               $text = preg_replace('/#related/e','make_related($vars[\'page\'],TRUE)',$text);
+               // <p>¤Î¤È¤­¤Ï¹ÔƬ¤«¤é¡¢<del>¤Î¤È¤­¤Ï¾¤ÎÍ×ÁǤλÒÍ×ÁǤȤ·¤Æ¸ºß
+               $text = preg_replace('/<(p|del)>#related<\/\1>/e','make_related($vars[\'page\'],\'$1\')',$text);
                
                return $text;
        }
index 8375de5..82cf291 100644 (file)
--- a/html.php
+++ b/html.php
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: html.php,v 1.49 2003/01/31 01:49:35 panda Exp $
+// $Id: html.php,v 1.50 2003/02/03 12:46:56 panda Exp $
 //
 
 // ËÜʸ¤ò½ÐÎÏ
@@ -39,7 +39,7 @@ function catbody($title,$page,$body)
        $lastmodified = $is_read ?
                get_date('D, d M Y H:i:s T',get_filetime($_page)).' '.get_pg_passage($_page,FALSE) : '';
        
-       $related = ($is_read and $related_link) ? make_related($_page,FALSE) : '';
+       $related = ($is_read and $related_link) ? make_related($_page) : '';
        
        $attaches = ($is_read and exist_plugin_action('attach')) ? attach_filelist() : '';
        
@@ -185,9 +185,10 @@ EOD;
 }
 
 // ´ØÏ¢¤¹¤ë¥Ú¡¼¥¸
-function make_related($page,$_isrule)
+function make_related($page,$tag='')
 {
        global $script,$vars,$related,$rule_related_str,$related_str;
+       global $_list_left_margin, $_list_margin, $_list_pad_str;
        
        $links = links_get_related($page);
        
@@ -202,12 +203,23 @@ function make_related($page,$_isrule)
                $r_page = rawurlencode($page);
                $s_page = htmlspecialchars($page);
                $passage = get_passage($lastmod);
-               $_links[] = $_isrule ?
+               $_links[] = $tag ?
                        "<a href=\"$script?$r_page\" title=\"$s_page $passage\">$s_page</a>" :
                        "<a href=\"$script?$r_page\">$s_page</a>$passage";
        }
        
-       return join($_isrule ? $rule_related_str : $related_str,$_links);
+       if ($tag) {
+               $retval = join($rule_related_str,$_links);
+               if ($tag == 'p') {
+                       $margin = $_list_left_margin + $_list_margin;
+                       $style = sprintf($_list_pad_str,1,$margin,$margin);
+                       $retval =  "\n<ul class=\"list1\" style=\"$style\">\n<li>$retval</li>\n</ul>\n";
+               }
+       }
+       else {
+               $retval = join($related_str,$_links);
+       }
+       return $retval;
 }
 
 // Ãí¼á½èÍý
index dbd7def..150c919 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: pukiwiki.ini.php,v 1.19 2003/02/03 10:25:11 panda Exp $
+// $Id: pukiwiki.ini.php,v 1.20 2003/02/03 12:46:56 panda Exp $
 //
 // PukiWiki setting file
 
@@ -229,6 +229,7 @@ $line_rules = array(
 "''(?!')((?:(?!'').)*)''" => '<strong>$1</strong>',
 '&amp;(#[0-9]+|#x[0-9a-f]+|[0-9a-zA-Z]+);' => '&$1;',
 "~\r" => '<br />', /* ¹ÔËö¤Ë¥Á¥ë¥À¤Ï²þ¹Ô */
+'#related' => '<del>#related</del>',
 );
 
 /////////////////////////////////////////////////