diff --git a/doc/clog-manual.html b/doc/clog-manual.html index 73f1de4..5de2bf9 100644 --- a/doc/clog-manual.html +++ b/doc/clog-manual.html @@ -54,7 +54,7 @@
SQL Timestamp by Engine
[variable] *MYSQL-TIMESTAMP* "unix_timestamp()"
+ +Function used by mysql to retrieve the time from the epoch
[variable] *SQLITE-TIMESTAMP* "strftime('%s')"
+ +Function used by sqlite to retrieve the time from the epoch
[variable] *POSTGRESQL-TIMESTAMP* "extract(epoch from now())"
+ +Function used by postgresql to retrieve the time from the epoch
SQL Writing Helpers
[function] SQL-QUOTE VALUE
+ +Returns value single quoted if string (single quote quoted by doubling) +unless is the single character '?'. If value is a list the car is returned +unquoted
:QUOTE-ALL t then all fields are in quotes.
[function] SQL-VALUE-LIST VALUE-LIST
-Given list of values returns a string for use in a SQL insert value
-list. If a value is a string it is quoted with single quotes
-(and single quotes qutoed by doubling) unless is the single
-character '?'.
Given list of values each passed to SQL-QUOTE returns a string for
+use in a SQL insert value list.
@@ -3984,10 +4022,9 @@ character '?'.
[function] SQL-UPDATE-LIST PLIST
-Given plist of field names and values returns a string for use in a
-SQL update. if the 'key' is a cons the first 'key' used. If a value
-is a string it is quoted with single quotes (and single quotes qutoed
-by doubling) unless is the single character '?'.
Given plist of field names and values each passed to SQL-QUOTE and
+returns a string for use in a SQL update. if the 'key' is a cons the
+first 'key' used.
@@ -6158,7 +6195,7 @@ is nil unbind the event.
CLOG-AUTH - Authorization
@@ -6178,7 +6215,7 @@ is nil unbind the event.[function] IS-AUTHORIZED-P ROLE-LIST ACTION
-Given ROLE-LIST is action authorized
Given ROLE-LIST is action authorized. If action is nil returns t.
@@ -6687,7 +6724,7 @@ machine, upon close ON-FILE-NAME called with filename or nil if fai
+
DESCRIPTION.
-+
-
DESCRIPTION.
[function] LOGIN OBJ SQL-CONNECTION USERNAME PASSWORD
+[function] LOGIN BODY SQL-CONNECTION USERNAME PASSWORD
Login and set current authentication token, it does not remove token if one is present and login fails.
@@ -7495,38 +7532,71 @@ no token or fails to match as user returns nil
[function] LOAD-CONTENT SQL-CONNECTION TABLE KEY-VALUE &KEY (KEY-COL "key") WHERE ORDER-BY
+ +Returns list of records found in TABLE where KEY-COL = KEY-VALUE and
+optional WHERE and ORDER-BY sql.
*SQLITE-TIMESTAMP*)+
Theme helpers
+ + + +[function] GET-SETTING WEBSITE KEY DEFAULT
+ +Return the setting for KEY or DEFAULT from website settings
[function] GET-PROPERTY PROPERTIES KEY DEFAULT
+ +Return the property for KEY from the p-list PROPERTIES or DEFAULT
Built in themes
[function] DEFAULT-THEME BODY WEBSITE PAGE PROPERTIES
+[function] DEFAULT-THEME BODY PAGE PROPERTIES
The default theme for clog-web-site. Settings available: - :color-class - w3 color class for menu bars and buttons - :border-class - w3 border - :text-class - w3 text color class + :color-class - w3 color class for menu bars and buttons (def: w3-black) + :border-class - w3 border (def: "") + :text-class - w3 text color class (def: "") + :signup-link - link to signup (def: /signup) + :login-link - link to login (def: /login) + :username-link - link when clicking on username (def: /logout) Page properties: - :menu - (("Menu Name" (("Menu Item" "link")))) - :content
diff --git a/source/clog-data.lisp b/source/clog-data.lisp index e334704..4508b89 100644 --- a/source/clog-data.lisp +++ b/source/clog-data.lisp @@ -124,9 +124,12 @@ keyword package." ;; Implementation - simple sql writers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defparameter *mysql-timestamp* "unix_timestamp()") -(defparameter *sqlite-timestamp* "strftime('%s')") -(defparameter *postgresql-timestamp* "extract(epoch from now())") +(defparameter *mysql-timestamp* "unix_timestamp()" + "Function used by mysql to retrieve the time from the epoch") +(defparameter *sqlite-timestamp* "strftime('%s')" + "Function used by sqlite to retrieve the time from the epoch") +(defparameter *postgresql-timestamp* "extract(epoch from now())" + "Function used by postgresql to retrieve the time from the epoch") ;;;;;;;;;;;;;;;;;;;; ;; sql-field-list ;; diff --git a/source/clog-web-dbi.lisp b/source/clog-web-dbi.lisp index 87a7dba..e1e0cd4 100644 --- a/source/clog-web-dbi.lisp +++ b/source/clog-web-dbi.lisp @@ -190,20 +190,20 @@ optional WHERE and ORDER-BY sql." (defun clog-web-content (sql-connection &key - (page "main") - (table "content") - (base-url "/content") - (follow-url-page t) + (page "main") + (table "content") + (base-url "/content") + (follow-url-page t) comment-table on-content on-comment on-new on-edit on-delete - (can-admin :content-admin) - (can-comment :content-comment) - (can-show-comments :content-show-comments) - (can-edit :content-edit) + (can-admin :content-admin) + (can-comment :content-comment) + (can-show-comments :content-show-comments) + (can-edit :content-edit) (sql-timestamp-func *sqlite-timestamp*)) "Create content for CLOG-WEB:CREATE-WEB-PAGE based on dbi TABLE value where key=PAGE or if FOLLOW-URL-PAGE is true PAGE is default diff --git a/source/clog.lisp b/source/clog.lisp index 934b901..3e75414 100644 --- a/source/clog.lisp +++ b/source/clog.lisp @@ -535,9 +535,9 @@ embedded in a native template application.)" (data-write-plist function) "SQL Timestamp by Engine" - (*mysql-timestamp* constant) - (*sqlite-timestamp* constant) - (*postgresql-timestamp* constant) + (*mysql-timestamp* variable) + (*sqlite-timestamp* variable) + (*postgresql-timestamp* variable) "SQL Writing Helpers" (sql-quote function)