Sydication updates
This commit is contained in:
@@ -37,18 +37,18 @@ router.get("/user/:username", (req, res) => {
|
|||||||
let user = data.getdata('users', 'id', userID)[0]
|
let user = data.getdata('users', 'id', userID)[0]
|
||||||
if (userID != -1) {
|
if (userID != -1) {
|
||||||
res.render("pages/user",
|
res.render("pages/user",
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
locale,
|
locale,
|
||||||
posts: data.getdata('posts'),
|
posts: data.getdata('posts'),
|
||||||
user,
|
user,
|
||||||
userID: userID,
|
userID: userID,
|
||||||
comments: data.getdata('comments'),
|
comments: data.getdata('comments'),
|
||||||
fromUnixTime,
|
fromUnixTime,
|
||||||
format,
|
format,
|
||||||
getUnixTime,
|
getUnixTime,
|
||||||
func,
|
func,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else if (userID == -1) {
|
else if (userID == -1) {
|
||||||
res.render("partials/message",
|
res.render("partials/message",
|
||||||
@@ -63,33 +63,29 @@ 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)
|
||||||
}
|
}
|
||||||
res.render("pages/post",
|
res.render("pages/post",
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
locale,
|
locale,
|
||||||
post,
|
post,
|
||||||
postID,
|
postID,
|
||||||
user: data.getdata('users','id', post.userID),
|
user: data.getdata('users','id', post.userID),
|
||||||
comments: data.getdata('comments','id', postID)["comments"],
|
comments: data.getdata('comments','id', postID)["comments"],
|
||||||
fromUnixTime,
|
fromUnixTime,
|
||||||
format,
|
format,
|
||||||
getUnixTime,
|
getUnixTime,
|
||||||
func,
|
func,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log("Error loading page")
|
|
||||||
res.redirect(301,"/")
|
|
||||||
}
|
}
|
||||||
}); // /post/:post_index
|
}); // /post/:post_index
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user