Compare commits
3 Commits
5a14b125d2
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| ad4efffed5 | |||
| 30cec0f7f0 | |||
| 9f5fd261c3 |
@@ -29,14 +29,20 @@ Read the [configuation guide](docs/CONFIG.md) for configuration help (in config.
|
||||
* Search functionality
|
||||
* Page indexes
|
||||
|
||||
# Bugs:
|
||||
* probably scales like shit
|
||||
* probably insecure as hell
|
||||
|
||||
# Planned features/todo list:
|
||||
* federation
|
||||
* federation (looks tricky)
|
||||
* inline comments and docs
|
||||
* clean up code a bit
|
||||
* /postID and /userID pages
|
||||
* Make EJS modification more user friendly (half done)
|
||||
* API for returning posts, users, comments, tags other?...
|
||||
* Moderation tools including a keyword blacklist
|
||||
* Request account function? Not sure how this should be implemented.
|
||||
* optional SQL
|
||||
* initialisation has prompts for setup process.
|
||||
|
||||
# Docs:
|
||||
|
||||
+4
-5
@@ -3,7 +3,6 @@
|
||||
"seperator": "<hr/>",
|
||||
"site_name": "My Blog",
|
||||
"site_url": "https://example.com",
|
||||
"site_path": "/",
|
||||
"locale": "en-US",
|
||||
"port": 8080,
|
||||
"data_storage": "json",
|
||||
@@ -14,10 +13,10 @@
|
||||
"enable_hitcount": true,
|
||||
"charset": "UTF-8",
|
||||
"root_path": "../webroot/",
|
||||
"edit_account_base_url": "edit_account",
|
||||
"new_post_url": "post",
|
||||
"signup_url": "signup",
|
||||
"edit_post_base_url": "edit",
|
||||
"edit_account_base_url": "/edit_account",
|
||||
"new_post_url": "/post",
|
||||
"signup_url": "/signup",
|
||||
"edit_post_base_url": "/edit",
|
||||
"default_commenter_username": "Anon",
|
||||
"rss": true,
|
||||
"atom": true,
|
||||
|
||||
+7
-37
@@ -90,16 +90,14 @@ export function getdata(table_name, key=-1, value=-1) {
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("No object of this ID exists for the selected table", table_name)
|
||||
console.log("No object of this ID exists for the selected table")
|
||||
return 1
|
||||
}
|
||||
}
|
||||
let return_value = func.find_key_value_pair(result, key, value)
|
||||
return return_value
|
||||
let return_list = func.find_key_value_pair(result,key,value)
|
||||
return return_list
|
||||
}
|
||||
let return_value = result.slice(- config['data_request_limit'])
|
||||
return return_value
|
||||
break;
|
||||
return result
|
||||
case 'hitcount':
|
||||
result = func.require_module('../data/data.json') // This file is actually called data.json
|
||||
return result["hitcount"]
|
||||
@@ -110,37 +108,9 @@ export function getdata(table_name, key=-1, value=-1) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// NOT YET WORKING!
|
||||
case 'mysql':
|
||||
const mysql = require('mysql');
|
||||
let con = mysql.createConnection({
|
||||
host: config.database.host,
|
||||
user: config.database.user,
|
||||
password: config.database.password,
|
||||
database: config.database.database,
|
||||
});
|
||||
|
||||
con.connect(function(err) {
|
||||
if (err) throw err;
|
||||
|
||||
if (data == "posts" || data == 'users' || data == 'comments') {
|
||||
con.query(`SELECT * FROM ${data}`, function (err, result, fields) {
|
||||
if (err) throw err;
|
||||
result = Object.values(JSON.parse(JSON.stringify(result)))
|
||||
console.log(result)
|
||||
return result;
|
||||
});
|
||||
}
|
||||
else if (data == 'hitcount') {
|
||||
con.query(`SELECT paramValue FROM params WHERE paramName = '${data}'`, function (err, result, fields) {
|
||||
if (err) throw err;
|
||||
result = Object.values(JSON.parse(JSON.stringify(result)))
|
||||
console.log(result)
|
||||
return result;
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
default:
|
||||
console.log("Error, invalid database management system")
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+53
-83
@@ -9,15 +9,15 @@ const locale = require(`../locales/${config.locale}.json`)
|
||||
// https://stackoverflow.com/a/16060619
|
||||
export function require_module(module)
|
||||
{
|
||||
if (config.cache_data == false)
|
||||
{
|
||||
delete require.cache[require.resolve(module)];
|
||||
return require(module);
|
||||
}
|
||||
else
|
||||
{
|
||||
return require(module);
|
||||
}
|
||||
if (config.cache_data == false)
|
||||
{
|
||||
delete require.cache[require.resolve(module)];
|
||||
return require(module);
|
||||
}
|
||||
else
|
||||
{
|
||||
return require(module);
|
||||
}
|
||||
}
|
||||
|
||||
// The configuration defines a date format using the date-fns (a datetime library) syntax
|
||||
@@ -27,7 +27,7 @@ export function require_module(module)
|
||||
// returns the formatted date (string)
|
||||
export function unix_time_to_date_format(unix_time)
|
||||
{
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
let date = fromUnixTime(unix_time)
|
||||
let formatted_date = format(date, config.date_format)
|
||||
return formatted_date
|
||||
@@ -39,7 +39,7 @@ export function unix_time_to_date_format(unix_time)
|
||||
// returns the formatted date (string)
|
||||
export function unix_time_to_rss_date(unix_time)
|
||||
{
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
let date = fromUnixTime(unix_time)
|
||||
let formatted_date = format(date, "EEE, dd MMM yyyy HH:mm:ss")
|
||||
return `${formatted_date} ${config.time_zone}`
|
||||
@@ -47,7 +47,7 @@ export function unix_time_to_rss_date(unix_time)
|
||||
// And again with atom's date format
|
||||
export function unix_time_to_atom_date(unix_time)
|
||||
{
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date utility library
|
||||
let date = fromUnixTime(unix_time)
|
||||
let formatted_date = format(date, "yyyy-MM-dd'T'HH:mm:ss'Z'")
|
||||
return `${formatted_date}`
|
||||
@@ -57,110 +57,80 @@ export function unix_time_to_atom_date(unix_time)
|
||||
// eg "<a href="/tag/string1">string1</a>, <a href="/tag/string2">string2</a>, <a href="/tag/string3">string3</a>"
|
||||
// this is so you can have a list of tags that each point to their individual tag page
|
||||
// returns: string
|
||||
export function render_tags(tags)
|
||||
export function render_tags(tags_string)
|
||||
{
|
||||
let tags = tags_string.split(',')
|
||||
tags = tags.filter((item, index) => tags.indexOf(item) === index) // Remove duplicate tags
|
||||
let string = "" // Initialises the string
|
||||
if (tags.length == 1 && tags[0] == "")
|
||||
{
|
||||
string = ''; // If there are no tags, output nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
for (let tag_index = 0; tag_index < tags.length; tag_index++)
|
||||
{ // Loop over each tag
|
||||
string += `<a href="${config.site_path}/tag/${tags[tag_index].trim()}">#${tags[tag_index].trim()}</a> ` // Adds the tag to the string as a HTML href
|
||||
}
|
||||
}
|
||||
if (tags.length == 1 && tags[0] == "")
|
||||
{
|
||||
string = ''; // If there are no tags, output nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
for (let tag_index = 0; tag_index < tags.length; tag_index++)
|
||||
{ // Loop over each tag
|
||||
string += `<a href="/tag/${tags[tag_index].trim()}">#${tags[tag_index].trim()}</a> ` // Adds the tag to the string as a HTML href
|
||||
}
|
||||
}
|
||||
return string
|
||||
}
|
||||
// The users are stored as a list of objects [ user_object, user_object, user_object ]
|
||||
// So you cannot easily find the userID (position in list) from the username
|
||||
// This function returns the username for a given userID by looping over every user
|
||||
// if the user is present, it returns the index of the user (integer)
|
||||
// if the user is not present it returns -1
|
||||
export function get_userID(username)
|
||||
{
|
||||
const users = require_module("../data/users.json")
|
||||
for (let i = 0; i < users.length; i++)
|
||||
{ // Loop over every user
|
||||
if (users[i]['username'] == username)
|
||||
{
|
||||
return i // If the username matches then return the index of that user
|
||||
}
|
||||
}
|
||||
return -1 // If user is not present, return -1
|
||||
}
|
||||
|
||||
// This escapes some potentially dangerous HTML characters with their HTML entities
|
||||
// https://www.freeformatter.com/html-entities.html
|
||||
// accepts a string
|
||||
// returns a string with some character replaced by their entities
|
||||
export function escape_input(input)
|
||||
{
|
||||
let output = input
|
||||
.replaceAll("&", "&") // This must be first
|
||||
.replaceAll("<", "<")
|
||||
.replaceAll(">", ">")
|
||||
.replaceAll("\\", "\")
|
||||
.replaceAll('"', """)
|
||||
.replaceAll("'", "'")
|
||||
.replaceAll("/", "/")
|
||||
.replaceAll("%", "%")
|
||||
return output
|
||||
let output = input
|
||||
.replaceAll("&", "&") // This must be first
|
||||
.replaceAll("<", "<")
|
||||
.replaceAll(">", ">")
|
||||
.replaceAll("\\", "\")
|
||||
.replaceAll('"', """)
|
||||
.replaceAll("'", "'")
|
||||
.replaceAll("/", "/")
|
||||
.replaceAll("%", "%")
|
||||
return output
|
||||
}
|
||||
|
||||
// Render comment content by replacing the >> int with a url link to that comment
|
||||
// Syntax: ">> postID-commentID"
|
||||
export function render_comment(comment_content)
|
||||
{
|
||||
return comment_content
|
||||
.replaceAll(/>> ([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>> $1-$2</a>")
|
||||
.replaceAll(/>>([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>>$1-$2</a>")
|
||||
.replaceAll(/>> ([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>> $1-$2</a>")
|
||||
.replaceAll(/>>([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>>$1-$2</a>")
|
||||
.replaceAll("\n", "<br/>")
|
||||
return comment_content
|
||||
.replaceAll(/>> ([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>> $1-$2</a>")
|
||||
.replaceAll(/>>([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>>$1-$2</a>")
|
||||
.replaceAll(/>> ([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>> $1-$2</a>")
|
||||
.replaceAll(/>>([0-9]*)-([0-9]*)/g, "<a href='/comment/$1-$2'>>>$1-$2</a>")
|
||||
.replaceAll("\n", "<br/>")
|
||||
|
||||
};
|
||||
|
||||
// Renders a string into markdown using markdown-it library
|
||||
export function render_md(content)
|
||||
{
|
||||
const markdownit = require("markdown-it")
|
||||
const md = markdownit
|
||||
({ // this is just defining some options for markdown-it, should I add this to config.json?
|
||||
html: false,
|
||||
xhtmlOut: false,
|
||||
breaks: true,
|
||||
linkify: false,
|
||||
typographer: true,
|
||||
quotes: locale.quotes,
|
||||
})
|
||||
const markdownit = require("markdown-it")
|
||||
const md = markdownit
|
||||
({ // this is just defining some options for markdown-it, should I add this to config.json?
|
||||
html: false,
|
||||
xhtmlOut: false,
|
||||
breaks: true,
|
||||
linkify: false,
|
||||
typographer: true,
|
||||
quotes: locale.quotes,
|
||||
})
|
||||
.disable('image');
|
||||
return md.render(content)
|
||||
return md.render(content)
|
||||
};
|
||||
|
||||
/*
|
||||
export function find_key_value_pair(data_array, key, value) {
|
||||
for (let i = 0; i < data_array.length; i++) {
|
||||
if (data_array[i][key] == value) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
};
|
||||
*/
|
||||
|
||||
// Returns a list of matches
|
||||
export function find_key_value_pair(data_array, key, value) {
|
||||
let return_list = []
|
||||
for (let i = 0; i < data_array.length; i++) {
|
||||
let element = data_array[i][key]
|
||||
if (element == value
|
||||
|| (Array.isArray(element) && element.includes(value))) {
|
||||
if (element == value || (key == 'tags' && element.includes(value))) {
|
||||
return_list.push(data_array[i])
|
||||
}
|
||||
}
|
||||
return return_list
|
||||
};
|
||||
|
||||
|
||||
+169
-170
@@ -14,197 +14,197 @@ const crypto = require('crypto')
|
||||
const router = express.Router();
|
||||
|
||||
////////////////////// Form actions /////////////////////////
|
||||
router.post(`${config.site_path}/submit_comment`, (req,res) => {
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
const postID = parseInt(req.body.post_index)
|
||||
const content = func.escape_input(req.body.content)
|
||||
let name = func.escape_input(req.body.name)
|
||||
// Give the user the default username if they left that bit blank
|
||||
if (name == "" || typeof name == 'undefined') {
|
||||
name = config.default_commenter_username
|
||||
}
|
||||
router.post("/submit_comment", (req,res) => {
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
const postID = parseInt(req.body.post_index)
|
||||
const content = func.escape_input(req.body.content)
|
||||
let name = func.escape_input(req.body.name)
|
||||
// Give the user the default username if they left that bit blank
|
||||
if (name == "" || typeof name == 'undefined') {
|
||||
name = config.default_commenter_username
|
||||
}
|
||||
|
||||
// Check there is actually content in the comment
|
||||
if (content != '' && typeof content != 'undefined') {
|
||||
let comments = data.getdata('comments')
|
||||
// Check there is actually content in the comment
|
||||
if (content != '' && typeof content != 'undefined') {
|
||||
let comments = data.getdata('comments')
|
||||
|
||||
new_comment = {
|
||||
new_comment = {
|
||||
"name": name,
|
||||
"content": content,
|
||||
"id": comments[postID]['comments'].length,
|
||||
"pubdate": unix_timestamp,
|
||||
};
|
||||
comments[postID]['comments'].push(new_comment);
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
}
|
||||
};
|
||||
comments[postID]['comments'].push(new_comment);
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
}
|
||||
|
||||
res.redirect(301,`${config.site_path}/post/${req.body.post_index}`)
|
||||
res.redirect(301,`/post/${req.body.post_index}`)
|
||||
}); // /submit_comment
|
||||
|
||||
router.post(`${config.site_path}/submit_post`, (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const username = func.escape_input(req.body.username)
|
||||
const title = func.escape_input(req.body.title)
|
||||
const content = req.body.content
|
||||
const tags = func.escape_input(req.body.tags).split(',').map(str => str.trim());
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
router.post("/submit_post", (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const username = func.escape_input(req.body.username)
|
||||
const title = func.escape_input(req.body.title)
|
||||
const content = req.body.content
|
||||
const tags = func.escape_input(req.body.tags).split(',').map(str => str.trim());
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
|
||||
if (func.get_userID(username) == -1) {
|
||||
res.render("partials/message", {
|
||||
message: locale.user_doesnt_exit,
|
||||
config,
|
||||
})
|
||||
}
|
||||
if (func.get_userID(username) == -1) {
|
||||
res.render("partials/message", {
|
||||
message: locale.user_doesnt_exit,
|
||||
config,
|
||||
})
|
||||
}
|
||||
|
||||
else if (users[func.get_userID(username)]['hash'] == password) { // Password matches
|
||||
console.log(username, "is submitting a post titled:", title);
|
||||
id = posts.length
|
||||
posts.push({
|
||||
"id": id,
|
||||
"userID": func.get_userID(username),
|
||||
"title": title,
|
||||
"content": content,
|
||||
"pubdate": unix_timestamp,
|
||||
"editdate": unix_timestamp,
|
||||
"tags": tags,
|
||||
})
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
comments.push({'id': id, 'comments': []})
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`)
|
||||
res.redirect(302, `/post/${id}`);
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.incorrect_password,
|
||||
config,
|
||||
})
|
||||
}
|
||||
else if (users[func.get_userID(username)]['hash'] == password) { // Password matches
|
||||
console.log(username, "is submitting a post titled:", title);
|
||||
id = posts.length
|
||||
posts.push({
|
||||
"id": id,
|
||||
"userID": func.get_userID(username),
|
||||
"title": title,
|
||||
"content": content,
|
||||
"pubdate": unix_timestamp,
|
||||
"editdate": unix_timestamp,
|
||||
"tags": tags,
|
||||
})
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
comments.push({'id': id, 'comments': []})
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`)
|
||||
res.redirect(302, "/");
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.incorrect_password,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}); // /submit_post
|
||||
|
||||
router.post(`${config.site_path}/submit_signup`, (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const username = func.escape_input(req.body.username)
|
||||
const prettyname = func.escape_input(req.body.prettyname)
|
||||
const description = req.body.description
|
||||
router.post("/submit_signup", (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const username = func.escape_input(req.body.username)
|
||||
const prettyname = func.escape_input(req.body.prettyname)
|
||||
const description = req.body.description
|
||||
|
||||
// Check that signups are allowed
|
||||
if (config.allow_signup == true) {
|
||||
// func.get_userID will return -1 if the user does not exist
|
||||
// so this checks that the user does not exist
|
||||
if (func.get_userID(username) == -1) {
|
||||
users.push({
|
||||
"id": users.length,
|
||||
"username": username,
|
||||
"prettyname": prettyname,
|
||||
"hash": password,
|
||||
"description": description,
|
||||
})
|
||||
fs.writeFileSync(`../data/users.json`, `${JSON.stringify(users)}`, 'utf-8');
|
||||
res.redirect(301, `${config.site_path}/user/${username}`)
|
||||
}
|
||||
// if the user does exist then
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.user_exists,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}
|
||||
else if (config.allow_signup == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.signups_unavailable,
|
||||
config,
|
||||
})
|
||||
}
|
||||
// If allow_signup is undefined or not a boolean, error
|
||||
else {
|
||||
res.redirect(301,config.site_path)
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
// Check that signups are allowed
|
||||
if (config.allow_signup == true) {
|
||||
// func.get_userID will return -1 if the user does not exist
|
||||
// so this checks that the user does not exist
|
||||
if (func.get_userID(username) == -1) {
|
||||
users.push({
|
||||
"id": users.length,
|
||||
"username": username,
|
||||
"prettyname": prettyname,
|
||||
"hash": password,
|
||||
"description": description,
|
||||
})
|
||||
fs.writeFileSync(`../data/users.json`, `${JSON.stringify(users)}`, 'utf-8');
|
||||
res.redirect(301, `/user/${username}`)
|
||||
}
|
||||
// if the user does exist then
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.user_exists,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}
|
||||
else if (config.allow_signup == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.signups_unavailable,
|
||||
config,
|
||||
})
|
||||
}
|
||||
// If allow_signup is undefined or not a boolean, error
|
||||
else {
|
||||
res.redirect(301,"/")
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
}); // /submit_signup
|
||||
|
||||
router.post(`${config.site_path}/submit_edit_user`, (req,res) => {
|
||||
// Get the form info
|
||||
const password = crypto.createHash("sha512").update(req.body.password).digest("hex");
|
||||
const userID = func.escape_input(req.body.userID)
|
||||
const description = req.body.description
|
||||
const prettyname = func.escape_input(req.body.prettyname)
|
||||
const delete_bool = req.body.delete
|
||||
router.post("/submit_edit_user", (req,res) => {
|
||||
// Get the form info
|
||||
const password = crypto.createHash("sha512").update(req.body.password).digest("hex");
|
||||
const userID = func.escape_input(req.body.userID)
|
||||
const description = req.body.description
|
||||
const prettyname = func.escape_input(req.body.prettyname)
|
||||
const delete_bool = req.body.delete
|
||||
|
||||
if (userID >= 0) { // The user exists
|
||||
if (password == users[userID]['hash']) { // password matches
|
||||
console.log(userID, " (userID) is modifying their account")
|
||||
users[userID]["prettyname"] = prettyname;
|
||||
users[userID]["description"] = description;
|
||||
if (userID >= 0) { // The user exists
|
||||
if (password == users[userID]['hash']) { // password matches
|
||||
console.log(userID, " (userID) is modifying their account")
|
||||
users[userID]["prettyname"] = prettyname;
|
||||
users[userID]["description"] = description;
|
||||
|
||||
if (delete_bool == true) {
|
||||
// Delete the user
|
||||
users[userID] = {"id": userID,"deleted": true}
|
||||
// Delete all their posts
|
||||
for (let postid = 0; postid < posts.length; postid++) { // loop over all posts
|
||||
if (posts[postid]['userID'] == userID) { // if userID matches
|
||||
posts[postid] = {"id": postid, "deleted": true} // delete the post
|
||||
comments[postid] = [] // the comments for this post should also be deleted
|
||||
}
|
||||
};
|
||||
}
|
||||
// Write these changes
|
||||
fs.writeFileSync(`../data/users.json`, `${JSON.stringify(users)}`, 'utf-8');
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
res.redirect(301,`${config.site_path}/user/${users[userID]["username"]}`)
|
||||
}
|
||||
else { // password does not match
|
||||
res.render("partials/message", {
|
||||
message: locale.incorrect_password,
|
||||
config
|
||||
}
|
||||
)
|
||||
};
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.user_doesnt_exist,
|
||||
config,
|
||||
})
|
||||
}
|
||||
if (delete_bool == true) {
|
||||
// Delete the user
|
||||
users[userID] = {"id": userID,"deleted": true}
|
||||
// Delete all their posts
|
||||
for (let postid = 0; postid < posts.length; postid++) { // loop over all posts
|
||||
if (posts[postid]['userID'] == userID) { // if userID matches
|
||||
posts[postid] = {"id": postid, "deleted": true} // delete the post
|
||||
comments[postid] = [] // the comments for this post should also be deleted
|
||||
}
|
||||
};
|
||||
}
|
||||
// Write these changes
|
||||
fs.writeFileSync(`../data/users.json`, `${JSON.stringify(users)}`, 'utf-8');
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
res.redirect(301,`/user/${users[userID]["username"]}`)
|
||||
}
|
||||
else { // password does not match
|
||||
res.render("partials/message", {
|
||||
message: locale.incorrect_password,
|
||||
config
|
||||
}
|
||||
)
|
||||
};
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.user_doesnt_exist,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}); // /submit_delete_account
|
||||
|
||||
router.post(`${config.site_path}/submit_edit_post`, (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const postID = req.body.postID
|
||||
const userID = req.body.userID
|
||||
const title = func.escape_input(req.body.title)
|
||||
const content = req.body.content
|
||||
const tags = func.escape_input(req.body.tags).split(",").map(str => str.trim());
|
||||
const delete_bool = req.body.delete
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
console.log(users[userID]['prettyname'], "is editting the post titled:", title);
|
||||
router.post("/submit_edit_post", (req,res) => {
|
||||
const password = crypto.createHash('sha512').update(req.body.password).digest('hex');
|
||||
const postID = req.body.postID
|
||||
const userID = req.body.userID
|
||||
const title = func.escape_input(req.body.title)
|
||||
const content = req.body.content
|
||||
const tags = func.escape_input(req.body.tags).split(",").map(str => str.trim());
|
||||
const delete_bool = req.body.delete
|
||||
const unix_timestamp = getUnixTime(new Date())
|
||||
console.log(users[userID]['prettyname'], "is editting the post titled:", title);
|
||||
|
||||
if (users[userID]['hash'] == password) { // password matches
|
||||
let post = posts[postID]
|
||||
post['title'] = title
|
||||
post['content'] = content
|
||||
post['tags'] = tags
|
||||
post['editdate'] = unix_timestamp
|
||||
if (typeof delete_bool != "undefined") {
|
||||
console.log("Deleting post!")
|
||||
posts[postID] = {"id": post["id"], "deleted": true}
|
||||
comments[postID] = [];
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
}
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
res.redirect(302, config.site_path);
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.incorrect_password,
|
||||
config,
|
||||
})
|
||||
}
|
||||
if (users[userID]['hash'] == password) { // password matches
|
||||
let post = posts[postID]
|
||||
post['title'] = title
|
||||
post['content'] = content
|
||||
post['tags'] = tags
|
||||
post['editdate'] = unix_timestamp
|
||||
if (typeof delete_bool != "undefined") {
|
||||
console.log("Deleting post!")
|
||||
posts[postID] = {"id": post["id"], "deleted": true}
|
||||
comments[postID] = [];
|
||||
fs.writeFileSync(`../data/comments.json`, `${JSON.stringify(comments)}`, 'utf-8');
|
||||
}
|
||||
fs.writeFileSync(`../data/posts.json`, `${JSON.stringify(posts)}`, 'utf-8');
|
||||
res.redirect(302, "/");
|
||||
}
|
||||
else {
|
||||
res.render("partials/message", {
|
||||
message: locale.incorrect_password,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}); // /submit_edit
|
||||
|
||||
router.get(`${config.site_path}/search`, (req, res) => {
|
||||
router.get('/search', (req, res) => {
|
||||
const search_term = func.escape_input(req.query.q); // 'q' is the parameter name
|
||||
let search_type = req.query.type; // eg 'post', 'user'
|
||||
if (typeof search_type == 'string') { // Make the search_term an array
|
||||
@@ -216,8 +216,7 @@ router.get(`${config.site_path}/search`, (req, res) => {
|
||||
console.log('searching for: ', search_term);
|
||||
const search_results = data.searchdata(search_term, search_type); // data.searchdata returns an array of search results
|
||||
|
||||
res.render('pages/search',
|
||||
{
|
||||
res.render('pages/search', {
|
||||
config,
|
||||
locale,
|
||||
search_results,
|
||||
|
||||
+45
-47
@@ -5,56 +5,54 @@ const func = require('../functions')
|
||||
const router = express.Router();
|
||||
|
||||
///////////////////// Form pages ////////////////////////////
|
||||
router.get(`${config.site_path}/${config.new_post_url}`, (req,res) => {
|
||||
res.render("forms/new_post", {
|
||||
config,
|
||||
locale,
|
||||
});
|
||||
router.get(config.new_post_url, (req,res) => {
|
||||
res.render("forms/new_post", {
|
||||
config,
|
||||
locale,
|
||||
});
|
||||
}); // /post
|
||||
router.get(`${config.site_path}/${config.signup_url}`, (req,res) => {
|
||||
// if the server does allow signup
|
||||
if (config.allow_signup == true) {
|
||||
// Send the page for signing up to the server
|
||||
res.render("forms/signup", {
|
||||
config,
|
||||
locale,
|
||||
});
|
||||
}
|
||||
// if the server does not allow signup
|
||||
else if (config.allow_signup == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.signups_unavailable,
|
||||
config,
|
||||
})
|
||||
}
|
||||
// If allow_signup is undefined or not a boolean, error
|
||||
else {
|
||||
res.redirect(301,"/")
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
router.get(config.signup_url, (req,res) => {
|
||||
// if the server does allow signup
|
||||
if (config.allow_signup == true) {
|
||||
// Send the page for signing up to the server
|
||||
res.render("forms/signup", {
|
||||
config,
|
||||
locale,
|
||||
});
|
||||
}
|
||||
// if the server does not allow signup
|
||||
else if (config.allow_signup == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.signups_unavailable,
|
||||
config,
|
||||
})
|
||||
}
|
||||
// If allow_signup is undefined or not a boolean, error
|
||||
else {
|
||||
res.redirect(301,"/")
|
||||
console.log("Error, invalid value for allow_signup (bool)")
|
||||
}
|
||||
}); // /signup
|
||||
router.get(`${config.site_path}/${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||
const userID = parseInt(req.params.user_id);
|
||||
res.render("forms/edit_account",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
user: data.getdata('users', 'id', userID),
|
||||
userID
|
||||
});
|
||||
router.get(`${config.edit_account_base_url}/:user_id`, (req,res) => {
|
||||
const userID = parseInt(req.params.user_id);
|
||||
res.render("forms/edit_account", {
|
||||
config,
|
||||
locale,
|
||||
user: data.getdata('users', 'id', userID),
|
||||
userID
|
||||
});
|
||||
}); // /delete_account
|
||||
router.get(`${config.site_path}/${config.edit_post_base_url}/:post_id`, (req,res) => {
|
||||
const postID = req.params.post_id
|
||||
const post = data.getdata('posts','id', postID)
|
||||
const user = data.getdata('users', 'id', post.userID)
|
||||
res.render("forms/edit_post",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
post,
|
||||
postID,
|
||||
user,
|
||||
});
|
||||
router.get(`${config.edit_post_base_url}/:post_id`, (req,res) => {
|
||||
const postID = req.params.post_id
|
||||
const post = data.getdata('posts','id', postID)
|
||||
const user = data.getdata('users', 'id', post.userID)
|
||||
res.render("forms/edit_post", {
|
||||
config,
|
||||
locale,
|
||||
post,
|
||||
postID,
|
||||
user,
|
||||
});
|
||||
}); // /edit/:post_id
|
||||
|
||||
module.exports = router;
|
||||
|
||||
+22
-22
@@ -6,31 +6,31 @@ const func = require('../functions')
|
||||
const router = express.Router();
|
||||
|
||||
///////////////////// Page index's ///////////////////////
|
||||
router.get(`${config.site_path}/index/pages`, (req,res) => {
|
||||
res.render("indexes/all_pages", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
comments: data.getdata('comments'),
|
||||
});
|
||||
router.get("/index/pages", (req,res) => {
|
||||
res.render("indexes/all_pages", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
comments: data.getdata('comments'),
|
||||
});
|
||||
}); // /index/pages
|
||||
router.get(`${config.site_path}/index/posts`, (req,res) => {
|
||||
res.render("indexes/posts", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
});
|
||||
router.get("/index/posts", (req,res) => {
|
||||
res.render("indexes/posts", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
});
|
||||
}); // /index/posts
|
||||
router.get(`${config.site_path}/index/users`, (req,res) => {
|
||||
res.render("indexes/users", {
|
||||
config,
|
||||
users: data.getdata('users'),
|
||||
});
|
||||
router.get("/index/users", (req,res) => {
|
||||
res.render("indexes/users", {
|
||||
config,
|
||||
users: data.getdata('users'),
|
||||
});
|
||||
}); // /index/users
|
||||
router.get(`${config.site_path}/index/comments`, (req,res) => {
|
||||
res.render("indexes/comments", {
|
||||
config,
|
||||
comments: data.getdata('comments'),
|
||||
});
|
||||
router.get("/index/comments", (req,res) => {
|
||||
res.render("indexes/comments", {
|
||||
config,
|
||||
comments: data.getdata('comments'),
|
||||
});
|
||||
}); // /index/comments
|
||||
|
||||
|
||||
|
||||
@@ -9,17 +9,18 @@ const router = express.Router();
|
||||
///////////////////// Standard Pages //////////////////////
|
||||
|
||||
// Timeline
|
||||
router.get(config.site_path, (req,res) => {
|
||||
// Increment the hitcount
|
||||
if (config.enable_hitcount) {
|
||||
data.increment_hitcount()
|
||||
}
|
||||
router.get("/", (req,res) => {
|
||||
let posts = data.getdata('posts')
|
||||
// Increment the hitcount
|
||||
if (config.enable_hitcount) {
|
||||
data.increment_hitcount()
|
||||
}
|
||||
|
||||
res.render("pages/timeline",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
posts: data.getdata("posts"),
|
||||
posts,
|
||||
users: data.getdata("users"),
|
||||
comments: data.getdata("comments"),
|
||||
hitcount: data.getdata("hitcount"),
|
||||
@@ -31,49 +32,46 @@ router.get(config.site_path, (req,res) => {
|
||||
}); // /
|
||||
|
||||
// Users
|
||||
router.get(`${config.site_path}/user/:username`, (req, res) => {
|
||||
const userID = func.get_userID(req.params.username)
|
||||
let posts = data.getdata('posts', 'userID', userID);
|
||||
let user = data.getdata('users', 'id', userID)[0];
|
||||
if (userID != -1) {
|
||||
res.render("pages/user",
|
||||
router.get("/user/:username", (req, res) => {
|
||||
let user = data.getdata('users', 'username', req.params.username)
|
||||
if (user.length > 0) {
|
||||
res.render("pages/user",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
posts,
|
||||
user,
|
||||
userID: userID,
|
||||
comments: data.getdata('comments', 'postID'),
|
||||
posts: data.getdata('posts','userID',user[0].id),
|
||||
user: user[0],
|
||||
comments: data.getdata('comments'),
|
||||
fromUnixTime,
|
||||
format,
|
||||
getUnixTime,
|
||||
func,
|
||||
})
|
||||
}
|
||||
else if (userID == -1) {
|
||||
res.render("partials/message",
|
||||
{
|
||||
message: locale.user_doesnt_exist,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}
|
||||
else {
|
||||
res.render("partials/message",
|
||||
{
|
||||
message: locale.user_doesnt_exist,
|
||||
config,
|
||||
})
|
||||
}
|
||||
}); // /user/:username
|
||||
|
||||
// Posts
|
||||
router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
||||
const postID = parseInt(req.params.post_index)
|
||||
let post = data.getdata('posts','id', postID)[0]
|
||||
if (post == 1) { // data.getdata returns error code 1 if nothing is available
|
||||
res.render("partials/message", {
|
||||
message: locale.post_doesnt_exist,
|
||||
config,
|
||||
})
|
||||
}
|
||||
else if (typeof post["deleted"] == "undefined" || post["deleted"] == false) {
|
||||
router.get("/post/:post_index", (req, res) => {
|
||||
const postID = parseInt(req.params.post_index)
|
||||
let post = data.getdata('posts','id', postID)[0]
|
||||
if (post.length == 0) { // data.getdata returns error code 1 if nothing is available
|
||||
res.render("partials/message", {
|
||||
message: locale.post_doesnt_exist,
|
||||
config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
if (config.enable_hitcount) {
|
||||
data.increment_hitcount(postID)
|
||||
}
|
||||
res.render("pages/post",
|
||||
res.render("pages/post",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
@@ -86,25 +84,25 @@ router.get(`${config.site_path}/post/:post_index`, (req, res) => {
|
||||
getUnixTime,
|
||||
func,
|
||||
})
|
||||
}
|
||||
else {
|
||||
console.log("Error loading page")
|
||||
res.redirect(301,"/")
|
||||
}
|
||||
}
|
||||
}); // /post/:post_index
|
||||
|
||||
|
||||
// Tags
|
||||
router.get(`${config.site_path}/tag/:tag`, (req,res) => {
|
||||
const tag = req.params.tag
|
||||
res.render("pages/tag",
|
||||
router.get("/tag/:tag", (req,res) => {
|
||||
const tag = req.params.tag
|
||||
const posts = data.getdata('posts','tags',tag);
|
||||
console.log(posts)
|
||||
const users = data.getdata('users')
|
||||
const comments = data.getdata('comments')
|
||||
res.render("pages/tag",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
tag,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
comments: data.getdata('comments'),
|
||||
posts,
|
||||
users,
|
||||
comments,
|
||||
fromUnixTime,
|
||||
format,
|
||||
getUnixTime,
|
||||
@@ -114,39 +112,39 @@ router.get(`${config.site_path}/tag/:tag`, (req,res) => {
|
||||
|
||||
|
||||
// Comments
|
||||
router.get(`${config.site_path}/comment/:postID-:commentID`, (req,res) => {
|
||||
const commentID = parseInt(req.params.commentID);
|
||||
const postID = parseInt(req.params.postID);
|
||||
router.get("/comment/:postID-:commentID", (req,res) => {
|
||||
const commentID = parseInt(req.params.commentID);
|
||||
const postID = parseInt(req.params.postID);
|
||||
|
||||
let posts_comments = data.getdata('comments', 'id', postID)["comments"]
|
||||
let comment = 1
|
||||
// For loop to find the comment with matching ID
|
||||
posts_comments.forEach((current_comment, index) => {
|
||||
if (current_comment.id == commentID) {
|
||||
comment = posts_comments[index]
|
||||
}
|
||||
})
|
||||
// If comment doesn't exist, show error
|
||||
if (comment == 1 || posts_comments == 1) { // Comment of this ID was not found
|
||||
res.render("partials/message", {
|
||||
config,
|
||||
message: locale.comment_doesnt_exist,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.render("pages/comment",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
comment,
|
||||
postID,
|
||||
commentID,
|
||||
fromUnixTime,
|
||||
format,
|
||||
getUnixTime,
|
||||
func,
|
||||
})
|
||||
}
|
||||
let posts_comments = data.getdata('comments', 'id', postID)["comments"]
|
||||
let comment = 1
|
||||
// For loop to find the comment with matching ID
|
||||
posts_comments.forEach((current_comment, index) => {
|
||||
if (current_comment.id == commentID) {
|
||||
comment = posts_comments[index]
|
||||
}
|
||||
})
|
||||
// If comment doesn't exist, show error
|
||||
if (comment == 1 || posts_comments == 1) { // Comment of this ID was not found
|
||||
res.render("partials/message", {
|
||||
config,
|
||||
message: locale.comment_doesnt_exist,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.render("pages/comment",
|
||||
{
|
||||
config,
|
||||
locale,
|
||||
comment,
|
||||
postID,
|
||||
commentID,
|
||||
fromUnixTime,
|
||||
format,
|
||||
getUnixTime,
|
||||
func,
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
+70
-67
@@ -9,80 +9,83 @@ const router = express.Router();
|
||||
|
||||
////////////////////// SYNDICATION ////////////////////////
|
||||
// global RSS protocol gets
|
||||
router.get(`${config.site_path}/rss`, (req,res) => {
|
||||
if (config.rss == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.rss_disabled,
|
||||
config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/rss", {
|
||||
router.get("/rss", (req,res) => {
|
||||
if (config.rss == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.rss_disabled,
|
||||
config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/rss", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
func,
|
||||
})
|
||||
};
|
||||
func,
|
||||
})
|
||||
};
|
||||
});
|
||||
// user RSS protocol gets
|
||||
// TODO specific title field and descriptions??
|
||||
router.get(`${config.site_path}/user/:username/rss`, (req,res) => {
|
||||
const username = req.params.username;
|
||||
const user = data.getdata('users','username',username)[0]; // Get the user data
|
||||
if (config.rss == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.rss_disabled,
|
||||
config: config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/rss", {
|
||||
users: [user],
|
||||
config,
|
||||
posts: data.getdata('posts','id',user['id']),
|
||||
func,
|
||||
})
|
||||
};
|
||||
router.get("/user/:username/rss", (req,res) => {
|
||||
const username = req.params.username;
|
||||
const user = data.getdata('users', 'username', username);
|
||||
if (config.rss == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.rss_disabled,
|
||||
config: config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/rss", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
users: user,
|
||||
func,
|
||||
})
|
||||
};
|
||||
});
|
||||
// global ATOM protocol gets
|
||||
router.get(`${config.site_path}/atom`, (req,res) => {
|
||||
if (config.atom == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.atom_disabled,
|
||||
config: config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/atom", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
func,
|
||||
getUnixTime,
|
||||
})
|
||||
};
|
||||
router.get("/atom", (req,res) => {
|
||||
if (config.atom == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.atom_disabled,
|
||||
config: config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/global_atom", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
func,
|
||||
getUnixTime,
|
||||
})
|
||||
};
|
||||
});
|
||||
// user ATOM protocol gets
|
||||
router.get(`${config.site_path}/user/:username/atom`, (req,res) => {
|
||||
const username = req.params.username;
|
||||
if (config.atom == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.atom_disabled,
|
||||
config: config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/atom", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
func,
|
||||
getUnixTime,
|
||||
})
|
||||
};
|
||||
router.get("/user/:username/atom", (req,res) => {
|
||||
const username = req.params.username;
|
||||
const userID = func.get_userID(username);
|
||||
if (config.atom == false) {
|
||||
res.render("partials/message", {
|
||||
message: locale.atom_disabled,
|
||||
config: config,
|
||||
})
|
||||
}
|
||||
else {
|
||||
res.setHeader('content-type', 'application/rss+xml');
|
||||
res.render("syndication/user_atom", {
|
||||
config,
|
||||
posts: data.getdata('posts'),
|
||||
users: data.getdata('users'),
|
||||
func,
|
||||
userID,
|
||||
getUnixTime,
|
||||
})
|
||||
};
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
+39
-38
@@ -15,18 +15,18 @@ config = require('../config.json');
|
||||
|
||||
// Import the locale
|
||||
try {
|
||||
locale = require(`../locales/${config.locale}.json`);
|
||||
locale = require(`../locales/${config.locale}.json`);
|
||||
}
|
||||
catch (error) {
|
||||
console.log("This locale doesn't exist, if you want to create it then you can create a PR")
|
||||
console.log("Locale selected: ", config.locale)
|
||||
console.log("This locale doesn't exist, if you want to create it then you can create a PR")
|
||||
console.log("Locale selected: ", config.locale)
|
||||
}
|
||||
|
||||
// Define stuff to do with express (nodejs webserver)
|
||||
const app = express();
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.json());
|
||||
app.use(config.site_path, express.static(config.root_path));
|
||||
app.use(express.static(config.root_path));
|
||||
// set the view engine to ejs
|
||||
app.set('view engine', 'ejs');
|
||||
app.set('views', '../views')
|
||||
@@ -46,43 +46,44 @@ app.use('/', form_actions_routes);
|
||||
|
||||
function perform_checks()
|
||||
{
|
||||
console.log("Performing startup checks...")
|
||||
exit_flag = false
|
||||
required_values = ['site_admin','seperator','site_name','site_url','locale','port','cache_data','allow_signup','site_description','request_data_limit','enable_hitcount','charset','root_path','edit_account_base_url','new_post_url','signup_url','default_commenter_username','rss','atom','date_format','time_zone','css']
|
||||
// Perform some standard checks:
|
||||
console.log("Performing startup checks...")
|
||||
exit_flag = false
|
||||
required_values = ['site_admin','seperator','site_name','site_url','locale','port','cache_data','allow_signup','site_description','request_data_limit','enable_hitcount','charset','root_path','edit_account_base_url','new_post_url','signup_url','default_commenter_username','rss','atom','date_format','time_zone','css']
|
||||
// Perform some standard checks:
|
||||
|
||||
// data_storage
|
||||
switch (config.data_storage)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'json':
|
||||
break
|
||||
default:
|
||||
console.log("[ ERROR ] invalid value in `data_storage`\nPlease modify config.json. Value should be 'mysql' or 'json'.")
|
||||
exit_flag = true
|
||||
}
|
||||
// auto_generated
|
||||
if (config.auto_generated)
|
||||
{
|
||||
console.log("[ ERROR ] `autogenerated` option set to true\nplease edit the config.json file to include your relevant information, then set to false or remove the autogenerated option.")
|
||||
exit_flag = true
|
||||
}
|
||||
// Check required values are present
|
||||
required_values.forEach((value) => { // Use a loop to check each required value is present
|
||||
if (typeof config[value] == 'undefined') {
|
||||
exit_flag = true
|
||||
console.log(`[ ERROR ] \`${value}\` is undefined\nPlease set it to something, read the documentation for help.`)
|
||||
}
|
||||
});
|
||||
if (exit_flag)
|
||||
{
|
||||
console.log("Exiting due to errors.")
|
||||
process.exit(1)
|
||||
}
|
||||
// data_storage
|
||||
switch (config.data_storage)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'json':
|
||||
break
|
||||
default:
|
||||
console.log("[ ERROR ] invalid value in `data_storage`\nPlease modify config.json. Value should be 'mysql' or 'json'.")
|
||||
exit_flag = true
|
||||
}
|
||||
// auto_generated
|
||||
if (config.auto_generated)
|
||||
{
|
||||
console.log("[ ERROR ] `autogenerated` option set to true\nplease edit the config.json file to include your relevant information, then set to false or remove the autogenerated option.")
|
||||
exit_flag = true
|
||||
}
|
||||
// Check required values are present
|
||||
required_values.forEach((value) => { // Use a loop to check each required value is present
|
||||
if (typeof config[value] == 'undefined') {
|
||||
exit_flag = true
|
||||
console.log(`[ ERROR ] \`${value}\` is undefined\nPlease set it to something, read the documentation for help.`)
|
||||
}
|
||||
});
|
||||
if (exit_flag)
|
||||
{
|
||||
console.log("Exiting due to errors.")
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
perform_checks()
|
||||
|
||||
|
||||
app.listen(config.port, () => {
|
||||
console.log(`Server is running at http://localhost:${config.port} webroot: ${config.root_path}`);
|
||||
console.log("Running in: ", __dirname)
|
||||
})
|
||||
console.log("Running in: ", __dirname)
|
||||
});
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.language %">
|
||||
<html lang="<%= config.language %>
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_path %>/submit_edit_user" method="POST">
|
||||
<form action="/submit_edit_user" method="POST">
|
||||
<input name="userID" type="hidden" value="<%= userID %>">
|
||||
<label><%= locale.password %>:</label><br/>
|
||||
<input type="password" required id="password" name="password"><br/><br/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_path %>/submit_edit_post" method="POST" onsubmit="sha512password()">
|
||||
<form action="/submit_edit_post" method="POST" onsubmit="sha512password()">
|
||||
<input name="userID" type="hidden" value="<%= post['userID'] %>">
|
||||
<input name="postID" type="hidden" value="<%= postID %>">
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include('../partials/head.ejs') %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_path %>/submit_post" method="POST">
|
||||
<form action="/submit_post" method="POST">
|
||||
<label><%= locale.username %>:</label><br/>
|
||||
<input required name="username"><br/><br/>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<form action="<%= config.site_path %>/submit_signup" method="POST">
|
||||
<form action="/submit_signup" method="POST">
|
||||
<label><%= locale.username %></label><br/>
|
||||
<input required name="username"><br/><br/>
|
||||
|
||||
|
||||
@@ -1,29 +1,28 @@
|
||||
<a id='home-page-link' href="<%= config.site_path %>/"><%= locale.home_page %></a>
|
||||
<a id='home-page-link' href="/"><%= locale.home_page %></a>
|
||||
/
|
||||
<% if (config.rss == true) { %>
|
||||
<a id='rss-link' href="<%= config.site_path %>/rss">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
<a id='rss-link' href="/rss">
|
||||
<img class='icon' src='/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
</a>
|
||||
<% } %>
|
||||
|
|
||||
<% if (config.atom == true) { %>
|
||||
<a id='atom-link' href="<%= config.site_path %>/atom">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
<a id='atom-link' href="/atom">
|
||||
<img class='icon' src='/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
</a>
|
||||
<% } %>
|
||||
/
|
||||
<a id='new-post-link' href="<%= config.site_path %>/<%= config.new_post_url %>"><%= locale.new_post %></a>
|
||||
<a id='new-post-link' href="<%= config.new_post_url %>"><%= locale.new_post %></a>
|
||||
/
|
||||
<% if (config.allow_signup == true) { %>
|
||||
<a id='signup-link' href="<%= config.site_path %>/<%= config.signup_url %>"><%= locale.sign_up %></a>
|
||||
<a id='signup-link' href="<%= config.signup_url %>"><%= locale.sign_up %></a>
|
||||
<% } %>
|
||||
/
|
||||
<form id='search-form' method="GET" action="<%= config.site_path %>/search" style="display: inline">
|
||||
<form id='search-form' method="GET" action="/search" style="display: inline">
|
||||
<input type="text" placeholder="🔍" name="q"><input type="submit" value="Search">
|
||||
</form>
|
||||
<br/>
|
||||
<div id='site-name'>
|
||||
<h1><a id='home-page-link' href="<%= config.site_path %>/"><%= config.site_name %></a></h1>
|
||||
<h1><a id='home-page-link' href="/"><%= config.site_name %></a></h1>
|
||||
</div>
|
||||
<div id='site-description'>
|
||||
<h2><%- config.site_description %></h2>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
</h1>
|
||||
</div>
|
||||
<p><%- func.render_md(user.description) %></p>
|
||||
<a if='edit-account-link' href="<%= config.site_path %>/<%= config.edit_account_base_url %>/<%= userID %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
<a if='edit-account-link' href="<%= config.edit_account_base_url %>/<%= user.id %>">
|
||||
<img class='icon' src='/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
</a>
|
||||
|
|
||||
<a id='rss-link' href="<%= config.site_path %>/user/<%= user.username %>/rss">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
<a id='rss-link' href="/user/<%= user.username %>/rss">
|
||||
<img class='icon' src='/icons/rss.png' alt="<%= locale.rss_feed %>" title='<%= locale.rss_feed %>'>
|
||||
</a>
|
||||
<a id='atom-link' href="<%= config.site_path %>/user/<%= user.username %>/atom">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
<a id='atom-link' href="/user/<%= user.username %>/atom">
|
||||
<img class='icon' src='/icons/atom.png' alt='<%= locale.atom_feed %>' title='<%= locale.atom_feed %>'>
|
||||
</a>
|
||||
<%- config.seperator %>
|
||||
|
||||
+44
-46
@@ -1,49 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.charset %>">
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
Misc:<br/>
|
||||
<a href="<%= config.site_path %>/">Home Page</a><br/>
|
||||
<a href="<%= config.site_path %><%= config.new_post_url %>">New Post Form</a><br/>
|
||||
<a href="<%= config.site_path %><%= config.signup_url %>">Signup Form</a><br/>
|
||||
Indexes:<br/>
|
||||
<a href="<%= config.site_path %>/index/posts">Posts Index</a><br/>
|
||||
<a href="<%= config.site_path %>/index/users">Users Index</a><br/>
|
||||
<a href="<%= config.site_path %>/index/comments">Comments Index</a><br/>
|
||||
Posts:<br/>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Comments:<br/>
|
||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Users:<br/>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Edit Posts:<br/>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_path %><%= config.edit_post_base_url %>/<%= postID %>">Edit <%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Edit Users:<br/>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_path %><%= config.edit_account_base_url %>/<%= users[userID]["username"] %>">Edit <%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
<!-- TODO add tags -->
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
Misc:<br/>
|
||||
<a href="/">Home Page</a><br/>
|
||||
<a href="<%= config.new_post_url %>">New Post Form</a><br/>
|
||||
<a href="<%= config.signup_url %>">Signup Form</a><br/>
|
||||
Indexes:<br/>
|
||||
<a href="/index/posts">Posts Index</a><br/>
|
||||
<a href="/index/users">Users Index</a><br/>
|
||||
<a href="/index/comments">Comments Index</a><br/>
|
||||
Posts:<br/>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Comments:<br/>
|
||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||
<a href="/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Users:<br/>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Edit Posts:<br/>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.edit_post_base_url %>/<%= postID %>">Edit <%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
Edit Users:<br/>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.edit_account_base_url %>/<%= users[userID]["username"] %>">Edit <%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
<!-- TODO add tags -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+10
-12
@@ -1,15 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.charset %>">
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||
<a href="<%= config.site_path %>/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<% for (let postID = 0; postID < comments.length; postID++) { %>
|
||||
<% for (let comment_index = 0; comment_index < comments[postID]['comments'].length; comment_index++) { %>
|
||||
<a href="/comment/<%= postID %>-<%= comment_index %>"><%= postID %>-<%= comment_index %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+10
-12
@@ -1,15 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.charset %>">
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_path %>/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<% for (let postID = 0; postID < posts.length; postID++) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<a href="/post/<%= postID %>"><%= posts[postID]["title"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+10
-12
@@ -1,15 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.charset %>">
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="<%= config.site_path %>/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include("../partials/head") %>
|
||||
</head>
|
||||
<body>
|
||||
<% for (let userID = 0; userID < users.length; userID++) { %>
|
||||
<% if (users[userID]["deleted"] != true) { %>
|
||||
<a href="/user/<%= users[userID]["username"] %>"><%= users[userID]["username"] %></a><br/>
|
||||
<% }; %>
|
||||
<% }; %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+23
-25
@@ -1,28 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<div id="comment">
|
||||
<%- include("../partials/comment"); %>
|
||||
</div>
|
||||
<%- config.seperator %>
|
||||
<b><%= locale.reply %>:</b>
|
||||
<div id="post-commentform">
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= postID %>">
|
||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||
<label><%= locale.comment %>:</label><br/><textarea name="content">>> <%- postID %>-<%- commentID %>
|
||||
</textarea><br/>
|
||||
<button type="submit"><%= locale.submit %></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<div id="comment">
|
||||
<%- include("../partials/comment"); %>
|
||||
</div>
|
||||
<%- config.seperator %>
|
||||
<b><%= locale.reply %>:</b>
|
||||
<div id="post-commentform">
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= postID %>">
|
||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||
<label><%= locale.comment %>:</label><br/><textarea name="content">>> <%- postID %>-<%- commentID %>
|
||||
</textarea><br/>
|
||||
<button type="submit"><%= locale.submit %></button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+14
-16
@@ -1,19 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<%- include('../posts/post'); %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<%- include('../posts/post'); %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+24
-26
@@ -4,36 +4,34 @@
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<div id='site-header'>
|
||||
<%- include('../headers/site_wide'); %>
|
||||
</div>
|
||||
<div id='site-header'>
|
||||
<%- include('../headers/site_wide'); %>
|
||||
</div>
|
||||
|
||||
<div id='advanced-search'>
|
||||
<form method="GET" action="/search">
|
||||
<label>Search Term:</label>
|
||||
<input type='text' placeholder='🔍' name='q' value='<%- search_term %>'><br/>
|
||||
<div id='advanced-search'>
|
||||
<form method="GET" action="/search">
|
||||
<label>Search Term:</label>
|
||||
<input type='text' placeholder='🔍' name='q' value='<%- search_term %>'><br/>
|
||||
|
||||
<label>Search for:</label><br/>
|
||||
<label>Post:</label>
|
||||
<input type="checkbox" name="type" value="post" <% if (search_type.includes('post')) {%>checked<% } %>><br/>
|
||||
<label>User:</label>
|
||||
<input type="checkbox" name="type" value="user" <% if (search_type.includes('user')) {%>checked<% } %>><br/>
|
||||
<label>Search for:</label><br/>
|
||||
<label>Post:</label>
|
||||
<input type="checkbox" name="type" value="post" <% if (search_type.includes('post')) {%>checked<% } %>><br/>
|
||||
<label>User:</label>
|
||||
<input type="checkbox" name="type" value="user" <% if (search_type.includes('user')) {%>checked<% } %>><br/>
|
||||
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%- config.seperator %>
|
||||
|
||||
<div id='results'>
|
||||
<% search_results.posts.forEach((result, index) => { %>
|
||||
<a href="/post/<%- result.id %>"><%- result.title %></a><br/>
|
||||
<% }); %>
|
||||
<% search_results.users.forEach((result, index) => { %>
|
||||
<a href="/user/<%- result.username %>"><%- result.prettyname %></a><br/>
|
||||
<% }); %>
|
||||
</div>
|
||||
<%- config.seperator %>
|
||||
|
||||
<div id='results'>
|
||||
<% search_results.posts.forEach((result, index) => { %>
|
||||
<a href="/post/<%- result.id %>"><%- result.title %></a><br/>
|
||||
<% }); %>
|
||||
<% search_results.users.forEach((result, index) => { %>
|
||||
<a href="/user/<%- result.username %>"><%- result.prettyname %></a><br/>
|
||||
<% }); %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+19
-27
@@ -1,30 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<header id="site-header">
|
||||
<%- include('../headers/site_wide'); %>
|
||||
</header>
|
||||
<header id='page-header'>
|
||||
<%- include('../headers/tag'); %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||
<% if ( posts[index].deleted != true) { %>
|
||||
<% posts[index].tags.forEach((current_tag, tag_index) => { %>
|
||||
<% if (current_tag.toLowerCase() == tag.toLowerCase()) { %>
|
||||
<%- include('../posts/tag', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
||||
<% } %>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">
|
||||
<%- include('../headers/site_wide'); %>
|
||||
</header>
|
||||
<header id='page-header'>
|
||||
<%- include('../headers/tag'); %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||
<%- include('../posts/tag', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+22
-23
@@ -1,26 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<header id='page-header'>
|
||||
<%- include('../headers/timeline'); %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||
<% if (posts[index]["deleted"] != true) { %>
|
||||
<%- include('../posts/timeline', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<header id='page-header'>
|
||||
<%- include('../headers/timeline'); %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||
<% if (posts[index]["deleted"] != true) { %>
|
||||
<%- console.log(posts[index]) %>
|
||||
<%- include('../posts/timeline', {post: posts[index], postID: index, user: users[posts[index].userID], comments: comments[index]}); %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+19
-23
@@ -1,26 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main">
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<header id='page-header'>
|
||||
<%- include('../headers/user'); %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||
<% if (posts[index].userID == userID) { %>
|
||||
<%- include('../posts/user', {post: posts[index], postID: index, user: user, comments: comments[index]}); %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
<head>
|
||||
<%- include('../partials/head'); %>
|
||||
</head>
|
||||
<body>
|
||||
<header id="site-header">
|
||||
<%- include("../headers/site_wide") %>
|
||||
</header>
|
||||
<header id='page-header'>
|
||||
<%- include('../headers/user'); %>
|
||||
</header>
|
||||
<div id="posts">
|
||||
<% for (let index = posts.length - 1; index >= 0; index--) { %>
|
||||
<%- include('../posts/user', {post: posts[index], postID: index, user: user, comments: comments[index]}); %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer id='footer'>
|
||||
<%- include('../partials/footer'); %>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<%= func.unix_time_to_date_format(comment.pubdate) %>
|
||||
</span>
|
||||
<span id='comment-id' style='display: inline'>
|
||||
<a href='<%= config.site_path %>/comment/<%= postID %>-<%= comment.id %>'>No. <%= postID %>-<%= comment.id %></a>:<br/>
|
||||
<a href='/comment/<%= postID %>-<%= comment.id %>'>No. <%= postID %>-<%= comment.id %></a>:<br/>
|
||||
</span>
|
||||
<span id='comment-content'>
|
||||
<%- func.render_comment(comment.content) %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<a id='site-index-link' href="<%= config.site_path %>/index/pages"><%= locale.site_index %></a><br/>
|
||||
<a id='site-index-link' href="/index/pages"><%= locale.site_index %></a><br/>
|
||||
<%= locale.site_ran_by %> <%= config.site_admin %><br/>
|
||||
<%- locale.attribution %><br/>
|
||||
<%= locale.AI_consent %> <!-- remove consent for AI scrapers -->
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<meta charset="<%- config.charset %>">
|
||||
<meta name='robots' content='noindex'>
|
||||
<title><%= config.site_path %></title>
|
||||
<title><%= config.site_name %></title>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="<%= config.site_path %>/default.css">
|
||||
<link rel="stylesheet" href="<%= config.site_path %>/custom.css">
|
||||
<link rel="stylesheet" href="/default.css">
|
||||
<link rel="stylesheet" href="/custom.css">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><%= locale.written_by %> <a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><%= locale.written_by %> <a href="/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -25,8 +25,8 @@
|
||||
<i><%= locale.last_modified %>: <%= func.unix_time_to_date_format(post.pubdate) %></i><br/>
|
||||
</div>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.site_path %>/<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<a href="<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
<% if (config.enable_hitcount == true) { %>
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
<div id="post-commentform">
|
||||
<!-- Comment form -->
|
||||
<form method="POST" action="<%= config.site_path %>/submit_comment">
|
||||
<form method="POST" action="/submit_comment">
|
||||
<input type="hidden" name="post_index" value="<%= post["id"] %>">
|
||||
<label><%= locale.username %>:</label><br/><input name="name"><br/><br/>
|
||||
<label><%= locale.comment %>:</label><br/><textarea name="content"></textarea><br/>
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><a href="/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -24,7 +24,7 @@
|
||||
<br/>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<img class='icon' src='/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><a href="/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<a if='edit-account-link' href="<%= config.site_path %>/<%= config.edit_account_base_url %>/<%= user.id %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
<a if='edit-account-link' href="<%= config.edit_account_base_url %>/<%= user.id %>">
|
||||
<img class='icon' src='/icons/edit.png' alt='<%= locale.edit_account %>' title='<%= locale.edit_account %>'>
|
||||
</a>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -27,8 +27,8 @@
|
||||
</span>
|
||||
<br/>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.site_path %>/<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<a href="<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div id="post-header">
|
||||
<h2>
|
||||
<a href='<%= config.site_path %>/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
<a href='/post/<%= post['id'] %>'><%= post.title %></a>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div id="post-details">
|
||||
<span id="post-author">
|
||||
<i><a href="<%= config.site_path %>/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
<i><a href="/user/<%= user.username %>"><%= user.prettyname %></a></i>
|
||||
</span>
|
||||
-
|
||||
<span id="post-pubdate">
|
||||
@@ -23,8 +23,8 @@
|
||||
</span>
|
||||
<br/>
|
||||
<div id="post-edit">
|
||||
<a href="<%= config.site_path %>/<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='<%= config.site_path %>/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
<a href="<%= config.edit_post_base_url %>/<%= post["id"] %>">
|
||||
<img class='icon' src='/icons/edit.png' alt='<%= locale.edit_post %>' title='<%= locale.edit_post %>'>
|
||||
</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+12
-11
@@ -6,17 +6,18 @@
|
||||
<updated><%= func.unix_time_to_date_format(getUnixTime(new Date()),"yyyy-MM-dd'T'HH:mm:ss'Z'") %></updated>
|
||||
<id><%= config.site_url %></id>
|
||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<entry>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<summary><![CDATA[<%- (posts[postID]["content"]) %>]]></summary>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%# func.unix_time_to_date_format(posts[postID]['pubdate'],"yyyy-MM-dd'T'HH:mm:ss'Z'") %></pubDate>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<entry>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<summary><![CDATA[<%- (posts[postID]["content"]) %>]]></summary>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%- func.unix_time_to_date_format(posts[postID]['pubdate'],"yyyy-MM-dd'T'HH:mm:ss'Z'") %></pubDate>
|
||||
<% tags = posts[postID]['tags'].split(',') %>
|
||||
<% for (let tag_index = 0; tag_index < tags.length; tag_index++) { %>
|
||||
<category><![CDATA[<%= tags[tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</entry>
|
||||
<% } %>
|
||||
</entry>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</feed>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title><%= config.site_name %></title>
|
||||
<link><%= config.site_url %></title>
|
||||
<description><%= config.site_description %></description>
|
||||
<updated><%= func.unix_time_to_atom_date(getUnixTime(new Date())) %></updated>
|
||||
<id><%= config.site_url %></id>
|
||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<entry>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<summary><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></summary>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%# func.unix_time_to_atom_date(posts[postID]['pubdate']) %></pubDate>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</entry>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</feed>
|
||||
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title><%= config.site_name %></title>
|
||||
<link><%= config.site_url %></title>
|
||||
<description><%= config.site_description %></description>
|
||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<item>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<description><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></description>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%= func.unix_time_to_rss_date(posts[postID]['pubdate']) %></pubDate>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</item>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title><%= config.site_name %></title>
|
||||
@@ -13,8 +12,9 @@
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%= func.unix_time_to_date_format(posts[postID]['pubdate'],'EEE, dd MMM yyyy HH:mm:ss') %></pubDate>
|
||||
<author><%= users[posts[postID]['userID']]['prettyname'] %></author>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% tags = posts[postID]['tags'].split(',') %>
|
||||
<% for (let tag_index = 0; tag_index < tags.length; tag_index++) { %>
|
||||
<category><![CDATA[<%= tags[tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</item>
|
||||
<% } %>
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title><%= config.site_name %></title>
|
||||
<link><%= config.site_url %></title>
|
||||
<description><%= config.site_description %></description>
|
||||
<updated><%= func.unix_time_to_atom_date(getUnixTime(new Date())) %></updated>
|
||||
<id><%= config.site_url %></id>
|
||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||
<% if (posts[postID]["userID"] == userID) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<entry>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<summary><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></summary>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%# func.unix_time_to_atom_date(posts[postID]['pubdate']) %></pubDate>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</entry>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</feed>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="<%= config.charset %>" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
<title><%= config.site_name %></title>
|
||||
<link><%= config.site_url %></title>
|
||||
<description><%= config.site_description %></description>
|
||||
<% for (let postID = posts.length-1; postID >= 0; postID--) { %>
|
||||
<% if (posts[postID]["userID"] == userID) { %>
|
||||
<% if (posts[postID]["deleted"] != true) { %>
|
||||
<item>
|
||||
<title><%= posts[postID]["title"] %></title>
|
||||
<link><%= config.site_url %>/post/<%= postID %></link>
|
||||
<description><![CDATA[<%- func.render_md(posts[postID]["content"]) %>]]></description>
|
||||
<guid isPermaLink="true"><%= config.site_url %>/post/<%= postID %></guid>
|
||||
<pubDate><%= func.unix_time_to_rss_date(posts[postID]['pubdate']) %></pubDate>
|
||||
<% for (let tag_index = 0; tag_index < posts[postID]['tags'].length; tag_index++) { %>
|
||||
<category><![CDATA[<%= posts[postID]['tags'][tag_index] %>]]></category>
|
||||
<% } %>
|
||||
</item>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</channel>
|
||||
</rss>
|
||||
Reference in New Issue
Block a user