]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - index.php
log
[SourceForge/phpwiki.git] / index.php
1 <?php
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 $');
8
9 /////////////////////////////////////////////////////////////////////
10 //
11 // Part One:
12 // Authentication and security settings:
13 // 
14 /////////////////////////////////////////////////////////////////////
15
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);
19
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', "");
25
26 // If true, only the admin user can make zip dumps, else
27 // zip dumps require no authentication.
28 define('ZIPDUMP_AUTH', false);
29
30 // The maximum file upload size.
31 define('MAX_UPLOAD_SIZE', 16 * 1024 * 1024);
32
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);
36
37 /////////////////////////////////////////////////////////////////////
38 //
39 // Part Two:
40 // Database Selection
41 //
42 /////////////////////////////////////////////////////////////////////
43
44 //
45 // This array holds the parameters which select the database to use.
46 //
47 // Not all of these parameters are used by any particular DB backend.
48 //
49 $DBParams = array(
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'.)
53    //'dbtype' => 'dba',
54    //'dbtype' => 'dbm',
55    //'dbtype' => 'mysql',
56    //'dbtype' => 'pgsql',
57    //'dbtype' => 'msql',
58    //'dbtype' => 'file',
59    
60    // Used by all DB types:
61    'database' => 'wiki',
62    'prefix' => '',      // prefix for filenames or table names
63    
64    // Used by 'dbm', 'dba', 'file'
65    'directory' => "/tmp",
66
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}*"
70    
71    // Used by 'dbm', 'dba'
72    'timeout' => 20,
73    
74    // Used by *sql as neccesary to log in to server:
75    'server'   => 'localhost',
76    'port'     => '',
77    'socket'   => '',
78    'user'     => 'guest',
79    'password' => ''
80 );
81
82
83 /////////////////////////////////////////////////////////////////////
84 // 
85 // Part Three:
86 // Page appearance and layout
87 //
88 /////////////////////////////////////////////////////////////////////
89
90 // Select your language - default language "C": English
91 // other languages available: Dutch "nl", Spanish "es", German "de",
92 // and Swedish "sv"
93 $LANG = "C";
94
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.)
99
100 // CSS location
101 define("CSS_URL", "phpwiki.css");
102
103 // logo image (path relative to index.php)
104 $logo = "images/wikibase.png";
105
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";
109
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
115
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);
119
120 // this defines how many page names to list when displaying related pages
121 define("NUM_RELATED_PAGES", 5);
122
123 // This path is searched when trying to read WIKI_PGSRC
124 // or template files.
125 $DataPath = array(".", "locale/$LANG");
126
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");
132
133
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.
139  */
140 define('WIKI_PGSRC', "pgsrc"); // Default (old) behavior.
141 //define('WIKI_PGSRC', 'wiki.zip'); // New style.
142
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");
152
153 /////////////////////////////////////////////////////////////////////
154 //
155 // Part four:
156 // Mark-up options.
157 // 
158 /////////////////////////////////////////////////////////////////////
159
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";
164
165 // URLs ending with the following extension should be inlined as images
166 $InlineImages = "png|jpg|gif";
167
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])";
171
172 // InterWiki linking -- wiki-style links to other wikis on the web
173 //
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");
177
178 /////////////////////////////////////////////////////////////////////
179 //
180 // Part five:
181 // URL options -- you can probably skip this section.
182 //
183 /////////////////////////////////////////////////////////////////////
184 /******************************************************************
185  *
186  * The following section contains settings which you can use to tailor
187  * the URLs which PhpWiki generates. 
188  *
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.
192  *
193  * In most cases the auto-detected values should work fine,
194  * so hopefully you don't need to mess with this section.
195  *
196  ******************************************************************/
197
198 /*
199  * Canonical name and httpd port of the server on which this
200  * PhpWiki resides.
201  */
202 //define('SERVER_NAME', 'some.host.com');
203 //define('SERVER_PORT', 80);
204
205 /*
206  * Absolute URL (from the server root) of the PhpWiki
207  * script.
208  */
209 //define('SCRIPT_NAME', '/some/where/index.php');
210
211 /*
212  * Absolute URL (from the server root) of the directory
213  * in which relative URL's for images and other support files
214  * are interpreted.
215  */
216 //define('DATA_PATH', '/some/where');
217
218 /*
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).
223  */
224 //define('USE_PATH_INFO', false);
225
226 /*
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.
231  *
232  * If you do this, you should set VIRTUAL_PATH here.
233  *
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.
236  *
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:
240  *
241  *    Action x-phpwiki-page /scripts/phpwiki/index.php
242  *    SetHandler x-phpwiki-page
243  *    DirectoryIndex /scripts/phpwiki/index.php
244  *
245  * In that case you should set VIRTUAL_PATH to '/wiki'.
246  *
247  * (VIRTUAL_PATH is only used if USE_PATH_INFO is true.)
248  */
249 //define('VIRTUAL_PATH', '/SomeWiki');
250
251
252 ////////////////////////////////////////////////////////////////
253 // Okay... fire up the code:
254 ////////////////////////////////////////////////////////////////
255
256 include "lib/main.php";
257
258 // For emacs users
259 // Local Variables:
260 // mode: php
261 // c-file-style: "ellemtel"
262 // End:   
263 ?>