diff options
Diffstat (limited to 'src/cgi-bin/nea.scm4')
-rw-r--r-- | src/cgi-bin/nea.scm4 | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/cgi-bin/nea.scm4 b/src/cgi-bin/nea.scm4 index f64aca2..e366a7c 100644 --- a/src/cgi-bin/nea.scm4 +++ b/src/cgi-bin/nea.scm4 | |||
@@ -1,5 +1,5 @@ | |||
1 | ;;;; News page for Ellinika | 1 | ;;;; News page for Ellinika |
2 | ;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff | 2 | ;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 Sergey Poznyakoff |
3 | ;;;; | 3 | ;;;; |
4 | ;;;; This program is free software; you can redistribute it and/or modify | 4 | ;;;; This program is free software; you can redistribute it and/or modify |
5 | ;;;; it under the terms of the GNU General Public License as published by | 5 | ;;;; it under the terms of the GNU General Public License as published by |
@@ -30,7 +30,7 @@ | |||
30 | ifelse(IFACE,[CGI],(cgi:init)) | 30 | ifelse(IFACE,[CGI],(cgi:init)) |
31 | 31 | ||
32 | (define tmpl (if (and monima-nea-template-file-name | 32 | (define tmpl (if (and monima-nea-template-file-name |
33 | (cgi:value "timestamp")) | 33 | (cgi:value-u8 "timestamp")) |
34 | monima-nea-template-file-name | 34 | monima-nea-template-file-name |
35 | nea-template-file-name)) | 35 | nea-template-file-name)) |
36 | 36 | ||
@@ -177,13 +177,13 @@ ifelse(IFACE,[CGI],(cgi:init)) | |||
177 | 0))) | 177 | 0))) |
178 | (from (catch #t | 178 | (from (catch #t |
179 | (lambda () | 179 | (lambda () |
180 | (let ((x (string->number (cgi:value "from")))) | 180 | (let ((x (string->number (cgi:value-u8 "from")))) |
181 | (if (< x count) | 181 | (if (< x count) |
182 | x | 182 | x |
183 | 0))) | 183 | 0))) |
184 | (lambda args | 184 | (lambda args |
185 | 0))) | 185 | 0))) |
186 | (fwd (let ((dir (cgi:value "dir"))) | 186 | (fwd (let ((dir (cgi:value-u8 "dir"))) |
187 | (or (not dir) | 187 | (or (not dir) |
188 | (string=? dir "1")))) | 188 | (string=? dir "1")))) |
189 | (entries (collect-entries from fwd))) | 189 | (entries (collect-entries from fwd))) |
@@ -199,7 +199,7 @@ ifelse(IFACE,[CGI],(cgi:init)) | |||
199 | (let ((num-entries (length result)) | 199 | (let ((num-entries (length result)) |
200 | (begin (if fwd from start)) | 200 | (begin (if fwd from start)) |
201 | (end (if fwd start from)) | 201 | (end (if fwd start from)) |
202 | (id (cgi:value "id"))) | 202 | (id (cgi:value-u8 "id"))) |
203 | 203 | ||
204 | (cond | 204 | (cond |
205 | ((not (and (= from 0) (< num-entries nea-max-rows))) | 205 | ((not (and (= from 0) (< num-entries nea-max-rows))) |
@@ -273,7 +273,7 @@ ifelse(IFACE,[CGI],(cgi:init)) | |||
273 | (display "<span class=\"itemsubject\">\n") | 273 | (display "<span class=\"itemsubject\">\n") |
274 | (display (list-ref item 2)) | 274 | (display (list-ref item 2)) |
275 | (display "</span>") | 275 | (display "</span>") |
276 | (if (not (cgi:value "timestamp")) | 276 | (if (not (cgi:value-u8 "timestamp")) |
277 | (permalink "span" (list-ref item 1))) | 277 | (permalink "span" (list-ref item 1))) |
278 | (display "</div><!-- news-header -->")) | 278 | (display "</div><!-- news-header -->")) |
279 | 279 | ||
@@ -337,7 +337,7 @@ ifelse(IFACE,[CGI],(cgi:init)) | |||
337 | (cond | 337 | (cond |
338 | ((string=? name "lang")) | 338 | ((string=? name "lang")) |
339 | (else | 339 | (else |
340 | (let ((v (cgi:value name))) | 340 | (let ((v (cgi:value-u8 name))) |
341 | (cond ((and v (not (string-null? v))) | 341 | (cond ((and v (not (string-null? v))) |
342 | (display "&") | 342 | (display "&") |
343 | (display name) | 343 | (display name) |
@@ -435,7 +435,7 @@ ifelse(IFACE,[CGI],(cgi:init)) | |||
435 | ;;; Main | 435 | ;;; Main |
436 | 436 | ||
437 | (cond | 437 | (cond |
438 | ((cgi:value "rss") | 438 | ((cgi:value-u8 "rss") |
439 | ifelse(IFACE,[CGI], | 439 | ifelse(IFACE,[CGI], |
440 | (display ["Content-type: text/xml; charset=utf-8\r\n\r\n"]), | 440 | (display ["Content-type: text/xml; charset=utf-8\r\n\r\n"]), |
441 | (request-rec:set-content-type! Request ["text/xml; charset=UTF-8"])) | 441 | (request-rec:set-content-type! Request ["text/xml; charset=UTF-8"])) |
@@ -447,15 +447,15 @@ ifelse(IFACE,[CGI],(cgi:init)) | |||
447 | (display ["Content-type: text/html; charset=utf-8\r\n\r\n"])) | 447 | (display ["Content-type: text/html; charset=utf-8\r\n\r\n"])) |
448 | (ellinika:sql-connect ellinika-sql-connection) | 448 | (ellinika:sql-connect ellinika-sql-connection) |
449 | (cond | 449 | (cond |
450 | ((or (cgi:value "timestamp") (cgi:value "id")) | 450 | ((or (cgi:value-u8 "timestamp") (cgi:value-u8 "id")) |
451 | (let ((tuples | 451 | (let ((tuples |
452 | (cond | 452 | (cond |
453 | ((cgi:value "timestamp") => | 453 | ((cgi:value-u8 "timestamp") => |
454 | (lambda (ts) | 454 | (lambda (ts) |
455 | (ellinika:sql-query | 455 | (ellinika:sql-query |
456 | "SELECT date,unix_timestamp(date),ident\ | 456 | "SELECT date,unix_timestamp(date),ident\ |
457 | FROM news WHERE unix_timestamp(date)=~Q" ts))) | 457 | FROM news WHERE unix_timestamp(date)=~Q" ts))) |
458 | ((cgi:value "id") => | 458 | ((cgi:value-u8 "id") => |
459 | (lambda (id) | 459 | (lambda (id) |
460 | (ellinika:sql-query | 460 | (ellinika:sql-query |
461 | "SELECT date,unix_timestamp(date),ident\ | 461 | "SELECT date,unix_timestamp(date),ident\ |