diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-24 19:40:50 -0600 |
---|---|---|
committer | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-24 19:40:50 -0600 |
commit | 2098bf444afadcf0363d89b4cc1dca5d2213d754 (patch) | |
tree | da93b29e22170d7be7c9ed215fde5238e9d76178 /search.php | |
parent | aae25cd709d486f7ee9513753d40eb5cc239c42d (diff) |
Remove all uses of db_inc.php
This method of importing the database login every time wasn't very good.
Now everything uses the new Database singleton class.
Diffstat (limited to 'search.php')
-rw-r--r-- | search.php | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -27,7 +27,8 @@ </form> <hr> <?php -include_once './includes/db_inc.php'; +include_once './includes/functions_thread.php'; +include_once './includes/functions_post.php'; include_once './includes/model/Thread.php'; include_once './includes/model/Post.php'; @@ -36,7 +37,7 @@ if (!isset($_GET['type'])) { } else { switch ($_GET['type']) { case 'thread': - $threads = get_all_threads($dbc); + $threads = get_all_threads(); foreach ($threads as $thread) { echo '<p>'; echo '<td><b><a href="viewthread.php?id=' . $thread->id . '">' . $thread->subject . '</a></b>'; @@ -45,11 +46,11 @@ if (!isset($_GET['type'])) { } break; case 'post': - $posts = get_all_posts($dbc); + $posts = get_all_posts(); foreach ($posts as $post) { echo '<h3>From <a href="viewthread.php?id=' . $post->thread->id . '">' . $post->thread->subject . '</a></h3>'; - $post->display_content($dbc); + echo get_post_content($post); echo '<hr>'; } break; |