From c63989699bbca26908c2efd7968f776800e75b36 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 15 Mar 2011 13:38:11 +0100 Subject: Improve spam detection information on comment submission pages. --- mulkcms.lisp | 38 ++++++++++++++++++++++------------- static-files/js/comment-submission.js | 3 +-- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/mulkcms.lisp b/mulkcms.lisp index 1445730..d6f09b4 100644 --- a/mulkcms.lisp +++ b/mulkcms.lisp @@ -63,9 +63,12 @@ ("comment_content" . ,body)))) +(defun use-akismet-p () + (and (boundp '*wordpress-key*) *wordpress-key* t)) + (defun spamp/akismet (&rest comment-data) ;; Taken from Mulkblog. - (when (and (boundp '*wordpress-key*) *wordpress-key*) + (when (use-akismet-p) (ignore-errors (akismet-login) (string= "true" (apply #'akismet-check-comment comment-data))))) @@ -174,19 +177,26 @@ :body-label "Message" :submit-button-label "Submit" :title "Submit a comment" - :notes "

Note: - This website uses Akismet - for spam detection. - E-mail addresses are never - disclosed to anyone (including - Akismet) other than - the site owner. Comment - format is plain text. Use - blank lines to separate - paragraphs.

" + :notes (format + nil + "

Note: + ~A + Comment format is plain + text. Use blank lines to + separate paragraphs.

" + (if + (use-akismet-p) + "This website uses Akismet + for spam detection. + E-mail addresses are + never disclosed to + anyone (including + Akismet) other than the + site owner." + "")) :action (link-to :post-comment :article-id article))) :edit-link (link-to :edit :article-id article) :edit-button-label "Edit" diff --git a/static-files/js/comment-submission.js b/static-files/js/comment-submission.js index c4c3d6a..23dae22 100644 --- a/static-files/js/comment-submission.js +++ b/static-files/js/comment-submission.js @@ -52,6 +52,5 @@ jQuery(function($) { return true; } }); - $('.spam-detection-method').text("Hashcash"); - $('.irrelevant-for-hashcash').text(''); + $('.spam-detection-info').html("This website uses a Hashcash-like proof-of-work system for spam detection."); }); -- cgit v1.2.3