[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$oneday = (time()-86400);
$result = dbquery("SELECT
download_id,
download_title,
download_cat,
download_count
FROM
".DB_DOWNLOADS."
INNER JOIN ".DB_DOWNLOAD_CATS."
ON download_cat_id = download_cat
WHERE ".groupaccess('download_cat_access'
."
AND download_datestamp > $oneday
ORDER BY download_datestamp
DESC LIMIT 0,6
"
;
if (dbrows($result) !=0) {
openside("Todays Downloads"
;
echo "<div class='small'>\n";
while ($data = dbarray($result)) {
echo "<a href='".BASEDIR."downloads.php?cat_id=".$data['download_cat']."' title='".$data['download_title']."' class='side'>".trimlink($data['download_title'], 30)."</a>";
echo "<span style='float:right;'>[".number_format($data['download_count'])."]</span><br />\n";
}
echo "</div>\n";
closeside();
} else {
openside("Todays Downloads"
;
echo "<center>No Downloads Today!</center>\n";
closeside();
}[/syntaxhighlighter]