]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/config.php
Changed occurances of *php3 to *php.
[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.2 2000-10-08 18:12:14 wainstead 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    // You should set the $ServerAddress below, and comment out
17    // the if/else that follows. The if/else sets the server address
18    // dynamically, and you can save some cycles on the server by
19    // setting $ServerAddress yourself.
20    //$ServerAddress = "http://127.0.0.1:8080/phpwiki/";
21
22
23    if (preg_match("#(.*?)([^/]*$)#", $REQUEST_URI, $matches)) {
24       $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT" . $matches[1];
25    } else {
26       $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT$REQUEST_URI";
27    }
28
29    // if you are using MySQL instead of a DBM to store your
30    // Wiki pages, use mysql.php instead of dbmlib.php
31    // See INSTALL.mysql for details on using MySQL
32
33    // if you are using Postgressl instead of a DBM to store your
34    // Wiki pages, use pgsql.php instead of dbmlib.php
35    // See INSTALL.pgsql for details on using Postgresql
36
37    // if you are using mSQL instead of a DBM to store your
38    // Wiki pages, use msql.php instead of dbmlib.php
39    // See INSTALL.mysql for details on using mSQL
40
41
42    // DBM settings (default)
43    include "lib/dbmlib.php";
44    $DBMdir = "/tmp";
45    $WikiPageStore = "wiki";
46    $ArchivePageStore = "archive";
47    $WikiDB['wiki']      = "$DBMdir/wikipagesdb";
48    $WikiDB['archive']   = "$DBMdir/wikiarchivedb";
49    $WikiDB['wikilinks'] = "$DBMdir/wikilinksdb";
50    $WikiDB['hottopics'] = "$DBMdir/wikihottopicsdb";
51    $WikiDB['hitcount']  = "$DBMdir/wikihitcountdb";
52
53 /*
54    // MySQL settings (thanks Arno Hollosi! <ahollosi@iname.com>)
55    // Comment out the lines above (for the DBM) if you use these
56
57    include "lib/mysql.php";
58    $WikiPageStore = "wiki";
59    $ArchivePageStore = "archive";
60    $mysql_server = 'localhost';
61    $mysql_user = 'root';
62    $mysql_pwd = '';
63    $mysql_db = 'wiki';
64 */
65
66 /*
67    // PostgreSQL settings. 
68    include "lib/pgsql.php";
69    $WikiDataBase  = "wiki"; // name of the database in Postgresql
70    $WikiPageStore = "wiki"; // name of the table where pages are stored
71    $ArchivePageStore = "archive"; // name of the table where pages are archived
72    $pg_dbhost    = "localhost";
73    $pg_dbport    = "5432";
74 */
75
76
77 /*
78    // MiniSQL (mSQL) settings.
79    include "lib/msql.php";
80    $msql_db = "wiki";
81    // should be the same as wikipages.line
82    define("MSQL_MAX_LINE_LENGTH", 128);
83    $WikiPageStore = array();
84    $ArchivePageStore = array();
85
86    $WikiPageStore['table']         = "wiki";
87    $WikiPageStore['page_table']    = "wikipages";
88    $ArchivePageStore['table']      = "archive";
89    $ArchivePageStore['page_table'] = "archivepages";
90    // end mSQL settings
91 */
92
93 /*
94    // Filesystem DB settings
95    include "lib/db_filesystem.php";
96    $DBdir = "/tmp/wiki";
97    $WikiPageStore = "wiki";
98    $ArchivePageStore = "archive";
99    $WikiDB['wiki']      = "$DBdir/pages";
100    $WikiDB['archive']   = "$DBdir/archive";
101    $WikiDB['wikilinks'] = "$DBdir/links";
102    $WikiDB['hottopics'] = "$DBdir/hottopics";
103    $WikiDB['hitcount']  = "$DBdir/hitcount";
104    // End Filsystem Settings
105 */
106
107
108    /* WIKI_PGSRC
109     *
110     * This constant specifies the source for the initial page contents
111     * of the Wiki.  The setting of WIKI_PGSRC only has effect when
112     * the wiki is accessed for the first time (or after clearing the
113     * database.)
114     *
115     * The WIKI_PGSRC can either name a directory or a zip file.
116     * In either case WIKI_PGSRC is scanned for files --- one file per page.
117     *
118     * FIXME: this documentation needs to be clarified.
119     *
120     * If the files appear to be MIME formatted messages, they are
121     * scanned for application/x-phpwiki content-types.  Any suitable
122     * content is added to the wiki.
123     *
124     * The files can also be plain text files, in which case the page name
125     * is taken from the file name.
126     */
127    define('WIKI_PGSRC', './pgsrc'); // Default (old) behavior.
128    //define('WIKI_PGSRC', './wiki.zip'); // New style.
129   
130    $ScriptName = "index.php";
131
132
133    // Template files (filenames are relative to script position)
134    $templates = array(
135         "BROWSE" =>    "templates/browse.html",
136         "EDITPAGE" =>  "templates/editpage.html",
137         "EDITLINKS" => "templates/editlinks.html",
138         "MESSAGE" =>   "templates/message.html"
139         );
140
141    $SignatureImg = "$ServerAddress/signature.png";
142    $logo = "wikibase.png";
143
144    // date & time formats used to display modification times, etc.
145    // formats are given as format strings to PHP date() function
146    $datetimeformat = "F j, Y";  // may contain time of day
147    $dateformat = "F j, Y";      // must not contain time
148
149    // allowed protocols for links - be careful not to allow "javascript:"
150    $AllowedProtocols = "http|https|mailto|ftp|news|gopher";
151    
152    // you shouldn't have to edit anyting below this line
153
154    $ScriptUrl = $ServerAddress . $ScriptName;
155    $LogoImage = "<img src='${ServerAddress}$logo' border='0'>";
156    $LogoImage = "<a href='$ScriptUrl'>$LogoImage</a>";
157
158    $FieldSeparator = "\263";
159
160    // Apache won't show REMOTE_HOST unless the admin configured it
161    // properly. We'll be nice and see if it's there.
162    empty($REMOTE_HOST) ?
163       ($remoteuser = $REMOTE_ADDR) : ($remoteuser = $REMOTE_HOST);
164
165
166    // number of user-defined external links, i.e. "[1]"
167    define("NUM_LINKS", 12);
168
169    // try this many times if the dbm is unavailable
170    define("MAX_DBM_ATTEMPTS", 20);
171
172    // constants used for HTML output. List tags like UL and 
173    // OL have a depth of one, PRE has a depth of 0.
174    define("ZERO_DEPTH", 0);
175    define("SINGLE_DEPTH", 1);
176
177    // constants for flags in $pagehash
178    define("FLAG_PAGE_LOCKED", 1);
179
180    // this defines how many page names to list when displaying
181    // the MostPopular pages; i.e. setting this to 20 will show
182    // the 20 most popular pages
183    define("MOST_POPULAR_LIST_LENGTH", 20);
184
185    // this defines how many page names to list when displaying
186    // scored related pages
187    define("NUM_RELATED_PAGES", 5);
188
189 ?>