Quote:
Originally Posted by lasto
clicked install m8 - all seems fine except for me it wont reg if someone downloads
the stats only update when they upload.Downloads stay at Zero regardless
will see if anyone else has same problems
|
okie, got that fixed now.

*update one instruction*
To fix your current download stats problem, open attachment.php,
FIND:
Code:
// update user download stats by tnguy3n
$filesize = $attachmentinfo['filesize']/1024;
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET downloadno = downloadno + 1
WHERE userid = $bbuserinfo[userid]
");
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET downloadtotal = downloadtotal + $filesize
WHERE userid = $bbuserinfo[userid]
");
Then DELETE IT!
FIND:
Code:
else
{
// or doing it once an hour
$DB_site->shutdown_query("
INSERT INTO " . TABLE_PREFIX . "attachmentviews (attachmentid)
VALUES ($attachmentinfo[attachmentid])
");
}
BELOW IT, ADD:
Code:
// update user download stats by tnguy3n
$filesize = $attachmentinfo['filesize']/1024;
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET downloadno = downloadno + 1
WHERE userid = $bbuserinfo[userid]
");
$DB_site->shutdown_query("
UPDATE " . TABLE_PREFIX . "user
SET downloadtotal = downloadtotal + $filesize
WHERE userid = $bbuserinfo[userid]
");
That's it! and it based on code of vb 3.0.5.