function get_path_pages($page, $p404 = 1) { global $thisSite; if ($thisSite->pagesLoaded[$page] == "") { if (file_exists($thisSite->DOS_CLIENT . "_pages/" . $page)) { $thisSite->pagesLoaded[$page] = $thisSite->DOS_CLIENT . "_pages/" . $page; } else { if (file_exists($thisSite->DOS_CLIENT . "_pages_std/" . $page)) { $thisSite->pagesLoaded[$page] = $thisSite->DOS_CLIENT . "_pages_std/" . $page; } else { if ($p404 == 1) { $thisSite->pagesLoaded[$page] = get_path_pages("404.php"); } else { $thisSite->pagesLoaded[$page] = ""; } } } } return $thisSite->pagesLoaded[$page]; }
if (file_exists($path_to_racine . $thisSite->DOS_BASE . "lang/" . $thisSite->current_lang . ".php")) { include $path_to_racine . $thisSite->DOS_BASE . "lang/" . $thisSite->current_lang . ".php"; } if (file_exists($path_to_racine . $thisSite->DOS_CLIENT . "lang/" . $thisSite->current_lang . ".php")) { include $path_to_racine . $thisSite->DOS_CLIENT . "lang/" . $thisSite->current_lang . ".php"; } $datas_lang = array_merge($thisSite->intitulesLang, $datas_lang); $smarty->assign("datas_lang", $datas_lang); // GESTION STATUT DU SITE if (!isset($_SESSION["login_OK"]) || !isset($_SESSION["is_logged_OK"]) || $_SESSION["is_logged_OK"] != "oui" || $_SESSION["nom_OK"] == "" || $_SESSION["id_OK"] == "" || $_SESSION["privilege_OK"] == "") { if ($thisSite->statut == "C") { include_once get_path_pages("site_en_construction.php"); exit; } if ($thisSite->statut == "D") { include_once get_path_pages("site_en_demonstration.php"); exit; } } // META TAGS $thisSite->metaTags = array(); $thisSite->metaTags["title"] = $thisSite->getDatasPage("", "", "", "page_tag_title") . $thisSite->suffixeTitle; $thisSite->metaTags["keywords"] = $thisSite->getDatasPage("", "", "", "page_tag_keywords"); $thisSite->metaTags["description"] = $thisSite->getDatasPage("", "", "", "page_tag_description"); $thisSite->metaTags["robots"] = $thisSite->getDatasPage("", "", "", "page_tag_robots"); // pour les reseaux sociaux $thisSite->socialTags = array(); $thisSite->socialTags["titre"] = urlencode($thisSite->metaTags["title"]); $thisSite->socialTags["image"] = $thisSite->RACINE . $thisSite->socialImage; $thisSite->socialTags["texte"] = urlencode($thisSite->metaTags["description"]); $thisSite->socialTags["lien"] = $thisSite->DOMAINE . $_SERVER["REQUEST_URI"];
<?php $fichier_php = implode("/", $thisSite->current_tab_paths); $script_php = get_path($fichier_php, 0); if ($script_php == "") { $script_php = get_path_pages($fichier_php, 0); } if ($script_php == "") { $script_php = $fichier_php; } if (!file_exists($script_php) || $script_php == "") { $thisSite->current_scriptPHP = get_path_pages("404.php", 0); config_404("index-php.php: page_php inconnue: " . $thisSite->RACINE . $script_php); } else { $thisSite->current_scriptPHP = $script_php; } $thisSite->current_scriptTPL = remove_extension($thisSite->current_scriptPHP) . ".tpl"; include_once $thisSite->DOS_BASE_INIT . "init_commun.php"; // initialisation commune à tout les types de page include $thisSite->current_scriptPHP; $smarty->assign("thisSite", $thisSite); $_SESSION["thisSite"] = serialize($thisSite); if (file_exists($thisSite->current_scriptTPL)) { $smarty->display($thisSite->current_scriptTPL); }
} $thisSite->page = $thisSite->pages[$thisSite->idPage]; //////////// if ($thisSite->current_scriptPHP == "") { $thisSite->current_scriptPHP = "404.php"; config_404("index-nophp.php: page_php==''"); } $fichier_php = get_path_pages($thisSite->current_scriptPHP, 0); if ($fichier_php == "") { $thisSite->current_scriptTPL = ""; } // Templating if ($thisSite->current_scriptTPL == "") { $thisSite->current_scriptTPL = remove_extension($fichier_php) . ".tpl"; } else { $thisSite->current_scriptTPL = get_path_pages($thisSite->current_scriptTPL, 0); } $my_cache_id = $thisSite->current_lang . "_" . implode($thisSite->current_tab_paths, "_"); $my_cache_id = md5($my_cache_id); if ($thisSite->current_scriptTPL == "") { $isCached = 0; } else { $isCached = $smarty->isCached($thisSite->current_scriptTPL, $my_cache_id); } // Ne pas mettre plus loin $smarty->assign("thisSite", $thisSite); if ($isCached == 0) { $datas_page = array(); include_once $thisSite->DOS_BASE_INIT . "init_commun.php"; // initialisation commune à tout les types de page @(include_once $thisSite->DOS_BASE_INIT . $thisSite->current_typePage . ".php");