Barnie wrote:
Next question: some days ago I read on some spip site about search restricted to the current root sector. Due to the structure of the various spip sites I don't find that article now. Any clue?
Ok, you want to limit the search to the sector that the user was visiting, so:
1- you need to have a limit on your search look, something like (in recherche.html):
<BOUCLE_articles(ARTICLES) {recherche} {par points} {inverse} {pagination} {branche?}>
{branche?} will tell the loop to limit the returned articles to the one in the specified branch, if an id_rubrique is specified (the ? is there for that)
2- you need the #RECHERCHE form to put the id_rubrique of the root sector in the url parameters when calling the search. To do that, personalize the formulaire/recherche.html template:
<div class="formulaire_spip formulaire_recherche">
<a name="formulaire_recherche" id="formulaire_recherche"></a>
<form action="[(#ENV{lien})]" method="get"><div>
[(#ENV{lien}|form_hidden)]
[<input type="hidden" name="lang" value="(#ENV{lang})" />]
<label for="recherche"><:info_rechercher:></label>
<input type="text" class="forml" name="recherche" id="recherche" value="[(#ENV{recherche}|sinon{<:info_rechercher:>" onfocus="this.value='';})]" />
[<input type="hidden" name="id_rubrique" value="(#ENV{id_secteur})"/>]
</div>
</form>
</div>
You also have to personalize the php file for the form to get the id_secteur from the context, this is quite easy:
<?php
/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
* Copyright (c) 2001-2007 *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
* Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
\***************************************************************************/
if (!defined("_ECRIRE_INC_VERSION")) return; #securite
// Pas besoin de contexte de compilation
// http://doc.spip.org/@balise_FORMULAIRE_RECHERCHE
function balise_FORMULAIRE_RECHERCHE ($p)
{
return calculer_balise_dynamique($p, 'FORMULAIRE_RECHERCHE', array('id_secteur'));
}
// http://doc.spip.org/@balise_FORMULAIRE_RECHERCHE_stat
function balise_FORMULAIRE_RECHERCHE_stat($args, $filtres) {
// Si le moteur n'est pas active, pas de balise
if ($GLOBALS['meta']["activer_moteur"] != "oui")
return '';
// filtres[0] doit etre un script (a revoir)
else {
list($id_secteur,$rech) = $args;
$id_secteur = intval($id_secteur);
return array($filtres[0], $rech, $id_secteur);
}
}
// http://doc.spip.org/@balise_FORMULAIRE_RECHERCHE_dyn
function balise_FORMULAIRE_RECHERCHE_dyn($lien, $rech, $id_secteur) {
if ($GLOBALS['spip_lang'] != $GLOBALS['meta']['langue_site'])
$lang = $GLOBALS['spip_lang'];
else
$lang='';
return array('formulaires/recherche', 3600,
array(
'lien' => ($lien ? $lien : generer_url_public('recherche')),
'recherche' => _request('recherche'),
'lang' => $lang,
'id_secteur' => $id_secteur
));
}
?>
Easy hey! 
Pierre