Commit 1e0b39b0 authored by Nigel McNie's avatar Nigel McNie
Browse files

Subscribe a user to topics they create when they're not subscribed to the forum.

parent 5baff6bd
......@@ -182,6 +182,12 @@ function addtopic_submit(Pieform $form, $values) {
'ctime' => db_format_timestamp(time())
)
);
if (!record_exists('interaction_forum_subscription_forum', 'user', $USER->get('id'), 'forum', $forumid)) {
insert_record('interaction_forum_subscription_topic', (object)array(
'user' => $USER->get('id'),
'topic' => $topicid,
));
}
db_commit();
$SESSION->add_ok_msg(get_string('addtopicsuccess', 'interaction.forum'));
redirect('/interaction/forum/topic.php?id='.$topicid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment