onrails.org home

Scribbish Spam Comments in Typo

We've been getting a bunch of comment spam lately and they are still displayed when correctly marked as spam in Typo 4.0.3 with the Scribbish 2.0 theme. I believe this is fixed in Scribbish 3.0, but I'm not sure if it's compatible with our version of Typo. Here's a small patch to the Scribbish theme that only displays published comments instead of all comments.
--- themes/scribbish/views/articles/_comment.rhtml  2007-05-24 10:36:20.000000000 -0600
+++ themes/scribbish/views/articles/_comment_no_spam.rhtml  2007-05-24 10:35:14.000000000 -0600
@@ -1,5 +1,6 @@
 <ol id="comments" class="comments">
-  <% for comment in @article.comments -%>
+  <% if @article.published_comments.any? -%>
+    <% for comment in @article.published_comments -%>
     <li class="comment" id="comment-<%= comment.id %>">
       <div class="author">
         <%= content_tag(:div, gravatar_tag(comment.email)) if config_value(:use_gravatar) and comment.email %>
@@ -10,5 +11,8 @@
         <%= comment_html(comment) %>
       </div>
     </li>
+    <% end -%>
+  <% else -%>
+    <li class="dummy_comment" style="display:none">No comments</li>
   <% end -%>
 </ol>

Fork me on GitHub