Mercurial > owls
comparison Setup.php @ 0:3021ce32ee14 owls-0.5
begin of using hg for owls
author | "Meillo r e t u r n s <meillo@marmaro.de>" |
---|---|
date | Sun, 03 Dec 2006 22:32:13 +0100 |
parents | |
children | 144bc36a6c27 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3021ce32ee14 |
---|---|
1 <?php | |
2 | |
3 // you can customize the config here | |
4 | |
5 $dbPrefix = 'rem__2_'; // the names of the db-tables will be prefixed with this string | |
6 | |
7 //$modifyProtected = true; // are guests allowed to modify data? (true or false) | |
8 | |
9 $defaultUser = 'admin'; // useraccount if "modifyProtected = true" above | |
10 $defaultUserPassword = 'admin'; // password for useraccount if "modifyProtected = true" above | |
11 | |
12 | |
13 | |
14 // dont change anything form here on (except you know what you do) | |
15 //################################################################## | |
16 | |
17 // write db-login-data to textfile | |
18 | |
19 | |
20 // connect to db and create tables | |
21 require('../Db.inc.php'); | |
22 | |
23 | |
24 // table 'Owls' for the content data | |
25 mysql_query(" | |
26 CREATE TABLE IF NOT EXISTS `". $dbPrefix ."Owls` ( | |
27 `id` int(11) NOT NULL auto_increment, | |
28 `idParent` int(11) default '0', | |
29 `name` text NOT NULL, | |
30 `text` longtext NOT NULL, | |
31 `permission` tinyint(4) NOT NULL default '1', | |
32 `date` int(11) NOT NULL default '0', | |
33 PRIMARY KEY (`id`) | |
34 ) | |
35 ") or die(mysql_error()); | |
36 | |
37 // insert startup nodes | |
38 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()); | |
39 | |
40 | |
41 | |
42 // login should be managed via text file in future | |
43 mysql_query("CREATE TABLE IF NOT EXISTS `". $dbPrefix ."User` ( | |
44 `id` int(11) NOT NULL auto_increment, | |
45 `loginname` tinytext NOT NULL, | |
46 `password` tinytext NOT NULL, | |
47 PRIMARY KEY (`id`) | |
48 )") or die(mysql_error()); | |
49 | |
50 mysql_query("INSERT INTO `". $dbPrefix ."User` VALUES (1, '". $defaultUser ."', '". md5($defaultUserPassword) ."')") or die(mysql_error()); | |
51 | |
52 ?> |