Exemplo n.º 1
0
    $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(\'' . $db->escape($lang_install['Test forum']) . '\', \'' . $db->escape($lang_install['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', __FILE__, __LINE__, $db->error());
    $db->query('INSERT INTO ' . $db_prefix . 'topics (poster, subject, posted, first_post_id, last_post, last_post_id, last_poster, forum_id) VALUES(\'' . $db->escape($username) . '\', \'' . $db->escape($subject) . '\', ' . $now . ', 1, ' . $now . ', 1, \'' . $db->escape($username) . '\', 1)') or error('Unable to insert into table ' . $db_prefix . 'topics. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
    $db->query('INSERT INTO ' . $db_prefix . 'posts (poster, poster_id, poster_ip, message, posted, topic_id) VALUES(\'' . $db->escape($username) . '\', 2, \'' . $db->escape(get_remote_address()) . '\', \'' . $db->escape($message) . '\', ' . $now . ', 1)') or error('Unable to insert into table ' . $db_prefix . 'posts. Please check your configuration and try again', __FILE__, __LINE__, $db->error());
    // Index the test post so searching for it works
    require PUN_ROOT . 'include/search_idx.php';
    update_search_index('post', 1, $message, $subject);
    $db->end_transaction();
    $alerts = array();
    // Check if we disabled uploading avatars because file_uploads was disabled
    if ($avatars == '0') {
        $alerts[] = $lang_install['Alert upload'];
    }
    // Add some random bytes at the end of the cookie name to prevent collisions
    $cookie_name = 'pun_cookie_' . random_key(6, false, true);
    // Generate the config.php file data
    $config = generate_config_file();
    // Attempt to write config.php and serve it up for download if writing fails
    $written = false;
    if (forum_is_writable(PUN_ROOT)) {
        $fh = @fopen(PUN_ROOT . 'config.php', 'wb');
        if ($fh) {
            fwrite($fh, $config);
            fclose($fh);
            $written = true;
        }
    }
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
Exemplo n.º 2
0
    $insert = array('forum_name' => $lang_install['Test forum'], 'forum_desc' => $lang_install['This is just a test forum'], 'num_topics' => 1, 'num_posts' => 1, 'last_post' => $now, 'last_post_id' => 1, 'last_topic' => sprintf($lang_install['Test post'], FORUM_VERSION), 'last_topic_id' => 1, 'last_poster' => $username, 'disp_position' => 1, 'cat_id' => 1, 'quickjump' => 1);
    $db->insert('forums', $insert);
    $insert = array('poster' => $username, 'subject' => sprintf($lang_install['Test post'], FORUM_VERSION), 'posted' => $now, 'first_post_id' => 1, 'last_post' => $now, 'last_post_id' => 1, 'last_poster' => $username, 'forum_id' => 1);
    $db->insert('topics', $insert);
    $insert = array('poster' => $username, 'poster_id' => 2, 'poster_ip' => get_remote_address(), 'message' => $lang_install['Message'], 'posted' => $now, 'topic_id' => 1);
    $db->insert('posts', $insert);
    // Index the test post so searching for it works
    require PANTHER_ROOT . 'include/search_idx.php';
    update_search_index('post', 1, $lang_install['Message'], $lang_install['Test post']);
    $db->end_transaction();
    // Check if we disabled uploading avatars because file_uploads was disabled
    if ($avatars == '0') {
        $alerts[] = $lang_install['Alert upload'];
    }
    // Generate the config.php file data
    $file = generate_config_file($config);
    // Attempt to write config.php and serve it up for download if writing fails
    $written = false;
    if (forum_is_writable(PANTHER_ROOT . 'include')) {
        $fh = @fopen(PANTHER_ROOT . 'include/config.php', 'wb');
        if ($fh) {
            fwrite($fh, $file);
            fclose($fh);
            $written = true;
        }
    }
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>