Commit f94a38f7 authored by cividesk's avatar cividesk

Workaround for sf.net erroneous entries in their stats

parent 0870803d
......@@ -25,7 +25,10 @@ $dbh->query(substr($query,0,-1));
$dbh->query("DELETE FROM sourceforge_download WHERE type='M'");
$query = "INSERT INTO sourceforge_download (type, label, value) VALUES ";
foreach ($result->downloads as $stat) {
$stat[0] = substr($stat[0], 0, 7); // keep only month part of string
$query .= "('M', '$stat[0]', $stat[1]),";
// Workaround for sf.net adding extra 0 values in their stats
if (substr($stat[0], -8) == '00:00:00') {
$stat[0] = substr($stat[0], 0, 7); // keep only month part of string
$query .= "('M', '$stat[0]', $stat[1]),";
}
}
$dbh->query(substr($query,0,-1));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment