Sydication updates
This commit is contained in:
@@ -63,13 +63,13 @@ router.get("/user/:username", (req, res) => {
|
|||||||
router.get("/post/:post_index", (req, res) => {
|
router.get("/post/:post_index", (req, res) => {
|
||||||
const postID = parseInt(req.params.post_index)
|
const postID = parseInt(req.params.post_index)
|
||||||
let post = data.getdata('posts','id', postID)[0]
|
let post = data.getdata('posts','id', postID)[0]
|
||||||
if (post == 1) { // data.getdata returns error code 1 if nothing is available
|
if (post.length == 0) { // data.getdata returns error code 1 if nothing is available
|
||||||
res.render("partials/message", {
|
res.render("partials/message", {
|
||||||
message: locale.post_doesnt_exist,
|
message: locale.post_doesnt_exist,
|
||||||
config,
|
config,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else if (typeof post["deleted"] == "undefined" || post["deleted"] == false) {
|
else {
|
||||||
if (config.enable_hitcount) {
|
if (config.enable_hitcount) {
|
||||||
data.increment_hitcount(postID)
|
data.increment_hitcount(postID)
|
||||||
}
|
}
|
||||||
@@ -87,10 +87,6 @@ router.get("/post/:post_index", (req, res) => {
|
|||||||
func,
|
func,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
console.log("Error loading page")
|
|
||||||
res.redirect(301,"/")
|
|
||||||
}
|
|
||||||
}); // /post/:post_index
|
}); // /post/:post_index
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user