diff --git a/ecrire/aide_droite.php3 b/ecrire/aide_droite.php3
deleted file mode 100644
index ffc88bf1020a6657d7b5b6ea377ca620d85d2ea0..0000000000000000000000000000000000000000
--- a/ecrire/aide_droite.php3
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-
-include ("inc_version.php3");
-
-// Recuperer les infos de langue (preferences auteur), si possible
-if (@file_exists("inc_connect.php3")) {
-	include_ecrire ("inc_auth.php3");
-}
-
-include_ecrire ("inc_lang.php3");
-utiliser_langue_visiteur();
-if ($var_lang) changer_langue($var_lang);
-
-// Selection du fichier d'aide correspondant a la langue
-function fichier_aide($lang_aide) {
-	if (@file_exists($fichier_aide = "AIDE/$lang_aide/aide")) 
-		return array($fichier_aide, $lang_aide);
-	else	// reduction ISO du code langue oc_prv_ni => oc_prv => oc
-		if (ereg("(.*)_", $lang_aide, $regs))
-			return fichier_aide($regs[1]);
-
-	return false;
-}
-
-if (!$aide) $aide = 'spip';
-$lang_aide = $spip_lang;
-
-// Recuperation du contenu de l'aide demandee
-list($fichier_aide, $l) = fichier_aide($lang_aide);
-if (!$fichier_aide)
-	$html = _T('aide_non_disponible');
-else {
-	if ($var_lang) {
-		$lastmodified = filemtime($fichier_aide);
-		$headers_only = http_last_modified($lastmodified);
-		if ($headers_only) exit;
-	}
-	
-	$html = join('', file($fichier_aide));
-	$html = substr($html, strpos($html,"<$aide>") + strlen("<$aide>"));
-	$html = substr($html, 0, strpos($html, "</$aide>"));
-
-	// Localisation des images de l'aide (si disponibles)
-	$suite = $html;
-	$html = "";
-	while (ereg("AIDE/([-_a-zA-Z0-9]+\.(gif|jpg))", $suite, $r)) {
-		$f = $r[1];
-		if (@file_exists("AIDE/$l/$f")) $f = "$l/$f";
-		else if (@file_exists("AIDE/fr/$f")) $f = "fr/$f";
-		$p = strpos($suite, $r[0]);
-		$html .= substr($suite, 0, $p) . "AIDE/$f";
-		$suite = substr($suite, $p + strlen($r[0]));
-	}
-	$html .= $suite;
-}
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<style type="text/css"><!--
-.spip_cadre {
-	width : 100%;
-	background-color: #FFFFFF;
-	padding: 5px;
-}
-.spip_quote {
-	margin-left : 40px;
-	margin-top : 10px;
-	margin-bottom : 10px;
-	border : solid 1px #aaaaaa;
-	background-color: #dddddd;
-	padding: 5px;
-}
-
-a {text-decoration: none;}
-a:hover {color:#FF9900; text-decoration: underline;}
-
-body {
-	font-family: Georgia, Garamond, Times New Roman, serif;
-}
-h3.spip {
-	font-family: Verdana,Arial,Sans,sans-serif;
-	font-weight: bold;
-	font-size: 115%;
-	text-align: center;
-}
-
-table.spip {
-}
-
-table.spip tr.row_first {
-	background-color: #FCF4D0;
-}
-
-table.spip tr.row_odd {
-	background-color: #C0C0C0;
-}
-
-table.spip tr.row_even {
-	background-color: #F0F0F0;
-}
-
-table.spip td {
-	padding: 1px;
-	text-align: left;
-	vertical-align: center;
-}
-
---></style>
-</head>
-<?php
-
-include_ecrire ("inc_texte.php3");
-include_ecrire ("inc_filtres.php3");
-
-echo '<body bgcolor="#FFFFFF" text="#000000" TOPMARGIN="24" LEFTMARGIN="24" MARGINWIDTH="24" MARGINHEIGHT="24"';
-if ($spip_lang_rtl)
-	echo " dir='rtl'";
-echo " lang='$lang_aide'>";
-
-if ($aide == 'spip') {
-	echo '<TABLE BORDER=0 WIDTH=100% HEIGHT=60%>
-<TR WIDTH=100% HEIGHT=60%>
-<TD WIDTH=100% HEIGHT=60% ALIGN="center" VALIGN="middle">
-
-<CENTER>
-<img src="img_pack/logo-spip.gif" alt="SPIP" width="300" height="170" border="0">
-</CENTER>
-
-</TD></TR></TABLE>';
-}
-
-// hack pour que la langue de typo() soit celle de l'aide en ligne
-$spip_lang = $lang_aide;
-
-$html = justifier(propre($html)."<p>");
-// Remplacer les liens externes par des liens ouvrants (a cause des frames)
-$html = ereg_replace('<a href="(http://[^"]+)"([^>]*)>', '<a href="\\1"\\2 target="_blank">', $html);
-
-echo $html;
-echo "<font size=2>$les_notes</font><p>";
-
-?>
-
-
-</body>
-</html>
diff --git a/ecrire/aide_gauche.php3 b/ecrire/aide_gauche.php3
deleted file mode 100644
index 3984000419739c180e6691a38648618d71cf6fd2..0000000000000000000000000000000000000000
--- a/ecrire/aide_gauche.php3
+++ /dev/null
@@ -1,264 +0,0 @@
-<?php
-
-include ("inc_version.php3");
-
-if ($var_lang) {
-	$lastmodified = filemtime("aide_gauche.php3");
-	$headers_only = http_last_modified($lastmodified, time() + 24 * 3600);
-	if ($headers_only) exit;
-}
-
-if (@file_exists($flag_ecrire ? "inc_connect.php3" : "ecrire/inc_connect.php3")) {
-	include_ecrire("inc_auth.php3");
-	$aide_statut = ($connect_statut == '1comite') ? 'redac' : 'admin';
-}
-else $aide_statut = 'admin';
-
-include_ecrire("inc_lang.php3");
-utiliser_langue_visiteur();
-if ($var_lang) changer_langue($var_lang);
-
-include_ecrire("inc_layer.php3");
-
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<style type="text/css">
-<!--
-	a {text-decoration: none; }
-	A:Hover {text-decoration: underline;}
-
-	.article-inactif {
-		float: <?php echo $spip_lang_left; ?>;
-		text-align: <?php echo $spip_lang_left; ?>;
-		width: 80%;
-		background: url(img_pack/triangle<?php echo $spip_lang_rtl; ?>.gif) <?php echo $spip_lang_left; ?> center no-repeat;
-		margin: 2px;
-		padding: 0px;
-		padding-<?php echo $spip_lang_left; ?>: 20px;
-		font-family: Arial, Sans, sans-serif;
-		font-size: 12px;
-	}
-	.article-actif {
-		float: <?php echo $spip_lang_right; ?>;
-		text-align: <?php echo $spip_lang_right; ?>;
-		width: 80%;
-		background: url(img_pack/triangle<?php echo $spip_lang_rtl; ?>.gif) <?php echo $spip_lang_right; ?> center no-repeat;
-		margin: 4px;
-		padding: 0px;
-		padding-<?php echo $spip_lang_right; ?>: 20px;
-		font-family: Arial, Sans, sans-serif;
-		font-size: 12px;
-		font-weight: bold;
-		color: black;
-	}
-	.article-actif:hover {
-		text-decoration: none;
-	}
-	.rubrique {
-		width: 90%;
-		margin: 0px;
-		margin-top: 6px;
-		margin-bottom: 4px;
-		padding: 4px;
-		font-family: Trebuchet MS, Arial, Sans, sans-serif;
-		font-size: 13px;
-		font-weight: bold;
-		color: black;
-		background-color: #EEEECC;
-		-moz-border-radius: 4px;
-	}
--->
-</style>
-<script type='text/javascript'><!--
-var curr_article;
-function activer_article(id) {
-	if (curr_article)
-		document.getElementById(curr_article).className = 'article-inactif';
-	if (id) {
-		document.getElementById(id).className = 'article-actif';
-		curr_article = id;
-	}
-}
-//--></script>
-<?php afficher_script_layer(); ?>
-</head>
-
-<body bgcolor="#FFFFFF" text="#000000" link='#E86519' vlink='#6E003A' alink='#FF9900' TOPMARGIN="5" LEFTMARGIN="5" MARGINWIDTH="5" MARGINHEIGHT="5"<?php
-	if ($spip_lang_rtl)
-		echo " dir='rtl'";
-		echo " lang='$lang_aide'>";
-
-function rubrique($titre, $statut = "redac") {
-	global $ligne_rubrique;
-	global $block_rubrique;
-	global $titre_rubrique;
-	global $afficher_rubrique, $ouvrir_rubrique;
-	global $larubrique;
-
-	global $aide_statut;
-
-	$afficher_rubrique = 0;
-
-	if (($statut == "admin" AND $aide_statut == "admin") OR ($statut == "redac")) {
-		$larubrique++;
-		$titre_rubrique = $titre;
-		$ligne_rubrique = array();
-		$block_rubrique = "block$larubrique";
-		$afficher_rubrique = 1;
-		$ouvrir_rubrique = 0;
-	}
-}
-
-function fin_rubrique() {
-	global $ligne_rubrique;
-	global $block_rubrique;
-	global $titre_rubrique;
-	global $afficher_rubrique, $ouvrir_rubrique;
-	global $texte;
-
-	if ($afficher_rubrique && count($ligne_rubrique)) {
-		echo "<div class='rubrique'>";
-		if ($ouvrir_rubrique)
-			echo bouton_block_visible($block_rubrique);
-		else 
-			echo bouton_block_invisible($block_rubrique);
-		echo $titre_rubrique;
-		echo "</div>\n";
-		if ($ouvrir_rubrique)
-			echo debut_block_visible($block_rubrique);
-		else
-			echo debut_block_invisible($block_rubrique);
-		echo "\n";
-		reset($ligne_rubrique);
-		while (list(, $ligne) = each($ligne_rubrique)) {
-			echo $texte[$ligne];
-		}
-		echo fin_block();
-		echo "\n\n";
-	}
-}
-
-function article($titre, $lien, $statut = "redac") {
-	global $aide;
-	global $ligne;
-	global $ligne_rubrique;
-	global $rubrique;
-	global $texte;
-	global $afficher_rubrique, $ouvrir_rubrique;
-	global $aide_statut;
-	global $spip_lang;
-
-	if ($afficher_rubrique AND (($statut == "admin" AND $aide_statut == "admin") OR ($statut == "redac"))) {
-		$ligne_rubrique[] = ++$ligne;
-		
-		$texte[$ligne] = '';
-		$id = "ligne$ligne";
-		$url = "aide_droite.php3?aide=$lien&var_lang=$spip_lang";
-		if ($aide == $lien) {
-			$ouvrir_rubrique = 1;
-			$class = "article-actif";
-			$texte[$ligne] .= "<script type='text/javascript'><!--\ncurr_article = '$id';\n// --></script>\n";
-		}
-		else {
-			$class = "article-inactif";
-		}
-		$texte[$ligne] .= "<a class='$class' id='$id' href='$url' target='droite' ".
-			"onClick=\"activer_article('$id');return true;\">$titre</a><br style='clear:both;'>\n";
-	}
-}
-
-
-rubrique(_T('menu_aide_installation_spip'),"admin");
-article(_T('menu_aide_installation_reactuliser_droits'), "install0", "admin");
-article(_T('menu_aide_installation_connexion_mysql'), "install1", "admin");
-article(_T('menu_aide_installation_choix_base'), "install2", "admin");
-article(_T('menu_aide_installation_informations_personnelles'), "install5", "admin");
-article(_T('menu_aide_installation_ftp'), "ftp_auth", "admin");
-article(_T('menu_aide_installation_probleme_squelette'), "erreur_mysql", "admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_articles'));
-article(_T('menu_aide_articles_raccourcis_typo'),"raccourcis");
-article(_T('menu_aide_articles_titres'),"arttitre");
-article(_T('menu_aide_articles_choix_rubrique'),"artrub");
-article(_T('menu_aide_articles_descriptif_rapide'),"artdesc");
-article(_T('menu_aide_articles_chapeau'),"artchap");
-article(_T('menu_aide_articles_redirection'),"artvirt","admin");
-article(_T('menu_aide_articles_texte'),"arttexte");
-article(_T('menu_aide_articles_date'),"artdate");
-article(_T('menu_aide_articles_date_anterieure'),"artdate_redac");
-article(_T('menu_aide_articles_auteurs'),"artauteurs");
-article(_T('menu_aide_articles_logos'),"logoart","admin");
-article(_T('menu_aide_articles_statut'),"artstatut");
-article(_T('menu_aide_articles_proposer'),"artprop");
-article(_T('menu_aide_articles_en_cours_modification'),"artmodif");
-fin_rubrique();
-
-rubrique(_T('menu_aide_rubriques'));
-article(_T('menu_aide_rubriques_structure'),"rubhier");
-article(_T('menu_aide_rubriques_choix'),"rubrub","admin");
-article(_T('menu_aide_rubriques_logo'),"rublogo","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_breves'));
-article(_T('menu_aide_breves_breves'),"breves");
-article(_T('menu_aide_breves_choix'),"brevesrub");
-article(_T('menu_aide_breves_lien'),"breveslien");
-article(_T('menu_aide_breves_statut'),"brevesstatut","admin");
-article(_T('menu_aide_breves_logo'),"breveslogo","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_images_doc'));
-article(_T('menu_aide_images_doc_inserer'),"ins_img");
-article(_T('menu_aide_images_doc_joindre'),"ins_doc");
-article(_T('menu_aide_images_doc_ftp'),"ins_upload","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_mots_cles'));
-article(_T('menu_aide_mots_cles_principe'),"mots");
-article(_T('menu_aide_mots_cles_mots_cles'),"artmots");
-article(_T('menu_aide_mots_cles_groupes'),"motsgroupes","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_sites'));
-article(_T('menu_aide_sites_referencer'),"reference");
-article(_T('menu_aide_sites_syndiquer'),"rubsyn");
-article(_T('menu_aide_sites_articles_syndiques'),"artsyn");
-article(_T('menu_aide_sites_proxy'),"confhttpproxy","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_messagerie'));
-article("<img src='img_pack/m_envoi$spip_lang_rtl.gif' border=0> "._T('menu_aide_messagerie_utilisateurs'),"messut");
-article("<img src='img_pack/m_envoi_bleu$spip_lang_rtl.gif' border=0> "._T('menu_aide_messagerie_pense_bete'),"messpense");
-article(_T('menu_aide_messagerie_calendrier'),"messcalen");
-article(_T('menu_aide_messagerie_configuration_perso'),"messconf");
-fin_rubrique();
-
-rubrique(_T('menu_aide_suivi_forum'),"admin");
-article(_T('menu_aide_suivi_forum_suivi'),"suiviforum","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_suivi_forum_configuration'),"admin");
-article(_T('menu_aide_suivi_forum_nom_adresse'),"confnom","admin");
-article(_T('menu_aide_suivi_forum_contenu_articles'),"confart","admin");
-article(_T('menu_aide_suivi_forum_articles_postes'),"confdates","admin");
-article(_T('menu_aide_suivi_forum_fonctionnement'),"confforums","admin");
-article(_T('menu_aide_suivi_forum_systeme_breves'),"confbreves","admin");
-article(_T('menu_aide_suivi_forum_messagerie_interne'),"confmessagerie","admin");
-article(_T('menu_aide_suivi_forum_statistiques'),"confstat","admin");
-article(_T('menu_aide_suivi_forum_envoi_emails'),"confmails","admin");
-article(_T('menu_aide_suivi_forum_moteur_recherche'),"confmoteur","admin");
-fin_rubrique();
-
-rubrique(_T('menu_aide_interface_perso'));
-article(_T('menu_aide_interface_perso_simplifiee'),"intersimple");
-article(_T('menu_aide_interface_perso_cookie'),"cookie");
-article(_T('menu_aide_interface_perso_deconnecter'),"deconnect");
-fin_rubrique();
-
-?>
-</body>
-</html>
diff --git a/ecrire/aide_index.php3 b/ecrire/aide_index.php3
deleted file mode 100644
index ad38fc4e51f3822d4be55255b8848e94390c9ff0..0000000000000000000000000000000000000000
--- a/ecrire/aide_index.php3
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-include ("inc_version.php3");
-
-if ($var_lang) {
-	$lastmodified = filemtime("aide_index.php3");
-	$headers_only = http_last_modified($lastmodified, time() + 24 * 3600);
-	if ($headers_only) exit;
-}
-
-// Recuperer les infos de langue (preferences auteur), si possible
-if (@file_exists("inc_connect.php3")) {
-	include_ecrire ("inc_auth.php3");
-}
-
-include_ecrire("inc_lang.php3");
-utiliser_langue_visiteur();
-if ($var_lang) changer_langue($var_lang);
-
-echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
-echo "<html>";
-echo "<head>";
-echo "<title dir=\"".($spip_lang_rtl ? 'rtl' : 'ltr')."\">"._T('info_aide_en_ligne')."</title>";
-echo "</head>\n";
-
-$frame_menu = "<frame src=\"aide_gauche.php3?aide=$aide&les_rub=$les_rub&var_lang=$spip_lang#$ancre\" name=\"gauche\" scrolling=\"auto\" noresize>\n";
-$frame_body = "<frame src=\"aide_droite.php3?aide=$aide&var_lang=$spip_lang\" name=\"droite\" scrolling=\"auto\" noresize>\n";
-
-if ($spip_lang_rtl) {
-	echo '<frameset cols="*,160" border="0" frameborder="0" framespacing="0">';
-	echo $frame_body.$frame_menu;
-}
-else {
-	echo '<frameset cols="160,*" border="0" frameborder="0" framespacing="0">';
-	echo $frame_menu.$frame_body;
-}
-echo '</frameset>';
-
-echo "\n</html>";
-
-?>
-
diff --git a/ecrire/inc_cron.php3 b/ecrire/inc_cron.php3
index b003dafcc64eba07bbe7b56678456a2586a1c015..8d2cd2ad79f24b11fe26e5d35e6918e84d0f302f 100644
--- a/ecrire/inc_cron.php3
+++ b/ecrire/inc_cron.php3
@@ -11,6 +11,30 @@ define("_ECRIRE_INC_CRON", "1");
 // --------------------------
 
 
+//
+// Verifier la presence du .htaccess dans le CACHE et dans ecrire/data
+//
+function verifier_htaccess($rep) {
+	if (!file_exists("$rep/.htaccess")) {
+		spip_log("creation $rep/.htaccess");
+		if ($GLOBALS['hebergeur'] != 'nexenservices'){
+			$f = fopen("$rep/.htaccess", "w");
+			fputs($f, "deny from all\n");
+			fclose($f);
+		} else {
+			echo "<font color=\"#FF0000\">IMPORTANT : </font>";
+			echo "Votre h&eacute;bergeur est Nexen Services.<br />";
+			echo "La protection du r&eacute;pertoire <i>$rep/</i> doit se faire
+			par l'interm&eacute;diaire de ";
+			echo "<a href=\"http://www.nexenservices.com/webmestres/htlocal.php\"
+			target=\"_blank\">l'espace webmestres</a>.";
+			echo "Veuillez cr&eacute;er manuellement la protection pour
+			ce r&eacute;pertoire (un couple login/mot de passe est
+			n&eacute;cessaire).<br />";
+		}
+	}
+}
+
 //
 // Calcul des referers
 //
@@ -60,6 +84,10 @@ function cron_archiver_stats($last_date) {
 function spip_cron() {
 	global $flag_ecrire, $dir_ecrire, $db_ok;
 
+	#echo "hum";	spip_log('hum');
+	verifier_htaccess('CACHE');
+	verifier_htaccess('ecrire/data');
+
 	include_ecrire("inc_connect.php3");
 	if (!$db_ok) {
 		@touch($dir_ecrire.'data/mysql_out');
diff --git a/ecrire/inc_layer.php3 b/ecrire/inc_layer.php3
index 6379d764a8a855a13fe0b6621e1d2a1c49d853b7..962d36e2339214f7e6c478d1bcb319f07bd40a8c 100644
--- a/ecrire/inc_layer.php3
+++ b/ecrire/inc_layer.php3
@@ -20,10 +20,10 @@ function test_layer(){
 
 
 function afficher_script_layer(){
-	global $flag_ecrire;
+	global $dir_ecrire;
 
 	if (test_layer()){
-		echo '<script type="text/javascript" src="'.($flag_ecrire ? "" : "ecrire/").'layer.js">';
+		echo '<script type="text/javascript" src="'.$dir_ecrire.'layer.js">';
 		echo "</script>\n";
 	}
 }
@@ -74,6 +74,7 @@ function bouton_block_invisible($nom_block) {
 	global $numero_block;
 	global $compteur_block;
 	global $spip_lang_rtl;
+	global $dir_ecrire;
 
 	$num_triangle = $compteur_block + 1;
 
@@ -91,17 +92,17 @@ function bouton_block_invisible($nom_block) {
 			$javasc .= "swap_couche(\\'".$numero_block[$nom_block]."\\', \\'$spip_lang_rtl\\');";
 		}
 		$retour = "\n<script type='text/javascript'><!--\n";
-		$retour .= "document.write('<a href=\"javascript:$javasc\"><img name=\"triangle".$numero_block["$nom_block"]."\" src=\"img_pack/deplierhaut$spip_lang_rtl.gif\" alt=\"\" title=\"".addslashes(_T('info_deplier'))."\" width=\"10\" height=\"10\" border=\"0\"></a>');\n";
+		$retour .= "document.write('<a href=\"javascript:$javasc\"><img name=\"triangle".$numero_block["$nom_block"]."\" src=\"".$dir_ecrire."img_pack/deplierhaut$spip_lang_rtl.gif\" alt=\"\" title=\"".addslashes(_T('info_deplier'))."\" width=\"10\" height=\"10\" border=\"0\"></a>');\n";
 		$retour .= "//-->\n";
 		$retour .= "</script>\n";
 
-		//$retour .= "<noscript><img name='triangle$num_triangle' src='img_pack/deplierbas$spip_lang_rtl.gif' alt='' width='16' height='14' border='0'></noscript>\n";
 		return $retour;
 	}
 }
 
 
 function bouton_block_visible($nom_block){
+	global $dir_ecrire;
 	global $spip_lang_rtl;
 	if (test_layer()){
 		global $numero_block;
@@ -112,7 +113,7 @@ function bouton_block_visible($nom_block){
 			$numero_block["$nom_block"] = $compteur_block;
 		}
 
-		return "<a href=\"javascript:swap_couche('".$numero_block["$nom_block"]."', '$spip_lang_rtl')\"><IMG name='triangle".$numero_block["$nom_block"]."' src='img_pack/deplierbas.gif' alt='' title='".addslashes(_T('info_deplier'))."' width='10' height='10' border='0'></a>";
+		return "<a href=\"javascript:swap_couche('".$numero_block["$nom_block"]."', '$spip_lang_rtl')\"><IMG name='triangle".$numero_block["$nom_block"]."' src='".$dir_ecrire."img_pack/deplierbas.gif' alt='' title='".addslashes(_T('info_deplier'))."' width='10' height='10' border='0'></a>";
 	}
 }
 
diff --git a/ecrire/inc_presentation.php3 b/ecrire/inc_presentation.php3
index 29b6e97b5c0e3c7b0ad64c537b22ee0eeea9e4e4..e86978f9ed0c64959c2492dc50e7d9cc1d8cc461 100644
--- a/ecrire/inc_presentation.php3
+++ b/ecrire/inc_presentation.php3
@@ -13,14 +13,14 @@ include_ecrire ("inc_calendrier.php");
 // Aide
 //
 function aide($aide='') {
-	global $couleur_foncee, $spip_lang, $spip_lang_rtl, $dir_ecrire;
+	global $couleur_foncee, $spip_lang, $spip_lang_rtl, $flag_ecrire;
 
 	if (!$aide) return;
 
-	return "&nbsp;&nbsp;<a class='aide' href=\"".$dir_ecrire."aide_index.php3?aide=$aide&var_lang=$spip_lang\" target=\"spip_aide\" ".
+	return "&nbsp;&nbsp;<a class='aide' href=\"".($flag_ecrire ? '../' : '')."spip_help.php3?aide=$aide&var_lang=$spip_lang\" target=\"spip_aide\" ".
 		"onclick=\"javascript:window.open(this.href, 'spip_aide', 'scrollbars=yes, ".
 		"resizable=yes, width=740, height=580'); return false;\"><img ".
-		"src=\"img_pack/aide.gif\" alt=\""._T('info_image_aide')."\" ".
+		"src=\"".$dir_ecrire."img_pack/aide.gif\" alt=\""._T('info_image_aide')."\" ".
 		"title=\""._T('titre_image_aide')."\" width=\"12\" height=\"12\" border=\"0\" ".
 		"align=\"middle\"></a>";
 }
@@ -1993,7 +1993,7 @@ else {
 
 
 
-	icone_bandeau_principal (_T('icone_aide_ligne'), "javascript:window.open('aide_index.php3?var_lang=$spip_lang', 'aide_spip', 'scrollbars=yes,resizable=yes,width=740,height=580');", "aide-48$spip_lang_rtl.png", "vide", "", "aide_index.php3?var_lang=$spip_lang", "aide-en-ligne", $sous_rubrique);
+	icone_bandeau_principal (_T('icone_aide_ligne'), "javascript:window.open('../spip_help.php3?var_lang=$spip_lang', 'aide_spip', 'scrollbars=yes,resizable=yes,width=740,height=580');", "aide-48$spip_lang_rtl.png", "vide", "", "../spip_help.php3?var_lang=$spip_lang", "aide-en-ligne", $sous_rubrique);
 	icone_bandeau_principal (_T('icone_visiter_site'), "$adresse_site", "visiter-48$spip_lang_rtl.png", "visiter","", "visiter", $sous_rubrique);
 
 	echo "</tr></table>\n";
diff --git a/ecrire/install.php3 b/ecrire/install.php3
index 4c84e9b6d047e042fefb092843ebe94a6d83ec98..565b5350ce4d9dc0dd8991a3f81c366bdd3c27d3 100644
--- a/ecrire/install.php3
+++ b/ecrire/install.php3
@@ -59,22 +59,11 @@ if ($etape == 6) {
 	init_config();
 	init_langues();
 
-	if ($hebergeur == 'nexenservices') {
-		echo "<p><B>"._T('info_nexen_1')."</B><br />";
-		echo "<p>"._T('info_nexen_2');
-		echo " <a href=\"http://www.nexenservices.com/webmestres/htlocal.php\" target=\"_blank\">"._T('info_nexen_3')."</a>.";
-		echo "<p>"._T('info_nexen_4');
-	}
-	else {
-		include_ecrire ("inc_acces.php3");
-		ecrire_acces();
-		$protec = "deny from all\n";
-		$myFile = fopen("data/.htaccess", "w");
-		fputs($myFile, $protec);
-		fclose($myFile);
-	}
+	include_ecrire ("inc_acces.php3");
+	ecrire_acces();
 
 	@unlink("data/inc_meta_cache.php3");
+	@unlink("data/meta_cache.php3");
 	if (!@rename("inc_connect_install.php3", "inc_connect.php3")) {
 		copy("inc_connect_install.php3", "inc_connect.php3");
 		@unlink("inc_connect_install.php3");
diff --git a/spip_help.php3 b/spip_help.php3
new file mode 100644
index 0000000000000000000000000000000000000000..e2e9a4b7d9893d99b7c2ff820159f93deb6080fe
--- /dev/null
+++ b/spip_help.php3
@@ -0,0 +1,445 @@
+<?php
+
+include ("ecrire/inc_version.php3");
+include_ecrire ("inc_layer.php3");
+
+// Eviter les calculs evitables (surtout en client/serveur sans cache !)
+#$lastmodified = filemtime("spip_help.php3");
+#$headers_only = http_last_modified($lastmodified, time() + 24 * 3600);
+#if ($headers_only) exit;
+
+// Recuperer les infos de langue (preferences auteur), si possible
+if (@file_exists("inc_connect.php3")) {
+	include_ecrire ("inc_auth.php3");
+}
+include_ecrire ("inc_lang.php3");
+utiliser_langue_visiteur();
+if ($var_lang) changer_langue($var_lang);
+
+// Debut page
+function entetes_html() {
+	header('Content-Type: text/html; charset=utf-8');
+	echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">';
+	echo "<html dir=\"".($GLOBALS['spip_lang_rtl'] ? 'rtl' : 'ltr')."\">";
+	echo "<head>";
+	echo "<title>"._T('info_aide_en_ligne')."</title>";
+}
+
+
+/////////////////////////////
+// La frame de base
+//
+function help_frame ($aide) {
+	global $spip_lang;
+
+	echo "</head>\n";
+	$frame_menu = "<frame src=\"spip_help.php3?aide=$aide&var_lang=$spip_lang&frame=menu\" name=\"gauche\" scrolling=\"auto\" noresize>\n";
+	$frame_body = "<frame src=\"spip_help.php3?aide=$aide&var_lang=$spip_lang&frame=body\" name=\"droite\" scrolling=\"auto\" noresize>\n";
+
+	if ($GLOBALS['spip_lang_rtl']) {
+		echo '<frameset cols="*,160" border="0" frameborder="0" framespacing="0">';
+		echo $frame_body.$frame_menu;
+	}
+	else {
+		echo '<frameset cols="160,*" border="0" frameborder="0" framespacing="0">';
+		echo $frame_menu.$frame_body;
+	}
+	echo '</frameset>';
+	echo "\n</html>";
+}
+
+
+
+/////////////////////////////
+// Le contenu demande
+//
+
+// Selection de l'aide correspondant a la langue demandee
+function fichier_aide($lang_aide = '') {
+
+	if (!$lang_aide) $lang_aide = $GLOBALS['spip_lang'];
+
+	if (@file_exists($fichier_aide = "ecrire/AIDE/$lang_aide-aide.html")) 
+		return array(file($fichier_aide), $lang_aide);
+	else	// reduction ISO du code langue oc_prv_ni => oc_prv => oc
+		if (ereg("(.*)_", $lang_aide, $regs)
+		AND $r = fichier_aide($regs[1]))
+			return $r;
+
+	else {
+		// Aide internet, en cache ?
+		include_ecrire('inc_sites.php3');
+		if (@file_exists($fichier_aide = "CACHE/aide/$lang_aide-aide.html"))
+			return array(file($fichier_aide), $lang_aide, "http://www.spip.net/aide_tmp/$lang_aide/", true);
+		else {
+			// sinon aller la chercher sur le site d'aide
+			if ($contenu = recuperer_page("http://www.spip.net/aide_tmp/$lang_aide-aide.html")) {
+				$ecrire_cache = ecrire_fichier ($fichier_aide, $contenu);
+				return array($contenu, $lang_aide, "http://www.spip.net/aide_tmp/$lang_aide/", $ecrire_cache);
+			} else
+				define ('erreur_langue', _L('Impossible de t&eacute;l&eacute;charger l\'aide en ligne pour cette langue. Erreur de r&eacute;seau, ou aide non traduite. Si vous utilisez ce site en-dehors d\'une connexion Internet, vous pouvez installer l\'aide en local.'));
+		}
+	}
+
+	return false;
+}
+
+
+function help_body($aide) {
+
+	// Gerer le cache de l'aide
+	include_local('inc-cache.php3');
+	$rep = creer_repertoire('CACHE', 'aide');
+
+	if (!$aide) $aide = 'spip';
+
+	// Recuperation du contenu de l'aide demandee
+	list($html, $l, $url_aide, $ecrire_cache) = fichier_aide();
+	$html = analyse_aide($html, $aide);
+
+	// Localisation des images de l'aide (si disponibles)
+	$suite = $html;
+	$html = "";
+	while (ereg("AIDE/([-_a-zA-Z0-9]+\.(gif|jpg))", $suite, $r)) {
+		$f = $r[1];
+		if (@file_exists("AIDE/$l/$f")) $f = "AIDE/$l/$f";
+		else if (@file_exists("CACHE/aide/${l}-$f")) $f = "spip_help.php3?img=aide/${l}-$f";
+		else if ($url_aide) {
+			if ($ecrire_cache AND $contenu =
+			recuperer_page("http://www.spip.net/ecrire/AIDE/$l/$f")
+			AND ecrire_fichier ("CACHE/aide/${l}-$f", $contenu))
+				$f = "spip_help.php3?img=aide/${l}-$f";
+			else
+				$f = "http://www.spip.net/ecrire/AIDE/$l/$f"; # erreur
+		} else if (@file_exists("AIDE/fr/$f")) $f = "AIDE/fr/$f";
+		else if (@file_exists("AIDE/fr/$f")) $f = "AIDE/fr/$f";
+		$p = strpos($suite, $r[0]);
+		$html .= substr($suite, 0, $p) . $f;
+		$suite = substr($suite, $p + strlen($r[0]));
+	}
+	$html .= $suite;
+
+
+?>
+<style type="text/css"><!--
+.spip_cadre {
+	width : 100%;
+	background-color: #FFFFFF;
+	padding: 5px;
+}
+.spip_quote {
+	margin-left : 40px;
+	margin-top : 10px;
+	margin-bottom : 10px;
+	border : solid 1px #aaaaaa;
+	background-color: #dddddd;
+	padding: 5px;
+}
+
+a {text-decoration: none;}
+a:hover {color:#FF9900; text-decoration: underline;}
+
+body {
+	font-family: Georgia, Garamond, Times New Roman, serif;
+}
+h3.spip {
+	font-family: Verdana,Arial,Sans,sans-serif;
+	font-weight: bold;
+	font-size: 115%;
+	text-align: center;
+}
+
+table.spip {
+}
+
+table.spip tr.row_first {
+	background-color: #FCF4D0;
+}
+
+table.spip tr.row_odd {
+	background-color: #C0C0C0;
+}
+
+table.spip tr.row_even {
+	background-color: #F0F0F0;
+}
+
+table.spip td {
+	padding: 1px;
+	text-align: left;
+	vertical-align: center;
+}
+
+--></style>
+</head>
+<?php
+
+	include_ecrire ("inc_texte.php3");
+	include_ecrire ("inc_filtres.php3");
+
+	echo '<body bgcolor="#FFFFFF" text="#000000" TOPMARGIN="24" LEFTMARGIN="24" MARGINWIDTH="24" MARGINHEIGHT="24"';
+	if ($spip_lang_rtl)
+		echo " dir='rtl'";
+	echo " lang='$lang_aide'>";
+
+	if ($aide == 'spip') {
+		echo '<TABLE BORDER=0 WIDTH=100% HEIGHT=60%>
+<TR WIDTH=100% HEIGHT=60%>
+<TD WIDTH=100% HEIGHT=60% ALIGN="center" VALIGN="middle">
+
+<CENTER>
+<img src="spip_help.php3?img=aide/-logo-spip.gif" alt="SPIP" width="300" height="170" border="0">
+</CENTER>
+</TD></TR></TABLE>';
+	}
+
+	// Il faut que la langue de typo() soit celle de l'aide en ligne
+	changer_typo($lang_aide);
+
+	$html = justifier(propre($html)."<p>");
+	// Remplacer les liens externes par des liens ouvrants (a cause des frames)
+	$html = ereg_replace('<a href="(http://[^"]+)"([^>]*)>', '<a href="\\1"\\2 target="_blank">', $html);
+
+	echo $html;
+
+	if (defined('erreur_langue'))
+		echo "<div>".erreur_langue."</div>";
+
+	echo "<font size=2>$les_notes</font><p>";
+	echo "</body></html>";
+
+}
+
+
+/////////////////////////////////////
+// Recuperer une image dans le cache
+//
+function help_img($regs) {
+	list ($cache, $lang, $file, $ext) = $regs;
+	header("Content-Type: image/$ext");
+	if (file_exists('CACHE/'.$cache)) {
+		readfile('CACHE/'.$cache);
+	} else {
+		include_ecrire('inc_sites.php3');
+		if (is_dir('CACHE/aide') AND $contenu =
+		recuperer_page("http://www.spip.net/ecrire/AIDE/$lang/$file")) {
+			echo $contenu;
+			ecrire_fichier ('CACHE/'.$cache, $contenu);
+		} else
+			header ("Location: http://www.spip.net/ecrire/AIDE/$lang/$file");
+	}
+	exit;
+}
+
+///////////////////////////////////////
+// Le menu de gauche
+//
+function help_menu($aide) {
+	global $spip_lang_left, $spip_lang_rtl, $spip_lang_right;
+
+echo '<style type="text/css">
+<!--
+	a {text-decoration: none; }
+	A:Hover {text-decoration: underline;}
+
+	.article-inactif {
+		float: '.$spip_lang_left.';
+		text-align: '.$spip_lang_left.';
+		width: 80%;
+		background: url(ecrire/img_pack/triangle'.$spip_lang_rtl.'.gif) '
+	. $spip_lang_left.' center no-repeat;
+		margin: 2px;
+		padding: 0px;
+		padding-'.$spip_lang_left.': 20px;
+		font-family: Arial, Sans, sans-serif;
+		font-size: 12px;
+	}
+	.article-actif {
+		float: '.$spip_lang_right.';
+		text-align: '.$spip_lang_right.';
+		width: 80%;
+		background: url(ecrire/img_pack/triangle'.$spip_lang_rtl.'.gif) '.$spip_lang_right.' center no-repeat;
+		margin: 4px;
+		padding: 0px;
+		padding-'.$spip_lang_right.': 20px;
+		font-family: Arial, Sans, sans-serif;
+		font-size: 12px;
+		font-weight: bold;
+		color: black;
+	}
+	.article-actif:hover {
+		text-decoration: none;
+	}
+	.rubrique {
+		width: 90%;
+		margin: 0px;
+		margin-top: 6px;
+		margin-bottom: 4px;
+		padding: 4px;
+		font-family: Trebuchet MS, Arial, Sans, sans-serif;
+		font-size: 13px;
+		font-weight: bold;
+		color: black;
+		background-color: #EEEECC;
+		-moz-border-radius: 4px;
+	}
+-->
+</style>
+<script type="text/javascript"><!--
+var curr_article;
+function activer_article(id) {
+	if (curr_article)
+		document.getElementById(curr_article).className = "article-inactif";
+	if (id) {
+		document.getElementById(id).className = "article-actif";
+		curr_article = id;
+	}
+}
+//--></script>
+';
+
+afficher_script_layer();
+
+echo '
+</head>
+<body bgcolor="#FFFFFF" text="#000000" link="#E86519" vlink="#6E003A" alink="#FF9900" TOPMARGIN="5" LEFTMARGIN="5" MARGINWIDTH="5" MARGINHEIGHT="5"';
+
+	if ($spip_lang_rtl)
+		echo " dir='rtl'";
+	echo " lang='$lang_aide'>";
+
+
+	// Recuperation et analyse de la structure de l'aide demandee
+	list($html, $l, $url_aide, $ecrire_cache) = fichier_aide();
+	$sections = analyse_aide($html);
+	foreach ($sections as $section) {
+		if ($section[1] == '1') {
+			if ($rubrique_vue)
+				fin_rubrique();
+			rubrique($section[3].$section[5]);
+			$rubrique_vue = true;
+		} else
+			article($section[5], $section[3]);
+	}
+	fin_rubrique();
+}
+
+
+function rubrique($titre, $statut = "redac") {
+	global $ligne_rubrique;
+	global $block_rubrique;
+	global $titre_rubrique;
+	global $afficher_rubrique, $ouvrir_rubrique;
+	global $larubrique;
+
+	global $aide_statut;
+
+	$afficher_rubrique = 0;
+
+	if (($statut == "admin" AND $aide_statut == "admin") OR ($statut == "redac")) {
+		$larubrique++;
+		$titre_rubrique = $titre;
+		$ligne_rubrique = array();
+		$block_rubrique = "block$larubrique";
+		$afficher_rubrique = 1;
+		$ouvrir_rubrique = 0;
+	}
+}
+
+function fin_rubrique() {
+	global $ligne_rubrique;
+	global $block_rubrique;
+	global $titre_rubrique;
+	global $afficher_rubrique, $ouvrir_rubrique;
+	global $texte;
+
+	if ($afficher_rubrique && count($ligne_rubrique)) {
+		echo "<div class='rubrique'>";
+		if ($ouvrir_rubrique)
+			echo bouton_block_visible($block_rubrique);
+		else 
+			echo bouton_block_invisible($block_rubrique);
+		echo $titre_rubrique;
+		echo "</div>\n";
+		if ($ouvrir_rubrique)
+			echo debut_block_visible($block_rubrique);
+		else
+			echo debut_block_invisible($block_rubrique);
+		echo "\n";
+		reset($ligne_rubrique);
+		while (list(, $ligne) = each($ligne_rubrique)) {
+			echo $texte[$ligne];
+		}
+		echo fin_block();
+		echo "\n\n";
+	}
+}
+
+function article($titre, $lien, $statut = "redac") {
+	global $aide;
+	global $ligne;
+	global $ligne_rubrique;
+	global $rubrique;
+	global $texte;
+	global $afficher_rubrique, $ouvrir_rubrique;
+	global $aide_statut;
+	global $spip_lang;
+
+	if ($afficher_rubrique AND (($statut == "admin" AND $aide_statut == "admin") OR ($statut == "redac"))) {
+		$ligne_rubrique[] = ++$ligne;
+		
+		$texte[$ligne] = '';
+		$id = "ligne$ligne";
+		$url = "spip_help.php3?aide=$lien&frame=body&var_lang=$spip_lang";
+		if ($aide == $lien) {
+			$ouvrir_rubrique = 1;
+			$class = "article-actif";
+			$texte[$ligne] .= "<script type='text/javascript'><!--\ncurr_article = '$id';\n// --></script>\n";
+		}
+		else {
+			$class = "article-inactif";
+		}
+		$texte[$ligne] .= "<a class='$class' id='$id' href='$url' target='droite' ".
+			"onClick=\"activer_article('$id');return true;\">$titre</a><br style='clear:both;'>\n";
+	}
+}
+
+
+function analyse_aide($html, $aide=false) {
+	if (is_array($html))
+		$html = join('', $html);
+
+	if (!$html)
+		define ('erreur_langue', _T('aide_non_disponible'));
+
+	preg_match_all(',<h([12])( class="spip")?'. '>([^/]+?)(/(.+?))?</h\1>,ism',
+	$html, $regs, PREG_SET_ORDER);
+
+	if ($aide) {
+		unset ($regs);
+		$preg = ',<h2( class="spip")?'
+		. ">$aide/(.+?)</h2>(.*)$,ism";
+		preg_match($preg, $html, $regs);
+		$regs = preg_replace(',<h[12].*,ism', '', $regs[3]);
+	}
+
+	return $regs;
+}
+
+
+//
+// Distribuer le travail
+//
+if (preg_match(',^aide/([^-.]*)-([^\.]*\.(gif|jpg|png))$,', $img, $regs))
+	help_img($regs);
+else {
+	entetes_html();
+	if ($frame == 'menu')
+		help_menu($aide);
+	else if ($frame == 'body')
+		help_body($aide);
+	else
+		help_frame($aide);
+}
+
+?>
diff --git a/spip_test_dirs.php3 b/spip_test_dirs.php3
index e9b16b49103a95af1f6b0b643b19b0a110c776b0..0828486d98d67fada8dcf13fa2b0d26a026d59b1 100644
--- a/spip_test_dirs.php3
+++ b/spip_test_dirs.php3
@@ -6,61 +6,6 @@ include_ecrire("inc_presentation.php3");
 
 utiliser_langue_visiteur();
 
-function bad_dirs($bad_dirs, $test_dir, $install) {
-	install_debut_html();
-
-	if ($install) {
-		$titre = _T('dirs_preliminaire');
-		$continuer = _T('dirs_commencer');
-	} else
-		$titre = _T('dirs_probleme_droits');
-
-	$bad_url = "spip_test_dirs.php3";
-	if ($test_dir) $bad_url .= '?test_dir='.$test_dir;
-
-	echo "<FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=3>$titre</FONT>\n<p>";
-	echo "<div align='right'>". menu_langues('var_lang_ecrire')."</div><p>";
-
-	echo _T('dirs_repertoires_suivants', array('bad_dirs' => $bad_dirs));
-	echo "<B>". _T('login_recharger')." $continuer.";
-
-	if ($install)
-		echo aide ("install0");
-	echo "<p>";
-
-	echo "<FORM ACTION='$bad_urls' METHOD='GET'>\n";
-	echo "<DIV align='right'><INPUT TYPE='submit' CLASS='fondl' NAME='Valider' VALUE='". _T('login_recharger')."'></DIV>";
-	echo "</FORM>";
-
-	install_fin_html();
-}
-
-
-function absent_dirs($bad_dirs, $test_dir) {
-	install_debut_html();
-
-	$titre = _T('dirs_preliminaire');
-	$continuer = _T('dirs_commencer');
-
-	$bad_url = "spip_test_dirs.php3";
-	if ($test_dir) $bad_url .= '?test_dir='.$test_dir;
-
-	echo "<FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=3>$titre</FONT>\n<p>";
-	echo "<div align='right'>". menu_langues('var_lang_ecrire')."</div><p>";
-
-	echo _T('dirs_repertoires_absents', array('bad_dirs' => $bad_dirs));
-	echo "<B>". _T('login_recharger')." $continuer.";
-
-	if ($install)
-		echo aide ("install0");
-	echo "<p>";
-
-	echo "<FORM ACTION='$bad_urls' METHOD='GET'>\n";
-	echo "<DIV align='right'><INPUT TYPE='submit' CLASS='fondl' NAME='Valider' VALUE='". _T('login_recharger')."'></DIV>";
-	echo "</FORM>";
-
-	install_fin_html();
-}
 
 //
 // Tente d'ecrire
@@ -109,15 +54,46 @@ while (list(, $my_dir) = each($test_dirs)) {
 	}
 }
 
-if ($bad_dirs) {
-	$bad_dirs = join(" ", $bad_dirs);
-	bad_dirs($bad_dirs, $test_dir, $install);
-}
-else if ($absent_dirs) {
-	$absent_dirs = join(" ", $absent_dirs);
-	absent_dirs($absent_dirs, $test_dir);
-}
-else {
+if ($bad_dirs OR $absent_dirs) {
+	install_debut_html();
+
+	if ($install) {
+		$titre = _T('dirs_preliminaire');
+		$continuer = ' '._T('dirs_commencer');
+	} else
+		$titre = _T('dirs_probleme_droits');
+
+	$bad_url = "spip_test_dirs.php3";
+	if ($test_dir) $bad_url .= '?test_dir='.$test_dir;
+
+	echo "<FONT FACE=\"Verdana,Arial,Helvetica,sans-serif\" SIZE=3>$titre</FONT>\n<p>";
+	echo "<div align='right'>". menu_langues('var_lang_ecrire')."</div>\n";
+
+	if ($bad_dirs) {
+		echo "<p>";
+		echo _T('dirs_repertoires_suivants',
+			array('bad_dirs' => join(" ", $bad_dirs)));
+		echo "<B>". _T('login_recharger')."</b>";
+	}
+
+	if ($absent_dirs) {
+		echo "<p>";
+		echo _T('dirs_repertoires_absents',
+			array('bad_dirs' => join(" ", $absent_dirs)));
+		echo "<B>". _T('login_recharger')."</b>";
+	}
+
+	echo $continuer.'. ';
+	echo aide ("install0");
+	echo "<p>";
+
+	echo "<FORM ACTION='$bad_urls' METHOD='GET'>\n";
+	echo "<DIV align='right'><INPUT TYPE='submit' CLASS='fondl' NAME='Valider' VALUE='". _T('login_recharger')."'></DIV>";
+	echo "</FORM>";
+
+	install_fin_html();
+
+} else {
 	if ($install)
 		header("Location: ./ecrire/install.php3?etape=1");
 	else