website logo
Auteur
avatar
rockandsnow74

Forum » » Questions » » metamot


Posté : 09-12-2012 22:25 icone du post

Sous evolution, j'ai fait ça:


function MM_LastHistoria ($arg) {
   $lugar=1;
   $content="";

   $arg = arg_filter($arg);

   $xtab=news_aff("libre","WHERE topic=8 order  by sid DESC limit 0, ".$arg*2,0,$arg*2);
   $story_limit=0;
   while (($story_limit<$arg) and ($story_li mit<sizeof($xtab))) {
      $rowcolor = tablos();
      list($sid, $catid, $aid, $ title, $time, $hometext, $bodytext, $comments, $counte r) = $xtab[$story_limit];
      $story_limit++;
      if($counter>0) {
        $content.="<li><a&nb sp;href=\"article.php?sid=$sid\" class=\"noir\">".aff_langue($title)."& lt;/a>";
         $lugar++;
     }
   }
   return($content);
}


Après dans un bloc, je peux afficher les derniers articles:
LastHistoria (8); 8 étant la catégorie de l'article
Ce bout de machin est certainement perfectible.
En limitant à 1, tu devrais obtenir le dernier.

Message édité par : developpeur / 10-12-2012 00:22


Cet article provient de NPDS REvolution 16
https://lab.grottes-et-karsts-de-chine.org/viewtopic.php?topic=25668&forum=9