-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
49 lines (37 loc) · 1.25 KB
/
index.php
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
<?php
require 'vendor/autoload.php';
use Smarty\Smarty;
# Chargement de la configuration
require_once("config.inc.php");
date_default_timezone_set($date_timezone);
# Messages d'erreur
error_reporting(0);
if($debug) error_reporting(E_ALL);
# Chargement des fonctions
require_once("lib/images.php");
require_once("lib/sql.php");
require_once("lib/smarty.php");
# Lancement de la connexion MySQL
require_once("lib/connexion_mysql.php");
# Choix de la page
$p = isset($_GET['p']) ? $_GET['p'] : "welcome";
# Protection des acces
$page = "pages/" . preg_replace("[^a-z]", "", $p) . ".php";
if (file_exists($page) == false)
{
header("Location: /?p=notfound");
die();
}
# Template
$smarty = new Smarty();
$smarty->assign('p',$p);
$smarty->assign('id_saison',$iCurrentSaisonNumber);
$smarty->assign('mysqli',$mysqli);
$smarty->assign('table_comediens',$table_comediens);
$smarty->assign('display_recrutement_public',$display_recrutement_public);
$smarty->registerPlugin("function","photo_membre","photo_membre");
$smarty->registerPlugin("function","get_membre","get_membre");
$smarty->registerPlugin("function","get_membre_min","get_membre_min");
$smarty->registerPlugin("function","get_saison_string","get_saison_string");
require_once($page);
$smarty->display('index.tpl');