/** * Register a download against the file * * @return void **/ function hit($version = '') { global $wpdb; if ($version == '') { $version = $this->version_id; } $wpdb->query("UPDATE {$wpdb->prefix}drainhole_files SET hits=hits+1 WHERE id='{$this->id}'"); $wpdb->query("UPDATE {$wpdb->prefix}drainhole_version SET hits=hits+1 WHERE id='{$version}'"); return DH_Access::create($this->id, $version); }