Voir les résultats de la recherche classés par ordre de numéro de rubrique

Voir les résultats de la recherche classés par nombre de mot clé

Voir les résultats de la recherche classés par ordre de numéro de rubrique

"; $nbcol = 0; $nbcolmax = 4; if ($result) { $compt = 0; while ($row = mysql_fetch_assoc($result)) { extract($row); $titre = supprimer_numero($titre); if ($nbcol == $nbcolmax) { $tabmot .= ""; $nbcol=0; } $tabmot .= ""; $nbcol += 1; } mysql_free_result($result); } $tabmot .= "
$titre
"; $sql = "select count(*) as num,spip_articles.id_article,spip_rubriques.id_rubrique,spip_rubriques.titre as titrerub "; $sql .= "from spip_articles inner join spip_rubriques on spip_rubriques.id_rubrique = spip_articles.id_rubrique "; $sql .= "inner join spip_mots_articles on spip_mots_articles.id_article = spip_articles.id_article "; $sql .= " where spip_mots_articles.id_mot in (". implode(",", $_POST['idmot']) .") "; $datedeb = date("Y-m-d", mktime(0,0,0,date("m"),(date("d") - $nbjour),date("Y"))); if ($nbjour != 0) { $sql .= "and spip_articles.date >= '$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_rubriques.id_rubrique,spip_mots_articles.id_mot,spip_articles.date desc"; } $result = mysql_query($sql); //$nbart = mysql_num_rows($result); $nbart = 0; $resultataffiche = ""; if ($result) { $titrerub = supprimer_numero($titrerub); $resultataffiche.= "
"; $idrub = 0; $resultataffiche.= "

Résultats :

"; $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"; $resultataffiche.= " ($titrerub2)
"; $listmodidprec = $listidmot2; $listidmot2 = ""; } } $idrub = $id_rubrique; } $resultataffiche.= "
"; mysql_free_result($result); echo "
$nbart article(s) trouvé(s) pour les mots :
$tabmot"; echo "$resultataffiche"; // echo "

Développé par Net Developpeur - Création sites web SPIP

"; } else { echo "
"; echo "
il n'y a pas d'article lié aux mots de numéro $the, $org
"; echo "
"; } } else { echo "
Merci de bien vouloir sélectionner au moins 1 mot clé!"; echo "
Retour
"; } ?>