]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/config.php
Some generic pages are included in English, ignoring the language setting
[SourceForge/phpwiki.git] / lib / config.php
1 <?php
2    if (!function_exists('rcs_id')) {
3       function rcs_id($id) { echo "<!-- $id -->\n"; };
4    }
5    rcs_id('$Id: config.php,v 1.7 2000-10-22 19:33:35 ahollosi Exp $');
6
7    /*
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.
14    */
15
16    // If you need to access your Wiki from assorted locations and
17    // you use DHCP, this setting might work for you:
18
19    //$ServerAddress = "http:";
20
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:
24
25    //$ServerAddress = "http://your.hostname.org/phpwiki/";
26
27    // Or you could use the if/else statement below to deduce
28    // the $ServerAddress dynamically. (Default)
29
30    if (preg_match("#(.*?)([^/]*$)#", $REQUEST_URI, $matches)) {
31       $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT" . $matches[1];
32    } else {
33       $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT$REQUEST_URI";
34    }
35
36    //  Select your language here
37  
38    $LANG="C"; // (What should be the) Default: English
39    // $LANG="nl";  // We all speak dutch, no?
40
41    if (!function_exists ('gettext')) {
42       $lcfile = "locale/$LANG/LC_MESSAGES/phpwiki.php";
43       if(file_exists($lcfile)) {
44          include($lcfile);
45       } else {
46          $locale = array();
47       }
48
49       function gettext ($text) { 
50          global $locale;
51          if (!empty ($locale[$text]))
52            return $locale[$text];
53          return $text;
54       }
55    } else {
56       putenv ("LANG=$LANG");
57       bindtextdomain ("phpwiki", "./locale");
58       textdomain ("phpwiki");
59    }
60
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
64
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
68
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
72
73
74    // DBM settings (default)
75    include "lib/dbmlib.php";
76    $DBMdir = "/tmp";
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";
84
85 /*
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';
92    $mysql_user = 'root';
93    $mysql_pwd = '';
94    $mysql_db = 'wiki';
95 */
96
97 /*
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";
104    $pg_dbport    = "5432";
105 */
106
107
108 /*
109    // MiniSQL (mSQL) settings.
110    include "lib/msql.php";
111    $msql_db = "wiki";
112    // should be the same as wikipages.line
113    define("MSQL_MAX_LINE_LENGTH", 128);
114    $WikiPageStore = array();
115    $ArchivePageStore = array();
116
117    $WikiPageStore['table']         = "wiki";
118    $WikiPageStore['page_table']    = "wikipages";
119    $ArchivePageStore['table']      = "archive";
120    $ArchivePageStore['page_table'] = "archivepages";
121    // end mSQL settings
122 */
123
124 /*
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
136 */
137
138
139    /* WIKI_PGSRC
140     *
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
144     * database.)
145     *
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.
148     *
149     * FIXME: this documentation needs to be clarified.
150     *
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.
154     *
155     * The files can also be plain text files, in which case the page name
156     * is taken from the file name.
157     */
158    define('WIKI_PGSRC', gettext("./pgsrc")); // Default (old) behavior.
159    //define('WIKI_PGSRC', './wiki.zip'); // New style.
160
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");
166   
167    $ScriptName = "index.php";
168
169    $SignatureImg = "images/signature.png";
170    $logo = "images/wikibase.png";
171
172    // Template files (filenames are relative to script position)
173    $templates = array(
174         "BROWSE" =>    gettext("templates/browse.html"),
175         "EDITPAGE" =>  gettext("templates/editpage.html"),
176         "EDITLINKS" => gettext("templates/editlinks.html"),
177         "MESSAGE" =>   gettext("templates/message.html")
178         );
179
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
184
185    // allowed protocols for links - be careful not to allow "javascript:"
186    $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
187
188    // this defines how many page names to list when displaying
189    // the MostPopular pages; i.e. setting this to 20 will show
190    // the 20 most popular pages
191    define("MOST_POPULAR_LIST_LENGTH", 20);
192
193    // this defines how many page names to list when displaying
194    // scored related pages
195    define("NUM_RELATED_PAGES", 5);
196
197    // number of user-defined external links, i.e. "[1]"
198    define("NUM_LINKS", 12);
199
200    // try this many times if the dbm is unavailable
201    define("MAX_DBM_ATTEMPTS", 20);
202
203
204    //////////////////////////////////////////////////////////////////////
205
206    // you shouldn't have to edit anyting below this line
207
208    $ScriptUrl = $ServerAddress . $ScriptName;
209    $LogoImage = "<img src='${ServerAddress}$logo' border='0'>";
210    $LogoImage = "<a href='$ScriptUrl'>$LogoImage</a>";
211
212    $FieldSeparator = "\263";
213
214    // Apache won't show REMOTE_HOST unless the admin configured it
215    // properly. We'll be nice and see if it's there.
216    empty($REMOTE_HOST) ?
217       ($remoteuser = $REMOTE_ADDR) : ($remoteuser = $REMOTE_HOST);
218
219    // constants used for HTML output. List tags like UL and 
220    // OL have a depth of one, PRE has a depth of 0.
221    define("ZERO_DEPTH", 0);
222    define("SINGLE_DEPTH", 1);
223
224    // constants for flags in $pagehash
225    define("FLAG_PAGE_LOCKED", 1);
226 ?>