<commit_before><div class="panel-heading">
    MySQL connection.
</div>
<div class="panel-body">
<?php
if (isset($_POST['submit'])) {
    try {
        $mysql_host = $_POST['host'];//MySQL Host.
        $mysql_username = $_POST['username'];//MySQL Username
        $mysql_password = (!$_POST['password']) ? '' : $_POST['password'];//MySQL Password
        $mysql_database = $_POST['database'];//MySQL Database
        $mysql_prefix = $_POST['prefix'];//MySQL Prefix.

        $request = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        $site_url = explode('/install/', $request);
        $site_url = $site_url[0];

        if (!$mysql_host or !$mysql_username or !$mysql_database or !$mysql_prefix) {//Check if all values are there.
            throw new Exception('All fields are required!');//If not, error.
            /* }elseif(!$conn = @mysqli_connect($mysql_host, $mysql_username, $mysql_password)){//Checks if MySQL connection could be established.
                 throw new Exception('MySQL Server connection could not be established.');//If not, error.
             }elseif(!@mysqli_select_db($conn, $mysql_database)){//Checks for connection to database.
                 throw new Exception('MySQL Database connection could not be established.');//If not, error.*/
        } else {

            $time = time();

            /*
             * Placing correct values into configuration file.
             */
            $config = file_get_contents('../config.php');
            $config = str_replace('%mysql_host%', $mysql_host, $config);
            $config = str_replace('%mysql_username%', $mysql_username, $config);
            $config = str_replace('%mysql_password%', $mysql_password, $config);
            $config = str_replace('%mysql_database%', $mysql_database, $config);
            $config = str_replace('%mysql_prefix%', $mysql_prefix, $config);
            $config = str_replace('%site_url%', $site_url, $config);
            //file_put_contents('../applications/config.php', $config);

            //Write contents into the config.php file in the applications directory.
            $fh = fopen('../../applications/config.php', 'w');
            fwrite($fh, $config);
            fclose($fh);

            //$MYSQL = new mysqli($mysql_host, $mysql_username, $mysql_password, $mysql_database);
            $dsn = 'mysql:dbname=' . $mysql_database . ';host=' . $mysql_host;

            try {
                $MYSQL = new PDO($dsn, $mysql_username, $mysql_password);
            } catch (PDOException $e) {
                throw new Exception('Connection failed: ' . $e->getMessage());
            }
            $MYSQL->query("DROP TABLE IF EXISTS `" . $mysql_prefix . "extensions`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "forum_category`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "forum_node`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "forum_posts`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "labels`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "generic`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "messages`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "permissions`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "reports`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "sessions`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "terminal`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "usergroups`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "users`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "user_comments`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "user_visitors`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "password_reset_requests`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "notifications`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "thread_tracking`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "countries`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "themes`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "poll`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "poll_answers`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "poll_votes`;
                           ");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "extensions` (`id` int(11) NOT NULL AUTO_INCREMENT,`extension_name` varchar(255) NOT NULL,`extension_folder` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "forum_category` (`id` int(11) NOT NULL AUTO_INCREMENT, `category_title` varchar(255) NOT NULL, `category_desc` varchar(255) NOT NULL, `category_place` int(11) NOT NULL DEFAULT '0', `allowed_usergroups` varchar(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "forum_category` (`id`, `category_title`, `category_desc`, `category_place`, `allowed_usergroups`) VALUES (1, 'First Category', 'First category on this forum!', 0, '0,1,3,4');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "forum_node` (`id` int(11) NOT NULL AUTO_INCREMENT, `node_name` varchar(255) NOT NULL, `name_friendly` varchar(255) NOT NULL, `node_desc` varchar(255) NOT NULL, `in_category` int(11) NOT NULL DEFAULT '0', `node_type` int(11) NOT NULL DEFAULT '1', `parent_node` int(11) NOT NULL DEFAULT '0', `node_locked` int(11) NOT NULL DEFAULT '0', `node_place` int(11) NOT NULL DEFAULT '0', `allowed_usergroups` varchar(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "forum_node` (`id`, `node_name`, `name_friendly`, `node_desc`, `in_category`, `node_locked`, `node_place`, `allowed_usergroups`) VALUES (1, 'First Node', 'first_node', 'The first node on this forum', 1, 0, 0, '0,1,3,4');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "forum_posts` (`id` int(11) NOT NULL AUTO_INCREMENT, `post_title` varchar(255) NOT NULL DEFAULT '', `title_friendly` varchar(255) NOT NULL, `post_content` text NOT NULL, `post_tags` varchar(255) NOT NULL, `post_time` int(11) NOT NULL, `post_user` int(11) NOT NULL, `origin_thread` int(11) NOT NULL DEFAULT '0', `origin_node` int(11) NOT NULL DEFAULT '0', `post_type` int(11) NOT NULL, `post_sticky` int(11) NOT NULL DEFAULT '0', `post_locked` int(11) NOT NULL DEFAULT '0', `last_updated` int(11) NOT NULL DEFAULT '0', `watchers` text NOT NULL, `label` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("ALTER TABLE `" . $mysql_prefix . "forum_posts` ADD FULLTEXT search(post_title, post_content);");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "labels` (`id` INT(11) NOT NULL AUTO_INCREMENT, `node_id` INT(11) NOT NULL, `label` VARCHAR(1000) NOT NULL, PRIMARY KEY (`id`))ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "generic` (`id` int(11) NOT NULL AUTO_INCREMENT, `site_rules` text NOT NULL, `site_name` varchar(255) NOT NULL, `site_theme` int(11) NOT NULL, `site_language` varchar(255) NOT NULL, `site_email` varchar(255) NOT NULL, `register_enable` int(11) NOT NULL DEFAULT '1', `register_email_activate` int(11) NOT NULL DEFAULT '0', `facebook_authenticate` int(11) NOT NULL DEFAULT '0', `facebook_app_id` varchar(255) NOT NULL DEFAULT '0', `facebook_app_secret` varchar(255) NOT NULL DEFAULT '0', `captcha_type` int(11) NOT NULL DEFAULT '1', `recaptcha_public_key` varchar(255) NOT NULL DEFAULT '0', `recaptcha_private_key` varchar(255) NOT NULL DEFAULT '0', `mail_type` int(11) NOT NULL DEFAULT '1', `smtp_address` varchar(255) NOT NULL DEFAULT '0', `smtp_port` int(11) NOT NULL DEFAULT '0', `smtp_username` varchar(255) NOT NULL DEFAULT '0', `smtp_password` varchar(255) NOT NULL DEFAULT '0', `post_merge` int(1) NOT NULL DEFAULT '1', `flat_ui_admin` INT NOT NULL DEFAULT '0', `number_subs` INT(3) DEFAULT 3  NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "messages` (`id` int(11) NOT NULL AUTO_INCREMENT,`message_title` varchar(255) NOT NULL,`message_content` text NOT NULL,`message_time` int(11) NOT NULL,`origin_message` int(11) NOT NULL DEFAULT '0',`message_sender` int(11) NOT NULL,`message_receiver` int(11) NOT NULL,`message_type` int(11) NOT NULL DEFAULT '1',`receiver_viewed` int(11) NOT NULL DEFAULT '0', `sender_deleted` BOOL NOT NULL DEFAULT '0', `receiver_deleted` BOOL NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "permissions` (`id` int(11) NOT NULL AUTO_INCREMENT,`permission_name` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "permissions` (`id`, `permission_name`) VALUES (1, 'view_forum'),(2, 'create_thread'),(3, 'reply_thread'),(4, 'access_moderation'),(5, 'access_administration');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "reports` (`id` int(11) NOT NULL AUTO_INCREMENT,`report_reason` varchar(255) NOT NULL,`reported_by` int(11) NOT NULL,`reported_user` int(11) NOT NULL DEFAULT '0',`reported_post` int(11) NOT NULL DEFAULT '0',`reported_time` int(11) NOT NULL,`report_close` int(11) NOT NULL DEFAULT '0',PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "sessions` (`id` int(11) NOT NULL AUTO_INCREMENT,`session_id` varchar(255) NOT NULL,`logged_user` int(11) NOT NULL,`session_type` int(11) NOT NULL DEFAULT '1',`session_time` int(11) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "terminal` (`id` int(11) NOT NULL AUTO_INCREMENT,`command_name` varchar(255) NOT NULL,`command_syntax` varchar(255) NOT NULL,`run_function` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "terminal` (`id`, `command_name`, `command_syntax`, `run_function`) VALUES (1, 'cugroup', 'cugroup %s %s', 'cugroup'),(2, 'ban', 'ban %s', 'ban'),(3, 'unban', 'unban %s', 'unban'),(4, 'dugroup', 'dugroup %s %s', 'dugroup');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "usergroups` (`id` int(11) NOT NULL AUTO_INCREMENT, `group_name` varchar(255) NOT NULL, `group_style` varchar(255) NOT NULL DEFAULT '%username%', `group_permissions` varchar(255) NOT NULL DEFAULT '0', `is_staff` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "usergroups` (`id`, `group_name`, `group_style`, `group_permissions`, `is_staff`) VALUES (1, 'User', '<span>%username%</span>', '1,2,3', '0'),(2, 'Banned', '<span>%username% (Banned)</span>', '0', '0'),(3, 'Moderator', '<span style=\"color:#3a5892;\"><strong>%username%</strong></span>', '1,2,3,4', '1'),(4, 'Administrator', '<span style=\"color:#762727;\"><strong>%username%</strong></span>', '*', '1');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "users` (`id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `user_password` varchar(255) NOT NULL, `user_email` varchar(255) NOT NULL,`user_message` varchar(255) NOT NULL DEFAULT 'User', `user_avatar` varchar(255) NOT NULL DEFAULT 'default.png', `avatar_type` int(11) NOT NULL DEFAULT '0', `user_signature` varchar(255) NOT NULL,`about_user` varchar(255) NOT NULL, `location` varchar (2) NOT NULL DEFAULT '--', `gender` int(1) DEFAULT '0', `date_joined` int(11) NOT NULL,`user_birthday` date NOT NULL, `additional_permissions` varchar(255) NOT NULL DEFAULT '0',  `user_group` int(11) NOT NULL DEFAULT '1', `display_group` INT NOT NULL, `chosen_theme` int(11) NOT NULL DEFAULT '0', `set_timezone` varchar(255) NOT NULL DEFAULT 'US/Central', `user_disabled` int(11) NOT NULL DEFAULT '0', `is_banned` int(11) NOT NULL DEFAULT '0', `unban_time` int(11) NOT NULL, `ban_reason` varchar(255) NOT NULL DEFAULT 'None', `facebook_id` varchar(100) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "user_comments` (`id` int(11) NOT NULL AUTO_INCREMENT, `profile_owner` int(11) NOT NULL, `writer` int(11) NOT NULL, `comment` text NOT NULL, `timestamp` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "user_visitors` (`id` int(11) NOT NULL AUTO_INCREMENT,`profile_owner` int(11) NOT NULL,`visitor` int(11) NOT NULL,`timestamp` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "password_reset_requests` (`id` int(11) NOT NULL AUTO_INCREMENT,`user` int(11) NOT NULL,`reset_token` varchar(255) NOT NULL UNIQUE,`request_time` int(11) NOT NULL,`active` tinyint(1) NOT NULL DEFAULT 1,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");<commit_msg>Updated preconfigurations<commit_after><div class="panel-heading">
    MySQL connection.
</div>
<div class="panel-body">
<?php
if (isset($_POST['submit'])) {
    try {
        $mysql_host = $_POST['host'];//MySQL Host.
        $mysql_username = $_POST['username'];//MySQL Username
        $mysql_password = (!$_POST['password']) ? '' : $_POST['password'];//MySQL Password
        $mysql_database = $_POST['database'];//MySQL Database
        $mysql_prefix = $_POST['prefix'];//MySQL Prefix.

        $request = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
        $site_url = explode('/install/', $request);
        $site_url = $site_url[0];

        if (!$mysql_host or !$mysql_username or !$mysql_database or !$mysql_prefix) {//Check if all values are there.
            throw new Exception('All fields are required!');//If not, error.
            /* }elseif(!$conn = @mysqli_connect($mysql_host, $mysql_username, $mysql_password)){//Checks if MySQL connection could be established.
                 throw new Exception('MySQL Server connection could not be established.');//If not, error.
             }elseif(!@mysqli_select_db($conn, $mysql_database)){//Checks for connection to database.
                 throw new Exception('MySQL Database connection could not be established.');//If not, error.*/
        } else {

            $time = time();

            /*
             * Placing correct values into configuration file.
             */
            $config = file_get_contents('../config.php');
            $config = str_replace('%mysql_host%', $mysql_host, $config);
            $config = str_replace('%mysql_username%', $mysql_username, $config);
            $config = str_replace('%mysql_password%', $mysql_password, $config);
            $config = str_replace('%mysql_database%', $mysql_database, $config);
            $config = str_replace('%mysql_prefix%', $mysql_prefix, $config);
            $config = str_replace('%site_url%', $site_url, $config);
            //file_put_contents('../applications/config.php', $config);

            //Write contents into the config.php file in the applications directory.
            $fh = fopen('../../applications/config.php', 'w');
            fwrite($fh, $config);
            fclose($fh);

            //$MYSQL = new mysqli($mysql_host, $mysql_username, $mysql_password, $mysql_database);
            $dsn = 'mysql:dbname=' . $mysql_database . ';host=' . $mysql_host;

            try {
                $MYSQL = new PDO($dsn, $mysql_username, $mysql_password);
            } catch (PDOException $e) {
                throw new Exception('Connection failed: ' . $e->getMessage());
            }
            $MYSQL->query("DROP TABLE IF EXISTS `" . $mysql_prefix . "extensions`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "forum_category`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "forum_node`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "forum_posts`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "labels`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "generic`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "messages`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "permissions`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "reports`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "sessions`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "terminal`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "usergroups`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "users`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "user_comments`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "user_visitors`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "password_reset_requests`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "notifications`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "thread_tracking`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "countries`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "themes`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "poll`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "poll_answers`;
                           DROP TABLE IF EXISTS `" . $mysql_prefix . "poll_votes`;
                           ");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "extensions` (`id` int(11) NOT NULL AUTO_INCREMENT,`extension_name` varchar(255) NOT NULL,`extension_folder` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "forum_category` (`id` int(11) NOT NULL AUTO_INCREMENT, `category_title` varchar(255) NOT NULL, `category_desc` varchar(255) NOT NULL, `category_place` int(11) NOT NULL DEFAULT '0', `allowed_usergroups` varchar(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "forum_category` (`id`, `category_title`, `category_desc`, `category_place`, `allowed_usergroups`) VALUES (1, 'First Category', 'First category on this forum!', 0, '0,1,3,4');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "forum_node` (`id` int(11) NOT NULL AUTO_INCREMENT, `node_name` varchar(255) NOT NULL, `name_friendly` varchar(255) NOT NULL, `node_desc` varchar(255) NOT NULL, `in_category` int(11) NOT NULL DEFAULT '0', `node_type` int(11) NOT NULL DEFAULT '1', `parent_node` int(11) NOT NULL DEFAULT '0', `node_locked` int(11) NOT NULL DEFAULT '0', `node_place` int(11) NOT NULL DEFAULT '0', `allowed_usergroups` varchar(255) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "forum_node` (`id`, `node_name`, `name_friendly`, `node_desc`, `in_category`, `node_locked`, `node_place`, `allowed_usergroups`) VALUES (1, 'First Node', 'first_node', 'The first node on this forum', 1, 0, 0, '0,1,3,4');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "forum_posts` (`id` int(11) NOT NULL AUTO_INCREMENT, `post_title` varchar(255) NOT NULL DEFAULT '', `title_friendly` varchar(255) NOT NULL, `post_content` text NOT NULL, `post_tags` varchar(255) NOT NULL, `post_time` int(11) NOT NULL, `post_user` int(11) NOT NULL, `origin_thread` int(11) NOT NULL DEFAULT '0', `origin_node` int(11) NOT NULL DEFAULT '0', `post_type` int(11) NOT NULL, `post_sticky` int(11) NOT NULL DEFAULT '0', `post_locked` int(11) NOT NULL DEFAULT '0', `last_updated` int(11) NOT NULL DEFAULT '0', `watchers` text NOT NULL, `label` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("ALTER TABLE `" . $mysql_prefix . "forum_posts` ADD FULLTEXT search(post_title, post_content);");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "labels` (`id` INT(11) NOT NULL AUTO_INCREMENT, `node_id` INT(11) NOT NULL, `label` VARCHAR(1000) NOT NULL, PRIMARY KEY (`id`))ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "generic` (`id` int(11) NOT NULL AUTO_INCREMENT, `site_rules` text NOT NULL, `site_name` varchar(255) NOT NULL, `site_theme` int(11) NOT NULL, `site_language` varchar(255) NOT NULL, `site_email` varchar(255) NOT NULL, `register_enable` int(11) NOT NULL DEFAULT '1', `register_email_activate` int(11) NOT NULL DEFAULT '0', `facebook_authenticate` int(11) NOT NULL DEFAULT '0', `facebook_app_id` varchar(255) NOT NULL DEFAULT '0', `facebook_app_secret` varchar(255) NOT NULL DEFAULT '0', `captcha_type` int(11) NOT NULL DEFAULT '1', `recaptcha_public_key` varchar(255) NOT NULL DEFAULT '0', `recaptcha_private_key` varchar(255) NOT NULL DEFAULT '0', `mail_type` int(11) NOT NULL DEFAULT '1', `smtp_address` varchar(255) NOT NULL DEFAULT '0', `smtp_port` int(11) NOT NULL DEFAULT '0', `smtp_username` varchar(255) NOT NULL DEFAULT '0', `smtp_password` varchar(255) NOT NULL DEFAULT '0', `post_merge` int(1) NOT NULL DEFAULT '0', `flat_ui_admin` INT NOT NULL DEFAULT '0', `number_subs` INT(3) DEFAULT 10  NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "messages` (`id` int(11) NOT NULL AUTO_INCREMENT,`message_title` varchar(255) NOT NULL,`message_content` text NOT NULL,`message_time` int(11) NOT NULL,`origin_message` int(11) NOT NULL DEFAULT '0',`message_sender` int(11) NOT NULL,`message_receiver` int(11) NOT NULL,`message_type` int(11) NOT NULL DEFAULT '1',`receiver_viewed` int(11) NOT NULL DEFAULT '0', `sender_deleted` BOOL NOT NULL DEFAULT '0', `receiver_deleted` BOOL NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "permissions` (`id` int(11) NOT NULL AUTO_INCREMENT,`permission_name` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "permissions` (`id`, `permission_name`) VALUES (1, 'view_forum'),(2, 'create_thread'),(3, 'reply_thread'),(4, 'access_moderation'),(5, 'access_administration');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "reports` (`id` int(11) NOT NULL AUTO_INCREMENT,`report_reason` varchar(255) NOT NULL,`reported_by` int(11) NOT NULL,`reported_user` int(11) NOT NULL DEFAULT '0',`reported_post` int(11) NOT NULL DEFAULT '0',`reported_time` int(11) NOT NULL,`report_close` int(11) NOT NULL DEFAULT '0',PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "sessions` (`id` int(11) NOT NULL AUTO_INCREMENT,`session_id` varchar(255) NOT NULL,`logged_user` int(11) NOT NULL,`session_type` int(11) NOT NULL DEFAULT '1',`session_time` int(11) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "terminal` (`id` int(11) NOT NULL AUTO_INCREMENT,`command_name` varchar(255) NOT NULL,`command_syntax` varchar(255) NOT NULL,`run_function` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "terminal` (`id`, `command_name`, `command_syntax`, `run_function`) VALUES (1, 'cugroup', 'cugroup %s %s', 'cugroup'),(2, 'ban', 'ban %s', 'ban'),(3, 'unban', 'unban %s', 'unban'),(4, 'dugroup', 'dugroup %s %s', 'dugroup');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "usergroups` (`id` int(11) NOT NULL AUTO_INCREMENT, `group_name` varchar(255) NOT NULL, `group_style` varchar(255) NOT NULL DEFAULT '%username%', `group_permissions` varchar(255) NOT NULL DEFAULT '0', `is_staff` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("INSERT INTO `" . $mysql_prefix . "usergroups` (`id`, `group_name`, `group_style`, `group_permissions`, `is_staff`) VALUES (1, 'User', '<span>%username%</span>', '1,2,3', '0'),(2, 'Banned', '<span>%username% (Banned)</span>', '0', '0'),(3, 'Moderator', '<span style=\"color:#3a5892;\"><strong>%username%</strong></span>', '1,2,3,4', '1'),(4, 'Administrator', '<span style=\"color:#762727;\"><strong>%username%</strong></span>', '*', '1');");

            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "users` (`id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(255) NOT NULL, `user_password` varchar(255) NOT NULL, `user_email` varchar(255) NOT NULL,`user_message` varchar(255) NOT NULL DEFAULT 'User', `user_avatar` varchar(255) NOT NULL DEFAULT 'default.png', `avatar_type` int(11) NOT NULL DEFAULT '0', `user_signature` varchar(255) NOT NULL,`about_user` varchar(255) NOT NULL, `location` varchar (2) NOT NULL DEFAULT '--', `gender` int(1) DEFAULT '0', `date_joined` int(11) NOT NULL,`user_birthday` date NOT NULL, `additional_permissions` varchar(255) NOT NULL DEFAULT '0',  `user_group` int(11) NOT NULL DEFAULT '1', `display_group` INT NOT NULL, `chosen_theme` int(11) NOT NULL DEFAULT '0', `set_timezone` varchar(255) NOT NULL DEFAULT 'US/Central', `user_disabled` int(11) NOT NULL DEFAULT '0', `is_banned` int(11) NOT NULL DEFAULT '0', `unban_time` int(11) NOT NULL, `ban_reason` varchar(255) NOT NULL DEFAULT 'None', `facebook_id` varchar(100) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "user_comments` (`id` int(11) NOT NULL AUTO_INCREMENT, `profile_owner` int(11) NOT NULL, `writer` int(11) NOT NULL, `comment` text NOT NULL, `timestamp` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "user_visitors` (`id` int(11) NOT NULL AUTO_INCREMENT,`profile_owner` int(11) NOT NULL,`visitor` int(11) NOT NULL,`timestamp` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
            $MYSQL->query("CREATE TABLE IF NOT EXISTS `" . $mysql_prefix . "password_reset_requests` (`id` int(11) NOT NULL AUTO_INCREMENT,`user` int(11) NOT NULL,`reset_token` varchar(255) NOT NULL UNIQUE,`request_time` int(11) NOT NULL,`active` tinyint(1) NOT NULL DEFAULT 1,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
{'fraction_non_alphanumeric': 0.1546949450077025, 'fraction_numerical': 0.028982911188335184, 'mean_word_length': 3.6291873963515755, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1169174', 'n_tokens_mistral': 9689, 'n_tokens_neox': 8937, 'n_words': 2510}