Quote:
Originally Posted by furnival
Excellent, many thanks Ted I used that code.
Regarding the post you made before about how the no. of posts rated in a 24 hour period works..... I might be pushing my luck here, but this will be my last request I promise: it would be useful for me to exclude users in certain usergroups from the limit on the number of posts they can rate in 24 hours (so that moderators can rate an unlimited number of posts as helpful). Is there an addition I could make to the code around line 323 to achieve that, please?
|
No need to stop anywhere... the idea of my mods is to extend them so asking how to do so is perfectly reasonable...
And yes, you can do this. If you just exclude groups from the function it's very simple...
Find
Code:
$datecut = TIMENOW - 86400;
$helpfulanswer = $db->query_first_slave("
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
WHERE userid = $safeuserid AND dateline > $datecut
");
$count = $helpfulanswer['count'];
Change to something like...
Code:
$datecut = TIMENOW - 86400;
if(!is_member_of($bbuserinfo, 1,2,3)){
$datecheck = "AND dateline > ". $datecut;
} else { $datecheck = ''; }
$helpfulanswer = $db->query_first_slave("
SELECT COUNT(helpfulanswerid) as count FROM " . TABLE_PREFIX . "helpfulanswer
WHERE userid = $safeuserid $datecheck
");
$count = $helpfulanswer['count'];
Where x,y,z are groups to exclude.