summaryrefslogtreecommitdiff
path: root/search.php
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-06-06 09:05:53 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-06-06 09:05:53 -0600
commit8b44cecf9637e77cf0495e5ad08fdd033b39f06f (patch)
tree4737a4eaba37e00419a2e19e613efa02c743b115 /search.php
parent08fc47935c3793a28359d185d13abba8aa075889 (diff)
Remove manage post and search pages
Diffstat (limited to 'search.php')
-rw-r--r--search.php66
1 files changed, 0 insertions, 66 deletions
diff --git a/search.php b/search.php
deleted file mode 100644
index e5ef9db..0000000
--- a/search.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php session_start() ?>
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>Search - cflip.net forum</title>
- <link rel="stylesheet" href="styles/style.css">
-</head>
-<body>
-<?php include_once './includes/templates/header.php'; ?>
-<h2>Search cflip.net forum</h2>
-<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="get">
- <label for="type">Type:</label>
- <select id="type" name="type">
- <option value="thread">Thread</option>
- <option value="post">Post</option>
- <option value="user">User</option>
- </select>
- <label for="sort">Sort By:</label>
- <select id="sort" name="sort">
- <option value="lr">Last Reply</option>
- <option value="cd">Creation Date</option>
- <option value="rc">Reply Count</option>
- </select>
- <label for="text">With Name:</label>
- <input id="text" type="text" name="query">
- <input type="submit" value="Search!">
-</form>
-<hr>
-<?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';
-
-if (!isset($_GET['type'])) {
- echo 'Specify a type to search.';
-} else {
- switch ($_GET['type']) {
- case 'thread':
- $threads = get_all_threads();
- foreach ($threads as $thread) {
- echo '<p>';
- echo '<td><b><a href="viewthread.php?id=' . $thread->id . '">' . $thread->subject . '</a></b>';
- echo '<small> created by <b><a href="viewuser.php?id=' . $thread->author->id . '">' . $thread->author->name . '</a></b> on ' . date('M d, Y', strtotime($thread->date_created)) . '</small></td>';
- echo '</p>';
- }
- break;
- case 'post':
- $posts = get_all_posts();
-
- foreach ($posts as $post) {
- echo '<h3>From <a href="viewthread.php?id=' . $post->thread->id . '">' . $post->thread->subject . '</a></h3>';
- echo get_post_content($post);
- echo '<hr>';
- }
- break;
- case 'user':
- break;
- default:
- echo '<h3>Could not search: Invalid type!</h3>';
- break;
- }
-}
-?>
-</body>
-</html>