summaryrefslogtreecommitdiff
path: root/src/application/actions/viewtopic/_common.php
blob: 080cd97adefefcd7cc6cc766b6ca020e0ce6d004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

use mystic\forum\orm\Topic;

$formId = "addpost";
$topicId = $_GET["topic"] ?? call_user_func(function() {
    http_response_code(400);
    msg_error(__("Missing topic id"));
    exit;
});
$topic = new Topic();
$topic->id = $topicId;
if (!$db->fetch($topic)) {
    http_response_code(404);
    msg_error(__("No topic exists with this id"));
    exit;
}