2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,6 +4,8 @@ posts.json
|
|||||||
comments.json
|
comments.json
|
||||||
users.json
|
users.json
|
||||||
config.json
|
config.json
|
||||||
|
data.json
|
||||||
hitcount.txt
|
hitcount.txt
|
||||||
*.swp
|
*.swp
|
||||||
webroot/
|
webroot/
|
||||||
|
images/*
|
||||||
|
@@ -1 +1 @@
|
|||||||
{"hitcount":37}
|
{"hitcount":40}
|
@@ -24,13 +24,14 @@ export function getdata(data, index=-1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOT YET WORKING!
|
||||||
if (config["data_storage"] == "mysql") {
|
if (config["data_storage"] == "mysql") {
|
||||||
const mysql = require('mysql');
|
const mysql = require('mysql');
|
||||||
let con = mysql.createConnection({
|
let con = mysql.createConnection({
|
||||||
host: config.database.host,
|
host: config.database.host,
|
||||||
user: config.database.user,
|
user: config.database.user,
|
||||||
password: config.database.password,
|
password: config.database.password,
|
||||||
database: config.database.database,
|
database: config.database.database,
|
||||||
});
|
});
|
||||||
|
|
||||||
con.connect(function(err) {
|
con.connect(function(err) {
|
||||||
|
@@ -87,7 +87,6 @@ export function escape_input(input) {
|
|||||||
|
|
||||||
// Render comment content by replacing the >> int with a url link to that comment
|
// Render comment content by replacing the >> int with a url link to that comment
|
||||||
export function render_comment(comment_content) {
|
export function render_comment(comment_content) {
|
||||||
console.log(comment_content)
|
|
||||||
return 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>")
|
||||||
|
@@ -32,7 +32,7 @@ export function initialise() {
|
|||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("Creating generic data file")
|
console.log("Creating generic data file")
|
||||||
fs.writeFileSync(`../data/data.json`, `{"hitcount": 0, "comment_counter": 0}`)
|
fs.writeFileSync(`../data/data.json`, `{"hitcount": 0}`)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const config = require("../config.json");
|
const config = require("../config.json");
|
||||||
|
Reference in New Issue
Block a user