= '$datedeb' ";
}
if ($idonlyrub != 0) {
$sql .= "AND spip_rubriques.id_rubrique = $idonlyrub ";
}
$sql .= "AND spip_articles.statut LIKE 'publie' GROUP BY spip_articles.id_article";
if ($order == 1) {
$sql .= " ORDER BY spip_rubriques.id_rubrique, NUM DESC, spip_mots_articles.id_mot, spip_articles.date DESC";
}
else {
$sql .= " ORDER BY NUM DESC, spip_mots_articles.id_mot, spip_rubriques.id_rubrique, spip_articles.date DESC";
}
$result = mysql_query($sql);
//$nbart = mysql_num_rows($result);
$nbart = 0;
$resultataffiche = "";
if ($result) {
$titrerub = supprimer_numero($titrerub);
$idrub = 0;
$resultataffiche .= "
<:rmc:recherche_resultats:>
";
$listidmot2 = "";
$listidmotprec = "";
while ($row = mysql_fetch_assoc($result)) {
extract($row);
if (($num != $nbmot) && ($allword == 1)) {
break;
}
if ($idrub != $id_rubrique) {
if (($pospoint = strrpos($titrerub, ". ")) === FALSE) {
$titrerub2=$titrerub;
}
else {
if (is_numeric(substr($titrerub, 0, $pospoint)) == false)
$titrerub2 = $titrerub;
else
$titrerub2 = substr($titrerub, $pospoint + 2);
}
if ($order == 1) {
$resultataffiche.= "$titrerub2 :
";
}
}
$sql2 = "SELECT spip_articles.id_article AS artid, spip_articles.titre AS titreart, spip_articles.date, spip_mots.id_mot ";
$sql2 .= ", spip_mots.titre AS titremot FROM spip_articles INNER JOIN spip_mots_articles ON spip_mots_articles.id_article = spip_articles.id_article ";
$sql2 .= "INNER JOIN spip_mots ON spip_mots.id_mot = spip_mots_articles.id_mot ";
$sql2 .= "WHERE spip_articles.id_article = $id_article AND spip_mots_articles.id_mot IN (". implode(",", $_POST['idmot']) .") AND statut LIKE 'publie' ";
$sql2 .= "ORDER BY spip_mots.id_mot";
$result2 = mysql_query($sql2);
if ($result2) {
$listmot = "";
$titrearticle = "";
$dataffich = "";
$idart = 0;
while ($row2 = mysql_fetch_assoc($result2)) {
extract($row2);
$listidmot2 .= "$id_mot,";
if ($idart == 0) {
$titrearticle = supprimer_numero($titreart);
if (!(($pospoint = strpos($titrearticle, '.')) === FALSE)) {
if (is_numeric(substr($titrearticle, 0, $pospoint)) == true)
$titrearticle = substr($titrearticle, $pospoint + 2);
}
if (!(($pospoint = strpos($titremot, '.')) === FALSE)) {
if (is_numeric(substr($titremot, 0, $pospoint)) == true)
$titremot = substr($titremot, $pospoint + 2);
}
$dataffich = date("d/m/Y", strtotime($date));
if ($order == 1) {
$nbart += 1;
$resultataffiche .= "
$titrearticle
$dataffich ";
$resultataffiche .= "$titremot";
}
$listmot .= "$titremot";
$idart = 1;
}
else {
$listmot .= ", $titremot";
if ($order == 1) {
$resultataffiche .= ", $titremot";
}
}
}
if ($order == 1) {
$resultataffiche .= "";
}
mysql_free_result($result2);
if ($order == 0) {
if ($listidmot2 != $listmodidprec) {
$resultataffiche .= " $listmot ";
}
$nbart += 1;
$resultataffiche .= "
-
$titrearticle
$dataffich
<:rmc:dans:> $titrerub2
";
$listmodidprec = $listidmot2;
$listidmot2 = "";
}
}
$idrub = $id_rubrique;
}
$resultataffiche .= "
";
mysql_free_result($result);
if($nbart == 0 || $nbart == 1)
$nbart_txt = "<:rmc:article_trouve:>";
else
$nbart_txt = "<:rmc:articles_trouves:>";
echo "
";
} else {
echo "<:rmc:articles_sans:> $the, $org
";
}
} else {
echo "<:rmc:selectionner_mot:>
";
# inutile si form recherche inclus
# echo "
Retour";
}
?>