view Setup.php @ 12:682b4a24469c

optimized layout of ctrl bar
author meillo@marmaro.de
date Sun, 27 May 2007 02:28:20 +0200
parents 144bc36a6c27
children
line wrap: on
line source

<?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());

?>