.
<?php
$dbhost = "localhost";
$dbuser = "<username>";
$dbpass = "<password>";
$dbname = "<database>";
$prefix = ""; $dblink = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $dblink);
$database_sql = "CREATE TABLE ${prefix}interwiki (
prefix varchar(80) NOT NULL default '',
where_defined varchar(80) NOT NULL default '',
url varchar(255) NOT NULL default '',
PRIMARY KEY (prefix)
) TYPE=MyISAM;
CREATE TABLE ${prefix}links (
page varchar(80) NOT NULL default '',
link varchar(80) NOT NULL default '',
count int(10) unsigned NOT NULL default '0',
PRIMARY KEY (page,link)
) TYPE=MyISAM;
CREATE TABLE ${prefix}pages (
title varchar(80) NOT NULL default '',
version int(10) unsigned NOT NULL default '1',
time timestamp(14) NOT NULL,
supercede timestamp(14) NOT NULL,
mutable set('off','on') NOT NULL default 'on',
username varchar(80) default NULL,
author varchar(80) NOT NULL default '',
comment varchar(80) NOT NULL default '',
body text,
PRIMARY KEY (title,version)
) TYPE=MyISAM;
CREATE TABLE ${prefix}rate (
ip char(20) NOT NULL default '',
time timestamp(14) NOT NULL,
viewLimit smallint(5) unsigned default NULL,
searchLimit smallint(5) unsigned default NULL,
editLimit smallint(5) unsigned default NULL,
PRIMARY KEY (ip)
) TYPE=MyISAM;
CREATE TABLE ${prefix}remote_pages (
page varchar(80) NOT NULL default '',
site varchar(80) NOT NULL default '',
PRIMARY KEY (page,site)
) TYPE=MyISAM;
CREATE TABLE ${prefix}sisterwiki (
prefix varchar(80) NOT NULL default '',
where_defined varchar(80) NOT NULL default '',
url varchar(255) NOT NULL default '',
PRIMARY KEY (prefix)
) TYPE=MyISAM;";
$sql_queries = explode(";", $database_sql);
foreach ($sql_queries as $q) {
mysql_query($q, $dblink);
}
echo "DB Created!"
?>
NOTE NOTE NOTE
Read all info through the bottom, it might be helpful:) It sure helped me;)
Make sure the table name prefix matches the prefix in the config.php file.
The default prefix in the config.php file is wiki_ So you MUST edit the table create statements,
or you'll get an error when you first load the page. Replace {prefix} with wiki_
What name should i put to this doc ? ===> mywiki.php
I just should run the document with the browser? ===> yes!
Thx!
When I run mywiki.php what directory should I put it in? (should it be in the /public_html?)
Whatever directory you have access to. It does not depend on anything, so just run it.
Is there a missing bracket ">" in line 12? $dbpass = "<password"; Jep, fixed Thx
I removed all the "<>" after thinking about it. and then ran the browser, calling mywiki.php.
A whole grip of errors were reported about lines 16, 17 and 8 errors alone regarding line 72.
Ilooked in that neighborhood and found what appeared to be an extra doublequote and semicolon
in the CREATE TABLE ${prefix}sisterwiki ( line, near the end.
Next attempt, I got rid of the "; and tried again. This time there was only a single error:
Parse error: parse error, unexpected T_STRING in /myvirtualhostpath/wiki/public_html/mywiki.php on line 72.
I am still staring at the php file trying to figure it out. -anyone?
When copying and pasting this file, you really should go to the "Edit document" page and grab the source.
There are a few WikiWords in the code that get superfluous question marks tacked to the end.
Those mess everything up.
I added < phpcode-tag > and I hope it now is possible to copy-paste from the web , PAH
By the way the . on top of this page is no loger needed, well sort of... The tavi 0.25 has fixed it I read somewhere :)