Support awarding multiple users with a single award.
This commit is contained in:
parent
b374691fab
commit
51e41cc3d3
@ -726,18 +726,25 @@ class YagaHooks implements Gdn_IPlugin {
|
||||
$Criteria = (object) unserialize($Badge->RuleCriteria);
|
||||
$Result = $Rule->Award($Sender, $User, $Criteria);
|
||||
if($Result) {
|
||||
if(is_numeric($Result)) {
|
||||
$AwardedUserID = $Result;
|
||||
$AwardedUserIDs = array();
|
||||
if(is_array($Result)) {
|
||||
$AwardedUserIDs = $Result;
|
||||
}
|
||||
else if(is_numeric($Result)) {
|
||||
$AwardedUserIDs[] = $Result;
|
||||
}
|
||||
else {
|
||||
$AwardedUserID = $UserID;
|
||||
$AwardedUserIDs[] = $UserID;
|
||||
}
|
||||
|
||||
foreach($AwardedUserIDs as $AwardedUserID) {
|
||||
$BadgeAwardModel->Award($Badge->BadgeID, $AwardedUserID, $UserID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the appropriate resources for each controller
|
||||
|
Loading…
x
Reference in New Issue
Block a user