[go: up one dir, main page]

Menu

[r5]: / index.php  Maximize  Restore  History

Download this file

119 lines (101 with data), 4.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?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_once LIBS.('xajax.inc.php');
$xajax = new xajax();
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);
//Desactivation des magic_quotes (cf problemes free.fr)
set_magic_quotes_runtime(FALSE);
if (get_magic_quotes_gpc()) {
$_SERVER = stripslashes_array($_SERVER);
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
$_COOKIE = stripslashes_array($_COOKIE);
$_FILES = stripslashes_array($_FILES);
$_ENV = stripslashes_array($_ENV);
$_REQUEST = stripslashes_array($_REQUEST);
$HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS);
$HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS);
$HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS);
$HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES);
$HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS);
if (isset($_SESSION)) { #These are unconfirmed (?)
$_SESSION = stripslashes_array($_SESSION, '');
$HTTP_SESSION_VARS = stripslashes_array($HTTP_SESSION_VARS, '');
}
}
//Getting main settings
$table_settings = array();
$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($lec_settings = $myDB->get_object($envoi_settings))
{
$table_settings[$lec_settings->setting_name]=$lec_settings->setting_value;
}
}
//Language in mc_settings
if($_SESSION['lang']=="")
{
$_SESSION['lang']=$table_settings["default_language"];
//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");
$tableau=array();
//free.fr ne supporte pas la fonction glob()
if ($dh = opendir(DATA))
{
while (($file = readdir($dh)) !== false)
if (substr($file, strlen($file) - 8) == '.inc.php')
array_push($tableau, DATA.$file);
}
closedir($dh);
//End unsupported glob()
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">fin</div> <!-- fin de footer -->
</body>
</html>