2 if (!function_exists('rcs_id')) {
3 function rcs_id($id) { echo "<!-- $id -->\n"; };
5 rcs_id('$Id: config.php,v 1.8 2000-10-25 14:41:32 ahollosi Exp $');
8 Constants and settings. Edit the values below for
9 your site. You need two image files, a banner and
10 a signature. The dbm file MUST be writable by the
11 web server or this won't work. If you configure your
12 server to allow index.php as an index file, you
13 can just give the URL without the script name.
16 // If you need to access your Wiki from assorted locations and
17 // you use DHCP, this setting might work for you:
19 //$ServerAddress = "http:";
21 // It works quite well thanks to relative URIs. (Yes, that's just
22 // 'http:'). If find that you want an explicit address (recommended),
23 // you can set one yourself by changing and uncommenting:
25 //$ServerAddress = "http://your.hostname.org/phpwiki/";
27 // Or you could use the if/else statement below to deduce
28 // the $ServerAddress dynamically. (Default)
30 if (preg_match("#(.*?)([^/]*$)#", $REQUEST_URI, $matches)) {
31 $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT" . $matches[1];
33 $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT$REQUEST_URI";
36 // Select your language here
38 $LANG="C"; // (What should be the) Default: English
39 // $LANG="nl"; // We all speak dutch, no?
41 if (!function_exists ('gettext')) {
42 $lcfile = "locale/$LANG/LC_MESSAGES/phpwiki.php";
43 if(file_exists($lcfile)) {
49 function gettext ($text) {
51 if (!empty ($locale[$text]))
52 return $locale[$text];
56 putenv ("LANG=$LANG");
57 bindtextdomain ("phpwiki", "./locale");
58 textdomain ("phpwiki");
61 // if you are using MySQL instead of a DBM to store your
62 // Wiki pages, use mysql.php instead of dbmlib.php
63 // See INSTALL.mysql for details on using MySQL
65 // if you are using Postgressl instead of a DBM to store your
66 // Wiki pages, use pgsql.php instead of dbmlib.php
67 // See INSTALL.pgsql for details on using Postgresql
69 // if you are using mSQL instead of a DBM to store your
70 // Wiki pages, use msql.php instead of dbmlib.php
71 // See INSTALL.mysql for details on using mSQL
74 // DBM settings (default)
75 include "lib/dbmlib.php";
77 $WikiPageStore = "wiki";
78 $ArchivePageStore = "archive";
79 $WikiDB['wiki'] = "$DBMdir/wikipagesdb";
80 $WikiDB['archive'] = "$DBMdir/wikiarchivedb";
81 $WikiDB['wikilinks'] = "$DBMdir/wikilinksdb";
82 $WikiDB['hottopics'] = "$DBMdir/wikihottopicsdb";
83 $WikiDB['hitcount'] = "$DBMdir/wikihitcountdb";
86 // MySQL settings (thanks Arno Hollosi! <ahollosi@iname.com>)
87 // Comment out the lines above (for the DBM) if you use these
88 include "lib/mysql.php";
89 $WikiPageStore = "wiki";
90 $ArchivePageStore = "archive";
91 $mysql_server = 'localhost';
98 // PostgreSQL settings.
99 include "lib/pgsql.php";
100 $WikiDataBase = "wiki"; // name of the database in Postgresql
101 $WikiPageStore = "wiki"; // name of the table where pages are stored
102 $ArchivePageStore = "archive"; // name of the table where pages are archived
103 $pg_dbhost = "localhost";
109 // MiniSQL (mSQL) settings.
110 include "lib/msql.php";
112 // should be the same as wikipages.line
113 define("MSQL_MAX_LINE_LENGTH", 128);
114 $WikiPageStore = array();
115 $ArchivePageStore = array();
117 $WikiPageStore['table'] = "wiki";
118 $WikiPageStore['page_table'] = "wikipages";
119 $ArchivePageStore['table'] = "archive";
120 $ArchivePageStore['page_table'] = "archivepages";
125 // Filesystem DB settings
126 include "lib/db_filesystem.php";
127 $DBdir = "/tmp/wiki";
128 $WikiPageStore = "wiki";
129 $ArchivePageStore = "archive";
130 $WikiDB['wiki'] = "$DBdir/pages";
131 $WikiDB['archive'] = "$DBdir/archive";
132 $WikiDB['wikilinks'] = "$DBdir/links";
133 $WikiDB['hottopics'] = "$DBdir/hottopics";
134 $WikiDB['hitcount'] = "$DBdir/hitcount";
135 // End Filsystem Settings
141 * This constant specifies the source for the initial page contents
142 * of the Wiki. The setting of WIKI_PGSRC only has effect when
143 * the wiki is accessed for the first time (or after clearing the
146 * The 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 * FIXME: this documentation needs to be clarified.
151 * If the files appear to be MIME formatted messages, they are
152 * scanned for application/x-phpwiki content-types. Any suitable
153 * content is added to the wiki.
155 * The files can also be plain text files, in which case the page name
156 * is taken from the file name.
158 define('WIKI_PGSRC', gettext("./pgsrc")); // Default (old) behavior.
159 //define('WIKI_PGSRC', './wiki.zip'); // New style.
161 // DEFAULT_WIKI_PGSRC is only used when the language is *not*
162 // the default (English) and when reading from a directory:
163 // in that case some English pages are inserted into the wiki as well
164 // DEFAULT_WIKI_PGSRC defines where the English pages reside
165 define('DEFAULT_WIKI_PGSRC', "./pgsrc");
167 $ScriptName = "index.php";
169 $SignatureImg = "images/signature.png";
170 $logo = "images/wikibase.png";
172 // Template files (filenames are relative to script position)
174 "BROWSE" => gettext("templates/browse.html"),
175 "EDITPAGE" => gettext("templates/editpage.html"),
176 "EDITLINKS" => gettext("templates/editlinks.html"),
177 "MESSAGE" => gettext("templates/message.html")
180 // date & time formats used to display modification times, etc.
181 // formats are given as format strings to PHP date() function
182 $datetimeformat = "F j, Y"; // may contain time of day
183 $dateformat = "F j, Y"; // must not contain time
185 // allowed protocols for links - be careful not to allow "javascript:"
186 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
188 // URLs ending with the following extension should be inlined as images
189 $InlineImages = "png|jpg|gif";
191 // Perl regexp for WikiNames
192 $WikiNameRegexp = "\b([A-Z][a-z]+){2,}\b";
194 // this defines how many page names to list when displaying
195 // the MostPopular pages; i.e. setting this to 20 will show
196 // the 20 most popular pages
197 define("MOST_POPULAR_LIST_LENGTH", 20);
199 // this defines how many page names to list when displaying
200 // scored related pages
201 define("NUM_RELATED_PAGES", 5);
203 // number of user-defined external links, i.e. "[1]"
204 define("NUM_LINKS", 12);
206 // try this many times if the dbm is unavailable
207 define("MAX_DBM_ATTEMPTS", 20);
210 //////////////////////////////////////////////////////////////////////
212 // you shouldn't have to edit anyting below this line
214 $ScriptUrl = $ServerAddress . $ScriptName;
215 $LogoImage = "<img src='${ServerAddress}$logo' border='0'>";
216 $LogoImage = "<a href='$ScriptUrl'>$LogoImage</a>";
218 $FieldSeparator = "\263";
220 // Apache won't show REMOTE_HOST unless the admin configured it
221 // properly. We'll be nice and see if it's there.
222 empty($REMOTE_HOST) ?
223 ($remoteuser = $REMOTE_ADDR) : ($remoteuser = $REMOTE_HOST);
225 // constants used for HTML output. List tags like UL and
226 // OL have a depth of one, PRE has a depth of 0.
227 define("ZERO_DEPTH", 0);
228 define("SINGLE_DEPTH", 1);
230 // constants for flags in $pagehash
231 define("FLAG_PAGE_LOCKED", 1);