summaryrefslogtreecommitdiff
path: root/main.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'main.lisp')
-rw-r--r--main.lisp26
1 files changed, 14 insertions, 12 deletions
diff --git a/main.lisp b/main.lisp
index d6b6448..f2dbc70 100644
--- a/main.lisp
+++ b/main.lisp
@@ -26,11 +26,6 @@
(defun call-with-initialised-journal (func)
(let* ((*site* (if (file-exists-p #p"/home/mulk") :mst-plus :nfs.net))
(*debugging-p* (eq *site* :mst-plus))
- (*query* #+clisp (mapcan #'(lambda (param)
- (list (keywordify param)
- (http-query-parameter param)))
- (http-query-parameter-list))
- #-clisp '())
(*http-env* (http-get-env-vars))
(*subpath-query* (subseq (gethash "REQUEST_URI" *http-env*)
(length (ecase *site*
@@ -42,11 +37,7 @@
(length *subpath-query*))))
(*subpath* (split-sequence #\/ *subpath-string*
:remove-empty-subseqs t))
- (*post-number* (parse-integer (or (first *subpath*)
- (getf *query* :id ""))
- :junk-allowed t #|| :radix 12 ||#))
- (*action* (or (keywordify (getf *query* :action))
- (cond ((string= "feed" (first *subpath*)) :view-atom-feed)
+ (*action* (or (cond ((string= "feed" (first *subpath*)) :view-atom-feed)
((string= "comment-feed" (first *subpath*)) :view-comment-feed)
((string= "debug" (first *subpath*)) :view-debugging-page)
((string= "preview" (car (last *subpath*))) :preview-entry)
@@ -54,8 +45,17 @@
((string= "save" (car (last *subpath*))) :save-entry)
((string= "moderate" (car (last *subpath*))) :moderate)
((string= "atom" (car (last *subpath*))) :view-atom-entry)
- (*post-number* :view)
- (t nil))))
+ (t nil))))
+ (*query* #+clisp (if (eq *action* :view-atom-entry)
+ nil
+ (mapcan #'(lambda (param)
+ (list (keywordify param)
+ (http-query-parameter param)))
+ (http-query-parameter-list)))
+ #-clisp '())
+ (*post-number* (parse-integer (or (first *subpath*)
+ (getf *query* :id ""))
+ :junk-allowed t #|| :radix 12 ||#))
(*method* (keywordify (gethash "REQUEST_METHOD" *http-env*)))
(*if-modified-since* #+clisp (ext:getenv "HTTP_IF_MODIFIED_SINCE")
#-clisp nil)
@@ -83,6 +83,8 @@
(ecase *site*
(:mst-plus #p"/usr/lib/")
(:nfs.net #p"/usr/local/lib/")))))
+ (when (null *action*)
+ (setq *action* (if *post-number* :view :index)))
(clsql:push-library-path *script-dir*)
(clsql:push-library-path #p"/usr/local/lib/")
(push *script-dir* clsql-sys:*foreign-library-search-paths*)