Browse Source

Finalisation des ennemies

master
heuzef 10 years ago
parent
commit
db519ba62c
7 changed files with 139 additions and 5 deletions
  1. +2
    -2
      medias/default/enemy.xml
  2. +6
    -0
      play/boss_wiki.php
  3. +1
    -1
      play/enemy.php
  4. +6
    -0
      play/enemy_wiki.php
  5. +80
    -2
      play/index.php
  6. +22
    -0
      play/new_boss.php
  7. +22
    -0
      play/new_enemy.php

+ 2
- 2
medias/default/enemy.xml View File

@@ -3,7 +3,7 @@
<entry>
<nom>enemy</nom>
<hp>3</hp>
<img>http://wiki.ecomonde.land/lib/exe/fetch.php?media=wiki:loup_garrou.jpg</img>
<url>http://wiki.ecomonde.land/doku.php?id=wiki:ennemies:loups_garrous</url>
<img></img>
<url>#</url>
</entry>
</response>

+ 6
- 0
play/boss_wiki.php View File

@@ -0,0 +1,6 @@
<option>clayrtonne</option>
<option>fordrums</option>
<option>harcelo</option>
<option>karog</option>
<option>kraken</option>
<option>witorl</option>

+ 1
- 1
play/enemy.php View File

@@ -21,7 +21,7 @@ foreach($xml->entry as $entry) {
</div>
<div class="row">
<div class="col-lg-5">
<a href="<?php echo $entry->url; ?>" target="_blank" /><img class="img-responsive img-rounded" src="<?php echo $entry->img; ?>" alt="enemy" />
<a href="<?php echo $entry->url; ?>" target="_blank" /><img class="img-responsive img-rounded" style="height:90px" src="<?php echo $entry->img; ?>" alt="enemy" />
</div>
<div class="col-lg-2">
<br />


+ 6
- 0
play/enemy_wiki.php View File

@@ -0,0 +1,6 @@
<option>bandit</option>
<option>goulmorg</option>
<option>loup_garou</option>
<option>sans_ame</option>
<option>serpent_geant</option>
<option>valsain</option>

+ 80
- 2
play/index.php View File

@@ -43,11 +43,11 @@
<br />
<div class="container-fluid">
<div class="col-lg-5">
<button class="btn btn-warning btn-sm"><i class="ionicons ion-plus"></i>&nbsp;&nbsp;Ajouter ennemi</button></a>
<button class="btn btn-warning btn-sm" data-toggle="modal" data-target="#add_enemy"><i class="ionicons ion-plus"></i>&nbsp;&nbsp;Ajouter ennemi</button>
</div>
<div class="col-lg-2"></div>
<div class="col-lg-5">
<button class="btn btn-danger btn-sm"><i class="ionicons ion-plus"></i>&nbsp;&nbsp;Ajouter BOSS</button></a>
<button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#add_boss"><i class="ionicons ion-plus"></i>&nbsp;&nbsp;Ajouter Boss</button>
</div>
</div>
</div>
@@ -164,6 +164,84 @@
</div>
<!-- /gamers -->

<!-- add_enemy -->
<div class="modal fade" id="add_enemy" tabindex="-1" role="dialog" aria-labelledby="add_enemy" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="new_enemy.php" enctype="multipart/form-data">
<div class="modal-body">
<div class="container-fluid">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Ajouter un ennemi</h3>
</div>
<div class="panel-body">
<div class="col-lg-6 form-group">
<label for="select" class="control-label">Type :</label>
<select class="form-control" id="focusedInput" name="enemy_type">
<?php include ("enemy_wiki.php"); ?>
</select>
</div>
<div class="col-lg-6 form-group">
<label class="control-label" for="focusedInput">Suffixe :</label>
<input class="form-control" id="focusedInput" type="text" name="enemy_suffix" maxlength="12" value="violent">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-warning">Création de l'ennemi</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
</div>
</form>
</div>
</div>
</div>
<!-- /add_enemy -->

<!-- add_boss -->
<div class="modal fade" id="add_boss" tabindex="-1" role="dialog" aria-labelledby="add_boss" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal well" role="form" method="post" action="new_boss.php" enctype="multipart/form-data">
<div class="modal-body">
<div class="container-fluid">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Ajouter un Boss</h3>
</div>
<div class="panel-body">
<div class="col-lg-12 form-group">
<label for="select" class="control-label">Type :</label>
<select class="form-control" id="focusedInput" name="boss_type">
<?php include ("boss_wiki.php"); ?>
</select>
</div>
<!--
<div class="col-lg-6 form-group">
<label class="control-label" for="focusedInput">Suffixe :</label>
<input class="form-control" id="focusedInput" type="text" name="boss_suffix" maxlength="12" value="epic">
</div>
-->
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-danger">Création du Boss</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
</div>
</form>
</div>
</div>
</div>
<!-- /add_boss -->

<!-- infos -->
<div class="modal fade" id="infos" tabindex="-1" role="dialog" aria-labelledby="infos" aria-hidden="true">
<div class="modal-dialog">


+ 22
- 0
play/new_boss.php View File

@@ -0,0 +1,22 @@
<?php
include "../header.php";
$boss_type=$_POST['boss_type'];

$boss_suffix=$_POST['boss_suffix'];

$boss_name=$boss_type;

copy("../medias/default/enemy.xml", "../medias/".$hash."/enemy/".$boss_name.".xml");

$xml = simplexml_load_file('../medias/'.$hash.'/enemy/'.$boss_name.'.xml');

$xml->entry->nom = $boss_name;

$xml->entry->img = "http://wiki.ecomonde.land/lib/exe/fetch.php?media=wiki:".$boss_type.".jpg";

$xml->entry->url = "http://wiki.ecomonde.land/doku.php?id=wiki:boss:".$boss_type;

$xml->asXml('../medias/'.$hash.'/enemy/'.$boss_name.'.xml');

header("location: index.php");
?>

+ 22
- 0
play/new_enemy.php View File

@@ -0,0 +1,22 @@
<?php
include "../header.php";
$enemy_type=$_POST['enemy_type'];

$enemy_suffix=$_POST['enemy_suffix'];

$enemy_name=$enemy_type." ".$enemy_suffix;

copy("../medias/default/enemy.xml", "../medias/".$hash."/enemy/".$enemy_name.".xml");

$xml = simplexml_load_file('../medias/'.$hash.'/enemy/'.$enemy_name.'.xml');

$xml->entry->nom = $enemy_name;

$xml->entry->img = "http://wiki.ecomonde.land/lib/exe/fetch.php?media=wiki:".$enemy_type.".jpg";

$xml->entry->url = "http://wiki.ecomonde.land/doku.php?id=wiki:ennemies:".$enemy_type;

$xml->asXml('../medias/'.$hash.'/enemy/'.$enemy_name.'.xml');

header("location: index.php");
?>

Loading…
Cancel
Save