1: <?php if(!defined('APPLICATION')) exit();
2:
3: 4: 5: 6: 7: 8: 9: 10:
11: class CakeDayPost implements YagaRule {
12:
13: public function Award($Sender, $User, $Criteria) {
14:
15: $CakeDate = strtotime($User->DateInserted);
16:
17: $CakeMonth = date('n', $CakeDate);
18: $CakeDay = date('j', $CakeDate);
19: $TodaysMonth = date('n');
20: $TodaysDay = date('j');
21:
22: if($CakeMonth == $TodaysMonth
23: && $CakeDay == $TodaysDay) {
24: return TRUE;
25: }
26: else {
27: return FALSE;
28: }
29: }
30:
31: public function Form($Form) {
32: return '';
33: }
34:
35: public function Validate($Criteria, $Form) {
36: return;
37: }
38:
39: public function Hooks() {
40: return array('DiscussionModel_AfterSaveDiscussion', 'CommentModel_AfterSaveComment', 'ActivityModel_BeforeSaveComment');
41: }
42:
43: public function Description() {
44: $Description = T('Yaga.Rules.CakeDayPost.Desc');
45: return Wrap($Description, 'div', array('class' => 'InfoMessage'));
46: }
47:
48: public function Name() {
49: return T('Yaga.Rules.CakeDayPost');
50: }
51:
52: public function Interacts() {
53: return FALSE;
54: }
55: }
56: