3 if (!defined('_ECRIRE_INC_VERSION')) {
7 function yaml_article($id_article) {
8 include_spip('inc/yaml');
9 $a = array_filter(sql_fetsel('*', 'spip_articles', 'id_article='.$id_article));
10 $a['rubrique'] = array_filter(sql_fetsel('*', 'spip_rubriques', 'id_rubrique='.$a['id_rubrique']));
12 foreach (sql_allfetsel('*', 'spip_mots AS m LEFT JOIN spip_mots_articles AS c ON m.id_mot=c.id_mot', 'c.id_article='.$id_article) as $m) {
13 $a['mots'][] = array_filter($m);
16 return yaml_encode(array_filter($a));