Mercurial > owls
diff Config/Setup.php @ 14:cebc198276eb owls-0.6
more file moving
author | meillo@marmaro.de |
---|---|
date | Sun, 27 May 2007 03:01:16 +0200 |
parents | Setup.php@144bc36a6c27 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Config/Setup.php Sun May 27 03:01:16 2007 +0200 @@ -0,0 +1,52 @@ +<?php + +// you can customize the config here + +$dbPrefix = 'rem__2_'; // the names of the db-tables will be prefixed with this string + +//$modifyProtected = true; // are guests allowed to modify data? (true or false) + +$defaultUser = 'admin'; // useraccount if "modifyProtected = true" above +$defaultUserPassword = 'admin'; // password for useraccount if "modifyProtected = true" above + + + +// dont change anything form here on (except you know what you do) +//################################################################## + + // write db-login-data to textfile + + + // connect to db and create tables + require('../Db.inc.php'); + + + // table 'Owls' for the content data + mysql_query(" + CREATE TABLE IF NOT EXISTS `". $dbPrefix ."Owls` ( + `id` int(11) NOT NULL auto_increment, + `idParent` int(11) default '0', + `name` text NOT NULL, + `text` longtext NOT NULL, + `permission` tinyint(4) NOT NULL default '1', + `date` int(11) NOT NULL default '0', + PRIMARY KEY (`id`) + ) + ") or die(mysql_error()); + + // insert startup nodes + mysql_query("INSERT INTO `". $dbPrefix ."Owls` VALUES (1, 0, 'Index', 'Thanks for using [url=http://prog.marmaro.de/owls/]Owls[/url]!', 0, now())") or die(mysql_error()); + + + + // login should be managed via text file in future + mysql_query("CREATE TABLE IF NOT EXISTS `". $dbPrefix ."User` ( + `id` int(11) NOT NULL auto_increment, + `loginname` tinytext NOT NULL, + `password` tinytext NOT NULL, + PRIMARY KEY (`id`) + )") or die(mysql_error()); + + mysql_query("INSERT INTO `". $dbPrefix ."User` VALUES (1, '". $defaultUser ."', '". md5($defaultUserPassword) ."')") or die(mysql_error()); + +?>