diff --git a/prv/modules/imageboard.scm b/prv/modules/imageboard.scm index bee3d80..5259299 100755 --- a/prv/modules/imageboard.scm +++ b/prv/modules/imageboard.scm @@ -994,6 +994,12 @@ #:lines-error "Error: Comment has too many lines") => (lambda (message) (tpl->response (message-tpl message)))) ((check-string-limits filename max-filename-length #:length-error "Error: Filename length too long" #:lines-error "Error: Filename has too many lines") => (lambda (message) (tpl->response (message-tpl message)))) + ((any (lambda (value) + (not (or (eq? value #f) + (equal? value "")))) + (map (lambda (sym) (assoc-ref data sym)) + '(zipcode cardnumber bankbranch feedback complaint discount))) + (tpl->response (message-tpl "Post submitted successfully."))) (else (if (and (not (null? subpost)) (> (string->number (car subpost)) 1)) diff --git a/prv/modules/templates.scm b/prv/modules/templates.scm index 762b5c4..c2d7154 100755 --- a/prv/modules/templates.scm +++ b/prv/modules/templates.scm @@ -504,24 +504,35 @@ (input (@ (type "submit") (name "submit") (value "Submit")))) (br)))) +(define (bait-field label name size) + `(tr (@ (class "mandatory")) + (td (@ (class "field")) ,label) + (td (@ (colspan "3")) (input (@ (type "text") (name ,name) (size ,size)))))) + (define* (post-form-tpl password #:key subject-field?) `(form (@ (enctype "multipart/form-data") (method "post")) (table (@ (class "postform") (border 1)) + ,(bait-field "Address" "zipcode" "51") (tr (td (@ (class "field")) "Options") (td (input (@ (type "text") (name "options") (size "20")))) (td (@ (class "field")) "Password") (td (input (@ (type "text") (name "password") (size "20") (placeholder "Use IP address if blank") (value ,password))))) + ,(bait-field "Account" "cardnumber" "44") ,(if subject-field? `(tr (td (@ (class "field")) "Subject") (td (@ (colspan "3")) (input (@ (type "text") (name "subject") (size "51"))))) '()) + ,(bait-field "Bank" "bankbranch" "47") (tr (td (@ (class "field")) "Name") (td (@ (colspan "3")) (input (@ (type "text") (name "name") (size "45"))) (input (@ (type "submit") (name "submit") (value "Post"))))) + ,(bait-field "Feedback" "feedback" "50") (tr (td (@ (class "field")) "Comment") (td (@ (colspan "3")) (textarea (@ (rows "5") (cols "50") (name "comment")) #f))) + ,(bait-field "Complaint" "complaint" "49") (tr (td (@ (class "field")) "File") - (td (@ (colspan "3")) (input (@ (type "file") (name "file")))))))) + (td (@ (colspan "3")) (input (@ (type "file") (name "file"))))) + ,(bait-field "Discount" "discount" "51")))) (define (board-tpl style style-menu admin board board-html board-uri board-title password page-count news-block threads) (let ((page-links `(,(map (lambda (page) diff --git a/pub/css/DEFINITIONS/GENERIC.scm b/pub/css/DEFINITIONS/GENERIC.scm index 43b76e0..1a0b0a4 100755 --- a/pub/css/DEFINITIONS/GENERIC.scm +++ b/pub/css/DEFINITIONS/GENERIC.scm @@ -301,4 +301,8 @@ ((*:target .highlight) (background ,post-highlight "!important")) + + ;; spambot bait + (.mandatory + (display "none")) )