/** * Function that will run updates to make Theamus the latest standard (1.3.1) * * @param array $system_info * @return boolean */ function update($Theamus, $update_information) { // Define the update 'functions' to run $updates = array("150", "160"); // Run updates foreach ($updates as $update) { $update_function = 'update_' . $update; if (!$update_function($Theamus)) { return false; } } update_version($update_information['version'], $Theamus); // Update the version update_cleanup($Theamus); // Cleanup! return true; }
} update_database_optionally($next_ver); $result = update_data_automatically($next_ver); if ($result === false) { die(implode(',', $err->last_message())); } echo 'OK'; break; /* 更新版本号 */ /* 更新版本号 */ case 'update_version': $next_ver = isset($_REQUEST['next_ver']) ? $_REQUEST['next_ver'] : ''; if ($next_ver === '') { die('EMPTY'); } update_version($next_ver); echo 'OK'; break; /* 成功页面 */ /* 成功页面 */ case 'done': $ui = isset($_REQUEST['ui']) ? $_REQUEST['ui'] : 'ecshop'; if ($ui == 'ucenter') { change_ucenter_config(); } clear_all_files(); remove_ucenter_config(); remove_lang_config(); $smarty->display('done.php'); break; /* 出错页面 */
{ $longshort = $long ."'". "," ."'". $short; $alongshort = "'" .$longshort. "'"; $q = "INSERT INTO `version`(`long`,`short`) VALUES ( ".$alongshort." )"; mysql_query($q); } else { echo "NO_NEW_VERSIONS <br>"; echo "CURRENT VERSION:" . $cachelongb[long]; } } function echo_newest_cache() { $host="localhost"; // Host name $username="******"; // Mysql username $password="******"; // Mysql password $db_name="cryptum1_minecraft"; // Database name $tbl_name="version"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $versiontable = mysql_query ("SELECT `short` FROM `version` ORDER BY `id` DESC LIMIT 1"); $version = mysql_fetch_assoc($versiontable); return $version[long]; } update_version(); ?>
break; case "X": echo "Fichero sin modificar {$ruta_destino}<br>\n"; break; case "U": if ($fichero == "main_config.php") { $fichero_config = $ruta_destino; update_config($fichero, $ruta, $ruta_destino); } echo "Fichero actualizado {$ruta_destino}<br>\n"; break; } } flush(); } update_version($fichero_config, trim($nueva_version)); echo "<br>----------------------------------------------<br>\n"; echo "<b>Actualización finalizada</b><br>\n"; ?> <SCRIPT language="JavaScript" type="text/javascript"> <!-- parent.cabecera.location.href="top.php"; //--> </SCRIPT> </font> <?php } else { ?> <table width="80%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td align="center" bgcolor="#FFCC66"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Últimas