// // This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. // // To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ // // or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. // // Francais (brouillon): http://creativecommons.org/projects/international/fr/translated-license // ////////////////////////////////////////////////////////////////////////////////////////////////////// // En-têtes généraux // v0.2.0 $files = array("sessions","groupes","journal"); if(is_array($requiredFiles)) $requiredFiles = array_unique(array_merge($files,$requiredFiles)); if(is_array($requiredFiles)) { if(count($requiredFiles) < 1) $requiredFiles = $files; else $requiredFiles = array_unique(array_merge($files,$requiredFiles)); } include_once("includes.php"); function tag($tag,$valeur="",$sortie) { preg_match_all("/\[([^\[\n]*)\(".$tag."\)([^\]\n]*)\]/Ui",$sortie,$outt,PREG_SET_ORDER); for($i = 0; $i < count($outt); $i++) { if(empty($valeur)) $sortie = str_replace($outt[$i][0],"",$sortie); else $sortie = str_replace($outt[$i][0],$outt[$i][1].$valeur.$outt[$i][2],$sortie); } $sortie = str_replace($tag,htmlentities(stripslashes($valeur)),$sortie); return $sortie; } // Affichage d'une page function page($titre,$texte) { $file = $GLOBALS['css_general']."/template.html"; if(!file_exists($file)) $file = "lencrier/template.html"; $tpl = file($file); $tpl = implode("",$tpl); $tpl = str_replace("#TITRE",htmlentities(stripslashes($titre)),$tpl); $tpl = str_replace("#TEXTE",$texte,$tpl); $tpl = str_replace("#CSS_GENERAL",$GLOBALS['css_general'].".css",$tpl); $c_page = $GLOBALS['css_general']."/".$GLOBALS['css_page'].".css"; if(file_exists($c_page)) $css_page = ""; $tpl = str_replace("#CSS_PAGE",$css_page,$tpl); $total_time = Script_Timer::Get_Time(4); $tpl = str_replace("#TIME",$total_time,$tpl); $tpl = str_replace("#URL_SITE",$GLOBALS['cfg']['url'],$tpl); $tpl = str_replace("#NOM_SITE",htmlentities($GLOBALS['cfg']['titre']),$tpl); if($GLOBALS['sessions']->groupe['statut'] == "administrateur") $admin = "../admin/"; $tpl = tag("#ESPACE_ADMIN",$admin,$tpl); $titre = $GLOBALS['journal']->courant['titre']; if(empty($titre)) $titre = "Espace écriture"; $tpl = tag("#JOURNAL_TITRE",$titre,$tpl); $tpl = tag("#JOURNAL_URL",id2url($GLOBALS['journal']->courant['id']),$tpl); echo $tpl; mysql_close(); } function popup($titre,$texte) { echo '