Quote:
Originally Posted by furnival
On a different note... Some of my users are asking how the time period for the max post ratings a user can make per day is calculated. Is it on a rolling 24 hour period, please? I couldn't see how this is done in the code.
|
It's rolling from the time of the last vote.
Line 323 of helpfulanswers.php should you wish to adjust
Code:
$datecut = TIMENOW - 86400;
$helpfulanswer = $db->query_first_slave("
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
WHERE userid = $safeuserid AND dateline > $datecut
");
To change to days something like this will work:
Code:
$helpfulanswer = $db->query_first_slave("
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
WHERE userid = $safeuserid AND (TO_DAYS(dateline) > TO_DAYS(TIMENOW))
");