1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TinyMCE -->
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
skin : "o2k7",
plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example word content CSS (should be your site CSS) this one removes paragraph margins
content_css : "css/word.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<?php
if (file_exists("../config/articles.xml")){
$doc2 = new DOMDocument();
$doc2->load('../config/articles.xml');
$blogs = $doc2->getElementsByTagName( "article" );
$i = 0;
foreach( $blogs as $blog ){
$y = $blog->getElementsByTagName( "id" );
$ide = $y->item(0)->nodeValue;
$x = $blog->getElementsByTagName( "titre" );
$tit = $x->item(0)->nodeValue;
$z = $blog->getElementsByTagName( "fichier" );
$txt = $z->item(0)->nodeValue;
if($_GET['id'] == $ide){
if (($_POST['ok'])==1){
$fp = fopen("../config/".$txt,"w"); // ouverture du fichier en écriture
$article = str_replace('\"',"'",$_POST['elm1']);
$article = str_replace("\'","'",$article);
//$article = str_replace('"href=\"',"href=",$article);
fwrite($fp, $article); // on écrit le nom et email dans le fichier
fclose($fp);
echo "<center>Enregistré !</center>";
}
if (!$fp = fopen("../config/".$txt,"r")) {
echo "Echec de l'ouverture du fichier";
exit;
}else{
while(!feof($fp)) {
// On récupère une ligne
$Ligne = fgets($fp,255);
// On stocke l'ensemble des lignes dans une variable
$Fichier .= $Ligne;
}
fclose($fp); // On ferme le fichier
}
?>
<form method="post" action="article.php?id=<?php echo $_GET['id']; ?>">
<div>
<center><table>
<tr>
<td>
Titre de l'article : <input type='text' id='title' name='title' value="<?php echo $tit; ?>"/></td>
</td>
</tr>
<tr>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
<td><div>
<textarea id="elm1" name="elm1" rows="30" cols="80" style="width: 25%" ><?php echo $Fichier; ?></textarea>
</div><td>
</tr>
<tr>
<td>
<input type="hidden" name="source" value"<?php echo $txt; ?>"/>
<input type="hidden" name="id" value="<?php echo $ide; ?>"/>
<input type="hidden" name="ok" value="1"/>
<center><input type="submit"/>
<input type="reset" name="reset" value="Reset" /></center></td>
</tr>
</table></center>
</div>
</form>
<?php
}}}
?> |
Partager