From 1aadce71dcce3ab20555342b6f1f21a4b2ea4b7f Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Sun, 20 May 2018 23:15:35 +0100 Subject: [PATCH] Fixes RSS regression. --- src/forum.nim | 7 ++++--- src/main.tmpl | 15 ++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/forum.nim b/src/forum.nim index 4a0c74e..6e60108 100644 --- a/src/forum.nim +++ b/src/forum.nim @@ -1305,9 +1305,6 @@ routes: ) resp content.rstToHtml() - get re"/(.+)?": - resp readFile("public/karax.html") - get "/threadActivity.xml": createTFD() resp genThreadsRSS(c), "application/atom+xml" @@ -1316,6 +1313,10 @@ routes: createTFD() resp genPostsRSS(c), "application/atom+xml" + get re"/(.+)?": + resp readFile("public/karax.html") + + get "/activateEmail/?": createTFD() cond(@"nick" != "") diff --git a/src/main.tmpl b/src/main.tmpl index b9b9069..1d82314 100644 --- a/src/main.tmpl +++ b/src/main.tmpl @@ -32,7 +32,7 @@ # ORDER BY modified DESC LIMIT 1""") - Nim forum thread activity + ${config.name} thread activity ${frontQuery} @@ -60,13 +60,14 @@ ${xmlEncode(rstToHtml(!postContent))} # #proc genPostsRSS(c: TForumData): string = # result = "" -# const query = sql"""SELECT A.id, B.name, A.content, A.thread, -# A.header, strftime('%Y-%m-%dT%H:%M:%SZ', A.creation), +# const query = sql"""SELECT A.id, B.name, A.content, A.thread, T.name, +# strftime('%Y-%m-%dT%H:%M:%SZ', A.creation), # A.creation, COUNT(C.id) -# FROM post AS A, person AS B, post AS C +# FROM post AS A, person AS B, post AS C, thread AS T # WHERE A.author = B.id AND A.thread = C.thread AND C.id <= A.id +# AND T.id = A.thread # GROUP BY A.id -# ORDER BY A.creation DESC LIMIT ?""" +# ORDER BY A.creation DESC LIMIT 10""" # const postId = 0 # const postAuthor = 1 # const postContent = 2 @@ -81,12 +82,12 @@ ${xmlEncode(rstToHtml(!postContent))} # ORDER BY creation DESC LIMIT 1""") - Nim forum post activity + ${config.name} post activity ${frontQuery} ${recent} -# for row in rows(db, query, 10): +# for row in rows(db, query): ${xmlEncode(!postHeader)} urn:entry:${!postId}