Index: branches/5.2.x/units/helpers/post_helper.php =================================================================== diff -u -N -r15249 -r15286 --- branches/5.2.x/units/helpers/post_helper.php (.../post_helper.php) (revision 15249) +++ branches/5.2.x/units/helpers/post_helper.php (.../post_helper.php) (revision 15286) @@ -1,6 +1,6 @@ Application->makeClass('kSubscriptionManager'); + /* @var $manager kSubscriptionManager */ + + $fields_hash = Array (); + + $user_id = isset($arguments[1]) ? $arguments[1] : $this->Application->RecallVar('user_id'); + + switch ( $name ) { + case 'CategoryTopics': + $category_id = isset($arguments[0]) ? $arguments[0] : $this->Application->GetVar('m_cat_id'); + + $fields_hash = Array ( + 'EmailEventId' => $manager->getEmailEventId('TOPIC.ADD.SUB'), + 'UserId' => $user_id, + 'CategoryId' => $category_id, + ); + break; + + case 'TopicPosts': + $fields_hash = Array ( + 'EmailEventId' => $manager->getEmailEventId('POST.ADD.SUB'), + 'UserId' => $user_id, + 'ParentItemId' => $arguments[0], + ); + break; + } + + $manager->add($fields_hash); + + return $manager; + } } \ No newline at end of file