Attention, c'est long
comme la boucle est en deux partie
je copie d'abord le résultat qui correspond à <BOUCLE_aff9(MOTS){par
titre}{id_groupe=9}{' - '}>
et ensuite <BOUCLE_aff9_art(SYNDIC_ARTICLES) {id_mot}>
Boucle 1
001 <?php
002 function BOUCLE_aff9html_d558f88ef57ef95183c91a7c3d3f0405(&$Cache,
&$Pile, &$doublons, &$Numrows, $SP) {
003
004 // REQUETE
005 $result = spip_optim_select(
006 array("mots.id_mot",
007 "mots.id_groupe",
008 "mots.titre"), # SELECT
009 array('mots' => 'spip_mots'), # FROM
010
011 array(
012 array('=', 'mots.id_groupe',
013 // 1 signes
014 "'9'")), # WHERE
015 array(), # WHERE pour jointure
016 '', # GROUP
017 array('mots.titre'), # ORDER
018 '', # LIMIT
019 '', # sous
020
021 array(), # HAVING
022 'mots', # table
023 '_aff9', # boucle
024 ''); # serveur
025 $t0 = "";
026 $SP++;
027
028 // RESULTATS
029 while ($Pile[$SP] = @spip_abstract_fetch($result,"")) {
030
031 $t1 = (
032 // 6 signes
033 '
034 ' .
035
036 // ?_aff9_art
037 ((strval($t1 =
BOUCLE_aff9_arthtml_d558f88ef57ef95183c91a7c3d3f0405($Cache, $Pile,
$doublons, $Numrows, $SP))!='') ?
038 ($t1 . (
039 // 36 signes
040 '
041
042 <span class="tag_epaisseur_' .
043
044 // #COMPTEUR_BOUCLE
045 alterner($Numrows['_aff1']['compteur_boucle'],
046 // 1 signes
047 '1',
048 // 1 signes
049 '2',
050 // 1 signes
051 '3',
052 // 1 signes
053 '4') .
054
055 // 8 signes
056 '">
057 ' .
058
059 // #TOTAL_BOUCLE
060 ((strval($t3 = alterner(coef(filtre_max($Numrows['_aff9_art']['total'],(
061 // 6 signes
062 'total_' .
063
064 // #ID_GROUPE
065 $Pile[$SP]['id_groupe'])),
066 // #TOTAL_BOUCLE
067 $Numrows['_aff9_art']['total'],
068 // 1 signes
069 '4'),
070 // 1 signes
071 '1',
072 // 1 signes
073 '2',
074 // 1 signes
075 '3',
076 // 1 signes
077 '4'))!='') ?
078 ((
079 // 39 signes
080 '<a href="spip.php?page=mot1&id_mot=' .
081
082 // #ID_MOT
083 $Pile[$SP]['id_mot'] .
084
085 // 15 signes
086 '"
087 style="color:' .
088
089 // #BA
090 '#BA' .
091
092 // 25 signes
093 '2916;"
094 class="tag_taille_') . $t3) :
095 ('')) .
096
097 // 9 signes
098 '"
099 title=\'' .
100
101 // #TOTAL_BOUCLE
102 $Numrows['_aff9_art']['total'] .
103
104 // 1 signes
105 '
106 ' .
107
108 // #TOTAL_BOUCLE
109 (($Numrows['_aff9_art']['total'] >
110 // 1 signes
111 '1') ?
112 // 10 signes
113 'references':
114 // 9 signes
115 'reference') .
116
117 // 2 signes
118 '\'>' .
119
120 // #TITRE
121 interdire_scripts(typo($Pile[$SP]['titre'])) .
122
123 // 24 signes
124 '</a>
125
126 </span>
127 ')) :
128 ('')) .
129
130 // 1 signes
131 '
132 ');
133 $t0 .= (($t1 && $t0) ? ' - ' : '') . $t1;
134 }
135
136 @spip_abstract_free($result,'');
137 return $t0;
138 }
139
140
141 ?>
Boucle2
01 <?php
02 function BOUCLE_aff9_arthtml_d558f88ef57ef95183c91a7c3d3f0405(&$Cache,
&$Pile, &$doublons, &$Numrows, $SP) {
03
04 // REQUETE
05 $result = spip_optim_select(
06 array("1"), # SELECT
07 array('L1' =>
'spip_mots_syndic_articles','syndic_articles' =>
'spip_syndic_articles','J2' => 'spip_syndic'), # FROM
08
09 array(
10 array('=', 'L1.id_mot', _q($Pile[$SP]['id_mot'])),
11 array('=', 'syndic_articles.id_syndic', "J2.id_syndic"),
12 array('=', 'syndic_articles.statut', '"publie"'),
13 array('=', 'J2.statut', '"publie"')), # WHERE
14 array(1 => array('syndic_articles',
'id_syndic_article')), # WHERE pour jointure
15 '', # GROUP
16 array(), # ORDER
17 '', # LIMIT
18 '', # sous
19
20 array(), # HAVING
21 'syndic_articles', # table
22 '_aff9_art', # boucle
23 ''); # serveur
24 $Numrows['_aff9_art']['total'] = @spip_abstract_count($result,'');
25 $t0 = "";
26 $SP++;
27 for($x=$Numrows["_aff9_art"]["total"];$x>0;$x--)
28 $t0 .=
29 // 1 signes
30 ' ';
31 @spip_abstract_free($result,'');
32 return $t0;
33 }
34
35
36 ?>