diff --git a/library/rules/class.commentcount.php b/library/rules/class.commentcount.php index fa85b40..7401bf3 100644 --- a/library/rules/class.commentcount.php +++ b/library/rules/class.commentcount.php @@ -62,7 +62,7 @@ class CommentCount implements YagaRule{ $Form->SetValidationResults($Validation->Results()); } public function Hooks() { - return array('CommentModel_AfterSaveComment'); + return array('Base_AfterGetSession'); } public function Description() { diff --git a/library/rules/class.discussioncount.php b/library/rules/class.discussioncount.php index 875bded..354e70f 100644 --- a/library/rules/class.discussioncount.php +++ b/library/rules/class.discussioncount.php @@ -63,7 +63,7 @@ class DiscussionCount implements YagaRule{ } public function Hooks() { - return array('DiscussionModel_AfterSaveDiscussion'); + return array('Base_AfterGetSession'); } public function Description() { diff --git a/library/rules/class.holidayvisit.php b/library/rules/class.holidayvisit.php index 5a65c5c..4aa581e 100644 --- a/library/rules/class.holidayvisit.php +++ b/library/rules/class.holidayvisit.php @@ -54,7 +54,7 @@ class HolidayVisit implements YagaRule { } public function Hooks() { - return array('Base_AfterSignIn'); + return array('Base_AfterGetSession'); } public function Description() { diff --git a/library/rules/class.lengthofservice.php b/library/rules/class.lengthofservice.php index aef8371..66d64c1 100644 --- a/library/rules/class.lengthofservice.php +++ b/library/rules/class.lengthofservice.php @@ -49,7 +49,7 @@ class LengthOfService implements YagaRule { } public function Hooks() { - return array('Base_AfterSignIn'); + return array('Base_AfterGetSession'); } public function Description() { diff --git a/library/rules/class.photoexists.php b/library/rules/class.photoexists.php index c633477..886b83e 100644 --- a/library/rules/class.photoexists.php +++ b/library/rules/class.photoexists.php @@ -27,7 +27,7 @@ class PhotoExists implements YagaRule { } public function Hooks() { - return array('UserModel_AfterSave'); + return array('Base_AfterGetSession'); } public function Description() { diff --git a/settings/about.php b/settings/about.php index 71e535b..1caaec6 100755 --- a/settings/about.php +++ b/settings/about.php @@ -3,14 +3,14 @@ $ApplicationInfo['Yaga'] = array( 'Name' => 'Yet Another Gamification Application', 'Description' => 'Yaga provides customizable reactions, badges, and ranks for your Vanilla forum software. Increase user activity by letting users react to content with emotions. Give users badges based on statistics and engagement in your community. Create and award custom badges for special events and recognition. Award Ranks which can confer different (configurable) permissions based on community perception and participation.', - 'Version' => '0.3.3', - 'Url' => 'http://github.com/hgtonight/application-yaga', + 'Version' => '0.3.4', + 'Url' => 'http://github.com/hgtonight/application-yaga', 'Author' => 'Zachary Doll', 'AuthorEmail' => 'hgtonight@daklutz.com', 'AuthorUrl' => 'http://www.daklutz.com', 'License' => 'GPLv3', 'SettingsUrl' => '/settings/yaga', - 'SettingsPermission' => 'Garden.Settings.Manage', + 'SettingsPermission' => 'Garden.Settings.Manage', // Application requirements 'RequiredApplications' => array('Vanilla' => '2.1b2'), diff --git a/settings/class.hooks.php b/settings/class.hooks.php index 6169fda..4eb12b6 100755 --- a/settings/class.hooks.php +++ b/settings/class.hooks.php @@ -419,6 +419,10 @@ class YagaHooks implements Gdn_IPlugin { /** * Check for Badge Awards where appropriate */ + public function Base_AfterGetSession_Handler($Sender) { + $this->_AwardBadges($Sender, 'Base_AfterGetSession'); + } + public function CommentModel_AfterSaveComment_Handler($Sender) { $this->_AwardBadges($Sender, 'CommentModel_AfterSaveComment'); } @@ -465,7 +469,13 @@ class YagaHooks implements Gdn_IPlugin { if(!C('Yaga.Badges.Enabled') || !$Session->IsValid()) { return; } - + + if(Debug()) { + $Controller = Gdn::Controller(); + if($Controller) { + $Controller->InformMessage("Checking for awards on $Hook"); + } + } $UserID = $Session->UserID; $UserModel = new UserModel(); $User = $UserModel->GetID($UserID);