p
This commit is contained in:
parent
e2987ed71c
commit
2f3da7731a
|
@ -18,9 +18,28 @@ require_once("../src/functions.php");
|
|||
|
||||
$arenas=get_arenas_list();
|
||||
$lang=get_language_array();
|
||||
|
||||
|
||||
if(isset($_GET['arena'])){
|
||||
//check if arena is list
|
||||
$currentArena = false;
|
||||
foreach($arenas as $arena){
|
||||
if($arena['id'] == $GET['arena']){
|
||||
$currentArena = $GET['arena'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$currentArena){
|
||||
error("Wrong parameter");
|
||||
die;
|
||||
}
|
||||
}else{
|
||||
$currentArena = "";
|
||||
}
|
||||
|
||||
|
||||
//form submitting
|
||||
if (isset($_POST['xd_check']))
|
||||
{
|
||||
if (isset($_POST['xd_check'])){
|
||||
//vérifier le numero de formulaire
|
||||
if (($_SESSION['xd_check']!=$_POST['xd_check']) AND ($_POST['xd_check'] !="")){
|
||||
erreur ('Something wrong has appen');
|
||||
|
@ -51,7 +70,18 @@ if (isset($_POST['xd_check']))
|
|||
<body>
|
||||
|
||||
<header>
|
||||
<nav id="languages"><a href="/fr">fr</a> <a href="/en">en</a></nav>
|
||||
<nav id="languages"><a href="-fr">fr</a> <a href="-en">en</a></nav>
|
||||
<nav id="menus"><a href="/"><?php echo $lang['HOME']; ?></a>
|
||||
<?php
|
||||
foreach($arenas as $arena){
|
||||
if( $arena['id'] == $currentArena){
|
||||
$class="selected";
|
||||
}else{
|
||||
$class="";
|
||||
}
|
||||
echo '<a href="'.$arena['url'].'" class="'.$class.'">'.$arena['title'].'</a>';
|
||||
}
|
||||
?>
|
||||
<h1><?php
|
||||
if(isset($arenas['current'])){
|
||||
echo $arenas['current']['title'];
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
$lang=array(
|
||||
'SITE_NAME' => 'Artificials Intelligences\' arena',
|
||||
'SITE_DESCRIPTION' => 'blah blah blah but english'
|
||||
'SITE_DESCRIPTION' => 'blah blah blah but english',
|
||||
'HOME' => 'Home page'
|
||||
);
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
$lang=array(
|
||||
'SITE_NAME' => 'Arène pour intelligences (ou persque) artificielles',
|
||||
'SITE_DESCRIPTION' => 'blah blah blah mais en francais'
|
||||
'SITE_DESCRIPTION' => 'blah blah blah mais en francais',
|
||||
'HOME' => 'accueil'
|
||||
);
|
|
@ -1,14 +1,6 @@
|
|||
<?php
|
||||
function get_arenas_list(){
|
||||
include (__DIR__."/arenas_lists.php");
|
||||
if(isset($_GET['arena'])){
|
||||
foreach ($arenas as $arena){
|
||||
if($arena['id'] == $_GET['arena']){
|
||||
$arenas['current'] = $arena;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $arenas;
|
||||
}
|
||||
function rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'){
|
||||
|
|
Loading…
Reference in New Issue
Block a user