diff --git a/html/.htaccess b/html/.htaccess
index aa02c20..557713c 100644
--- a/html/.htaccess
+++ b/html/.htaccess
@@ -6,6 +6,7 @@ RewriteRule ^p/(.*)-([a-z]{2})$ index\.php?page=$1&lang=$2 [L]
RewriteRule ^p/(.*)$ index\.php?page=$1 [L]
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,})/scores$ index\.php?scores=$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]
diff --git a/html/index.php b/html/index.php
index 718733c..f20475e 100644
--- a/html/index.php
+++ b/html/index.php
@@ -41,50 +41,10 @@ if(isset($_GET['arena'])){
error(404,"Wrong parameter");
die;
}
- $hist=get_battles_history($currentArena);
-
$siteTitle=$currentArenaArr['title'];
$siteDescription=$currentArenaArr['metaDescription'];
$mainSectionScript="../src/arenas/".$currentArena."/public.php";
- $asideSectionContent='
infos:
'.$lang['DEV-YOUR-OWN-BOT'].'
'.$lang['DOC_SPECS_LINKS'].'
- Scores
';
-
- $podium=ELO_get_podium($currentArena);
- $count=0;
- $asideSectionContent.='';
- foreach($podium as $sc){
- $count++;
-
- switch($count){
- case 1:
- $img='';
- break;
- case 2:
- $img='';
- break;
- case 3:
- $img='';
- break;
- default:
- $img='';
- break;
-
-
- }
-
- $asideSectionContent.='- '.$img.' '.htmlentities($sc['name']).' ELO rank: '.$sc['ELO'].'
';
- }
- $asideSectionContent.='
Détail des matchs
';
-
- foreach($hist as $sc){
- $asideSectionContent.='
-
- - '.$sc['bot1']." ".$lang['VICTORIES'].":".$sc['player1Wins'].'
- - '.$sc['bot2']." ".$lang['VICTORIES'].":".$sc['player2Wins'].'
- - '.$lang['DRAW'].":".$sc['draws'].'
-
';
- }
-
+ $asideSectionContent= get_default_aside_content($currentArena);
$cssAdditionalScript="";
if(isset($currentArenaArr['cssFile'])){
$cssAdditionalScript.='";
@@ -112,16 +72,41 @@ if(isset($_GET['arena'])){
error(404,"Wrong parameter");
die;
}
- $siteTitle="Specifications ".$currentArenaArr['title'];
- $siteDescription="documentation, faites votre propre bot pour ".$currentArenaArr['metaDescription'];
- $mainSectionScript="../src/arenas/".$currentArenaArr['id']."/doc-".$lang['lang'].".html";
- $asideSectionContent=''; //to do
- $cssAdditionalScript="";
+ $siteTitle = "Specifications ".$currentArenaArr['title'];
+ $siteDescription = "documentation, faites votre propre bot pour ".$currentArenaArr['metaDescription'];
+ $mainSectionScript = "../src/arenas/".$currentArenaArr['id']."/doc-".$lang['lang'].".html";
+ $asideSectionContent = get_default_aside_content($currentArena);
+ $cssAdditionalScript = "";
if(isset($currentArenaArr['cssFile'])){
$cssAdditionalScript.='";
}
$jsAdditionalScript="";
+}elseif(isset($_GET['scores'])){
+ //check if arena exists
+ $currentArena = false;
+ foreach($arenas as $arena){
+ if($arena['id'] == $_GET['scores']){
+ $currentArena = $_GET['scores'];
+ $currentArenaArr=$arena;
+ break;
+ }
+ }
+ if(!$currentArena){
+ error(404,"Wrong parameter");
+ die;
+ }
+
+ $siteTitle="détail des combats ".$currentArenaArr['title'];
+ $siteDescription="scores ".$currentArenaArr['metaDescription'];
+ $mainSectionScript="../src/scores.php";
+ $asideSectionContent=get_default_aside_content($currentArena);
+ $cssAdditionalScript="";
+ $jsAdditionalScript="";
+
+
+ //to do !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
}elseif(isset($_GET['page'])){
//simple page
switch($_GET['page']){
diff --git a/html/style.css b/html/style.css
index 73703e7..ea3fe42 100644
--- a/html/style.css
+++ b/html/style.css
@@ -107,6 +107,7 @@ pre{
.podium{list-style-type:none;padding: 5px 20px 5px 0;}
.podium li{padding: 5px 20px 5px 0;}
.podium li img {height: 50px; vertical-align:middle;}
+.hidden{display:none;}
@media screen and (max-width: 800px){
aside, article{display: block; width: 100%; border-right:none;}
diff --git a/src/functions.php b/src/functions.php
index 17f6830..0ea3b07 100644
--- a/src/functions.php
+++ b/src/functions.php
@@ -293,7 +293,37 @@ function get_unique_id(){
fclose($fp);
return $count;
}
-
+function get_default_aside_content($currentArena){
+ global $lang;
+ $asideSectionContent='infos:
'.$lang['DEV-YOUR-OWN-BOT'].'
'.$lang['DOC_SPECS_LINKS'].'
+ Scores
';
+
+ $podium=ELO_get_podium($currentArena);
+ $count=0;
+ $asideSectionContent.='';
+ foreach($podium as $sc){
+ $count++;
+
+ switch($count){
+ case 1:
+ $img='';
+ break;
+ case 2:
+ $img='';
+ break;
+ case 3:
+ $img='';
+ break;
+ default:
+ $img='';
+ break;
+ }
+
+ $asideSectionContent.='- '.$img.' '.htmlentities($sc['name']).' ELO rank: '.$sc['ELO'].'
';
+ }
+ $asideSectionContent.='
Détail des matchs >>
';
+ return $asideSectionContent;
+}
function does_arena_exist($string,$arenasArr){
foreach($arenasArr as $arena){
if($string == $arena['id']){
diff --git a/src/scores.php b/src/scores.php
new file mode 100644
index 0000000..34a6841
--- /dev/null
+++ b/src/scores.php
@@ -0,0 +1,12 @@
+
+
+ - '.$sc['bot1']." ".$lang['VICTORIES'].":".$sc['player1Wins'].'
+ - '.$sc['bot2']." ".$lang['VICTORIES'].":".$sc['player2Wins'].'
+ - '.$lang['DRAW'].":".$sc['draws'].'
+
';
+}
\ No newline at end of file