What This Modification Does
With this modification, when a user replies to a forum thread, they are automatically subscribed to that thread and will receive notifications when new replies are added. The base functionality for Oxwall requires users to manually subscribe to threads, even if they've posted in them previously. The only time a user is automatically subscribed to a thread is if they're the OP. This modification is more intuitive and provides a smoother user experience.
Original thread/credit here.
----
Find the following file:
/ow_plugins/forum/classes/event_handler.php
----
Locate the following lines:
$event = new OW_Event('notifications.add', $params, $data);
OW::getEventManager()->trigger($event);
}
----
Add this code immediately after:
$subscribeService = FORUM_BOL_SubscriptionService::getInstance();
$userId = OW::getUser()->getId();
$topicId = $post->topicId;
if ( OW::getUser()->isAuthorized('forum', 'subscribe') && !$subscribeService->isUserSubscribed($userId, $topicId) )
{
$subscription = new FORUM_BOL_Subscription;
$subscription->userId = $userId;
$subscription->topicId = $topicId;
$subscribeService->addSubscription($subscription);
}
Best of luck!