aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-02-17 07:35:13 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-02-17 07:35:13 +0000
commitb126867df82cf6d14eb62ea95fb8650d6431b3be (patch)
tree7762a925465197df8ef47b17101b1c3ac8f2cc1d
parent7b1fbd54ee0b5f805d65ef5e7820a975a6b76fea (diff)
downloadellinika-b126867df82cf6d14eb62ea95fb8650d6431b3be.tar.gz
ellinika-b126867df82cf6d14eb62ea95fb8650d6431b3be.tar.bz2
Produce valid HTMP 4.01. Read configuration file.
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@13 941c8c0f-9102-463b-b60b-cd22ce0e6858
-rwxr-xr-xcgi-bin/dict.cgi89
1 files changed, 61 insertions, 28 deletions
diff --git a/cgi-bin/dict.cgi b/cgi-bin/dict.cgi
index fc41a67..637ab98 100755
--- a/cgi-bin/dict.cgi
+++ b/cgi-bin/dict.cgi
@@ -24,16 +24,31 @@
(cgi:init)
;;; User-definable variables
-(define dict-cgi-path "/cgi-bin/dict.cgi")
-(define sql-iface "mysql")
-(define sql-host "localhost")
-(define sql-port 3306)
-(define sql-database "ellinika")
-(define sql-username "gray")
-(define sql-password "Imbabura")
-(define match-list-columns 4) ;; Number of colums in fuzzy search output
+(define rc-file-name "/home/gray/linguae/ellinika/etc/ellinika.conf")
+(define base-href "http://localhost/") ;; Base HREF
+(define home-page "http://cvs.farlep.net/~gray") ;; Author home page
+(define dict-cgi-path "cgi-bin/dict.cgi") ;; Path to the cgi (relative
+ ;; to the Base )
+(define admin-email "gray@mirddin.farlep.net") ;; Administrator email address
+(define admin-email-text "gray at mirddin.farlep.net") ;; Textual representation
+ ;; thereof
+
+(define sql-iface "mysql") ;; SQL interface ("mysql" or "postgres")
+(define sql-host "localhost") ;; SQL server hostname or a path to the UNIX
+ ;; socket
+(define sql-port 3306) ;; SQL port number (0 for sockaddr_un
+ ;; connection)
+(define sql-database "ellinika") ;; Name of the database
+(define sql-username "gray") ;; Database user name
+(define sql-password "") ;; Password for that user name
+
+(define match-list-columns 4) ;; Number of colums in fuzzy search output
;;; End of user-definable variables
+;;; Load the site defaults
+(if (file-exists? rc-file-name)
+ (load rc-file-name))
+
;; Τα μέρη του λογου
(define part-of-speech
(list (cons "κανένα μέρος του λογου" #f)
@@ -79,29 +94,41 @@
(define (dict-html-start)
(display "Content-type: text/html; charset=utf-8\r\n\r\n")
(display "
+<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<HTML>
<HEAD>
<TITLE>Ellinorosiko lexiko</TITLE>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
+ <BASE HREF=\"")
+ (display base-href)
+ (display "\">
</HEAD>
<BODY BGCOLOR=\"#000080\" TEXT=\"#000000\" LINK=\"#1F00FF\" ALINK=\"#FF0000\" VLINK=\"#9900DD\">
<TABLE WIDTH=\"99%\" ALIGN=\"CENTER\" CELLSPACING=\"0\" CELLPADDING=\"10%\" BORDER=\"0\" BGCOLOR=\"#FFFFFF\">
<TR>
- <TD VALIGN=TOP width=20%>
- <IMG SRC=\"/graphics/iep-small.jpg\" ALIGN=\"top\" ALT=\" [IEP logo] \"><P>
+ <TD VALIGN=TOP width=\"20%\">
+ <IMG SRC=\"graphics/gnu-head-sm.jpg\" ALIGN=\"top\" ALT=\" [A GNU head] \"><P>
<TABLE WIDTH=\"100%\" ALIGN=\"LEFT\" CELLSPACING=\"0\" CELLPADDING=\"10%\" BORDER=\"0\" BGCOLOR=\"#FFFFFF\">
- <TR><TD BGCOLOR=\"#0063C1\" ALIGN=\"CENTER\">Γραμματική</TD><TR>
- <TR><TD><A HREF=\"/ellinika/gram.html\">Γραμματική</A></TD><TR>
- <TR><TD><A HREF=\"/ellinika/arthra.html\">Τα άρθρα</A></TD></TR>
- <TR><TD><A HREF=\"/ellinika/oysiastika.html\">Τα ουσιαστικά</A></TD></TR>
- <TR><TD><A HREF=\"/ellinika/epitheta.html\">Τα επίθετα</A></TD></TR>
- <TR><TD><A HREF=\"/ellinika/antonimies.html\">Αντωνιμίες</A></TD></TR>
- <TR><TD><A HREF=\"/ellinika/rhmata.html\">Ρήματα</A></TD></TR>
- <TR><TD><A HREF=\"/index.html\">Αρχικύ σελίδα</A></TD></TR>
+ <TR><TD BGCOLOR=\"#0063C1\"><CENTER><STRONG><FONT color=\"white\">Γραμματική</FONT></STRONG></CENTER></TD></TR>
+ <TR><TD><A HREF=\"ellinika/gram.html\">Γραμματική</A></TD></TR>
+ <TR><TD><A HREF=\"ellinika/arthra.html\">Τα άρθρα</A></TD></TR>
+ <TR><TD><A HREF=\"ellinika/oysiastika.html\">Τα ουσιαστικά</A></TD></TR>
+ <TR><TD><A HREF=\"ellinika/epitheta.html\">Τα επίθετα</A></TD></TR>
+ <TR><TD><A HREF=\"ellinika/antonimies.html\">Αντωνυμίες</A></TD></TR>
+ <TR><TD><A HREF=\"ellinika/rhmata.html\">Ρήματα</A></TD></TR>
+ <TR><TD><A HREF=\"")
+ (display home-page)
+ (display "\">Αρχική σελίδα</A></TD></TR>
+
+ <TR><TD BGCOLOR=\"#0063C1\"><CENTER><STRONG><FONT color=\"white\">Πληροφορίες</FONT></STRONG></CENTER></TD></TR>
+ <TR><TD><A HREF=\"http://validator.w3.org/check/referer\">
+ <img border=\"0\" src=\"graphics/valid-html401.png\"
+ alt=\"[ Valid HTML 4.01! ]\" height=\"31\" width=\"88\"></A></TD></TR>
+
</TABLE>
</TD>
<TD VALIGN=top>
- <H1 ALIGN=CENTER>Ελληνορώσικο λέξικο</H1>
+ <H1 ALIGN=CENTER>Ελληνορωσικό λέξικο</H1>
<HR>"))
(define (dict-html-end)
@@ -111,8 +138,12 @@
<TR>
<TD colspan=\"2\">
<hr>
-Για προτάσεις ή απορίες σχετικά με αυτή η σελίδα επικοινωνήστε στο
-&lt;<A HREF=\"mailto:gray@mirddin.farlep.net\">gray at mirddin.farlep.net</A>&gt;
+Για προτάσεις ή απορίες σχετικά με αυτήν τη σελίδα επικοινωνήστε στο
+&lt;<A HREF=\"mailto:")
+ (display admin-email)
+ (display "\">")
+ (display admin-email-text)
+ (display "</A>&gt;
</TD>
</TR>
@@ -126,7 +157,7 @@
<TABLE BORDER=0>
<TR>
<TD>
- Εισάγετε η λέξη
+ Εισάγετε τη λέξη
</TD>
<TD>
<INPUT size=36 NAME=\"key\" TABINDEX=\"1\"")
@@ -142,7 +173,7 @@
<TR>
<TD>")
- (display "Διαλέξτε το μέρος του λόγου</TD><TD>")
+ (display "Επιλέξτε το μέρος του λόγου</TD><TD>")
(let ((selected-choice (or (let ((s (cgi:value "POS")))
(if s
@@ -172,7 +203,7 @@
<TR>
<TD>")
- (display "Διαλέξτε η θέμα</TD><TD>")
+ (display "Επιλέξτε το θέμα</TD><TD>")
(let ((topic-list (get-topic-list)))
(if topic-list
(let ((selected-choice (or (let ((s (cgi:value "TOPIC")))
@@ -181,7 +212,7 @@
#f))
0)))
(display "<SELECT NAME=\"TOPIC\" TABINDEX=\"3\">")
- (display "<OPTION VALUE=0>καμία θέμα")
+ (display "<OPTION VALUE=0>κανένα θέμα")
(for-each
(lambda (x)
(let ((id (car x))
@@ -204,6 +235,7 @@
</TD>
</TR>
</TABLE>
+</FORM>
<P>"))
@@ -442,18 +474,19 @@
((= i len) (apply string-append (reverse sl)))
(set! sl (cons
(cond
- ((and (< (+ i 2) len)
+ ((and (<= (+ i 4) len)
(assoc (substring str i (+ i 4)) transcription-list)) =>
(lambda (x)
(set! i (+ i 4))
(cdr x)))
- ((assoc (substring str i (+ i 2)) transcription-list) =>
+ ((and (<= (+ i 2) len)
+ (assoc (substring str i (+ i 2)) transcription-list)) =>
(lambda (x)
(set! i (+ i 2))
(cdr x)))
(else
(set! i (1+ i))
- (substring str i (+ i 1))))
+ (substring str (- i 1) i)))
sl)))))

Return to:

Send suggestions and report system problems to the System administrator.