From 81e04e11a649145eb8e658cab832c9f2d0f197d6 Mon Sep 17 00:00:00 2001
From: Fil <fil@rezo.net>
Date: Wed, 22 Feb 2006 11:27:19 +0000
Subject: [PATCH] modif index (merci Cedric) + log verbeux

---
 ecrire/inc_index.php | 28 ++++++++++++++--------------
 ecrire/inc_utils.php |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/ecrire/inc_index.php b/ecrire/inc_index.php
index 34eaef9927..040785bc67 100644
--- a/ecrire/inc_index.php
+++ b/ecrire/inc_index.php
@@ -50,7 +50,6 @@ global $INDEX_objet_associes;
 $INDEX_objet_associes['spip_articles'] = array('spip_documents'=>1,'spip_auteurs'=>10,'mot'=>3);
 $INDEX_objet_associes['spip_breves'] = array('spip_documents'=>1,'spip_mots'=>3);
 $INDEX_objet_associes['spip_rubriques'] = array('spip_documents'=>1,'spip_mots'=>3);
-$INDEX_objet_associes['spip_syndic'] = array('spip_documents'=>1,'spip_mots'=>3);
 $INDEX_objet_associes['spip_documents'] = array('spip_mots'=>3);
 
 // Indexation des elements des objets associes
@@ -385,20 +384,21 @@ function indexer_elements_associes($table, $id_objet, $table_associe, $valeur) {
 		$relation = $tables_relations[$table];
 		if (!$relation) $relation = $tables_relations[$table_abreg];
 		if ( ($relation)
-				&&(isset($relation[$col_id_as])) )
+				&&(isset($relation[$col_id_as])) ){
+				
 			$table_rel = $relation[$col_id_as];
-
-	  $select="assoc.$col_id_as";
-	  foreach(array_keys($INDEX_elements_associes[$table_associe]) as $quoi)
-			$select.=',assoc.' . $quoi;
-		$q = "SELECT $select FROM $table_associe AS assoc,
-			spip_$table_rel AS lien
-			WHERE lien.$col_id=$id_objet
-			AND assoc.$col_id_as=lien.$col_id_as";
-
-		$r = spip_query($q);
-		while ($row = spip_fetch_array($r)) {
-      indexer_les_champs($row,$INDEX_elements_associes[$table_associe],$valeur);
+		  $select="assoc.$col_id_as";
+		  foreach(array_keys($INDEX_elements_associes[$table_associe]) as $quoi)
+				$select.=',assoc.' . $quoi;
+			$q = "SELECT $select FROM $table_associe AS assoc,
+				spip_$table_rel AS lien
+				WHERE lien.$col_id=$id_objet
+				AND assoc.$col_id_as=lien.$col_id_as";
+	
+			$r = spip_query($q);
+			while ($row = spip_fetch_array($r)) {
+	      indexer_les_champs($row,$INDEX_elements_associes[$table_associe],$valeur);
+			}
 		}
  	}
 }
diff --git a/ecrire/inc_utils.php b/ecrire/inc_utils.php
index 852fca9705..3942efa634 100644
--- a/ecrire/inc_utils.php
+++ b/ecrire/inc_utils.php
@@ -613,7 +613,7 @@ function find_in_path ($filename, $sinon = NULL, $path='AUTO') {
 			return $f;
 		}
 	}
-	spip_log("find_in_path n'a pas vu '$filename' dans $path");
+#	spip_log("find_in_path n'a pas vu '$filename' dans $path");
 }
 
 // predicat sur les scripts de ecrire qui n'authentifient pas par cookie
-- 
GitLab