Mirari
Accès à un fichier
File: index.php - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off

<?php

// CLASSES
require './classes/smarty/Smarty.class.php';
require './classes/sql.class.php';

// FICHIERS DE CONFIGURATION
require './config.base.php';
require './config.inc.php';

// INITIALISATION
session_start();
$sm = new Smarty;
$sm->caching = 0;
$sm->compile_check = TRUE;
$sm->debugging = FALSE;
$sm->template_dir = './template/templates';
$sm->compile_dir = './template/templates_c';
$sm->cache_dir = './template/cache';
$sm->config_dir = './template/configs';

$sm->assign('url', $_CONFIG['urlSite']);

$db = new sql($_CONFIG['hote'], $_CONFIG['utilisateur'], $_CONFIG['motDePasse'], $_CONFIG['base']);

$time = time();

// FONCTIONS
require './functions/secure.php';
require './functions/checkLogin.php';
require './functions/avatar.php';

// SECURISATION DES DONNEES POST ET GET
foreach($_GET as $key => $value) {
    $var = 'g' . $key;
    $$var = secure($value);
}
foreach($_POST as $key => $value) {
    $var = 'p' . $key;
    if ($key != 'cName') { $$var = secure($value); }
    else { $$var = $value; }
}

// SELECTION DU MODULE
$dossier = 'modules/';
$defaut = 'home.php';
$fichiers = glob($dossier . '*.php');
if (isset($gp))
{
    $fichier = $gp;
   
    if (in_array($dossier . $fichier . '.php', $fichiers) == TRUE) { include($dossier . $fichier . '.php'); }
    else { include($dossier . $defaut); }
}

else { include($dossier . $defaut); }

// ADMIN TASK //
$sql = "SELECT COUNT(*) AS nombre FROM members WHERE status='0'";
$members = $db->sql_query($sql, TRUE);

$sql = "SELECT COUNT(*) AS nombre FROM applications WHERE status='1'";
$applications = $db->sql_query($sql, TRUE);

$sm->assign('adminTasks', $members['nombre'] + $applications['nombre']);

$sm->assign('config', $_CONFIG);

$sm->assign('lvl', $_SESSION['access']);
$sm->assign('uID', $_SESSION['uID']);
$sm->assign('titre', $_CONFIG['titreSite']);
$sm->assign('altTitre', $titrePage);
$sm->assign('page', $page);
$sm->display('main.tpl');

?>

Cet affichage est obtenu après traitement par le site et peut ne pas correspondre à l'état original du fichier
© r3c 2011 :: 3 ms