Fix DownloadCount Error reported in Bug 257229 Comment 9. DownloadCounts should be last 7 days, not one day 7 days ago.

This commit is contained in:
psychoticwolf%carolina.rr.com 2004-10-17 05:23:15 +00:00
Родитель a1261bb589
Коммит 3a3a1604a9
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -77,7 +77,7 @@ $today=date("Ymd")."000000";
// This is also where the weekly w/e code would go. if that feature is ever created.
$mindate = date("Ymd", mktime(0, 0, 0, date("m"), date("d")-7, date("Y")))."000000";
$downloadcount="0";
$sql = "SELECT `downloadcount` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`>='$mindate' AND `type`='count' LIMIT 1";
$sql = "SELECT `downloadcount` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`>='$mindate' AND `type`='count' ORDER BY `date` DESC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$downloadcount = $downloadcount+$row["downloadcount"];

Просмотреть файл

@ -77,7 +77,7 @@ $today=date("Ymd")."000000";
// This is also where the weekly w/e code would go. if that feature is ever created.
$mindate = date("Ymd", mktime(0, 0, 0, date("m"), date("d")-7, date("Y")))."000000";
$downloadcount="0";
$sql = "SELECT `downloadcount` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`>='$mindate' AND `type`='count' LIMIT 1";
$sql = "SELECT `downloadcount` FROM `t_downloads` WHERE `ID`='$_GET[id]' AND `date`>='$mindate' AND `type`='count' ORDER BY `date` DESC";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
$downloadcount = $downloadcount+$row["downloadcount"];