Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin/parse_logs/count_downloads.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'bin/parse_logs/count_downloads.class.php')
-rw-r--r--bin/parse_logs/count_downloads.class.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/parse_logs/count_downloads.class.php b/bin/parse_logs/count_downloads.class.php
index 9274654..f1e43f1 100644
--- a/bin/parse_logs/count_downloads.class.php
+++ b/bin/parse_logs/count_downloads.class.php
@@ -86,7 +86,7 @@ class Count_Downloads {
}
$_addon_ids = $details['addon_ids'];
} elseif (!empty($details['fileid'])) {
- $addon_id_result = $this->db->read("SELECT versions.addon_id FROM files LEFT JOIN versions ON files.version_id = versions.id WHERE files.id={$details['fileid']}");
+ $addon_id_result = $this->db->query("SELECT versions.addon_id FROM files LEFT JOIN versions ON files.version_id = versions.id WHERE files.id={$details['fileid']}");
$addon_id = mysql_fetch_array($addon_id_result);
if (!empty($addon_id['addon_id'])) {
@@ -165,22 +165,22 @@ class Count_Downloads {
function logfileParsedCallback() {
// update total downloads
foreach ( $this->counts['totdown'] as $id => $ct ) {
- $this->db->write("UPDATE addons SET totaldownloads=totaldownloads+{$ct} WHERE id={$id}");
+ $this->db->query("UPDATE addons SET totaldownloads=totaldownloads+{$ct} WHERE id={$id}", true);
}
// now the dailies
foreach ( $this->counts['perday'] as $id => $days ) {
foreach ( $days as $day => $ct ) {
- $this->db->write("INSERT INTO download_counts(addon_id, count, date) VALUES({$id}, {$ct}, '{$day}')
- ON DUPLICATE KEY UPDATE count=count+{$ct}");
+ $this->db->query("INSERT INTO download_counts(addon_id, count, date) VALUES({$id}, {$ct}, '{$day}')
+ ON DUPLICATE KEY UPDATE count=count+{$ct}", true);
}
}
// now the collections
foreach ( $this->counts['collections_and_addons'] as $collection_id => $details) {
- $this->db->write("UPDATE collections SET downloads = downloads + {$details['total']} WHERE id={$collection_id} LIMIT 1");
+ $this->db->query("UPDATE collections SET downloads = downloads + {$details['total']} WHERE id={$collection_id} LIMIT 1", true);
foreach ($details['addon_ids'] as $addon_id => $count ) {
- $this->db->write("UPDATE addons_collections SET downloads = downloads + {$count} WHERE addon_id={$addon_id} AND collection_id={$collection_id} LIMIT 1");
+ $this->db->query("UPDATE addons_collections SET downloads = downloads + {$count} WHERE addon_id={$addon_id} AND collection_id={$collection_id} LIMIT 1", true);
}
}