summaryrefslogtreecommitdiff
path: root/src/application
diff options
context:
space:
mode:
authorJonas Kohl2024-12-26 20:18:57 +0100
committerJonas Kohl2024-12-26 20:18:57 +0100
commit8945dff16e2e6208051bae25617c9f76d62a8e0b (patch)
tree2591cca0eaa28eb45abe2bd2b7e0f6100b376fd5 /src/application
parent686fff945e0b4697aa74da404ce90534bb7b121d (diff)
Automatically subscribe to topic when creating itHEADv0.7.3main
Diffstat (limited to 'src/application')
-rw-r--r--src/application/actions/newtopic/post.php7
-rw-r--r--src/application/appdef.php2
2 files changed, 8 insertions, 1 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));
diff --git a/src/application/appdef.php b/src/application/appdef.php
index d623cd1..1e36a07 100644
--- a/src/application/appdef.php
+++ b/src/application/appdef.php
@@ -1,3 +1,3 @@
<?php
-const MYSTICBB_VERSION = "0.7.2";
+const MYSTICBB_VERSION = "0.7.3";