forked from halo-battle/game
Version 1.7b
This commit is contained in:
parent
58928889ed
commit
8a8280758b
716 changed files with 4361 additions and 33524 deletions
|
|
@ -1,49 +0,0 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
$page = 'rename';
|
||||
$titre = $queryPlanete["nom_planete"];
|
||||
$id_plan = $queryPlanete["id"];
|
||||
|
||||
if (isset($_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>');
|
||||
$template->assign('couleur','red');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$table = $config['db_prefix'].'planete';
|
||||
$chapeau->unique_query("UPDATE `$table` SET `nom_planete` = '$nouvNom' WHERE `id_user` = '$id_user' AND `id` = '$id_plan'");
|
||||
$template->assign('message','Le nom de votre planète a été modifié avec succès.');
|
||||
$template->assign('script','<script type="text/javascript">setTimeout(\'document.location.href="?p=accueil";\', 2500);</script>');
|
||||
$template->assign('couleur','green');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
elseif(isset($_GET['a']) && $_GET['a'] == $sess->values['abandon']) {
|
||||
$galaxie = $queryPlanete["galaxie"]; $ss = $queryPlanete["ss"]; $position = $queryPlanete["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';");
|
||||
|
||||
$req = $chapeau->unique_query("SELECT * FROM `$table_planete` WHERE `id_user` = '$id_user' LIMIT 1;");
|
||||
$sess->values['idPlan'] = $req['id'];
|
||||
$sess->put();
|
||||
|
||||
$template->assign('message','Cette planète n\'est désormais plus sous votre contrôle.');
|
||||
$template->assign('script','<script type="text/javascript">setTimeout(\'document.location.href="?p=accueil";\', 2500);</script>');
|
||||
$template->assign('couleur','green');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
|
||||
$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;
|
||||
$sess->put();
|
||||
$template->assign('abandonH', $hashA);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue