AEOS Calvarium v0.4
This commit is contained in:
parent
821b405f5a
commit
57b531cb62
189 changed files with 3810 additions and 1417 deletions
68
lib/config.lib.php
Normal file → Executable file
68
lib/config.lib.php
Normal file → Executable file
|
|
@ -1,29 +1,53 @@
|
|||
<?php
|
||||
/* ***************************************************
|
||||
Listings des variables les plus utilisées sous AEOS.
|
||||
*************************************************** */
|
||||
if(empty($_GET['id'])){$id=1;} else {$id = $_GET['id'];}
|
||||
$dossier = preg_match("/admin/", $_SERVER['SCRIPT_FILENAME']) ? "../" : "";
|
||||
****************************************************/
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
|
||||
//Check Admin
|
||||
if (preg_match("/admin/", $_SERVER['SCRIPT_FILENAME']) || preg_match("/install/", $_SERVER['SCRIPT_FILENAME']))
|
||||
{
|
||||
$subdir = "../";
|
||||
//Sécurisation
|
||||
foreach ($_GET as $a => $b){$_[$a] = $b;}
|
||||
foreach ($_POST as $a => $b){$_[$a] = $b;}
|
||||
}
|
||||
else
|
||||
{
|
||||
$subdir = "";
|
||||
//Sécurisation
|
||||
foreach ($_GET as $a => $b){$_[$a] = CA20($b);}
|
||||
foreach ($_POST as $a => $b){$_[$a] = CA20($b);}
|
||||
}
|
||||
|
||||
// Lecture de toutes les pages
|
||||
$listing_pages = listing_dossier($subdir.'data/pages/');
|
||||
$nbPages = count($listing_pages);
|
||||
|
||||
// Attribution des IDs
|
||||
$lecture_pages = array();
|
||||
for($i=0; $i<$nbPages; ++$i)
|
||||
{
|
||||
$allid = explode('#', $listing_pages[$i]);
|
||||
$lecture_pages[$allid[0]] = substr($allid[0].'#'.$allid[1], 0, -4);
|
||||
}
|
||||
|
||||
// Attribution des ordres
|
||||
$ordre_pages = array();
|
||||
for($i=0; $i<$nbPages; ++$i)
|
||||
{
|
||||
$lecture_tmp = lecture_xml($subdir.'data/pages/'.$listing_pages[$i]);
|
||||
$ordre_pages[$lecture_tmp['page']['ordre']['#text']] = $listing_pages[$i];
|
||||
}
|
||||
|
||||
|
||||
// Lecture des fichiers de bases
|
||||
$config = lecture_xml($dossier.'data/config.xml');
|
||||
$data_pages = $dossier.'data/pages/';
|
||||
$page = lecture_xml($dossier.'data/pages/'.$id.'.xml');
|
||||
$config = lecture_xml($subdir.'data/config.xml');
|
||||
$data_pages = $subdir.'data/pages/';
|
||||
if (isset($redirect)) $id=$redirect; else if(empty($_GET['id'])) $id=$config['configuration']['accueil']['#text']; else $id = $_GET['id'];
|
||||
$page = lecture_xml($subdir.'data/pages/'.$lecture_pages[$id].'.xml');
|
||||
|
||||
// Variables utilisées fréquemments
|
||||
$SITE_NOM = $config['configuration']['nom_site']['#text'];
|
||||
$SITE_DESC = $config['configuration']['description_site']['#text'];
|
||||
$SITE_THEME = $config['configuration']['theme']['#text'];
|
||||
$SITE_MAINTENANCE = $config['configuration']['maintenance']['#text'];
|
||||
$SITE_MESSAGE = $config['configuration']['message']['#text'];
|
||||
$SITE_VERSION = $config['configuration']['version']['#text'];
|
||||
$SITE_FOOTER = $config['configuration']['footer']['#text'];
|
||||
|
||||
// Permet le référencement
|
||||
$PAGE_TITRE = $page['page']['nom']['#text']; unset($page);
|
||||
|
||||
// Information administration
|
||||
$ADMIN_MDP = $config['configuration']['mdp_admin']['#text'];
|
||||
$ADMIN_LOG = $config['configuration']['login_admin']['#text'];
|
||||
$ADMIN_EMAIL = $config['configuration']['email_admin']['#text'];
|
||||
// Admin
|
||||
if (isset($_['pid'])) $pid=$_['pid']; else $pid = 1;
|
||||
if (isset($_['sid'])) $sid=$_['sid']; else $sid = 1;
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue