query("SELECT Langage, Msg, Theme, Titresite FROM ".$configuration['prefix']."_vars"); list($Langage, $Msg, $Theme, $TitreSite) = mysql_fetch_array($db->query); # Langage require ('../langages/'.$Langage); # HTML echo ''; $template =& new Templates(); $template->SetFile('../templates/head_admin.tpl'); $template->Read(); $template->SetEntry = array('js' => '../', 'css' => '../templates', 'titresite' => $TitreSite, 'theme' => $Theme); $template->SetEntry(); # Affichage if (isset($_GET['id']) && is_numeric($_GET['id'])) { $db->query("SELECT Text, Pseudo FROM ".$configuration['prefix']."_msg WHERE Id = ".$_GET['id']); list($text, $pseudo) = mysql_fetch_array($db->query); $bodytemplate =& new Templates; $bodytemplate->SetFile('../templates/'.$Theme.'/edit.tpl'); $bodytemplate->Read(); $bodytemplate->SetVars = array('auteur' => 'pseudo', 'body'); $bodytemplate->SetVars(); $text = str_replace('src="tinymce/jscripts/tiny_mce/plugins/emotions/images/', 'src="../tinymce/jscripts/tiny_mce/plugins/emotions/images/', $text); $bodytemplate->SetEntry = array('id' => $_GET['id'], 'i' => 1, 'text' => $text, 'pseudo' => htmlspecialchars($pseudo, ENT_QUOTES)); $bodytemplate->SetEntry(); $msgedit = $bodytemplate->read[0]; $template->SetFile('../templates/'.$Theme.'/admin_directedit.tpl'); $template->Read(); $template->SetEntry = array('listmsgtoedit' => $msgedit); $template->SetEntry(count($template->read)-1); $template->SetVars = array('quit', 'messages', 'edit'); $template->SetVars(count($template->read)-1); $template->Write(); } $db->close(); ?>