diff options
Diffstat (limited to 'create_thread.php')
-rw-r--r-- | create_thread.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/create_thread.php b/create_thread.php index 976bd9f..3d1c530 100644 --- a/create_thread.php +++ b/create_thread.php @@ -21,10 +21,9 @@ if (!Session::get()->is_signed_in()) { <input type="text" name="thread_subject"><br> <label for="thread_cat">Category: </label><br> <?php - include_once './includes/functions_category.php'; include_once './includes/model/Category.php'; - $categories = get_all_categories(); + $categories = Category::get_all_categories(); if (count($categories) == 0) { trigger_error('There are no categories to post to!'); @@ -43,9 +42,9 @@ if (!Session::get()->is_signed_in()) { <input type="submit" name="submit"> </form> <?php -include_once 'includes/functions_post.php'; -include_once 'includes/functions_thread.php'; -include_once 'includes/error.php'; +include_once './includes/model/Post.php'; +include_once './includes/model/Thread.php'; +include_once './includes/error.php'; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $post_content = filter_input(INPUT_POST, 'post_content', FILTER_SANITIZE_STRING); @@ -68,8 +67,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { $errstr .= '</ul>'; trigger_error($errstr); } else { - $thread_id = create_thread($thread_subject, $thread_cat); - create_post($post_content, $thread_id, $thread_cat); + $thread_id = Thread::create($thread_subject, $thread_cat); + Post::create($post_content, $thread_id, $thread_cat); header("Location: viewthread.php?id=" . $thread_id); } |