OSDN Git Service

<?を<?phpに修正
[pukiwiki/pukiwiki.git] / plugin / include.inc.php
1 <?php
2 // $Id: include.inc.php,v 1.2 2002/12/05 05:45:18 panda Exp $
3 function plugin_include_convert()
4 {
5         global $script,$get,$post,$vars,$WikiName,$BracketName,$hr;
6         static $include_list; //½èÍýºÑ¥Ú¡¼¥¸Ì¾¤ÎÇÛÎó
7         
8         if (!isset($include_list))
9                 $include_list = array($vars['page']=>TRUE);
10         
11         if(func_num_args() == 0)
12                 return;
13         
14         list($page) = func_get_args();
15         
16         if (!preg_match("/^($WikiName|$BracketName)$/",$page))
17                 $page = "[[$page]]";
18         
19         if (!is_page($page))
20                 return '';
21         
22         if (isset($include_list[$page]))
23                 return '';
24         
25         $include_list[$page] = TRUE;
26         
27         $tmppage = $vars['page'];
28         
29         $get['page'] = $post['page'] = $vars['page'] = $page;
30
31         $body = @join('',@file(get_filename(encode($page))));
32         $body = convert_html($body);
33
34         // $link = "<a href=\"$script?".rawurlencode($page)."\">".strip_bracket($page)."</a>";
35         $link = "<a href=\"$script?cmd=edit&page=".rawurlencode($page)."\">".strip_bracket($page)."</a>";
36         if($page == 'MenuBar'){
37                 $head = "<span align=\"center\"><h5 class=\"side_label\">$link</h5></span>";
38                 $body = "$head\n<small>$body</small>\n";
39         } else {
40                 $head = "<h1>$link</h1>\n";
41                 $body = "$head\n$body\n";
42         }
43
44         $get['page'] = $post['page'] = $vars['page'] = $tmppage;
45         
46         return $body;
47 }
48 ?>