diff --git a/install.php b/install.php index de318c3a..7d90b523 100644 --- a/install.php +++ b/install.php @@ -310,8 +310,10 @@ preg_match_all("/((SET|CREATE|INSERT).+)\n\n/msU", $sql, $queries); $queries = $queries[1]; + $sql_errors = ''; foreach($queries as &$query) { - query($query) or error(db_error()); + if(!query($query)) + $sql_errors .= '
  • ' . db_error() . '
  • '; } $boards = listBoards(); @@ -322,13 +324,26 @@ sql_close(); - touch($config['has_installed'], 0777); - $page['title'] = 'Installation complete'; $page['body'] = '

    Thank you for using Tinyboard. Please remember to report any bugs you discover.

    '; + if(!empty($sql_errors)) { + $page['body'] .= '

    SQL errors

    SQL errors were encountered when trying to install the database. This may be the result of using a database which is already occupied with a Tinyboard installation; if so, you can probably ignore this.

    The errors encountered were:

    Ignore errors and complete installation.

    '; + } else { + touch($config['has_installed'], 0777); + if(!@unlink(__FILE__)) { + $page['body'] .= '

    Delete install.php!

    I couldn\'t remove install.php. You will have to remove it manually.

    '; + } + } + + echo Element('page.html', $page); + } elseif($step == 5) { + $page['title'] = 'Installation complete'; + $page['body'] = '

    Thank you for using Tinyboard. Please remember to report any bugs you discover.

    '; + + touch($config['has_installed'], 0777); if(!@unlink(__FILE__)) { - $page['body'] = '

    I couldn\'t remove install.php. You will have to remove it manually.

    '; + $page['body'] .= '

    Delete install.php!

    I couldn\'t remove install.php. You will have to remove it manually.

    '; } echo Element('page.html', $page);