2 /////////////////////////////////////////////////////////////////////
3 // Part Zero: If PHP needs help in finding where you installed the
4 // rest of the PhpWiki code, you can set the include_path here.
5 /////////////////////////////////////////////////////////////////////
7 //ini_set('include_path', '.:/where/you/installed/phpwiki');
9 /////////////////////////////////////////////////////////////////////
10 // Part Null: Don't touch this!
11 /////////////////////////////////////////////////////////////////////
12 define ('PHPWIKI_VERSION', '1.3.0pre');
13 require "lib/prepend.php";
14 rcs_id('$Id: index.php,v 1.13 2001-03-07 16:45:19 dairiki Exp $');
16 /////////////////////////////////////////////////////////////////////
19 // Authentication and security settings:
21 /////////////////////////////////////////////////////////////////////
23 // If set, we will perform reverse dns lookups to try to convert the users
24 // IP number to a host name, even if the http server didn't do it for us.
25 define('ENABLE_REVERSE_DNS', true);
27 // Username and password of administrator.
28 // Set these to your preferences. For heaven's sake
29 // pick a good password!
30 define('ADMIN_USER', "");
31 define('ADMIN_PASSWD', "");
33 // If true, only the admin user can make zip dumps, else
34 // zip dumps require no authentication.
35 define('ZIPDUMP_AUTH', false);
37 // The maximum file upload size.
38 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
40 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default
41 // state for the "minor edit" checkbox on the edit page form will be off.
42 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
44 // Actions listed in this array will not be allowed.
45 //$DisabledActions = array('dumpserial', 'loadfile');
47 // PhpWiki can generate an access_log (in "NCSA combined log" format)
48 // for you. If you want one, define this to the name of the log file.
49 define('ACCESS_LOG', '/tmp/wiki_access_log');
51 /////////////////////////////////////////////////////////////////////
56 /////////////////////////////////////////////////////////////////////
59 // This array holds the parameters which select the database to use.
61 // Not all of these parameters are used by any particular DB backend.
64 // Select the database type:
65 // Uncomment one of these, or leave all commented for the default
66 // data base type ('dba' if supported, else 'dbm'.)
69 //'dbtype' => 'mysql',
70 //'dbtype' => 'pgsql',
74 // Used by all DB types:
76 'prefix' => '', // prefix for filenames or table names
78 // Used by 'dbm', 'dba', 'file'
79 'directory' => "/tmp",
81 // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*".
82 // 'file' creates files named "$directory/${database}/{$prefix}*/*".
83 // The sql types use tables named "{$prefix}*"
85 // Used by 'dbm', 'dba'
88 // Used by *sql as neccesary to log in to server:
89 'server' => 'localhost',
97 /////////////////////////////////////////////////////////////////////
100 // Page appearance and layout
102 /////////////////////////////////////////////////////////////////////
104 // Select your language - default language "C": English
105 // other languages available: Dutch "nl", Spanish "es", German "de",
109 // If you specify a relative URL for the CSS and images,
110 // the are interpreted relative to DATA_PATH (see below).
111 // (The default value of DATA_PATH is the directory in which
112 // index.php (this file) resides.)
115 define("CSS_URL", "phpwiki.css");
117 // logo image (path relative to index.php)
118 $logo = "images/wikibase.png";
120 // Signature image which is shown after saving an edited page
121 // If this is left blank (or unset), the signature will be omitted.
122 //$SignatureImg = "images/signature.png";
124 // date & time formats used to display modification times, etc.
125 // formats are given as format strings to PHP date() function
126 // FIXME: these should have different defaults depending on locale.
127 $datetimeformat = "F j, Y"; // may contain time of day
128 $dateformat = "F j, Y"; // must not contain time
130 // this defines how many page names to list when displaying
131 // the MostPopular pages; the default is to show the 20 most popular pages
132 define("MOST_POPULAR_LIST_LENGTH", 20);
134 // this defines how many page names to list when displaying related pages
135 define("NUM_RELATED_PAGES", 5);
137 // Template files (filenames are relative to script position)
138 // (These filenames will be passed through gettext() before use.)
139 $templates = array("BROWSE" => "templates/browse.html",
140 "EDITPAGE" => "templates/editpage.html",
141 "MESSAGE" => "templates/message.html");
143 /* WIKI_PGSRC -- specifies the source for the initial page contents
144 * of the Wiki. The setting of WIKI_PGSRC only has effect when
145 * the wiki is accessed for the first time (or after clearing the
146 * database.) WIKI_PGSRC can either name a directory or a zip file.
147 * In either case WIKI_PGSRC is scanned for files --- one file per page.
149 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
150 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
152 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
153 // the default (English) and when reading from a directory:
154 // in that case some English pages are inserted into the wiki as well
155 // DEFAULT_WIKI_PGSRC defines where the English pages reside
156 // FIXME: is this really needed? Can't we just copy
157 // these pages into the localized pgsrc?
158 define('DEFAULT_WIKI_PGSRC', "pgsrc");
159 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.
160 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
162 /////////////////////////////////////////////////////////////////////
167 /////////////////////////////////////////////////////////////////////
169 // allowed protocols for links - be careful not to allow "javascript:"
170 // URL of these types will be automatically linked.
171 // within a named link [name|uri] one more protocol is defined: phpwiki
172 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
174 // URLs ending with the following extension should be inlined as images
175 $InlineImages = "png|jpg|gif";
177 // Perl regexp for WikiNames ("bumpy words")
178 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
179 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
181 // InterWiki linking -- wiki-style links to other wikis on the web
183 // Intermap file for InterWikiLinks -- define other wikis there
184 // Leave this undefined to disable InterWiki linking.
185 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
187 /////////////////////////////////////////////////////////////////////
190 // URL options -- you can probably skip this section.
192 /////////////////////////////////////////////////////////////////////
193 /******************************************************************
195 * The following section contains settings which you can use to tailor
196 * the URLs which PhpWiki generates.
198 * Any of these parameters which are left undefined will be
199 * deduced automatically. You need only set them explicitly
200 * if the auto-detected values prove to be incorrect.
202 * In most cases the auto-detected values should work fine,
203 * so hopefully you don't need to mess with this section.
205 ******************************************************************/
208 * Canonical name and httpd port of the server on which this
211 //define('SERVER_NAME', 'some.host.com');
212 //define('SERVER_PORT', 80);
215 * Absolute URL (from the server root) of the PhpWiki
218 //define('SCRIPT_NAME', '/some/where/index.php');
221 * Absolute URL (from the server root) of the directory
222 * in which relative URL's for images and other support files
225 //define('DATA_PATH', '/some/where');
228 * Define to 'true' to use PATH_INFO to pass the pagename's.
229 * e.g. http://www.some.where/index.php/FrontPage instead
230 * of http://www.some.where/index.php?pagename=FrontPage
231 * FIXME: more docs (maybe in README).
233 //define('USE_PATH_INFO', false);
236 * VIRTUAL_PATH is the canonical URL path under which your
237 * your wiki appears. Normally this is the same as
238 * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
239 * (or mod_rewrite), you can make it something different.
241 * If you do this, you should set VIRTUAL_PATH here.
243 * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
244 * but * you've made it accessible through eg. /wiki/FrontPage.
246 * One way to do this is to create a directory named 'wiki' in your
247 * server root. The directory contains only one file: an .htaccess
248 * file which reads something like:
250 * Action x-phpwiki-page /scripts/phpwiki/index.php
251 * SetHandler x-phpwiki-page
252 * DirectoryIndex /scripts/phpwiki/index.php
254 * In that case you should set VIRTUAL_PATH to '/wiki'.
256 * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
258 //define('VIRTUAL_PATH', '/SomeWiki');
261 ////////////////////////////////////////////////////////////////
262 // Okay... fire up the code:
263 ////////////////////////////////////////////////////////////////
265 include "lib/main.php";
270 // c-file-style: "ellemtel"