Location: PHPKode > scripts > WH Board > wh_board/setup/install.php
<?php

    define('CONFIG_CHECK', 1);
    define('MYSQL_CHECK', 1);

	if(file_exists('../framework/mysql.php') == TRUE)
        include_once('../framework/config.php');
        include_once('../framework/mysql.php');

		if($language == "de") {
			require('../language/de.php');

		}elseif ($language == "en") {
			require('../language/en.php');

    }else{

	echo '<p class="false">' . $lang['no_config'] . '!</p><br>';
	exit;
	}

?>
<!DOCTYPE html>
<html>

<head>
    <title><?php echo $title; ?></title>

    <meta charset="ISO-8859-1" />

    <link href="../style/css/design.css" rel="stylesheet" />
    <link href="../style/images/favicon.ico" rel="shortcut icon" />

    <!--[if IE]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>

<body>

<div id="main">

<div id="wrapper">

<header>
    <div class="header_wrapper">
        <div class="header_left"><a href="" class="logo_text"><?php echo $logo; ?></a></div>
        <div class="header_right"><span class="slogan">WH Board - Installation</span><br>
		<span class="slogan">(<?php echo $lang['step']; ?> 1/2)</span></div>
    </div>
</header>

<div class="clear"></div>

<div id="content_wrapper">
    <div class="content">

		<?php

        echo '<p class="headline_effect">' . $lang['table_creation'] . '</p>';

        $sql = 'DROP TABLE IF EXISTS users';
        mysql_query($sql);
        $sql = 'CREATE TABLE `users` ('
        . '`user_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`user_name` VARCHAR(30) NOT NULL,'
        . '`user_pass` VARCHAR(255) NOT NULL,'
        . '`user_email` VARCHAR(255) NOT NULL,'
        . '`user_date` DATETIME NOT NULL,'
        . '`user_level` INT(8) NOT NULL,'
        . '`user_hash` VARCHAR(32) NOT NULL,'
        . '`user_active` INT(1) NOT NULL DEFAULT "0",'
        . '`user_status` DATETIME NOT NULL,'
        . '`user_visits` BIGINT(11) NOT NULL,'
        . '`user_showmail` TINYINT(1) NULL,'
        . '`user_homepage` VARCHAR(70) NOT NULL,'
        . '`user_icq` VARCHAR(70) NOT NULL,'
        . '`user_live` VARCHAR(70) NOT NULL,'
        . '`user_skype` VARCHAR(70) NOT NULL,'
        . '`user_facebook` VARCHAR(70) NOT NULL,'
        . '`user_twitter` VARCHAR(70) NOT NULL,'
        . '`user_about` VARCHAR(500) NOT NULL,'
        . '`user_sex` VARCHAR(70) NOT NULL,'
        . '`user_bday` DATE NOT NULL,'
        . '`user_signature` VARCHAR(100) NOT NULL,'
        . 'UNIQUE INDEX user_name_unique (`user_name`),'
        . 'PRIMARY KEY (`user_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>users</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>users</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS categories';
        mysql_query($sql);
        $sql = 'CREATE TABLE `categories` ('
        . '`cat_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`cat_name` VARCHAR(255) NOT NULL,'
        . '`cat_description` VARCHAR(255) NOT NULL,'
        . 'UNIQUE INDEX cat_name_unique (`cat_name`),'
        . 'PRIMARY KEY (`cat_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>categories</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>categories</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS topics';
        mysql_query($sql);
        $sql = 'CREATE TABLE `topics` ('
        . '`topic_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`topic_subject` VARCHAR(255) NOT NULL,'
        . '`topic_date` DATETIME NOT NULL,'
        . '`topic_cat` INT(8) NOT NULL,'
        . '`topic_by` INT(8) NOT NULL,'
        . '`topic_views` BIGINT(11) NOT NULL,'
        . 'PRIMARY KEY (`topic_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>topics</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>topics</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS posts';
        mysql_query($sql);
        $sql = 'CREATE TABLE `posts` ('
        . '`post_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`post_content` TEXT NOT NULL,'
        . '`post_date` DATETIME NOT NULL,'
        . '`post_topic` INT(8) NOT NULL,'
        . '`post_by`INT(8) NOT NULL,'
        . 'PRIMARY KEY (`post_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>posts</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>posts</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS articles';
        mysql_query($sql);
        $sql = 'CREATE TABLE `articles` ('
        . '`blog_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`blog_title` VARCHAR(80) NOT NULL,'
        . '`blog_author` VARCHAR(60) NOT NULL,'
        . '`blog_post` TEXT NOT NULL,'
        . '`blog_date` DATETIME NOT NULL,'
        . 'PRIMARY KEY (`blog_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>articles</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>articles</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS comments';
        mysql_query($sql);
        $sql = 'CREATE TABLE `comments` ('
        . '`com_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`com_id2` INT(8) NOT NULL,'
        . '`com_title` VARCHAR(80) NOT NULL,'
        . '`com_author` VARCHAR(60) NOT NULL,'
        . '`com_comment` TEXT NOT NULL,'
        . '`com_date` DATETIME NOT NULL,'
        . 'PRIMARY KEY (`com_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>comments</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>comments</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS messages';
        mysql_query($sql);
        $sql = 'CREATE TABLE `messages` ('
        . '`msg_id` INT(8) NOT NULL,'
        . '`msg_id2` INT(8) NOT NULL,'
        . '`msg_title` VARCHAR(255) NOT NULL,'
        . '`msg_user1` BIGINT(20) NOT NULL,'
        . '`msg_user2` BIGINT(20) NOT NULL,'
        . '`msg_content` TEXT NOT NULL,'
        . '`msg_date` DATETIME NOT NULL,'
        . '`msg_user1read` VARCHAR(3) NOT NULL,'
        . '`msg_user2read` VARCHAR(3) NOT NULL'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>messages</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>messages</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS counter';
        mysql_query($sql);
        $sql = 'CREATE TABLE `counter` ('
        . '`count_id` BIGINT(20) NOT NULL AUTO_INCREMENT,'
        . '`count_ip` VARCHAR(15) NOT NULL DEFAULT "",'
        . '`count_timed` VARCHAR(11) NOT NULL DEFAULT "",'
        . 'PRIMARY KEY (`count_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>counter</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>counter</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS online';
        mysql_query($sql);
        $sql = 'CREATE TABLE `online` ('
        . '`online_ip` VARCHAR(15),'
        . '`online_timed` DATETIME'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>online</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>online</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS badwords';
        mysql_query($sql);
        $sql = 'CREATE TABLE `badwords` ('
        . '`badword_id` INT(8) NOT NULL AUTO_INCREMENT,'
        . '`badword_word` VARCHAR(100) NOT NULL,'
        . 'PRIMARY KEY (`badword_id`)'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>badwords</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>badwords</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

        $sql = 'DROP TABLE IF EXISTS iplock';
        mysql_query($sql);
        $sql = 'CREATE TABLE `iplock` ('
        . '`iplock_register` VARCHAR (15),'
        . '`iplock_timed` INT(11) NOT NULL DEFAULT "0"'
        . ') ENGINE=MYISAM';
        if(mysql_query($sql))
		echo '<p class="success">' . $lang['table'] . ' <u>iplock</u> ' . $lang['successfully_created'] . '</p>';
		else{
		echo '<p class="false">' . $lang['table'] . ' <u>iplock</u> ' . $lang['couldnot_created'] . '</p>';
		echo '<p><strong>' . $lang['error'] . ':</strong> ' . mysql_error() . '</p>';
		die();
		}

		echo '<br>';
		echo '<p class="success">' . $lang['installation_finished'] . '</p>';
		echo '<p>' . $lang['now_create_admin'] . '! [ <a href="admin.php">' . $lang['go_on'] . '</a> ]</p>';

        echo '<div class="spacer_div">&nbsp;</div>';

		?>

    </div>
</div>

</div>

<div class="clear"></div>

<?php define('POWERED_URL', 'http://www.webmasterhelp.net'); define('POWERED_BY', 'WebmasterHelp.net - WH Board'); ?>

<footer>
    <div class="footer_wrapper">
        <p align="center"><?php echo '&copy; <a href="' . POWERED_URL . '" class="footer" target="_blank" title="WebmasterHelp.net">' . POWERED_BY . '</a>'; ?></p>
    </div>
</footer>

</div>

</body>
</html>
Return current item: WH Board