Ce méta-mot permet d'afficher les 15 derniers fichiers les plus téléchargés. La valeur 15 peut être modifiée
function MM_top_download ($arg) {
global $NPDS_Prefix;
$content="";
$arg = arg_filter($arg);
$long_chain=18;
$result = sql_query("select did, dcounter, durl, dfilename, dfilesize, ddate, dweb, duser,dver,
dcategory, ddescription, perms from ".$NPDS_Prefix."downloads order by dcounter
DESC limit 0,$arg");
$content.='<table width="100%"><tr><td width="45%"><strong>Nom</strong></td><td>
<td width="13%"><strong>version</strong></td>
<td width="15%"><strong>Catégorie</strong></td>
<td width="20%"><strong>Date</strong></td><td width="7%"><strong>Hits</strong></td>
</tr></table>';
while (list($did, $dcounter, $durl, $dfilename, $dfilesize, $ddate, $dweb, $duser, $dver, $dcategory,
$ddescription, $dperm) = sql_fetch_row($result)) {
$okfile=autorisation($dperm);
if (strlen($title)>$long_chain) {
$title = (substr($title, 0, $long_chain))." ...";
}
if ($okfile==true) {
$rowcolor = tablos();
if ($dcounter>0) {
$content.='<table width="100%"><tr '.$rowcolor.'><td width="45%">
<a href="/download.php?op=geninfo&did='.$did.'" >'.aff_langue($dfilename).'</a></td>
<td width="13%">'.$dver.'</td><td width="15%">'.aff_langue(stripslashes($dcategory)).'</td>
<td width="20%">'.convertdate($ddate).'</td>
<td width="7%" align="right">'.wrh($dcounter).'</td>
</tr></table>';
}
}
}
sql_free_result($result);
return($content);
}