2 /////////////////////////////////////////////////////////////////////
3 // Part Zero: Don't touch this!
4 /////////////////////////////////////////////////////////////////////
5 define ('PHPWIKI_VERSION', '1.3.0pre');
6 require "lib/prepend.php";
7 rcs_id('$Id: index.php,v 1.9 2001-02-14 05:22:49 dairiki Exp $');
9 /////////////////////////////////////////////////////////////////////
12 // Authentication and security settings:
14 /////////////////////////////////////////////////////////////////////
16 // If set, we will perform reverse dns lookups to try to convert the users
17 // IP number to a host name, even if the http server didn't do it for us.
18 define('ENABLE_REVERSE_DNS', true);
20 // Username and password of administrator.
21 // Set these to your preferences. For heaven's sake
22 // pick a good password!
23 define('ADMIN_USER', "");
24 define('ADMIN_PASSWD', "");
26 // If true, only the admin user can make zip dumps, else
27 // zip dumps require no authentication.
28 define('ZIPDUMP_AUTH', false);
30 // The maximum file upload size.
31 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
33 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default
34 // state for the "minor edit" checkbox on the edit page form will be off.
35 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
37 /////////////////////////////////////////////////////////////////////
42 /////////////////////////////////////////////////////////////////////
45 // This array holds the parameters which select the database to use.
47 // Not all of these parameters are used by any particular DB backend.
50 // Select the database type:
51 // Uncomment one of these, or leave all commented for the default
52 // data base type ('dba' if supported, else 'dbm'.)
55 //'dbtype' => 'mysql',
56 //'dbtype' => 'pgsql',
60 // Used by all DB types:
62 'prefix' => '', // prefix for filenames or table names
64 // Used by 'dbm', 'dba', 'file'
65 'directory' => "/tmp",
67 // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*".
68 // 'file' creates files named "$directory/${database}/{$prefix}*/*".
69 // The sql types use tables named "{$prefix}*"
71 // Used by 'dbm', 'dba'
74 // Used by *sql as neccesary to log in to server:
75 'server' => 'localhost',
83 /////////////////////////////////////////////////////////////////////
86 // Page appearance and layout
88 /////////////////////////////////////////////////////////////////////
90 // Select your language - default language "C": English
91 // other languages available: Dutch "nl", Spanish "es", German "de",
95 // If you specify a relative URL for the CSS and images,
96 // the are interpreted relative to DATA_PATH (see below).
97 // (The default value of DATA_PATH is the directory in which
98 // index.php (this file) resides.)
101 define("CSS_URL", "phpwiki.css");
103 // logo image (path relative to index.php)
104 $logo = "images/wikibase.png";
106 // Signature image which is shown after saving an edited page
107 // If this is left blank (or unset), the signature will be omitted.
108 //$SignatureImg = "images/signature.png";
110 // date & time formats used to display modification times, etc.
111 // formats are given as format strings to PHP date() function
112 // FIXME: these should have different defaults depending on locale.
113 $datetimeformat = "F j, Y"; // may contain time of day
114 $dateformat = "F j, Y"; // must not contain time
116 // this defines how many page names to list when displaying
117 // the MostPopular pages; the default is to show the 20 most popular pages
118 define("MOST_POPULAR_LIST_LENGTH", 20);
120 // this defines how many page names to list when displaying related pages
121 define("NUM_RELATED_PAGES", 5);
123 // This path is searched when trying to read WIKI_PGSRC
124 // or template files.
125 $DataPath = array(".", "locale/$LANG");
127 // Template files (filenames are relative to script position)
128 // (These filenames will be passed through gettext() before use.)
129 $templates = array("BROWSE" => "templates/browse.html",
130 "EDITPAGE" => "templates/editpage.html",
131 "MESSAGE" => "templates/message.html");
134 /* WIKI_PGSRC -- specifies the source for the initial page contents
135 * of the Wiki. The setting of WIKI_PGSRC only has effect when
136 * the wiki is accessed for the first time (or after clearing the
137 * database.) WIKI_PGSRC can either name a directory or a zip file.
138 * In either case WIKI_PGSRC is scanned for files --- one file per page.
140 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
141 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
143 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
144 // the default (English) and when reading from a directory:
145 // in that case some English pages are inserted into the wiki as well
146 // DEFAULT_WIKI_PGSRC defines where the English pages reside
147 // FIXME: is this really needed? Can't we just copy
148 // these pages into the localized pgsrc?
149 define('DEFAULT_WIKI_PGSRC', "pgsrc");
150 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.
151 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
153 /////////////////////////////////////////////////////////////////////
158 /////////////////////////////////////////////////////////////////////
160 // allowed protocols for links - be careful not to allow "javascript:"
161 // URL of these types will be automatically linked.
162 // within a named link [name|uri] one more protocol is defined: phpwiki
163 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
165 // URLs ending with the following extension should be inlined as images
166 $InlineImages = "png|jpg|gif";
168 // Perl regexp for WikiNames ("bumpy words")
169 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
170 $WikiNameRegexp = "(?<![A-Za-z0-9])([A-Z][a-z]+){2,}(?![A-Za-z0-9])";
172 // InterWiki linking -- wiki-style links to other wikis on the web
174 // Intermap file for InterWikiLinks -- define other wikis there
175 // Leave this undefined to disable InterWiki linking.
176 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
178 /////////////////////////////////////////////////////////////////////
181 // URL options -- you can probably skip this section.
183 /////////////////////////////////////////////////////////////////////
184 /******************************************************************
186 * The following section contains settings which you can use to tailor
187 * the URLs which PhpWiki generates.
189 * Any of these parameters which are left undefined will be
190 * deduced automatically. You need only set them explicitly
191 * if the auto-detected values prove to be incorrect.
193 * In most cases the auto-detected values should work fine,
194 * so hopefully you don't need to mess with this section.
196 ******************************************************************/
199 * Canonical name and httpd port of the server on which this
202 //define('SERVER_NAME', 'some.host.com');
203 //define('SERVER_PORT', 80);
206 * Absolute URL (from the server root) of the PhpWiki
209 //define('SCRIPT_NAME', '/some/where/index.php');
212 * Absolute URL (from the server root) of the directory
213 * in which relative URL's for images and other support files
216 //define('DATA_PATH', '/some/where');
219 * Define to 'true' to use PATH_INFO to pass the pagename's.
220 * e.g. http://www.some.where/index.php/FrontPage instead
221 * of http://www.some.where/index.php?pagename=FrontPage
222 * FIXME: more docs (maybe in README).
224 //define('USE_PATH_INFO', false);
227 * VIRTUAL_PATH is the canonical URL path under which your
228 * your wiki appears. Normally this is the same as
229 * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
230 * (or mod_rewrite), you can make it something different.
232 * If you do this, you should set VIRTUAL_PATH here.
234 * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
235 * but * you've made it accessible through eg. /wiki/FrontPage.
237 * One way to do this is to create a directory named 'wiki' in your
238 * server root. The directory contains only one file: an .htaccess
239 * file which reads something like:
241 * Action x-phpwiki-page /scripts/phpwiki/index.php
242 * SetHandler x-phpwiki-page
243 * DirectoryIndex /scripts/phpwiki/index.php
245 * In that case you should set VIRTUAL_PATH to '/wiki'.
247 * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
249 //define('VIRTUAL_PATH', '/SomeWiki');
252 ////////////////////////////////////////////////////////////////
253 // Okay... fire up the code:
254 ////////////////////////////////////////////////////////////////
256 include "lib/main.php";
261 // c-file-style: "ellemtel"