2 // pukiwiki.php - Yet another WikiWikiWeb clone.
5 // Copyright (C) 2002 by PukiWiki Developers Team
6 // http://pukiwiki.org/
9 // Copyright (C) 2002 by PukiWiki Developers Team
10 // http://pukiwiki.org/
12 // PukiWiki 1.3 (Base)
13 // Copyright (C) 2001,2002 by sng.
15 // http://factage.com/sng/pukiwiki/
18 // YukiWiki by Hiroshi Yuki
20 // http://www.hyuki.com/yukiwiki/
22 // This program is free software; you can redistribute it and/or modify
23 // it under the terms of the GNU General Public License as published by
24 // the Free Software Foundation; either version 2 of the License, or
25 // (at your option) any later version.
27 // This program is distributed in the hope that it will be useful,
28 // but WITHOUT ANY WARRANTY; without even the implied warranty of
29 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 // GNU General Public License for more details.
32 // $Id: pukiwiki.php,v 1.28 2003/07/27 13:52:18 arino Exp $
33 /////////////////////////////////////////////////
36 /////////////////////////////////////////////////
37 // ¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß
40 require('plugin.php');
42 require('backup.php');
44 require('convert_html.php');
45 require('make_link.php');
47 require('config.php');
49 require('trackback.php');
51 if (!extension_loaded('mbstring'))
53 require('mbstring.php');
56 /////////////////////////////////////////////////
57 // ¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß
60 /////////////////////////////////////////////////
67 if (!empty($vars['plugin'])) {
68 if (!exist_plugin_action($vars['plugin'])) {
69 $s_plugin = htmlspecialchars($vars['plugin']);
70 $msg = "plugin=$s_plugin is not implemented.";
71 $retvars = array('msg'=>$msg,'body'=>$msg);
74 $retvars = do_plugin_action($vars['plugin']);
75 if ($retvars !== FALSE) {
76 $base = array_key_exists('refer',$vars) ? $vars['refer'] : '';
81 else if (!empty($vars['cmd'])) {
82 if (!exist_plugin_action($vars['cmd'])) {
83 $s_cmd = htmlspecialchars($vars['cmd']);
84 $msg = "cmd=$s_cmd is not implemented.";
85 $retvars = array('msg'=>$msg,'body'=>$msg);
88 $retvars = do_plugin_action($vars['cmd']);
89 $base = $vars['page'];
93 if ($retvars !== FALSE) {
94 $title = htmlspecialchars(strip_bracket($base));
95 $page = make_search($base);
97 if (array_key_exists('msg',$retvars) and $retvars['msg'] != '') {
98 $title = str_replace('$1',$title,$retvars['msg']);
99 $page = str_replace('$1',$page,$retvars['msg']);
102 if (array_key_exists('body',$retvars) and $retvars['body'] != '') {
103 $body = $retvars['body'];
106 if ($base == '' or !is_page($base)) {
107 $base = $defaultpage;
108 $title = htmlspecialchars(strip_bracket($base));
109 $page = make_search($base);
112 $vars['cmd'] = 'read';
113 $vars['page'] = $base;
114 $body = convert_html(get_source($base));
115 $body .= tb_get_rdf($vars['page']);
116 ref_save($vars['page']);
120 catbody($title,$page,$body);