r12160 - spip/ecrire/public

Author: esj@rezo.net
Date: 2008-07-23 18:00:24 +0200 (mer, 23 jui 2008)
New Revision: 12160

Log:
Pb avec [12109] détecté par Arno: si on a un critère {{{n,m}}} avec {{{n > 0}}} dans une boucle à corps constant, produire un COUNT est incorrect car MySQL applique {{{LIMIT n}}} sur l'agrégation COUNT, forcément unique. On isole le cas.
Le code étant devenu très chevelu ici, on le remet un peu à plat, il était temps.

Tests:
{{{
<BOUCLE_test_theme(ARTICLES){4,1} />
#TOTAL_BOUCLE
<//B_test_theme>
<hr />
<B_test2>
#TOTAL_BOUCLE
<br />
<BOUCLE_test2(ARTICLES){4,1}>[(#TITRE|supprimer_numero)] </BOUCLE_test2>

<BOUCLE_mois(ARTICLES){mois=1}></BOUCLE_mois>

<BOUCLE_COMPTEUR_BOUCLE(AUTEURS){1/2} />#TOTAL_BOUCLE<//B_COMPTEUR_BOUCLE>
  </body>
</html>
}}}

Modified:
   spip/ecrire/public/compiler.php

Details: http://trac.rezo.net/trac/spip/changeset/12160