2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: pukiwiki.php,v 1.6 2005/04/10 04:46:05 henoheno Exp $
4 // $Id: pukiwiki.php,v 1.6 2005/04/10 04:46:05 henoheno Exp $
7 // Copyright (C) 2002-2005 by PukiWiki Developers Team
8 // http://pukiwiki.org/
11 // Copyright (C) 2002-2004 by PukiWiki Developers Team
12 // http://pukiwiki.org/
14 // PukiWiki 1.3 (Base)
15 // Copyright (C) 2001-2002 by yu-ji <sng@factage.com>
16 // http://factage.com/sng/pukiwiki/
19 // YukiWiki by Hiroshi Yuki <hyuki@hyuki.com>
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 if (! defined('DATA_HOME')) define('DATA_HOME', '');
34 /////////////////////////////////////////////////
35 // Include subroutines
37 if (! defined('LIB_DIR')) define('LIB_DIR', '');
39 require(LIB_DIR . 'func.php');
40 require(LIB_DIR . 'file.php');
41 require(LIB_DIR . 'plugin.php');
42 require(LIB_DIR . 'html.php');
43 require(LIB_DIR . 'backup.php');
45 require(LIB_DIR . 'convert_html.php');
46 require(LIB_DIR . 'make_link.php');
47 require(LIB_DIR . 'diff.php');
48 require(LIB_DIR . 'config.php');
49 require(LIB_DIR . 'link.php');
50 require(LIB_DIR . 'trackback.php');
51 require(LIB_DIR . 'auth.php');
52 require(LIB_DIR . 'proxy.php');
53 require(LIB_DIR . 'mail.php');
54 if (! extension_loaded('mbstring')) {
55 require(LIB_DIR . 'mbstring.php');
58 // Load *.ini.php files and init PukiWiki
59 require(LIB_DIR . 'init.php');
61 /////////////////////////////////////////////////
66 if (isset($vars['cmd'])) {
68 $plugin = & $vars['cmd'];
69 } else if (isset($vars['plugin'])) {
70 $plugin = & $vars['plugin'];
75 if (exist_plugin_action($plugin)) {
77 $retvars = do_plugin_action($plugin);
78 if ($retvars === FALSE) exit; // Done
81 $base = isset($vars['page']) ? $vars['page'] : '';
83 $base = isset($vars['refer']) ? $vars['refer'] : '';
87 $msg = 'plugin=' . htmlspecialchars($plugin) .
88 ' is not implemented.';
89 $retvars = array('msg'=>$msg,'body'=>$msg);
90 $base = & $defaultpage;
94 $title = htmlspecialchars(strip_bracket($base));
95 $page = make_search($base);
96 if (isset($retvars['msg']) && $retvars['msg'] != '') {
97 $title = str_replace('$1', $title, $retvars['msg']);
98 $page = str_replace('$1', $page, $retvars['msg']);
101 if (isset($retvars['body']) && $retvars['body'] != '') {
102 $body = & $retvars['body'];
104 if ($base == '' || ! is_page($base)) {
105 $base = & $defaultpage;
106 $title = htmlspecialchars(strip_bracket($base));
107 $page = make_search($base);
110 $vars['cmd'] = 'read';
111 $vars['page'] = & $base;
113 $body = convert_html(get_source($base));
114 $body .= tb_get_rdf($base);
119 catbody($title, $page, $body);