Compare commits

..

1 Commits

Author SHA1 Message Date
SnowCode 55a94c2308 Adding sql commands 2021-09-08 21:34:38 +02:00
16 changed files with 155 additions and 126 deletions

View File

@ -7,7 +7,6 @@ Macros that insert templates
- `%BANNER_COOKIES%` the cookie banner (requires PHP)
### [pass1_misc.json](./pass1_misc.json)
Miscellaneous macros
- `%FAVICON%` links the tab icon (HTML <head> section)
- `%STYLESHEET%` links stylesheet (HTML <head> section)
- `%PLEAZE_NO_CACHE%` tell the browser not to cache this page (PHP, before any data is sent to the client)
- `%COLOR_BEIGE%`, `%COLOR_ORANGE%`, `%COLOR_BLUE%`, `%COLOR_PINK%`, `%COLOR_CYAN%` color codes, format: #XXXXXX

View File

@ -1,5 +1,4 @@
{
"FAVICON":"<link rel=\"icon\" type=\"image\/png\" href=\"%CONTENT_DIR%\/img\/favicon-32x32.png\" sizes=\"32x32\" />",
"STYLESHEET":"<link rel=\"stylesheet\" type=\"text\/css\" href=\"%CONTENT_DIR%\/style.css\">",
"PLEAZE_NO_CACHE":"header('Cache-Control: no-cache, no-store, must-revalidate');header('Pragma: no-cache');header('Expires: 0');",
"COLOR_BEIGE":"#fef6e4", "COLOR_ORANGE":"#f3d2c1", "COLOR_BLUE":"#001858", "COLOR_PINK":"#f582ae", "COLOR_CYAN":"#8bd3dd"

View File

@ -12,7 +12,7 @@ $navbar="about";
ThreadR - About Us
</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -11,7 +11,7 @@ $id=$_GET['id'];
<head>
<title>ThreadR - Boards</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<?php
if(isset($_GET['action'])) {
if ($_GET['action']=='submit') {

View File

@ -10,16 +10,14 @@ $navbar="boards";
<head>
<title>ThreadR - Boards</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
%NAVBAR%
<div class="container">
<div class="item-1">
<h1>
<center>ThreadR Boards</center>
</h1>
<h1><center>ThreadR Boards</center></h1>
</div>
<div class="item-2">
<ul class="list">

View File

@ -1,25 +1,7 @@
# Short documentation of all files
### [index.html](./index.html)
This is my usual nope.html to prevent kiddies from poking at my files. It just redirects. There is no real security benefit to it though as it does not even prevent `wget -r`.
### [favicon-32x32.png](./favicon-32x32.png)
- Tab icon
- format: PNG
- resolution: 32x32
### [threadR.png](./threadR.png)
- unused
- format: PNG
- resolution: 48x48
### [ThreadR.png](./ThreadR.png)
- unused, render of the main logo svg
- format: PNG
- resolution: 1856x674
### [ThreadR.svg](./ThreadR.svg)
- main logo, front center on the home page
- format: SVG + macros
- will not render properly without macro processing
### [ThreadR_Home.svg](./ThreadR_Home.svg)
- more square version of the logo, used on the "home" link on the navbar
- format: SVG + macros
- will not render properly without macro processing
### *.{svg,png,jpg}
images that are used on the page
### [README.md](./README.md)
this file

View File

@ -11,7 +11,7 @@ $navbar="home";
<head>
<title>ThreadR - Home</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -11,7 +11,7 @@ if (isset($_SESSION['user_id'])){
<head>
<title>ThreadR - Log In</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -8,7 +8,7 @@ $navbar = "logout";
<head>
<title>ThreadR - Home</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -10,7 +10,7 @@ $navbar = "news";
<head>
<title>ThreadR - News</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -26,7 +26,7 @@ $navbar = "profile";
<head>
<title>ThreadR - Profile</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -9,7 +9,7 @@ $navbar = "signup";
<head>
<title>ThreadR - Sign Up</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -34,7 +34,7 @@ $navbar = "verify-email";
<head>
<title>ThreadR - Verification</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

View File

@ -25,7 +25,7 @@ $navbar = "home";
<head>
<title>ThreadR</title>
%STYLESHEET%
%FAVICON%
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

51
threadr.sql Normal file
View File

@ -0,0 +1,51 @@
CREATE DATABASE threadr;
USE threadr;
CREATE TABLE boards(
id INT AUTO_INCREMENT,
name VARCHAR(50),
user_friendly_name VARCHAR(50),
private BOOL,
public_visible BOOL,
PRIMARY KEY (id)
);
CREATE TABLE posts(
id INT AUTO_INCREMENT,
board_id INT,
user_id INT,
post_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
edit_time TIMESTAMP NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(),
content TEXT NULL DEFAULT NULL,
attachement_hash BIGINT(20) NULL DEFAULT NULL,
attachement_name VARCHAR(100) NULL DEFAULT NULL,
title VARCHAR(100) NULL DEFAULT NULL,
reply_to INT DEFAULT -1,
PRIMARY KEY (id)
);
CREATE TABLE profiles(
id INT AUTO_INCREMENT,
email VARCHAR(100),
display_name VARCHAR(50),
status VARCHAR(100),
about TEXT,
website VARCHAR(100),
PRIMARY KEY (id)
);
CREATE TABLE users(
id INT AUTO_INCREMENT,
name VARCHAR(50),
authentication_string VARCHAR(128),
authentication_salt VARCHAR(128),
authentication_algorithm VARCHAR(128),
time_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP(),
time_altered TIMESTAMP DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP(),
verified BOOLEAN DEFAULT 0,
PRIMARY KEY (id)
);
CREATE USER 'threadr'@'localhost' IDENTIFIED BY 'azerty';
GRANT ALL PRIVILEGES ON threadr.* TO 'threadr'@'localhost';
FLUSH PRIVILEGES;
EXIT;