diff --git a/ecrire/public/boucles.php b/ecrire/public/boucles.php index e8dffd77b3e99ba4761e2fa66a4d26f4a9cddb97..be4f86fd25286ee082156f9d7eedcb1d09adb679 100644 --- a/ecrire/public/boucles.php +++ b/ecrire/public/boucles.php @@ -42,7 +42,6 @@ function boucle_BOUCLE_dist($id_boucle, &$boucles) { function boucle_ARTICLES_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_articles"; $mstatut = $id_table .'.statut'; // Restreindre aux elements publies @@ -64,7 +63,6 @@ function boucle_ARTICLES_dist($id_boucle, &$boucles) { function boucle_AUTEURS_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_auteurs"; $mstatut = $id_table .'.statut'; // Restreindre aux elements publies @@ -94,7 +92,6 @@ function boucle_AUTEURS_dist($id_boucle, &$boucles) { function boucle_BREVES_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_breves"; $mstatut = $id_table .'.statut'; // Restreindre aux elements publies @@ -116,9 +113,7 @@ function boucle_BREVES_dist($id_boucle, &$boucles) { function boucle_FORUMS_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_forum"; $mstatut = $id_table .'.statut'; - // Par defaut, selectionner uniquement les forums sans mere // Les criteres {tout} et {plat} inversent ce choix if (!isset($boucle->modificateur['tout']) AND !isset($boucle->modificateur['plat'])) { @@ -145,8 +140,6 @@ function boucle_SIGNATURES_dist($id_boucle, &$boucles) { $id_table = $boucle->id_table; $mstatut = $id_table .'.statut'; - $boucle->from[$id_table] = "spip_signatures"; - // Restreindre aux elements publies if (!$boucle->modificateur['criteres']['statut']) { $boucle->where[]= array("'='", "'$mstatut'", "'\\'publie\\''"); @@ -162,7 +155,6 @@ function boucle_SIGNATURES_dist($id_boucle, &$boucles) { function boucle_DOCUMENTS_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_documents"; // on ne veut pas des fichiers de taille nulle, // sauf s'ils sont distants (taille inconnue) @@ -220,7 +212,6 @@ function boucle_DOCUMENTS_dist($id_boucle, &$boucles) { function boucle_RUBRIQUES_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_rubriques"; $mstatut = $id_table .'.statut'; // Restreindre aux elements publies @@ -271,7 +262,6 @@ function boucle_HIERARCHIE_dist($id_boucle, &$boucles) { function boucle_SYNDICATION_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_syndic"; $mstatut = $id_table .'.statut'; // Restreindre aux elements publies @@ -292,7 +282,6 @@ function boucle_SYNDICATION_dist($id_boucle, &$boucles) { function boucle_SYNDIC_ARTICLES_dist($id_boucle, &$boucles) { $boucle = &$boucles[$id_boucle]; $id_table = $boucle->id_table; - $boucle->from[$id_table] = "spip_syndic_articles" ; $mstatut = $id_table .'.statut'; // Restreindre aux elements publies, sauf critere contraire diff --git a/ecrire/public/compiler.php b/ecrire/public/compiler.php index 0f2db1864abc05a5a54ba6291fbde7f3bc573ee5..700af9cd60f34cd8e8d0f248be69c21c0b68abc4 100644 --- a/ecrire/public/compiler.php +++ b/ecrire/public/compiler.php @@ -700,8 +700,8 @@ function public_compiler_dist($squelette, $nom, $gram, $sourcefile, $connect='') $boucles[$id]->sql_serveur = $connect; $show = trouver_table($type, $boucles[$id]); if ($show) { - $boucle->from[$type] = $nom_table = $show['table']; - $boucles[$id]->id_table = $show['id_table']; + $boucles[$id]->id_table = $x = $show['id_table']; + $boucles[$id]->from[$x] = $nom_table = $show['table']; $boucles[$id]->primary = $show['key']["PRIMARY KEY"]; $boucles[$id]->descr = &$descr; if ((!$boucles[$id]->jointures)