Pages vues depuis 25/05/2001 : 108 296 664
Index du forum »» Questions »» Equivalent lastarticle pour sections
---------------------------------------------
!modifsection!
Retourne le dernier texte crée ou modifié dans les sections.
function MM_modifsection()
{
global $NPDS_Prefix;
$query=sql_query("SELECT artid,title FROM ".$NPDS_Prefix."seccont ORDER BY timestamp DESC LIMIT 0,1");
while (list($artid,$title)=sql_fetch_row($query))
{
$MM_modifsection = '<a href="sections.php?op=viewarticle&artid='.$artid.'">'.aff_langue($title).'</a>';
}
return ($MM_modifsection);
}
----------------------------------------------
!lastsection!
Retourne le dernier article crée dans les sections.
function MM_lastsection()
{
global $NPDS_Prefix;
$query=sql_query("SELECT artid,title FROM ".$NPDS_Prefix."seccont ORDER BY artid DESC LIMIT 0,1");
while (list($artid,$title)=sql_fetch_row($query))
{
$MM_lastsection = '<a href="sections.php?op=viewarticle&artid='.$artid.'">'.aff_langue($title).'</a>';
}
return ($MM_lastsection);
}
------------------------------------------------
!toparticles!
Retourne les X articles les plus lus dans section.
Variables que vous devez configurer :
top : nombre de posts que vous voulez afficher.
function MM_toparticles()
{
global $NPDS_Prefix;
$MM_toparticles .= '<table width="100%" cellspacing="2" cellpadding="2" border="0">';
settype($top,"integer");
$top = "10";
$max_caracteres=30;
$result = sql_query("select artid, secid, title, content, counter from ".$NPDS_Prefix."seccont order by counter DESC limit 0,$top");
$lugar=1;
$i=0;
while (list($artid, $secid, $title, $content, $counter) = sql_fetch_row($result))
{
$rowcolor=tablos();
$MM_toparticles .= '<tr '.$rowcolor.'>'
.'<td>'.$lugar.' : <a href="sections.php?op=viewarticle&artid='.$artid.'">'.aff_langue($title).'</a></td>'
.'<td align="right">'.$counter.' '.translate('times').'</td>'
.'</tr>';
$lugar++;
}
$MM_toparticles .= '</table>';
return ($MM_toparticles);
}
---------------------------------------