function start_update() { // The updater html_header("Coppermine - Upgrade"); html_logo(); test_fs(); if ($errors != '') { html_prereq_errors($errors); } else { test_sql_connection(); if ($errors == '') { update_tables(); update_system_thumbs(); } else { html_error($errors); } if ($errors == '') { html_install_success($notes); session_destroy(); } else { html_error($errors); } } html_footer(); }
<?php require_once ("install_function.php"); $step =0; $ndb =1; $dbserver = isset($_POST["dbserver"])?$_POST["dbserver"]:"localhost"; $dbuser = isset($_POST["dbuser"])?$_POST["dbuser"]:"******"; $dbpass = isset($_POST["dbpass"])?$_POST["dbpass"]:""; $dbname = isset($_POST["dbname"])?$_POST["dbname"]:"db_xframejs"; $site_title = isset($_POST["site_title"])?$_POST["site_title"]:"Your Title Here"; $menu_title = isset($_POST["menu_title"])?$_POST["menu_title"]:"Main Menu"; if (isset($_POST["Test"])) { $ndb = isset($_POST["ndb"])?1:0; test_sql_connection($ndb); if (!$errors) write_config_file(); if (!$errors) $step=1; } if (isset($_POST["idb"])) { require_once(CONF_DB); if (!$connect_id = @mysql_connect(HOST,USER,PASS)) $errors[] = "Tidak Bisa Terkoneksi ke Database"; if (!$errors) if (!mysql_select_db(DB, $connect_id)) $errors[] = "Tidak Dapat Menemukan Database $db"; if ($errors) { $dbhost = $host; $dbuser = $user; $dbpass = $pass;
// GD2 test $im = imagecreatetruecolor(1, 1); imagejpeg($im, "{$DFLT['alb_d']}/{$DFLT['upl_d']}/gd2.jpg"); header("Content-type: image/gif"); fpassthru(fopen('images/spacer.gif')); } elseif ($_GET['phpinfo'] && !file_exists($DFLT['cfg_f'])) { phpinfo(); } else { // The installer html_header(); html_logo(); if (file_exists($DFLT['cfg_f'])) { html_installer_locked(); } elseif (count($_POST)) { test_fs(); test_sql_connection(); test_admin_login(); write_config_file(); if ($errors == '') { create_tables(); } if ($errors != '') { html_input_config($errors); } else { //lock_install(); html_install_success($notes); } } else { test_fs(); if ($errors != '') { html_prereq_errors($errors);
function start_update() { global $errors, $notes, $lang_update_php, $LINEBREAK; global $update_icon, $ok_icon, $already_done_icon, $error_icon, $file_system_icon; // The updater //html_header($lang_update_php['title']); test_sql_connection(); if (function_exists('cpg_fetch_icon')) { $update_icon = cpg_fetch_icon('update_database', 2); $ok_icon = cpg_fetch_icon('ok', 2); $already_done_icon = cpg_fetch_icon('info', 2); $error_icon = cpg_fetch_icon('stop', 2); $file_system_icon = cpg_fetch_icon('hdd', 2); } else { $update_icon = ''; $ok_icon = ''; $already_done_icon = ''; $error_icon = ''; $file_system_icon = ''; } if ($errors == '') { echo ' <table border="0" cellspacing="0" cellpadding="0" class="maintable">' . $LINEBREAK; update_tables(); update_files(); echo ' </table>' . $LINEBREAK; } else { html_error($errors); } if ($errors == '') { html_install_success($notes); session_destroy(); } else { html_error($errors); } //html_footer(); }