<?php
//Copyright by Stefan Jungbauer
//www.zocker-eppingen.de
//V 1.1
defined ('main') or die ( 'no direct access' );
echo '<b>Newest Download</b>';
$erg = db_query("SELECT prefix_downloads.cat,prefix_downloads.name,prefix_downloads.id,DATE_FORMAT(time,'%d.%m.%Y') as datum FROM prefix_downloads LEFT JOIN prefix_downcats ON prefix_downcats.id = prefix_downloads.cat WHERE ".$_SESSION['authright']." <= prefix_downcats.recht order by prefix_downloads.id DESC LIMIT 0,5");
$i = 0;
while ($row = db_fetch_object($erg)) {
$i++;
$user = $row->name;
echo'
<table width="100%" cellspacing="0" cellpadding="0" height="13">
<tr><td> '.$i.'. <a href="index.php?downloads-show-'.$row->id.'"> '.$user.'</a></td><td></td></tr>
</table>';
}
echo '<b>Top Download</b>';
$a = 0;
$erg = db_query("SELECT prefix_downloads.cat,hits,downs,prefix_downloads.name,prefix_downloads.id,DATE_FORMAT(time,'%d.%m.%Y') as datum FROM prefix_downloads LEFT JOIN prefix_downcats ON prefix_downcats.id = prefix_downloads.cat WHERE ".$_SESSION['authright']." <= prefix_downcats.recht order by downs DESC LIMIT 0,5");
while ($row = db_fetch_object($erg)) {
$a++;
$name = $row->name;
echo'
<table width="100%" cellspacing="0" cellpadding="0" height="13">
<tr><td>'.$a.'. <a href="index.php?downloads-show-'.$row->id.'"> '.$name.'</a></td><td><div align="right">'.$row->downs.'</div></td></tr>
</table>';
}
?>
nimm den... Order by hits?? nein dei downs^^