$queries[] = 'CREATE INDEX ' . $db_prefix . 'search_words_id_idx ON ' . $db_prefix . 'search_words(id)';
            break;
    }
    @reset($queries);
    while (list(, $sql) = @each($queries)) {
        $db->query($sql) or error('Unable to create indexes. Please check your configuration and try again.', __FILE__, __LINE__, $db->error());
    }
    $now = time();
    // Insert the four preset groups
    $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Administrators', 'Administrator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
    $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
    $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Guest', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
    $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Members', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
    // Insert guest and first admin user
    $db->query('INSERT INTO ' . $db_prefix . "users (group_id, username, password, email) VALUES(3, 'Guest', 'Guest', 'Guest')") or error('Unable to add guest user. Please check your configuration and try again.');
    $db->query('INSERT INTO ' . $db_prefix . "users (group_id, username, password, email, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, '" . $db->escape($username) . "', '" . pun_hash($password1) . "', '{$email}', 1, " . $now . ", " . $now . ", '127.0.0.1', " . $now . ')') or error('Unable to add administrator user. Please check your configuration and try again.');
    // Insert config data
    $config = array('o_cur_version' => "'{$punbb_version}'", 'o_board_title' => "'My PunBB forum'", 'o_board_desc' => "'Unfortunately no one can be told what PunBB is - you have to see it for yourself.'", 'o_server_timezone' => "'0'", 'o_time_format' => "'H:i:s'", 'o_date_format' => "'Y-m-d'", 'o_timeout_visit' => "'600'", 'o_timeout_online' => "'300'", 'o_redirect_delay' => "'1'", 'o_show_version' => "'0'", 'o_show_user_info' => "'1'", 'o_show_post_count' => "'1'", 'o_smilies' => "'1'", 'o_smilies_sig' => "'1'", 'o_make_links' => "'1'", 'o_default_lang' => "'English'", 'o_default_style' => "'Oxygen'", 'o_default_user_group' => "'4'", 'o_topic_review' => "'15'", 'o_disp_topics_default' => "'30'", 'o_disp_posts_default' => "'25'", 'o_indent_num_spaces' => "'4'", 'o_quickpost' => "'1'", 'o_users_online' => "'1'", 'o_censoring' => "'0'", 'o_ranks' => "'1'", 'o_show_dot' => "'0'", 'o_quickjump' => "'1'", 'o_gzip' => "'0'", 'o_additional_navlinks' => "'1 = <a href=\"glossary.php\">EVGS</a>'", 'o_report_method' => "'0'", 'o_regs_report' => "'0'", 'o_mailing_list' => "'{$email}'", 'o_avatars' => "'1'", 'o_avatars_dir' => "'img/avatars'", 'o_avatars_width' => "'60'", 'o_avatars_height' => "'60'", 'o_avatars_size' => "'10240'", 'o_search_all_forums' => "'1'", 'o_base_url' => "'{$base_url}'", 'o_admin_email' => "'{$email}'", 'o_webmaster_email' => "'{$email}'", 'o_subscriptions' => "'1'", 'o_smtp_host' => "NULL", 'o_smtp_user' => "NULL", 'o_smtp_pass' => "NULL", 'o_regs_allow' => "'1'", 'o_regs_verify' => "'0'", 'o_announcement' => "'0'", 'o_announcement_message' => "'Enter your announcement here.'", 'o_rules' => "'0'", 'o_rules_message' => "'Enter your rules here.'", 'o_maintenance' => "'0'", 'o_maintenance_message' => "'The forums are temporarily down for maintenance. Please try again in a few minutes.<br />\\n<br />\\n/Administrator'", 'p_mod_edit_users' => "'1'", 'p_mod_rename_users' => "'0'", 'p_mod_change_passwords' => "'0'", 'p_mod_ban_users' => "'0'", 'p_message_bbcode' => "'1'", 'p_message_img_tag' => "'1'", 'p_message_all_caps' => "'1'", 'p_subject_all_caps' => "'1'", 'p_sig_all_caps' => "'1'", 'p_sig_bbcode' => "'1'", 'p_sig_img_tag' => "'0'", 'p_sig_length' => "'400'", 'p_sig_lines' => "'4'", 'p_allow_banned_email' => "'1'", 'p_allow_dupe_email' => "'0'", 'p_force_guest_email' => "'1'", 'o_evgs_forum' => '0', 'o_quick_links' => '1', 'o_quick_links_content' => "'" . $db->escape('<table class="tablelayout">
<tr>
<td align="center">{A*|A}</td>
<td align="center">{B*|B}</td>
<td align="center">{C*|C}</td>
<td align="center">{D*|D}</td>
<td align="center">{E*|E}</td>
<td align="center">{F*|F}</td>
<td align="center">{G*|G}</td>
<td align="center">{H*|H}</td>
<td align="center">{I*|I}</td>
<td align="center">{J*|J}</td>
<td align="center">{K*|K}</td>
<td align="center">{L*|L}</td>
Beispiel #2
0
 $forum_db->query_build($query) or error(__FILE__, __LINE__);
 $query = array('INSERT' => 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood', 'INTO' => 'groups', 'VALUES' => '\'Moderators\', \'Moderator\', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0');
 if ($db_type != 'pgsql') {
     $query['INSERT'] .= ', g_id';
     $query['VALUES'] .= ', 4';
 }
 $forum_db->query_build($query) or error(__FILE__, __LINE__);
 // Insert guest and first admin user
 $query = array('INSERT' => 'group_id, username, password, email', 'INTO' => 'users', 'VALUES' => '2, \'Guest\', \'Guest\', \'Guest\'');
 if ($db_type != 'pgsql') {
     $query['INSERT'] .= ', id';
     $query['VALUES'] .= ', 1';
 }
 $forum_db->query_build($query) or error(__FILE__, __LINE__);
 $salt = random_key(12);
 $query = array('INSERT' => 'group_id, username, password, email, language, num_posts, last_post, registered, registration_ip, last_visit, salt', 'INTO' => 'users', 'VALUES' => '1, \'' . $forum_db->escape($username) . '\', \'' . forum_hash($password1, $salt) . '\', \'' . $forum_db->escape($email) . '\', \'' . $forum_db->escape($default_lang) . '\', 1, ' . $now . ', ' . $now . ', \'127.0.0.1\', ' . $now . ', \'' . $forum_db->escape($salt) . '\'');
 $forum_db->query_build($query) or error(__FILE__, __LINE__);
 $new_uid = $forum_db->insert_id();
 // Enable/disable avatars depending on file_uploads setting in PHP configuration
 $avatars = in_array(strtolower(@ini_get('file_uploads')), array('on', 'true', '1')) ? 1 : 0;
 // Enable/disable automatic check for updates depending on PHP environment (require cURL, fsockopen or allow_url_fopen)
 $check_for_updates = function_exists('curl_init') || function_exists('fsockopen') || in_array(strtolower(@ini_get('allow_url_fopen')), array('on', 'true', '1')) ? 1 : 0;
 // Insert config data
 $config = array('o_cur_version' => "'" . FORUM_VERSION . "'", 'o_database_revision' => "'" . FORUM_DB_REVISION . "'", 'o_board_title' => "'" . $forum_db->escape($board_title) . "'", 'o_board_desc' => "'" . $forum_db->escape($board_descrip) . "'", 'o_default_timezone' => "'0'", 'o_time_format' => "'H:i:s'", 'o_date_format' => "'Y-m-d'", 'o_check_for_updates' => "'{$check_for_updates}'", 'o_check_for_versions' => "'{$check_for_updates}'", 'o_timeout_visit' => "'5400'", 'o_timeout_online' => "'300'", 'o_redirect_delay' => "'0'", 'o_show_version' => "'0'", 'o_show_user_info' => "'1'", 'o_show_post_count' => "'1'", 'o_signatures' => "'1'", 'o_smilies' => "'1'", 'o_smilies_sig' => "'1'", 'o_make_links' => "'1'", 'o_default_lang' => "'" . $forum_db->escape($default_lang) . "'", 'o_default_style' => "'Oxygen'", 'o_default_user_group' => "'3'", 'o_topic_review' => "'15'", 'o_disp_topics_default' => "'30'", 'o_disp_posts_default' => "'25'", 'o_indent_num_spaces' => "'4'", 'o_quote_depth' => "'3'", 'o_quickpost' => "'1'", 'o_users_online' => "'1'", 'o_censoring' => "'0'", 'o_ranks' => "'1'", 'o_show_dot' => "'0'", 'o_topic_views' => "'1'", 'o_quickjump' => "'1'", 'o_gzip' => "'0'", 'o_additional_navlinks' => "''", 'o_report_method' => "'0'", 'o_regs_report' => "'0'", 'o_default_email_setting' => "'1'", 'o_mailing_list' => "'" . $forum_db->escape($email) . "'", 'o_avatars' => "'{$avatars}'", 'o_avatars_dir' => "'img/avatars'", 'o_avatars_width' => "'60'", 'o_avatars_height' => "'60'", 'o_avatars_size' => "'15360'", 'o_search_all_forums' => "'1'", 'o_sef' => "'Default'", 'o_admin_email' => "'" . $forum_db->escape($email) . "'", 'o_webmaster_email' => "'" . $forum_db->escape($email) . "'", 'o_subscriptions' => "'1'", 'o_smtp_host' => "NULL", 'o_smtp_user' => "NULL", 'o_smtp_pass' => "NULL", 'o_smtp_ssl' => "'0'", 'o_regs_allow' => "'1'", 'o_regs_verify' => "'0'", 'o_announcement' => "'0'", 'o_announcement_heading' => "'" . $lang_install['Default announce heading'] . "'", 'o_announcement_message' => "'" . $lang_install['Default announce message'] . "'", 'o_rules' => "'0'", 'o_rules_message' => "'" . $lang_install['Default rules'] . "'", 'o_maintenance' => "'0'", 'o_maintenance_message' => "'" . $lang_admin_settings['Maintenance message default'] . "'", 'o_default_dst' => "'0'", 'p_message_bbcode' => "'1'", 'p_message_img_tag' => "'1'", 'p_message_all_caps' => "'1'", 'p_subject_all_caps' => "'1'", 'p_sig_all_caps' => "'1'", 'p_sig_bbcode' => "'1'", 'p_sig_img_tag' => "'0'", 'p_sig_length' => "'400'", 'p_sig_lines' => "'4'", 'p_allow_banned_email' => "'1'", 'p_allow_dupe_email' => "'0'", 'p_force_guest_email' => "'1'", 'o_show_moderators' => "'0'", 'o_mask_passwords' => "'1'");
 foreach ($config as $conf_name => $conf_value) {
     $query = array('INSERT' => 'conf_name, conf_value', 'INTO' => 'config', 'VALUES' => '\'' . $conf_name . '\', ' . $conf_value . '');
     $forum_db->query_build($query) or error(__FILE__, __LINE__);
 }
 // Insert some other default data
 $query = array('INSERT' => 'cat_name, disp_position', 'INTO' => 'categories', 'VALUES' => '\'' . $lang_install['Default category name'] . '\', 1');
 $forum_db->query_build($query) or error(__FILE__, __LINE__);
Beispiel #3
0
 $db->create_table('search_cache', $schema) or error('Unable to create search_cache table', __FILE__, __LINE__, $db->error());
 $schema = array('FIELDS' => array('post_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'word_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'subject_match' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0')), 'INDEXES' => array('word_id_idx' => array('word_id'), 'post_id_idx' => array('post_id')));
 $db->create_table('search_matches', $schema) or error('Unable to create search_matches table', __FILE__, __LINE__, $db->error());
 $schema = array('FIELDS' => array('id' => array('datatype' => 'SERIAL', 'allow_null' => false), 'word' => array('datatype' => 'VARCHAR(20)', 'allow_null' => false, 'default' => '\'\'', 'collation' => 'bin')), 'PRIMARY KEY' => array('word'), 'INDEXES' => array('id_idx' => array('id')));
 if ($db_type == 'sqlite') {
     $schema['PRIMARY KEY'] = array('id');
     $schema['UNIQUE KEYS'] = array('word_idx' => array('word'));
 }
 $db->create_table('search_words', $schema) or error('Unable to create search_words table', __FILE__, __LINE__, $db->error());
 $schema = array('FIELDS' => array('user_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'topic_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0')), 'PRIMARY KEY' => array('user_id', 'topic_id'));
 $db->create_table('topic_subscriptions', $schema) or error('Unable to create topic subscriptions table', __FILE__, __LINE__, $db->error());
 $schema = array('FIELDS' => array('user_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'forum_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0')), 'PRIMARY KEY' => array('user_id', 'forum_id'));
 $db->create_table('forum_subscriptions', $schema) or error('Unable to create forum subscriptions table', __FILE__, __LINE__, $db->error());
 $schema = array('FIELDS' => array('id' => array('datatype' => 'SERIAL', 'allow_null' => false), 'poster' => array('datatype' => 'VARCHAR(200)', 'allow_null' => false, 'default' => '\'\''), 'subject' => array('datatype' => 'VARCHAR(255)', 'allow_null' => false, 'default' => '\'\''), 'posted' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'first_post_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'last_post' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'last_post_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'last_poster' => array('datatype' => 'VARCHAR(200)', 'allow_null' => true), 'num_views' => array('datatype' => 'MEDIUMINT(8) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'num_replies' => array('datatype' => 'MEDIUMINT(8) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'closed' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'sticky' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'moved_to' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => true), 'forum_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0')), 'PRIMARY KEY' => array('id'), 'INDEXES' => array('forum_id_idx' => array('forum_id'), 'moved_to_idx' => array('moved_to'), 'last_post_idx' => array('last_post'), 'first_post_id_idx' => array('first_post_id')));
 $db->create_table('topics', $schema) or error('Unable to create topics table', __FILE__, __LINE__, $db->error());
 $schema = array('FIELDS' => array('id' => array('datatype' => 'SERIAL', 'allow_null' => false), 'group_id' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '3'), 'username' => array('datatype' => 'VARCHAR(200)', 'allow_null' => false, 'default' => '\'\''), 'password' => array('datatype' => 'VARCHAR(40)', 'allow_null' => false, 'default' => '\'\''), 'email' => array('datatype' => 'VARCHAR(80)', 'allow_null' => false, 'default' => '\'\''), 'title' => array('datatype' => 'VARCHAR(50)', 'allow_null' => true), 'realname' => array('datatype' => 'VARCHAR(40)', 'allow_null' => true), 'url' => array('datatype' => 'VARCHAR(100)', 'allow_null' => true), 'jabber' => array('datatype' => 'VARCHAR(80)', 'allow_null' => true), 'icq' => array('datatype' => 'VARCHAR(12)', 'allow_null' => true), 'msn' => array('datatype' => 'VARCHAR(80)', 'allow_null' => true), 'aim' => array('datatype' => 'VARCHAR(30)', 'allow_null' => true), 'yahoo' => array('datatype' => 'VARCHAR(30)', 'allow_null' => true), 'location' => array('datatype' => 'VARCHAR(30)', 'allow_null' => true), 'signature' => array('datatype' => 'TEXT', 'allow_null' => true), 'disp_topics' => array('datatype' => 'TINYINT(3) UNSIGNED', 'allow_null' => true), 'disp_posts' => array('datatype' => 'TINYINT(3) UNSIGNED', 'allow_null' => true), 'email_setting' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '1'), 'notify_with_post' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'auto_notify' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'show_smilies' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '1'), 'show_img' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '1'), 'show_img_sig' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '1'), 'show_avatars' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '1'), 'show_sig' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '1'), 'timezone' => array('datatype' => 'FLOAT', 'allow_null' => false, 'default' => '0'), 'dst' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'time_format' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'date_format' => array('datatype' => 'TINYINT(1)', 'allow_null' => false, 'default' => '0'), 'language' => array('datatype' => 'VARCHAR(25)', 'allow_null' => false, 'default' => '\'' . $db->escape($default_lang) . '\''), 'style' => array('datatype' => 'VARCHAR(25)', 'allow_null' => false, 'default' => '\'' . $db->escape($default_style) . '\''), 'num_posts' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'last_post' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => true), 'last_search' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => true), 'last_email_sent' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => true), 'last_report_sent' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => true), 'registered' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'registration_ip' => array('datatype' => 'VARCHAR(39)', 'allow_null' => false, 'default' => '\'0.0.0.0\''), 'last_visit' => array('datatype' => 'INT(10) UNSIGNED', 'allow_null' => false, 'default' => '0'), 'admin_note' => array('datatype' => 'VARCHAR(30)', 'allow_null' => true), 'activate_string' => array('datatype' => 'VARCHAR(80)', 'allow_null' => true), 'activate_key' => array('datatype' => 'VARCHAR(8)', 'allow_null' => true)), 'PRIMARY KEY' => array('id'), 'UNIQUE KEYS' => array('username_idx' => array('username')), 'INDEXES' => array('registered_idx' => array('registered')));
 if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb') {
     $schema['UNIQUE KEYS']['username_idx'] = array('username(25)');
 }
 $db->create_table('users', $schema) or error('Unable to create users table', __FILE__, __LINE__, $db->error());
 $now = time();
 // Insert the four preset groups
 $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES(' . ($db_type != 'pgsql' ? '1, ' : '') . '\'' . $db->escape($lang_install['Administrators']) . '\', \'' . $db->escape($lang_install['Administrator']) . '\', 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_mod_promote_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES(' . ($db_type != 'pgsql' ? '2, ' : '') . '\'' . $db->escape($lang_install['Moderators']) . '\', \'' . $db->escape($lang_install['Moderator']) . '\', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES(' . ($db_type != 'pgsql' ? '3, ' : '') . '\'' . $db->escape($lang_install['Guests']) . '\', NULL, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 60, 30, 0, 0)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db->prefix . 'groups (' . ($db_type != 'pgsql' ? 'g_id, ' : '') . 'g_title, g_user_title, g_moderator, g_mod_edit_users, g_mod_rename_users, g_mod_change_passwords, g_mod_ban_users, g_read_board, g_view_users, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_send_email, g_post_flood, g_search_flood, g_email_flood, g_report_flood) VALUES(' . ($db_type != 'pgsql' ? '4, ' : '') . '\'' . $db->escape($lang_install['Members']) . '\', NULL, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 60, 30, 60, 60)') or error('Unable to add group', __FILE__, __LINE__, $db->error());
 // Insert guest and first admin user
 $db->query('INSERT INTO ' . $db_prefix . 'users (group_id, username, password, email) VALUES(3, \'' . $db->escape($lang_install['Guest']) . '\', \'' . $db->escape($lang_install['Guest']) . '\', \'' . $db->escape($lang_install['Guest']) . '\')') or error('Unable to add guest user. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db_prefix . 'users (group_id, username, password, email, language, style, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, \'' . $db->escape($username) . '\', \'' . pun_hash($password1) . '\', \'' . $email . '\', \'' . $db->escape($default_lang) . '\', \'' . $db->escape($default_style) . '\', 1, ' . $now . ', ' . $now . ', \'' . $db->escape(get_remote_address()) . '\', ' . $now . ')') or error('Unable to add administrator user. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
 // Enable/disable avatars depending on file_uploads setting in PHP configuration
 $avatars = in_array(strtolower(@ini_get('file_uploads')), array('on', 'true', '1')) ? 1 : 0;
Beispiel #4
0
         $queries[] = 'CREATE INDEX ' . $db_prefix . 'search_words_id_idx ON ' . $db_prefix . 'search_words(id)';
         break;
 }
 @reset($queries);
 while (list(, $sql) = @each($queries)) {
     $db->query($sql) or error('Unable to create indexes. Please check your configuration and try again.', __FILE__, __LINE__, $db->error());
 }
 $now = time();
 // Insert the four preset groups
 $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Administrators', 'Administrator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Moderators', 'Moderator', 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Guest', NULL, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
 $db->query('INSERT INTO ' . $db->prefix . "groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_post_polls, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES('Members', NULL, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 300, 60, 30)") or error('Unable to add group', __FILE__, __LINE__, $db->error());
 // Insert guest and first admin user
 $db->query('INSERT INTO ' . $db_prefix . "users (group_id, username, password, email) VALUES(3, 'Guest', 'Guest', 'Guest')") or error('Unable to add guest user. Please check your configuration and try again.');
 $db->query('INSERT INTO ' . $db_prefix . "users (group_id, username, password, email, num_posts, last_post, registered, registration_ip, last_visit) VALUES(1, '" . $db->escape($username) . "', '" . pun_hash($password1) . "', '{$email}', 1, " . $now . ", " . $now . ", '127.0.0.1', " . $now . ')') or error('Unable to add administrator user. Please check your configuration and try again.');
 // Insert config data
 $config = array('o_cur_version' => "'{$punbb_version}'", 'o_board_title' => "'My PunBB forum'", 'o_board_desc' => "'Unfortunately no one can be told what PunBB is - you have to see it for yourself.'", 'o_server_timezone' => "'0'", 'o_time_format' => "'H:i:s'", 'o_date_format' => "'Y-m-d'", 'o_timeout_visit' => "'600'", 'o_timeout_online' => "'300'", 'o_redirect_delay' => "'1'", 'o_show_version' => "'0'", 'o_show_user_info' => "'1'", 'o_show_post_count' => "'1'", 'o_smilies' => "'1'", 'o_smilies_sig' => "'1'", 'o_make_links' => "'1'", 'o_default_lang' => "'English'", 'o_default_style' => "'Oxygen'", 'o_default_user_group' => "'4'", 'o_topic_review' => "'15'", 'o_disp_topics_default' => "'30'", 'o_disp_posts_default' => "'25'", 'o_indent_num_spaces' => "'4'", 'o_quickpost' => "'1'", 'o_users_online' => "'1'", 'o_censoring' => "'0'", 'o_ranks' => "'1'", 'o_show_dot' => "'0'", 'o_quickjump' => "'1'", 'o_gzip' => "'0'", 'o_additional_navlinks' => "''", 'o_report_method' => "'0'", 'o_regs_report' => "'0'", 'o_mailing_list' => "'{$email}'", 'o_avatars' => "'1'", 'o_avatars_dir' => "'img/avatars'", 'o_avatars_width' => "'60'", 'o_avatars_height' => "'60'", 'o_avatars_size' => "'10240'", 'o_search_all_forums' => "'1'", 'o_base_url' => "'{$base_url}'", 'o_admin_email' => "'{$email}'", 'o_webmaster_email' => "'{$email}'", 'o_subscriptions' => "'1'", 'o_smtp_host' => "NULL", 'o_smtp_user' => "NULL", 'o_smtp_pass' => "NULL", 'o_regs_allow' => "'1'", 'o_regs_verify' => "'0'", 'o_announcement' => "'0'", 'o_announcement_message' => "'Enter your announcement here.'", 'o_rules' => "'0'", 'o_rules_message' => "'Enter your rules here.'", 'o_maintenance' => "'0'", 'o_maintenance_message' => "'The forums are temporarily down for maintenance. Please try again in a few minutes.<br />\\n<br />\\n/Administrator'", 'p_mod_edit_users' => "'1'", 'p_mod_rename_users' => "'0'", 'p_mod_change_passwords' => "'0'", 'p_mod_ban_users' => "'0'", 'p_message_bbcode' => "'1'", 'p_message_img_tag' => "'1'", 'p_message_all_caps' => "'1'", 'p_subject_all_caps' => "'1'", 'p_sig_all_caps' => "'1'", 'p_sig_bbcode' => "'1'", 'p_sig_img_tag' => "'0'", 'p_sig_length' => "'400'", 'p_sig_lines' => "'4'", 'p_allow_banned_email' => "'1'", 'p_allow_dupe_email' => "'0'", 'p_force_guest_email' => "'1'");
 while (list($conf_name, $conf_value) = @each($config)) {
     $db->query('INSERT INTO ' . $db_prefix . "config (conf_name, conf_value) VALUES('{$conf_name}', {$conf_value})") or error('Unable to insert into table ' . $db_prefix . 'config. Please check your configuration and try again.');
 }
 // Insert some other default data
 $db->query('INSERT INTO ' . $db_prefix . "categories (cat_name, disp_position) VALUES('Test category', 1)") or error('Unable to insert into table ' . $db_prefix . 'categories. Please check your configuration and try again.');
 $db->query('INSERT INTO ' . $db_prefix . "forums (forum_name, forum_desc, num_topics, num_posts, last_post, last_post_id, last_poster, disp_position, cat_id) VALUES('Test forum', 'This is just a test forum', 1, 1, " . $now . ", 1, '" . $db->escape($username) . "', 1, 1)") or error('Unable to insert into table ' . $db_prefix . 'forums. Please check your configuration and try again.');
 $db->query('INSERT INTO ' . $db_prefix . "topics (poster, subject, posted, last_post, last_post_id, last_poster, forum_id) VALUES('" . $db->escape($username) . "', 'Test post', " . $now . ", " . $now . ", 1, '" . $db->escape($username) . "', 1)") or error('Unable to insert into table ' . $db_prefix . 'topics. Please check your configuration and try again.');
 $db->query('INSERT INTO ' . $db_prefix . "posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES('" . $db->escape($username) . "', 2, '127.0.0.1', 'If you are looking at this (which I guess you are), the install of PunBB appears to have worked! Now log in and head over to the administration control panel to configure your forum.', " . $now . ', 1)') or error('Unable to insert into table ' . $db_prefix . 'posts. Please check your configuration and try again.');
 $db->query('INSERT INTO ' . $db_prefix . "ranks (rank, min_posts) VALUES('New member', 0)") or error('Unable to insert into table ' . $db_prefix . 'ranks. Please check your configuration and try again.');
 $db->query('INSERT INTO ' . $db_prefix . "ranks (rank, min_posts) VALUES('Member', 10)") or error('Unable to insert into table ' . $db_prefix . 'ranks. Please check your configuration and try again.');
 if ($db_type == 'pgsql' || $db_type == 'sqlite') {
     $db->end_transaction();
 }