diff --git a/ecrire/exec/export_all.php b/ecrire/exec/export_all.php index 401b376b4a3640dd6254b0270009f2850de1a535..8c7c289e6d66df5f9f1de274553925f32a7f6426 100644 --- a/ecrire/exec/export_all.php +++ b/ecrire/exec/export_all.php @@ -157,13 +157,13 @@ function export_objets($table, $type, $file = 0, $gz = false, $etape_en_cours="" } // Exporter les relations if ($type == 'article') { - $res2 = spip_query("SELECT id_auteur FROM spip_auteurs_articles WHERE id_article=".$row[0]); + $res2 = spip_query("SELECT id_auteur FROM spip_auteurs_articles WHERE id_article=".$row['id_article']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:auteur>' . $row2['id_auteur'] . '</lien:auteur>' . "\n"; } spip_free_result($res2); - $res2 = spip_query("SELECT id_document FROM spip_documents_articles WHERE id_article=".$row[0]); + $res2 = spip_query("SELECT id_document FROM spip_documents_articles WHERE id_article=".$row['id_article']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:document>' . $row2['id_document'] . '</lien:document>' . "\n"; @@ -171,7 +171,7 @@ function export_objets($table, $type, $file = 0, $gz = false, $etape_en_cours="" spip_free_result($res2); } else if ($type == 'message') { - $res2 = spip_query("SELECT id_auteur FROM spip_auteurs_messages WHERE id_message=".$row[0]); + $res2 = spip_query("SELECT id_auteur FROM spip_auteurs_messages WHERE id_message=".$row['id_message']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:auteur>' . $row2['id_auteur'] . '</lien:auteur>' . "\n"; @@ -179,7 +179,7 @@ function export_objets($table, $type, $file = 0, $gz = false, $etape_en_cours="" spip_free_result($res2); } else if ($type == 'breve') { - $res2 = spip_query("SELECT id_document FROM spip_documents_breves WHERE id_breve=".$row[0]); + $res2 = spip_query("SELECT id_document FROM spip_documents_breves WHERE id_breve=".$row['id_breve']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:document>' . $row2['id_document'] . '</lien:document>' . "\n"; @@ -187,13 +187,13 @@ function export_objets($table, $type, $file = 0, $gz = false, $etape_en_cours="" spip_free_result($res2); } else if ($type == 'rubrique') { - $res2 = spip_query("SELECT id_document FROM spip_documents_rubriques WHERE id_rubrique=".$row[0]); + $res2 = spip_query("SELECT id_document FROM spip_documents_rubriques WHERE id_rubrique=".$row['id_rubrique']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:document>' . $row2['id_document'] . '</lien:document>' . "\n"; } spip_free_result($res2); - $res2 = spip_query("SELECT id_auteur FROM spip_auteurs_rubriques WHERE id_rubrique=".$row[0]); + $res2 = spip_query("SELECT id_auteur FROM spip_auteurs_rubriques WHERE id_rubrique=".$row['id_rubrique']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:auteur>' . $row2['id_auteur'] . '</lien:auteur>' . "\n"; @@ -201,38 +201,38 @@ function export_objets($table, $type, $file = 0, $gz = false, $etape_en_cours="" spip_free_result($res2); } else if ($type == 'auteur') { - $res2 = spip_query("SELECT id_rubrique FROM spip_auteurs_rubriques WHERE id_auteur=".$row[0]); + $res2 = spip_query("SELECT id_rubrique FROM spip_auteurs_rubriques WHERE id_auteur=".$row['id_auteur']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:rubrique>' . $row2['id_rubrique'] . '</lien:rubrique>' . "\n"; } spip_free_result($res2); } else if ($type == 'mot') { - $res2 = spip_query("SELECT id_article FROM spip_mots_articles WHERE id_mot=".$row[0]); + $res2 = spip_query("SELECT id_article FROM spip_mots_articles WHERE id_mot=".$row['id_mot']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:article>' . $row2['id_article'] . '</lien:article>' . "\n"; } spip_free_result($res2); - $res2 = spip_query("SELECT id_breve FROM spip_mots_breves WHERE id_mot=".$row[0]); + $res2 = spip_query("SELECT id_breve FROM spip_mots_breves WHERE id_mot=".$row['id_mot']); while($row2 = spip_fetch_array($res2)) { $string .= '<lien:breve>' . $row2['id_breve'] . '</lien:breve>' . "\n"; } spip_free_result($res2); - $res3 = spip_query("SELECT id_forum FROM spip_mots_forum WHERE id_mot=".$row[0]); + $res3 = spip_query("SELECT id_forum FROM spip_mots_forum WHERE id_mot=".$row['id_mot']); while($row3 = spip_fetch_array($res3)) { $string .= '<lien:forum>' . $row3['id_forum'] . '</lien:forum>' . "\n"; } spip_free_result($res3); - $res4 = spip_query("SELECT id_rubrique FROM spip_mots_rubriques WHERE id_mot=".$row[0]); + $res4 = spip_query("SELECT id_rubrique FROM spip_mots_rubriques WHERE id_mot=".$row['id_mot']); while($row4 = spip_fetch_array($res4)) { $string .= '<lien:rubrique>' . $row4['id_rubrique'] . '</lien:rubrique>' . "\n"; } spip_free_result($res4); - $res4 = spip_query("SELECT id_syndic FROM spip_mots_syndic WHERE id_mot=".$row[0]); + $res4 = spip_query("SELECT id_syndic FROM spip_mots_syndic WHERE id_mot=".$row['id_mot']); while($row4 = spip_fetch_array($res4)) { $string .= '<lien:syndic>' . $row4['id_syndic'] . '</lien:syndic>' . "\n"; diff --git a/ecrire/exec/rubriques_edit.php b/ecrire/exec/rubriques_edit.php index 5dd62ba2f233ef54694686d33764a87b1e8fdc03..01b4a8b965b2b9bf01a7cbde7d5988dc7a68e772 100644 --- a/ecrire/exec/rubriques_edit.php +++ b/ecrire/exec/rubriques_edit.php @@ -115,7 +115,8 @@ echo selecteur_rubrique($id_parent, 'rubrique', $restreint, $id_rubrique); // si c'est une rubrique-secteur contenant des breves, demander la // confirmation du deplacement - list($contient_breves) = spip_fetch_array(spip_query("SELECT COUNT(*) AS cnt FROM spip_breves WHERE id_rubrique='$id_rubrique' LIMIT 1")); + $contient_breves = spip_fetch_array(spip_query("SELECT COUNT(*) AS cnt FROM spip_breves WHERE id_rubrique='$id_rubrique' LIMIT 1")); + $contient_breves = $contient_breves['cnt']; if ($contient_breves > 0) { $scb = ($contient_breves>1? 's':''); diff --git a/ecrire/inc/forum_insert.php b/ecrire/inc/forum_insert.php index aa40d242e163426270fa3cdd94c5bb3ae81cdb10..3320b60d5955fba03d650e13b53e9d5be9faafab 100644 --- a/ecrire/inc/forum_insert.php +++ b/ecrire/inc/forum_insert.php @@ -202,8 +202,10 @@ function inc_forum_insert_dist() { // Entrer le message dans la base $id_message = spip_abstract_insert('spip_forum', '(date_heure)', '(NOW())'); - if ($id_forum) - list($id_thread) = spip_fetch_array(spip_query("SELECT id_thread FROM spip_forum WHERE id_forum = $id_forum")); + if ($id_forum) { + $id_thread = spip_fetch_array(spip_query("SELECT id_thread FROM spip_forum WHERE id_forum = $id_forum")); + $id_thread = $id_thread['id_thread']; + } else $id_thread = $id_message; # id_thread oblige INSERT puis UPDATE. diff --git a/ecrire/inc/indexation.php b/ecrire/inc/indexation.php index 41d982e70908d00a4b244b054c9f70698e2ff4eb..27a1c2ebdb3fb7c13da03271f5bf4b55418e18a7 100644 --- a/ecrire/inc/indexation.php +++ b/ecrire/inc/indexation.php @@ -305,7 +305,8 @@ function indexer_contenu_document ($row) { global $extracteur; if ($row['mode'] == 'vignette') return; - list($extension) = spip_fetch_array(spip_query("SELECT extension FROM spip_types_documents WHERE id_type = ".$row['id_type'])); + $extension = spip_fetch_array(spip_query("SELECT extension FROM spip_types_documents WHERE id_type = ".$row['id_type'])); + $extension = $extension['extension']; // Voir si on sait lire le contenu (eventuellement en chargeant le // fichier extract/pdf.php dans find_in_path() )