commit
ac30b1a1f2
|
@ -86,7 +86,8 @@ if($currentArena == ""){
|
|||
<body>
|
||||
<header>
|
||||
<h1><?php echo $siteTitle; ?></h1>
|
||||
<nav id="languages"><a href="-fr">fr</a> <a href="-en">en</a></nav>
|
||||
|
||||
<nav id="languages"><a href="<?php echo $currentArena; ?>-fr">fr</a> <a href="<?php echo $currentArena; ?>-en">en</a></nav>
|
||||
<nav id="menus"><a href="/"<?php if($currentArena == "") echo ' class="selected"'; ?>><?php echo $lang['HOME']; ?></a>
|
||||
<?php
|
||||
foreach($arenas as $arena){
|
||||
|
@ -103,7 +104,7 @@ if($currentArena == ""){
|
|||
<?php
|
||||
switch($currentArena){
|
||||
case "":
|
||||
echo "<h2>Accueil</h2>";
|
||||
include ("../src/home.php");
|
||||
break;
|
||||
default:
|
||||
include ("../src/arenas/".$currentArena."/public.php");
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
$lang=array(
|
||||
'SITE_NAME' => 'Arène à bots',
|
||||
'SITE_DESCRIPTION' => 'blah blah blah mais en francais',
|
||||
'SITE_DESCRIPTION' =>
|
||||
'<p>Bienvenue sur cette arène à bots.<br/>
|
||||
Plusieurs jeux sont proposés ici. Vous ne devez pas y jouer, mais dévolopper le "bot" qui jouera en votre nom.
|
||||
Ce site permet de faire s\'affronter les bots des différents développeurs.</p>',
|
||||
'HOME' => 'accueil'
|
||||
);
|
7
src/config.php
Normal file
7
src/config.php
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
$mysqlParams=array(
|
||||
'host' => 'localhost',
|
||||
'user' => '',
|
||||
'pass' => '',
|
||||
'database'=>''
|
||||
);
|
|
@ -56,15 +56,13 @@ function get_language_array(){
|
|||
|
||||
$langsAvailable=array('fr','en');
|
||||
$language="";
|
||||
if( isset($_GET['lang']) ){
|
||||
|
||||
$lang = $_GET['lang'];
|
||||
if( isset($_GET['lang']) ){
|
||||
|
||||
$language = $_GET['lang'];
|
||||
setcookie( 'lang', $language, time() + 60*60*24*30 );
|
||||
|
||||
}elseif( isset($_COOKIE['lang']) ){
|
||||
|
||||
$language=$_COOKIE['lang'];
|
||||
|
||||
}else{
|
||||
|
||||
if(in_array(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2),$langsAvailable)){
|
||||
|
|
2
src/home.php
Normal file
2
src/home.php
Normal file
|
@ -0,0 +1,2 @@
|
|||
<?php
|
||||
echo $lang['SITE_DESCRIPTION'];
|
Loading…
Reference in New Issue
Block a user