Version 1.2

This commit is contained in:
nemunaire 2008-11-22 12:00:00 +01:00
commit 083eb365c5
73 changed files with 1165 additions and 361 deletions

View file

@ -5,7 +5,8 @@ $titre = $queryPlanete["nom_planete"];
$id_plan = $queryPlanete["id"];
if (isset($_POST['planete'])) {
$nouvNom = mysql_real_escape_string(str_replace('<', '&lt;', trim($_POST['planete'])));
$nouvNom = trim($_POST['planete']);
$chapeau->escape($nouvNom);
if (empty($nouvNom)) {
$template->assign('message','Vous n\'avez indiqué aucun nom de planète.');
$template->assign('script','<script type="text/javascript">setTimeout(\'document.location.href="?p=rename";\', 2500);</script>');
@ -25,11 +26,10 @@ if (isset($_POST['planete'])) {
}
elseif(isset($_GET['a']) && $_GET['a'] == $sess->values['abandon']) {
$galaxie = $queryPlanete["galaxie"]; $ss = $queryPlanete["ss"]; $position = $queryPlanete["position"];
mysql_query("DELETE FROM `planete` WHERE `id_user` = '$id_user' AND `id` = '$id_plan' LIMIT 1;");
mysql_query("DELETE FROM `flottes` WHERE `id_user` = '$id_user' AND `start_galaxie` = '$galaxie' AND `start_ss` = '$ss' AND `start_position` = '$position';");
$chapeau->query("DELETE FROM `$table_planete` WHERE `id_user` = '$id_user' AND `id` = '$id_plan' LIMIT 1;");
$chapeau->query("DELETE FROM `$table_flottes` WHERE `id_user` = '$id_user' AND `start_galaxie` = '$galaxie' AND `start_ss` = '$ss' AND `start_position` = '$position';");
$table = $config['db_prefix'].'planete';
$req = $chapeau->unique_query("SELECT * FROM `$table` WHERE `id_user` = '$id_user' LIMIT 1;");
$req = $chapeau->unique_query("SELECT * FROM `$table_planete` WHERE `id_user` = '$id_user' LIMIT 1;");
$sess->values['idPlan'] = $req['id'];
$sess->put();
@ -40,8 +40,7 @@ elseif(isset($_GET['a']) && $_GET['a'] == $sess->values['abandon']) {
exit;
}
$table = $config['db_prefix'].'planete';
$reqnb = $chapeau->query("SELECT * FROM `$table` WHERE `id_user` = '$id_user'");
$reqnb = $chapeau->query("SELECT * FROM `$table_planete` WHERE `id_user` = '$id_user'");
if (count($reqnb) > 1) $hashA = md5(rand(123456789,9876543210));
else $hashA = false;
$sess->values['abandon'] = $hashA;