summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-04-07 15:24:15 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-04-07 15:24:15 -0600
commit700449b8d903b9707b2751784dc54b4450a655df (patch)
tree438db8c9baaa026f46a35e3f6f149d7aaa32db1e
parentd61a18a93bc1b39d91725497ebb2fe85c4785ead (diff)
Style and layout changes
-rw-r--r--create_thread.php5
-rw-r--r--index.php3
-rw-r--r--model/Post.php4
-rw-r--r--register.php4
-rw-r--r--search.php3
-rw-r--r--signin.php4
-rw-r--r--styles/style.css155
-rw-r--r--templates/404.php3
-rw-r--r--viewcategory.php9
-rw-r--r--viewthread.php3
-rw-r--r--viewuser.php1
11 files changed, 51 insertions, 143 deletions
diff --git a/create_thread.php b/create_thread.php
index dc0ce06..4598ce2 100644
--- a/create_thread.php
+++ b/create_thread.php
@@ -3,6 +3,7 @@
<html>
<head>
<title>Create a thread - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once 'templates/header.php' ?>
@@ -58,9 +59,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$sql = "UPDATE categories SET `cat_thread_count` = `cat_thread_count` + '1' WHERE cat_id = " . $thread_cat . ";";
mysqli_query($dbc, $sql);
- header("Location: /forum/thread/" . $thread_id);
+ header("Location: viewthread.php?id=" . $thread_id);
}
}
?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/index.php b/index.php
index e27a155..7dd0fe4 100644
--- a/index.php
+++ b/index.php
@@ -3,6 +3,7 @@
<html>
<head>
<title>cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once 'templates/header.php'; ?>
@@ -43,7 +44,7 @@
echo '<tr>';
echo '<td>';
echo '<b><a href="viewcategory.php?id=' . $category->id . '">' . $category->name . '</a></b>';
- echo '<br>' . $category->description;
+ echo '<br><small>' . $category->description . '</small>';
echo '</td>';
echo '<td>' . $category->thread_count . '</td>';
echo '<td>' . $category->post_count . '</td>';
diff --git a/model/Post.php b/model/Post.php
index d10a505..ef2fe4f 100644
--- a/model/Post.php
+++ b/model/Post.php
@@ -37,7 +37,7 @@ class Post {
}
function display_content() {
- echo '<div>#' . $this->id . ' Posted by <a href="viewuser.php?id='. $this->author->id.'">' . $this->author->name . '</a> on ' . date('m/d/Y g:ia', strtotime($this->date)) . '<br></div>';
+ echo '<div class="header">#' . $this->id . ' Posted by <a href="viewuser.php?id='. $this->author->id.'">' . $this->author->name . '</a> on ' . date('m/d/Y g:ia', strtotime($this->date)) . '<br></div>';
$post_content = $this->content;
@@ -54,7 +54,7 @@ class Post {
// Replace other URLs with links.
$post_content = preg_replace('@\b(http(s)?://)([^\s]*?(?:\.[a-z\d?=/_-]+)+)(?![^<]*?(?:</\w+>|/?>))@i', '<a href="http$2://$3">$0</a>', $post_content);
- echo $post_content;
+ echo '<p class="post-content">' . $post_content . '</p>';
}
}
diff --git a/register.php b/register.php
index c17c1dd..cd72a37 100644
--- a/register.php
+++ b/register.php
@@ -2,8 +2,10 @@
<html>
<head>
<title>Register an account - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
+<?php include_once 'templates/header.php'?>
<h2>Register an account</h2>
<form action="register.php" method="post">
<label for="user_name">Username: </label><br>
@@ -105,4 +107,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/search.php b/search.php
index d90d0e6..1357d55 100644
--- a/search.php
+++ b/search.php
@@ -3,6 +3,7 @@
<html>
<head>
<title>Search - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once 'templates/header.php'; ?>
@@ -58,4 +59,4 @@
}
?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/signin.php b/signin.php
index ba8f147..aaefbda 100644
--- a/signin.php
+++ b/signin.php
@@ -3,8 +3,10 @@
<html>
<head>
<title>Sign in - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
+ <?php include_once 'templates/header.php'?>
<h2>Sign in</h2>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<label for="user_name">Username: </label><br>
@@ -75,4 +77,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
?>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/styles/style.css b/styles/style.css
index 0455b46..b2a56af 100644
--- a/styles/style.css
+++ b/styles/style.css
@@ -1,65 +1,17 @@
body {
- background-color: #222;
- text-align: center;
-
font-family: sans-serif;
font-size: 10pt;
+ width: 960px;
+ margin: auto;
}
-nav, section, table {
- background-color: white;
- border: 1px solid black;
- text-align: left;
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-section {
- padding: 15px;
-}
-
-footer {
- font-size: 65%;
- color: #999;
- text-align: left;
- display: inline-block;
- width: 100%;
-}
-
-blockquote {
- border-color: #b6dcd5;
- background-color: rgba(199,229,223,.4);
- margin: 18px 5px;
- padding: 12px;
- border: 1px solid #79a;
- overflow: hidden;
- text-overflow: ellipsis;
- border-radius: 5px;
-}
-
-table {
- border-collapse: collapse;
- width: 100%;
- padding: 20px 30px;
- text-align: left;
-}
-
-th {
- background-color: #078;
- color: white;
- border: 1px solid black;
- padding: 0.25em;
- text-align: left;
-}
-
-form {
- text-align: left;
- padding: 5px 5px 5px 50px;
- display: inline-block;
+a {
+ color: #2365B0;
}
-a {
- color: #000;
+small {
+ font-size: 8pt;
+ color: #333;
}
a:hover {
@@ -67,95 +19,38 @@ a:hover {
text-decoration: none;
}
-th a {
- color: white;
- font-style: italic;
-}
-
-th a:hover {
- color:#ddd;
- text-decoration: none;
+table {
+ width: 100%;
}
-#title {
+th, .header {
+ background-color: #469;
color: #eee;
- margin: 20px;
-}
-
-#wrapper {
- width: 900px;
- margin: 0 auto;
+ padding: 2px;
}
-#user {
- float: right;
- text-align: right;
-}
-
-.post td {
- height: 200px;
- min-height: 200px;
- max-height: 600px;
-}
-
-.nav_button {
- background-color: #00728B;
- border: 1px solid black;
- color: white;
- padding: 3px;
- text-decoration: none;
-}
-
-.nav_button:hover {
- color: white;
- background-color: #009FC1;
+th, .header a {
+ color: #eee;
+ font-weight: bold;
}
-.left {
- width: 70%;
+td {
+ background-color: #eee;
}
-.right {
- width: 30%;
+.info {
+ margin: 1px 1px 1px 6px;
+ color: #666;
}
.post-content {
- width: 70%;
- white-space: pre-line;
- padding: 12px;
-}
-
-.youtube-embed {
- width: 480px;
- height: 270px;
- border: none;
-}
-
-.image-embed {
- width: 480px;
-}
-
-.greentext {
- color: darkolivegreen;
-}
-
-h1, h4 {
- margin-top: 2px;
- margin-bottom: 10px;
-}
-
-td {
- padding: 5px;
- border: 1px solid black;
-}
-
-h3 {
- margin: 0;
- padding: 0;
+ overflow: auto;
}
textarea {
- width: 500px;
+ width: 100%;
height: 200px;
+ margin-right: 0px;
overflow: scroll;
-} \ No newline at end of file
+ resize: none;
+}
diff --git a/templates/404.php b/templates/404.php
index 9ba4bcc..d4d5128 100644
--- a/templates/404.php
+++ b/templates/404.php
@@ -2,10 +2,11 @@
<html>
<head>
<title>cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once 'header.php'; ?>
<h1>Page Not Found</h1>
<p>The page you requested does not exist.</p>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/viewcategory.php b/viewcategory.php
index ebdc03f..85dc7ea 100644
--- a/viewcategory.php
+++ b/viewcategory.php
@@ -23,12 +23,15 @@ if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
<html>
<head>
<title><?php echo $current->name; ?> - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once 'templates/header.php';?>
<h1><?php echo $current->name; ?></h1>
<p><?php echo $current->description; ?></p>
- <?php echo $current->thread_count . ' threads, ' . $current->post_count . ' posts'; ?>
+ <span class="info">
+ <?php echo $current->thread_count . ' threads, ' . $current->post_count . ' posts'; ?>
+ </span>
<h2>Threads</h2>
<table width="100%">
<tr>
@@ -53,10 +56,10 @@ if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
echo '<tr>';
echo '<td><b><a href="viewthread.php?id=' . $thread->id . '">' . $thread->subject . '</a></b>';
- echo ' by <b><a href="viewuser.php?id=' . $thread->author->id . '">' . $thread->author->name . '</a></b> on ' . date('M d, Y', strtotime($thread->date_created)) . '</td>';
+ echo '<small> 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>';
if (!is_null($latest_post)) {
- echo '<td>by <b><a href="viewuser.php?id=' . $latest_post->author->id . '">' . $latest_post->author->name . '</a></b> on ' . $latest_post->date . '</td>';
+ echo '<td>by <b><a href="viewuser.php?id=' . $latest_post->author->id . '">' . $latest_post->author->name . '</a></b><small> on ' . $latest_post->date . '</small></td>';
} else {
echo '<td>No posts yet!</td>';
}
diff --git a/viewthread.php b/viewthread.php
index f784e40..c8ae99e 100644
--- a/viewthread.php
+++ b/viewthread.php
@@ -23,6 +23,7 @@ if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
<html>
<head>
<title><?php echo $current->subject; ?> - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once 'templates/header.php';?>
@@ -67,4 +68,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
}
}
-?> \ No newline at end of file
+?>
diff --git a/viewuser.php b/viewuser.php
index 5a6afbc..c43a700 100644
--- a/viewuser.php
+++ b/viewuser.php
@@ -15,6 +15,7 @@ if (!isset($_GET['id'])) {
<html>
<head>
<title><?php echo $current->name; ?>'s Profile - cflip.net forum</title>
+ <link rel="stylesheet" href="styles/style.css">
</head>
<body>
<?php include_once "templates/header.php" ?>