<?php
/* This file is part of Madcollector.
* Madcollector created by Thomas Andrieu,
* Developped by Mickael Jardet and Thomas Andrieu.
* Madcollector is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* Madcollector is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
session_start(); // on démarre la session
ob_start();//Pour le PDF
?>
<?php
//defines divers
define("DATA", "data/");
define("LIBS", "libs/");
define("COVER","covers/kingsize");
define("PREVIEWCOVER","covers/thumbails");
require LIBS.'functions.php';
require LIBS.'classes/mysql.php';
require 'cfg/param.php'; // Fichiers de configuration
$myDB = new MYSQL(); // on ouvre une nouvelle instance
// penser à faire un test de connection
$link = $myDB -> connect($myHost, $myUser, $myPass, $myBase);
//Lang in mc_settings
if($_SESSION['lang']=="")
{
$requete_settings = 'SELECT * FROM mc_settings;';
$envoi_settings = $myDB->send_query($requete_settings);
$nb_occur = $myDB->num_rows();
if(($nb_occur != 0)&&($nb_occur != ""))
{
while($table_settings = $myDB->get_object($envoi_settings))
{
if($table_settings->setting_name =="default_language")
$_SESSION['lang']=$table_settings->setting_value;
}
}
//si malgré tout pas de langue par défaut, français
if($_SESSION['lang']=="")
$_SESSION['lang']="fr";
}
// Langue
if($_GET['lang']!=""){$_SESSION['lang']=$_GET['lang'];}
$lang=$_SESSION['lang'];
include 'locales/'.$lang.'/locale.'.$lang.".php"; // exemple "locales/fr/locale.fr ou fr est la variable $lang
// Pour faire plus 'secure' et faire plaisir au chef
$rub=$_GET['rub'];
// Tableau contenant les pages autorisées
$tableau = glob(DATA."*.inc.php");
if (isset($rub) && in_array(DATA.$rub . ".inc.php", $tableau)) {
$pageInclude = DATA.$rub.".inc.php";
}else{
$pageInclude = DATA."introduction.inc.php";
}
include $pageInclude;
?>
</div> <!-- fin de contenu (contents) -->
</div> <!-- fin de page -->
<div id="footer"><p>fin</p></div> <!-- fin de footer -->
</body>
</html>