Merge pull request #11 from gnieark/dev

Dev
This commit is contained in:
Gnieark 2015-11-29 20:25:18 +01:00
commit b6dc254f9c
10 changed files with 55 additions and 21 deletions

View File

@ -1,5 +1,7 @@
RewriteEngine On RewriteEngine On
RewriteBase / RewriteBase /
RewriteRule ^([a-zA-Z]{1,})/doc-([a-z]{2})$ index\.php?doc=$1&lang=$2 [L]
RewriteRule ^([a-zA-Z]{1,})/doc$ index\.php?doc=$1 [L]
RewriteRule ^([a-zA-Z]{1,})-([a-z]{2})$ index\.php?arena=$1&lang=$2 [L] RewriteRule ^([a-zA-Z]{1,})-([a-z]{2})$ index\.php?arena=$1&lang=$2 [L]
RewriteRule ^([a-zA-Z]{1,})$ index\.php?arena=$1 [L] RewriteRule ^([a-zA-Z]{1,})$ index\.php?arena=$1 [L]
RewriteRule ^-([a-z]{2})$ index\.php?lang=$1 [L] RewriteRule ^-([a-z]{2})$ index\.php?lang=$1 [L]

View File

@ -102,6 +102,25 @@ if($currentArena == ""){
</header> </header>
<section> <section>
<?php <?php
if(isset($_GET['doc'])){
//on affiche une page de doc.
$pageExists=false;
foreach($arenas as $arena){
if($arena['id'] == $_GET['doc']){
if(file_exists("../src/arenas/".$arena['id']."/doc-".$lang['lang'].".html")){
$pageExists=true;
echo file_get_contents("../src/arenas/".$arena['id']."/doc-".$lang['lang'].".html");
break;
}
}
}
if(!$pageExists){
error(404,"doc is missing");
die;
}
}else{
//on affiche une arene ou page d'accueil
switch($currentArena){ switch($currentArena){
case "": case "":
include ("../src/home.php"); include ("../src/home.php");
@ -109,7 +128,10 @@ if($currentArena == ""){
default: default:
//battle history for this arena //battle history for this arena
$hist=get_battles_history($currentArena); $hist=get_battles_history($currentArena);
echo '<aside id="history"><h2>Scores</h2>'; echo '<aside id="history">
<h2>infos:</h2>
<a href="/'.$currentArena.'/doc">'.$lang['DEV_DOC_SPECS_LINKS'].'</a>
<h2>Scores</h2>';
foreach($hist as $sc){ foreach($hist as $sc){
echo '<h3>'.$sc['bot1'].' VS '.$sc['bot2'].'</h3> echo '<h3>'.$sc['bot1'].' VS '.$sc['bot2'].'</h3>
<ul> <ul>
@ -122,6 +144,9 @@ if($currentArena == ""){
include ("../src/arenas/".$currentArena."/public.php"); include ("../src/arenas/".$currentArena."/public.php");
break; break;
} }
}
?> ?>
</section> </section>
<footer> <footer>

View File

@ -1,9 +1,12 @@
<?php <?php
$lang=array( $lang=array(
'lang' => 'en',
'SITE_NAME' => 'bots\'arena', 'SITE_NAME' => 'bots\'arena',
'SITE_DESCRIPTION' => 'blah blah blah but english', 'SITE_DESCRIPTION' => 'blah blah blah but english',
'HOME' => 'Home page', 'HOME' => 'Home page',
'VICTORIES' => 'victories', 'VICTORIES' => 'victories',
'DRAW' => 'drawn match', 'DRAW' => 'drawn match',
'MAKE_DUEL' => 'Organise a duel' 'MAKE_DUEL' => 'Organise a duel',
'FIGHT' => 'Fight!',
'DEV_DOC_SPECS_LINKS' =>'Program your own bot, and send it on this arena. Read tle technicals specifications'
); );

View File

@ -1,5 +1,6 @@
<?php <?php
$lang=array( $lang=array(
'lang' => 'fr',
'SITE_NAME' => 'Arène à bots', 'SITE_NAME' => 'Arène à bots',
'SITE_DESCRIPTION' => 'SITE_DESCRIPTION' =>
'<p>Bienvenue sur cette arène à bots.<br/> '<p>Bienvenue sur cette arène à bots.<br/>
@ -8,6 +9,8 @@ $lang=array(
'HOME' => 'accueil', 'HOME' => 'accueil',
'VICTORIES' => 'victoires', 'VICTORIES' => 'victoires',
'DRAW' => 'matchs nuls', 'DRAW' => 'matchs nuls',
'MAKE_DUEL' => 'Provoquer un duel' 'MAKE_DUEL' => 'Provoquer un duel',
'FIGHT' => 'Baston!',
'DEV_DOC_SPECS_LINKS' =>'Developpez votre bot et envoyez le dans cette arène. Voici les spécifications techniques'
); );

0
src/about.html Normal file
View File

View File

View File

@ -0,0 +1 @@
<h1>Documentation du TicTacToe</h1>

View File

View File

@ -40,6 +40,6 @@ if(!$postParams){
?> ?>
</select> </select>
</p> </p>
<p><input type="button" value="Fight!" onclick="tictactoe(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>');"></p> <p><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="tictactoe(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>');"></p>
</article> </article>
<article id="fightResult"></article> <article id="fightResult"></article>

0
src/legals.html Normal file
View File