From 84cc05acc872ba2407b352ab37c4f60c0cd83383 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sun, 29 Nov 2015 18:49:45 +0100 Subject: [PATCH 1/5] fight --- lang/en.php | 3 ++- lang/fr.php | 3 ++- src/arenas/tictactoe/public.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/en.php b/lang/en.php index f0603ed..e8a1979 100644 --- a/lang/en.php +++ b/lang/en.php @@ -5,5 +5,6 @@ $lang=array( 'HOME' => 'Home page', 'VICTORIES' => 'victories', 'DRAW' => 'drawn match', - 'MAKE_DUEL' => 'Organise a duel' + 'MAKE_DUEL' => 'Organise a duel', + 'FIGHT' => 'Fight!' ); \ No newline at end of file diff --git a/lang/fr.php b/lang/fr.php index 890596b..5f55498 100644 --- a/lang/fr.php +++ b/lang/fr.php @@ -8,6 +8,7 @@ $lang=array( 'HOME' => 'accueil', 'VICTORIES' => 'victoires', 'DRAW' => 'matchs nuls', - 'MAKE_DUEL' => 'Provoquer un duel' + 'MAKE_DUEL' => 'Provoquer un duel', + 'FIGHT' => 'Baston!' ); \ No newline at end of file diff --git a/src/arenas/tictactoe/public.php b/src/arenas/tictactoe/public.php index 066674c..4e111fa 100644 --- a/src/arenas/tictactoe/public.php +++ b/src/arenas/tictactoe/public.php @@ -40,6 +40,6 @@ if(!$postParams){ ?>

-

+

\ No newline at end of file From f9af1b5feca6aa58baedffa96dc1ca55a3b61eb4 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sun, 29 Nov 2015 19:00:58 +0100 Subject: [PATCH 2/5] rewriterules - ajout des pages de documentation --- html/.htaccess | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/.htaccess b/html/.htaccess index 9caecf4..683757e 100644 --- a/html/.htaccess +++ b/html/.htaccess @@ -1,5 +1,7 @@ RewriteEngine On 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,})$ index\.php?arena=$1 [L] RewriteRule ^-([a-z]{2})$ index\.php?lang=$1 [L] From 16889fb2e4ad4c26f15a4542591800074530aa40 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Sun, 29 Nov 2015 19:41:37 +0100 Subject: [PATCH 3/5] doc --- html/index.php | 58 ++++++++++++++++++++++---------- lang/en.php | 1 + lang/fr.php | 1 + src/about.html | 0 src/arenas/tictactoe/doc-en.html | 0 src/arenas/tictactoe/doc-fr.html | 1 + src/arenas/tictactoe/doc.html | 0 src/legals.html | 0 8 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 src/about.html create mode 100644 src/arenas/tictactoe/doc-en.html create mode 100644 src/arenas/tictactoe/doc-fr.html create mode 100644 src/arenas/tictactoe/doc.html create mode 100644 src/legals.html diff --git a/html/index.php b/html/index.php index f0a1db2..ca5df84 100644 --- a/html/index.php +++ b/html/index.php @@ -102,26 +102,48 @@ if($currentArena == ""){

Scores

'; - foreach($hist as $sc){ - echo '

'.$sc['bot1'].' VS '.$sc['bot2'].'

-
    -
  • '.$sc['bot1']." ".$lang['VICTORIES'].":".$sc['player1Wins'].'
  • -
  • '.$sc['bot2']." ".$lang['VICTORIES'].":".$sc['player2Wins'].'
  • -
  • '.$lang['DRAW'].":".$sc['draws'].'
  • -
'; + 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; + } } - echo ''; - include ("../src/arenas/".$currentArena."/public.php"); - break; + } + if(!$pageExists){ + error(404,"doc is missing"); + die; + } + + }else{ + //on affiche une arene ou page d'accueil + switch($currentArena){ + case "": + include ("../src/home.php"); + break; + default: + //battle history for this arena + $hist=get_battles_history($currentArena); + echo ''; + include ("../src/arenas/".$currentArena."/public.php"); + break; + } } + + ?>