blinkster

Customer
Trying to create or find a forum block simply says the total number of downloads to date. In ACP on the left click attachments then attachments statistics, on that page it says

Total Downloads xxxxxx

Is there a simply code for a side block that can use this information which is already there?

As always thank you in advance for any help.
 
Configuration:
attachmentstats.png


PHP:
PHP:
$astats = $this->registry->db->query_first("
	SELECT SUM(counter) AS downloads
	FROM " . TABLE_PREFIX . "attachment AS a
	INNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid);
");

return 'Total Downloads: ' . vb_number_format($astats['downloads']);
 
Back
Top