]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - index.php
Fixed some bugs in the page source in the "Emphasis" section.
[SourceForge/phpwiki.git] / index.php
1 <?php
2
3 /*
4   This is the starting file for PhpWiki. All this file does
5    is set configuration options, and at the end of the file 
6    it includes() the file lib/main.php, where the real action begins.
7
8    This file is divided into six parts: Parts Zero, One, Two, Three,
9    Four and Five. Each one has different configuration settings you 
10    can change; in all cases the default should work on your system, 
11    however, we recommend you tailor things to your particular setting.
12 */
13
14 /////////////////////////////////////////////////////////////////////
15 // Part Zero: If PHP needs help in finding where you installed the
16 //   rest of the PhpWiki code, you can set the include_path here.
17
18
19 //ini_set('include_path', '.:/where/you/installed/phpwiki');
20
21 /////////////////////////////////////////////////////////////////////
22 // Part Null: Don't touch this!
23
24 define ('PHPWIKI_VERSION', '1.3.0pre');
25 require "lib/prepend.php";
26 rcs_id('$Id: index.php,v 1.20 2001-07-20 17:40:12 dairiki Exp $');
27
28 /////////////////////////////////////////////////////////////////////
29 //
30 // Part One:
31 // Authentication and security settings:
32 // 
33 /////////////////////////////////////////////////////////////////////
34
35 // If set, we will perform reverse dns lookups to try to convert the users
36 // IP number to a host name, even if the http server didn't do it for us.
37 define('ENABLE_REVERSE_DNS', true);
38
39 // Username and password of administrator.
40 // Set these to your preferences. For heaven's sake
41 // pick a good password!
42 define('ADMIN_USER', "");
43 define('ADMIN_PASSWD', "");
44
45 // If true, only the admin user can make zip dumps, else
46 // zip dumps require no authentication.
47 define('ZIPDUMP_AUTH', false);
48
49 // The maximum file upload size.
50 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
51
52 // If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default
53 // state for the "minor edit" checkbox on the edit page form will be off.
54 define("MINOR_EDIT_TIMEOUT", 7 * 24 * 3600);
55
56 // Actions listed in this array will not be allowed.
57 //$DisabledActions = array('dumpserial', 'loadfile');
58
59 // PhpWiki can generate an access_log (in "NCSA combined log" format)
60 // for you.  If you want one, define this to the name of the log file.
61 define('ACCESS_LOG', '/tmp/wiki_access_log');
62
63
64 // If ALLOW_BOGO_LOGIN is true, users are allowed to login
65 // (with any/no password) using any userid which: 1) is not
66 // the ADMIN_USER, 2) is a valid WikiWord (matches $WikiNameRegexp.)
67 define('ALLOW_BOGO_LOGIN', true);
68
69 /////////////////////////////////////////////////////////////////////
70 //
71 // Part Two:
72 // Database Selection
73 //
74 /////////////////////////////////////////////////////////////////////
75
76 //
77 // This array holds the parameters which select the database to use.
78 //
79 // Not all of these parameters are used by any particular DB backend.
80 //
81 $DBParams = array(
82    // Select the database type:
83    // Uncomment one of these, or leave all commented for the default
84    // data base type ('dba' if supported, else 'dbm'.)
85    //'dbtype' => 'dba',
86    //'dbtype' => 'dbm',
87    //'dbtype' => 'mysql',
88    //'dbtype' => 'pgsql',
89    //'dbtype' => 'msql',
90    //'dbtype' => 'file',
91    
92    // Used by all DB types:
93    'database' => 'wiki',
94    // prefix for filenames or table names
95    /* 
96     * currently you MUST EDIT THE SQL file too (in the schemas/ directory
97     * because we aren't doing on the fly sql generation during the
98     * installation.
99    */
100    'prefix' => 'phpwiki_',
101    
102    // Used by 'dbm', 'dba', 'file'
103    'directory' => "/tmp",
104
105    // 'dbm' and 'dba create files named "$directory/${database}{$prefix}*".
106    // 'file' creates files named "$directory/${database}/{$prefix}*/*".
107    // The sql types use tables named "{$prefix}*"
108    
109    // Used by 'dbm', 'dba'
110    'timeout' => 20,
111    
112    // Used by *sql as neccesary to log in to server:
113    'server'   => 'localhost',
114    'port'     => '',
115    'socket'   => '',
116    'user'     => 'guest',
117    'password' => ''
118 );
119
120
121 /////////////////////////////////////////////////////////////////////
122 // 
123 // Part Three:
124 // Page appearance and layout
125 //
126 /////////////////////////////////////////////////////////////////////
127
128 // Select your language/locale - default language "C": English
129 // other languages available: Dutch "nl", Spanish "es", German "de",
130 // Swedish "sv", and Italian, "it".
131 //
132 // Note that on some systems, apprently using these short forms for
133 // the locale won't work.  On my home system 'LANG=de' won't result
134 // in german pages.  Somehow the system must recognize the locale
135 // as a valid locale before gettext() will work, i.e., use 'de_DE',
136 // 'nl_NL'.
137 $LANG='C';
138 //$LANG='nl_NL';
139
140 // Setting the LANG environment variable (accomplished above) may or
141 // may not be sufficient to cause PhpWiki to produce dates in your
142 // native language.  (It depends on the configuration of the operating
143 // system on your http server.)  The problem is that, e.g. 'de' is
144 // often not a valid locale.
145 //
146 // A standard locale name is typically of  the  form
147 // language[_territory][.codeset][@modifier],  where  language is
148 // an ISO 639 language code, territory is an ISO 3166 country code,
149 // and codeset  is  a  character  set or encoding identifier like
150 // ISO-8859-1 or UTF-8.
151 //
152 // You can tailor the locale used for time and date formatting by setting
153 // the LC_TIME environment variable.  You'll have to experiment to find
154 // the correct setting:
155 //putenv('LC_TIME=de_DE');
156
157 // If you specify a relative URL for the CSS and images,
158 // the are interpreted relative to DATA_PATH (see below).
159 // (The default value of DATA_PATH is the directory in which
160 // index.php (this file) resides.)
161
162 // CSS location
163 define("CSS_URL", "phpwiki.css");
164
165 // logo image (path relative to index.php)
166 $logo = "images/wikibase.png";
167
168 // Signature image which is shown after saving an edited page
169 // If this is left blank (or unset), the signature will be omitted.
170 //$SignatureImg = "images/signature.png";
171
172 // Date & time formats used to display modification times, etc.
173 // Formats are given as format strings to PHP strftime() function
174 // See http://www.php.net/manual/en/function.strftime.php for details.
175 $datetimeformat = "%B %e, %Y";  // may contain time of day
176 $dateformat = "%B %e, %Y";      // must not contain time
177
178 // this defines how many page names to list when displaying
179 // the MostPopular pages; the default is to show the 20 most popular pages
180 define("MOST_POPULAR_LIST_LENGTH", 20);
181
182 // this defines how many page names to list when displaying related pages
183 define("NUM_RELATED_PAGES", 5);
184
185 // Template files (filenames are relative to script position)
186 // However, if a LANG is set, they we be searched for in a locale
187 // specific location first.
188 $templates = array("BROWSE" =>    "templates/browse.html",
189                    "EDITPAGE" =>  "templates/editpage.html",
190                    "MESSAGE" =>   "templates/message.html");
191
192 /* WIKI_PGSRC -- specifies the source for the initial page contents
193  * of the Wiki.  The setting of WIKI_PGSRC only has effect when
194  * the wiki is accessed for the first time (or after clearing the
195  * database.) WIKI_PGSRC can either name a directory or a zip file.
196  * In either case WIKI_PGSRC is scanned for files --- one file per page.
197  */
198 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
199 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
200
201 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
202 // the default (English) and when reading from a directory:
203 // in that case some English pages are inserted into the wiki as well
204 // DEFAULT_WIKI_PGSRC defines where the English pages reside 
205 // FIXME: is this really needed?  Can't we just copy
206 //  these pages into the localized pgsrc?
207 define('DEFAULT_WIKI_PGSRC', "pgsrc");
208 // These are the pages which will get loaded from DEFAULT_WIKI_PGSRC.   
209 $GenericPages = array("ReleaseNotes", "SteveWainstead", "TestPage");
210
211 /////////////////////////////////////////////////////////////////////
212 //
213 // Part four:
214 // Mark-up options.
215 // 
216 /////////////////////////////////////////////////////////////////////
217
218 // allowed protocols for links - be careful not to allow "javascript:"
219 // URL of these types will be automatically linked.
220 // within a named link [name|uri] one more protocol is defined: phpwiki
221 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
222
223 // URLs ending with the following extension should be inlined as images
224 $InlineImages = "png|jpg|gif";
225
226 // Perl regexp for WikiNames ("bumpy words")
227 // (?<!..) & (?!...) used instead of '\b' because \b matches '_' as well
228 $WikiNameRegexp = "(?<![[:alnum:]])([[:upper:]][[:lower:]]+){2,}(?![[:alnum:]])";
229
230 // InterWiki linking -- wiki-style links to other wikis on the web
231 //
232 // Intermap file for InterWikiLinks -- define other wikis there
233 // Leave this undefined to disable InterWiki linking.
234 define('INTERWIKI_MAP_FILE', "lib/interwiki.map");
235
236 /////////////////////////////////////////////////////////////////////
237 //
238 // Part five:
239 // URL options -- you can probably skip this section.
240 //
241 /////////////////////////////////////////////////////////////////////
242 /******************************************************************
243  *
244  * The following section contains settings which you can use to tailor
245  * the URLs which PhpWiki generates. 
246  *
247  * Any of these parameters which are left undefined will be
248  * deduced automatically.  You need only set them explicitly
249  * if the auto-detected values prove to be incorrect.
250  *
251  * In most cases the auto-detected values should work fine,
252  * so hopefully you don't need to mess with this section.
253  *
254  ******************************************************************/
255
256 /*
257  * Canonical name and httpd port of the server on which this
258  * PhpWiki resides.
259  */
260 //define('SERVER_NAME', 'some.host.com');
261 //define('SERVER_PORT', 80);
262
263 /*
264  * Absolute URL (from the server root) of the PhpWiki
265  * script.
266  */
267 //define('SCRIPT_NAME', '/some/where/index.php');
268
269 /*
270  * Absolute URL (from the server root) of the directory
271  * in which relative URL's for images and other support files
272  * are interpreted.
273  */
274 //define('DATA_PATH', '/some/where');
275
276 /*
277  * Define to 'true' to use PATH_INFO to pass the pagename's.
278  * e.g. http://www.some.where/index.php/HomePage instead
279  * of http://www.some.where/index.php?pagename=HomePage
280  * FIXME: more docs (maybe in README).
281  */
282 //define('USE_PATH_INFO', false);
283
284 /*
285  * VIRTUAL_PATH is the canonical URL path under which your
286  * your wiki appears.  Normally this is the same as
287  * dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions
288  * (or mod_rewrite), you can make it something different.
289  *
290  * If you do this, you should set VIRTUAL_PATH here.
291  *
292  * E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php,
293  * but  * you've made it accessible through eg. /wiki/HomePage.
294  *
295  * One way to do this is to create a directory named 'wiki' in your
296  * server root.  The directory contains only one file: an .htaccess
297  * file which reads something like:
298  *
299  *    Action x-phpwiki-page /scripts/phpwiki/index.php
300  *    SetHandler x-phpwiki-page
301  *    DirectoryIndex /scripts/phpwiki/index.php
302  *
303  * In that case you should set VIRTUAL_PATH to '/wiki'.
304  *
305  * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
306  */
307 //define('VIRTUAL_PATH', '/SomeWiki');
308
309
310 ////////////////////////////////////////////////////////////////
311 // Okay... fire up the code:
312 ////////////////////////////////////////////////////////////////
313
314 include "lib/main.php";
315
316 // For emacs users
317 // Local Variables:
318 // mode: php
319 // c-file-style: "ellemtel"
320 // End:   
321 ?>