2 if (!function_exists('rcs_id')) {
3 function rcs_id($id) { echo "<!-- $id -->\n"; };
5 rcs_id('$Id: config.php,v 1.4 2000-10-08 20:05:59 wainstead 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 // An empty server address:
20 // works quite well thanks to relative URIs. If find that you
21 // want an explicit address, you can set one yourself by changing
23 //$ServerAddress = "http://127.0.0.1:8080/phpwiki/";
26 // Or you could use the if/else statement below to deduce
27 // the $ServerAddress dynamically.
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";
38 // if you are using MySQL instead of a DBM to store your
39 // Wiki pages, use mysql.php instead of dbmlib.php
40 // See INSTALL.mysql for details on using MySQL
42 // if you are using Postgressl instead of a DBM to store your
43 // Wiki pages, use pgsql.php instead of dbmlib.php
44 // See INSTALL.pgsql for details on using Postgresql
46 // if you are using mSQL instead of a DBM to store your
47 // Wiki pages, use msql.php instead of dbmlib.php
48 // See INSTALL.mysql for details on using mSQL
51 // DBM settings (default)
52 include "lib/dbmlib.php";
54 $WikiPageStore = "wiki";
55 $ArchivePageStore = "archive";
56 $WikiDB['wiki'] = "$DBMdir/wikipagesdb";
57 $WikiDB['archive'] = "$DBMdir/wikiarchivedb";
58 $WikiDB['wikilinks'] = "$DBMdir/wikilinksdb";
59 $WikiDB['hottopics'] = "$DBMdir/wikihottopicsdb";
60 $WikiDB['hitcount'] = "$DBMdir/wikihitcountdb";
63 // MySQL settings (thanks Arno Hollosi! <ahollosi@iname.com>)
64 // Comment out the lines above (for the DBM) if you use these
66 include "lib/mysql.php";
67 $WikiPageStore = "wiki";
68 $ArchivePageStore = "archive";
69 $mysql_server = 'localhost';
76 // PostgreSQL settings.
77 include "lib/pgsql.php";
78 $WikiDataBase = "wiki"; // name of the database in Postgresql
79 $WikiPageStore = "wiki"; // name of the table where pages are stored
80 $ArchivePageStore = "archive"; // name of the table where pages are archived
81 $pg_dbhost = "localhost";
87 // MiniSQL (mSQL) settings.
88 include "lib/msql.php";
90 // should be the same as wikipages.line
91 define("MSQL_MAX_LINE_LENGTH", 128);
92 $WikiPageStore = array();
93 $ArchivePageStore = array();
95 $WikiPageStore['table'] = "wiki";
96 $WikiPageStore['page_table'] = "wikipages";
97 $ArchivePageStore['table'] = "archive";
98 $ArchivePageStore['page_table'] = "archivepages";
103 // Filesystem DB settings
104 include "lib/db_filesystem.php";
105 $DBdir = "/tmp/wiki";
106 $WikiPageStore = "wiki";
107 $ArchivePageStore = "archive";
108 $WikiDB['wiki'] = "$DBdir/pages";
109 $WikiDB['archive'] = "$DBdir/archive";
110 $WikiDB['wikilinks'] = "$DBdir/links";
111 $WikiDB['hottopics'] = "$DBdir/hottopics";
112 $WikiDB['hitcount'] = "$DBdir/hitcount";
113 // End Filsystem Settings
119 * This constant specifies the source for the initial page contents
120 * of the Wiki. The setting of WIKI_PGSRC only has effect when
121 * the wiki is accessed for the first time (or after clearing the
124 * The WIKI_PGSRC can either name a directory or a zip file.
125 * In either case WIKI_PGSRC is scanned for files --- one file per page.
127 * FIXME: this documentation needs to be clarified.
129 * If the files appear to be MIME formatted messages, they are
130 * scanned for application/x-phpwiki content-types. Any suitable
131 * content is added to the wiki.
133 * The files can also be plain text files, in which case the page name
134 * is taken from the file name.
136 define('WIKI_PGSRC', './pgsrc'); // Default (old) behavior.
137 //define('WIKI_PGSRC', './wiki.zip'); // New style.
139 $ScriptName = "index.php";
142 // Template files (filenames are relative to script position)
144 "BROWSE" => "templates/browse.html",
145 "EDITPAGE" => "templates/editpage.html",
146 "EDITLINKS" => "templates/editlinks.html",
147 "MESSAGE" => "templates/message.html"
150 $SignatureImg = "images/signature.png";
151 $logo = "images/wikibase.png";
153 // date & time formats used to display modification times, etc.
154 // formats are given as format strings to PHP date() function
155 $datetimeformat = "F j, Y"; // may contain time of day
156 $dateformat = "F j, Y"; // must not contain time
158 // allowed protocols for links - be careful not to allow "javascript:"
159 $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
161 // you shouldn't have to edit anyting below this line
163 $ScriptUrl = $ServerAddress . $ScriptName;
164 $LogoImage = "<img src='${ServerAddress}$logo' border='0'>";
165 $LogoImage = "<a href='$ScriptUrl'>$LogoImage</a>";
167 $FieldSeparator = "\263";
169 // Apache won't show REMOTE_HOST unless the admin configured it
170 // properly. We'll be nice and see if it's there.
171 empty($REMOTE_HOST) ?
172 ($remoteuser = $REMOTE_ADDR) : ($remoteuser = $REMOTE_HOST);
175 // number of user-defined external links, i.e. "[1]"
176 define("NUM_LINKS", 12);
178 // try this many times if the dbm is unavailable
179 define("MAX_DBM_ATTEMPTS", 20);
181 // constants used for HTML output. List tags like UL and
182 // OL have a depth of one, PRE has a depth of 0.
183 define("ZERO_DEPTH", 0);
184 define("SINGLE_DEPTH", 1);
186 // constants for flags in $pagehash
187 define("FLAG_PAGE_LOCKED", 1);
189 // this defines how many page names to list when displaying
190 // the MostPopular pages; i.e. setting this to 20 will show
191 // the 20 most popular pages
192 define("MOST_POPULAR_LIST_LENGTH", 20);
194 // this defines how many page names to list when displaying
195 // scored related pages
196 define("NUM_RELATED_PAGES", 5);