Location: PHPKode > projects > AlkalinePHP > install2.php
<!doctype html public "-//w3c//dtd html 3.2//en">

<html>

<head>
<title>AlkalinePHP Install | Step 2</title>
</head>

<body bgcolor="#8db8fe" text="#000000" link="#008000" vlink="#ff8040" alink="#ff0000">
<h2>AlkalinePHP(V 0.75.78 <i>beta</i>) Install | Step 2</h2><br>

<?
if ($action != "skip") {
	echo "Creating site settings file...";
	$filename = "load_settings.inc";
	$info_file = fopen($filename, "w") or die("Couldn't create file.");

	$file_contents = "<?
\$site_name = \"$site_name\";
\$server = \"$server\";
\$database = \"$database\";
\$db_user_name = \"$db_user_name\";
\$db_user_password = \"$db_user_password\";
?>";

	@fwrite($info_file, $file_contents) or die("Couldn't write to file.");
	fclose($info_file);

	echo "complete<br>";
} else {
	echo "Skipping creation of site settings file.<br>";
}

echo "Loading settings....<br>";
include("load_settings.inc");
echo "..<b>Site name</b>: $site_name..<br>";
echo "..<b>Server</b>: $server..<br>";
echo "..<b>Database</b>: $database..<br>";
echo "..<b>DB user name</b>: $db_user_name..<br>";
echo "..<b>DB user password</b>: $db_user_password..<br>";
echo "complete<br>";

echo "Connecting to database....";
$connection = @mysql_connect("$server", "$db_user_name", "$db_user_password") or die("Couldn't connect.");
echo "complete<br>";

echo "Accessing database....";
$db = @mysql_select_db("$database", $connection) or die(mysql_error());
echo "complete<br>";

echo "Creating articles table....";
$sql = "CREATE TABLE `articles` (
  `id` int(11) NOT NULL auto_increment,
  `owner_id` int(11) default NULL,
  `owner_name` text,
  `title` text,
  `content` text,
  `content_preview` text,
  `link1` text,
  `link1_iview` int(11) default NULL,
  `link1_title` text,
  `link2` text,
  `link2_iview` int(11) default NULL,
  `link2_title` text,
  `date` date default NULL,
  `comments` int(11) default '0',
  `catagory` text,
  `page_views` int(11) default '0',
  PRIMARY KEY  (`id`)
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "Creating newscomments table....";
$sql = "CREATE TABLE `newscomments` (
  `id` int(11) NOT NULL auto_increment,
  `news_owner` int(11) default NULL,
  `user_owner` int(11) default NULL,
  `owner_name` text,
  `content` text,
  `date` int(11) default NULL,
  `ip_address` text,
  PRIMARY KEY  (`id`)
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "Creating themes table....";
$sql = "CREATE TABLE `themes` (
  `id` int(11) NOT NULL auto_increment,
  `name` text,
  `version` text,
  `author` text,
  `misc_info` text,
  `header_pic` text,
  `default_theme` int(11) default '0',
  `bgcolor` text,
  `text_font` text,
  `text_color` text,
  `text_size` int(11) default '2',
  `header_text_color` text,
  `link_color` text,
  `link_underline` int(11) default '0',
  `link_bold` int(11) default '0',
  `link_hover` text,
  `link_hover_underline` int(11) default '0',
  `link_hover_bold` int(11) default '0',
  `grid_border_color` text,
  `table_width` int(11) default '500',
  `table_header_color` text,
  `table_header_img` text,
  `table_content_img` text,
  `table_content_left_img` text,
  `table_content_right_img` text,
  `table_content_color` text,
  `table_border_color` text,
  `table_bottom_color` text,
  `table_bottom_img` text,
  `table_up_left_img` text,
  `table_down_left_img` text,
  `table_up_right_img` text,
  `table_down_right_img` text,
  `drop_shadow` int(11) default '0',
  `top` text,
  `bottom` text,
  `css_file` text,
  `use_cssfile_only` int(10) unsigned default '0',
  `header_text_vcenter` int(10) unsigned default '0',
  `header_padding` int(10) unsigned default '5',
  PRIMARY KEY  (`id`)
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "Creating users table....";
$sql = "CREATE TABLE `users` (
  `id` int(11) NOT NULL auto_increment,
  `real_name` text,
  `user_name` text,
  `join_date` int(10) unsigned default NULL,
  `icon` text,
  `password` text,
  `level` int(11) default '1',
  `email` text,
  `website` text,
  `aim_name` text,
  `icq_id_number` int(10) unsigned default NULL,
  `msn_name` text,
  `yahoo_name` text,
  `signature` text,
  `misc` text,
  `page_views` int(11) default '0',
  `setting_show_messages` int(11) default '1',
  `setting_forum_visit` date default NULL,
  `setting_theme` int(10) unsigned default NULL,
  `setting_time_offset` int(10) unsigned default '0',
  PRIMARY KEY  (`id`)
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "Creating messages table....";
$sql = "CREATE TABLE `messages` (
  `id` int(11) NOT NULL auto_increment,
  `sender_id` int(11) default NULL,
  `rec_id` int(11) default NULL,
  `subject` text,
  `content` text,
  `new` int(11) default '1',
  `date` int(11) default NULL,
  `urgency` int(11) default NULL,
  PRIMARY KEY  (`id`)
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "Creating forums table....";
$sql = "CREATE TABLE `forum` (
  `id` int(11) NOT NULL auto_increment,
  `owner_id` int(11) default NULL,
  `title` text,
  `content` text,
  `date` int(11) default NULL,
  `date_mod` int(10) unsigned default NULL,
  `parent_id` int(11) default NULL,
  `is_catagory` int(11) default '0',
  `is_subcatagory` int(11) default '0',
  `is_closed` int(11) default '0',
  `last_post_id` int(11) default NULL,
  `allow_level` int(11) default '0',
  `views` int(10) unsigned default '0',
  PRIMARY KEY  (`id`)
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "Creating settings table....";
$sql = "CREATE TABLE `settings` (
  `hide_user_login` int(11) default '0',
  `user_sets_theme` int(11) default '0',
  `min_op_edit_themes` int(11) default '5',
  `news_commenting` int(11) default '1',
  `anon_news_commenting` int(11) default '1',
  `articles_ppage` int(11) default '5',
  `min_op_post_news` int(11) default '5',
  `min_op_delete_comments` int(11) default '5',
  `min_op_add_user` int(11) default '10',
  `min_op_reset_password` int(11) default '7',
  `cookie_expire` int(11) default '50000',
  `index_redirect` text,
  `use_logging` tinyint(3) unsigned default '0',
  `date_format` text,
  `time_format` text
) TYPE=ISAM PACK_KEYS=1;";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

echo "inserting initial settings....";
$sql = "INSERT INTO settings VALUES(\"0\",\"0\",\"5\",\"1\",\"1\",\"3\",\"5\",\"5\",\"10\",\"7\",\"50000\",\"news.php\",\"0\",\"\",\"\")
";
$result = mysql_query($sql, $connection) or die("Couldn't execute query.");
echo "complete<br>";

?>
<hr><br>
[Primary user information]
<form action="install3.php" method="post">
Primary Real Name: <input type="text" name="primary_real_name" size="30" maxlength="80"><br>
Primary User Name: <input type="text" name="primary_user_name" size="30" maxlength="80"><br>
Primary User Password: <input type="text" name="primary_password" size="30" maxlength="80"><br>
<input type="submit" value="Next-->">

</form>

</body>

</html>
Return current item: AlkalinePHP