summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-15 13:38:11 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-03-15 13:38:11 +0100
commitc63989699bbca26908c2efd7968f776800e75b36 (patch)
tree2e2779c891ab2d617ecdf4419cc888851f1a6a14
parentc5436f91374bdf463e4c83637c90ac888f973a3f (diff)
Improve spam detection information on comment submission pages.
-rw-r--r--mulkcms.lisp38
-rw-r--r--static-files/js/comment-submission.js3
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 "<p><strong>Note:</strong>
- This website uses <span
- class='spam-detection-method'><a
- href=\"http://akismet.com/\">Akismet</a></span>
- for spam detection.
- E-mail addresses are never
- disclosed to anyone <span
- class='irrelevant-for-hashcash'>(including
- Akismet)</span> other than
- the site owner. Comment
- format is plain text. Use
- blank lines to separate
- paragraphs.</p>"
+ :notes (format
+ nil
+ "<p><strong>Note:</strong>
+ <span
+ class='spam-detection-info'>~A</span>
+ Comment format is plain
+ text. Use blank lines to
+ separate paragraphs.</p>"
+ (if
+ (use-akismet-p)
+ "This website uses <span
+ class='spam-detection-method'><a
+ href=\"http://akismet.com/\">Akismet</a></span>
+ 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 <a href=\"http://en.wikipedia.org/w/index.php?title=Hashcash&oldid=417692755\">Hashcash</a>-like proof-of-work system for spam detection.");
});