summaryrefslogtreecommitdiff
path: root/src/application/actions/newtopic
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/actions/newtopic')
-rw-r--r--src/application/actions/newtopic/post.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/application/actions/newtopic/post.php b/src/application/actions/newtopic/post.php
index ca79599..79110eb 100644
--- a/src/application/actions/newtopic/post.php
+++ b/src/application/actions/newtopic/post.php
@@ -2,6 +2,7 @@
use mystic\forum\orm\Attachment;
use mystic\forum\orm\Post;
+use mystic\forum\orm\Subscription;
use mystic\forum\orm\Topic;
use mystic\forum\utils\RequestUtils;
@@ -65,4 +66,10 @@ foreach ($attachments as $att) {
$db->insert($attachment);
}
+$subscription = new Subscription();
+$subscription->id = $db->generateId();
+$subscription->userId = $currentUser->id;
+$subscription->topicId = $topic->id;
+$db->insert($subscription);
+
header("Location: ?_action=viewtopic&topic=" . urlencode($topic->id));