<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/MIT-LICENSE</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/README</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/Rakefile</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/init.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/install.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rule.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/arms_race.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/bad_words.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/bbcode.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/chinese.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/good_words.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/href.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/html.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/line_length.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/punctuation.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/russian.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/lib/splam/rules/word_length.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/tasks/splam_tasks.rake</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api-1.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api-2.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api-3.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api-4.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api-5.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/api_bug.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/backtrace.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/epic.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/epic_warehouse.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/extra_fields.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/feedlinks.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/github.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/hub.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/mario.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/mylyn.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/omg_thanks_again_finally_warehouse.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/omg_thanks_again_warehouse.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/problem.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/sample_html.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/short_reply.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/tags.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/thanks_warehouse.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/ham/thx.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/125_spam-12420.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/40_pharmacia.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/amazon.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/bluebichen.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/boobz.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/buffy.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/chinese.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/comment_bbc.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/comment_cnn.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/comment_randi.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/comment_wordy.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/consent.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/december.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/digital_rights.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/dyed_wool.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/hairbrush_sex.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/handbag.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/inqius.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/kidneys.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/madonna.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/make_plans.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/oem.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/oem2.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/oem_intl.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/omg_sex.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/ottersex.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/pr0n.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/property.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/pyromancy.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/rapid.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/russki.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/russki2.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/shipping.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/short_n_sweet.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-13232.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-13518.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-13519.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-13520.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-13521.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-13982.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-14178.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-14447.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam-14718.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/spam0113081.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/tk.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/troubles.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/url_only_idiot.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/fixtures/comment/spam/webcam.txt</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/splam_rule_test.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/splam_test.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/test/test_helper.rb</filename>
    </added>
    <added>
      <filename>app/plugins/feather-comments/vendor/splam/uninstall.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,21 +2,27 @@ module Feather
   module Admin
     class Comments &lt; Base
       include_plugin_views __FILE__
-      before :find_comment, :only =&gt; %w(edit update delete show)
+      before :find_comment, :only =&gt; %w(delete show)
 
       def index
-        @page_count, @comments = Feather::Comment.paginated(:page =&gt; params[:page], :per_page =&gt; 10, :order =&gt; [:created_at.desc])
+        @page_count, @comments = Feather::Comment.paginated(:page =&gt; (params[:page] || 1).to_i, :per_page =&gt; 20, :order =&gt; [:created_at.desc])
         display @comments
       end
 
-      def update
-        @comment.published = (params[:published] == &quot;true&quot; ? true : false) if params[:published]
-        @comment.save
-        render_js
-      end
-
       def delete
-        @comment.destroy
+        # Make sure we have a comment
+        unless @comment.nil?
+          # See if we're marking this as spam (i.e. looking to remove others just like it)
+          if params[:spam] &amp;&amp; params[:spam] == &quot;true&quot;
+            # If so, we want to remove all other comments with the same IP, e-mail, website or name
+            Feather::Comment.all(:conditions =&gt; {:ip_address =&gt; @comment.ip_address}).each { |c| c.destroy }
+            Feather::Comment.all(:conditions =&gt; {:email_address =&gt; @comment.email_address}).each { |c| c.destroy }
+            Feather::Comment.all(:conditions =&gt; {:website =&gt; @comment.website}).each { |c| c.destroy }
+            Feather::Comment.all(:conditions =&gt; {:name =&gt; @comment.name}).each { |c| c.destroy }
+          end
+          # Now remove the comment itself
+          @comment.destroy
+        end
         redirect url(:admin_comments)
       end
 
@@ -26,7 +32,7 @@ module Feather
 
       private
         def find_comment
-          @comment = Comment[params[:id]]
+          @comment = Feather::Comment.get(params[:id])
         end
     end
   end</diff>
      <filename>app/plugins/feather-comments/controllers/admin/comments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,13 @@
 module Feather
   class Comments &lt; Application  
     def create
-      if (!CommentSetting.current.negative_captcha || params[:comment][:notes].nil? || params[:comment][:notes] == &quot;&quot;)
+      if params[:comment][:title].blank?
         @comment = Comment.new(params[:comment])
         @comment.ip_address = request.remote_ip
-        @comment.published = !CommentSetting.current.moderation
-        if !@comment.save
-          session[:comment_error] = @comment.errors.collect { |e| e[1].first }
-        else
-          article = Article[@comment.article_id]
-          # Send e-mail notification if that setting is enabled
-          if CommentSetting.current.email_notification
-            email_params = { :from =&gt; CommentSetting.current.from_email, :to =&gt; CommentSetting.current.to_email, :subject =&gt; &quot;New comment - RE: #{article.title}&quot; }
-            params = { :comment =&gt; @comment, :article =&gt; article, :request =&gt; request }
-            send_mail(CommentMailer, :notify, email_params, params)
-          end
-          redirect article.permalink
-        end
+        @comment.save
+        @article = Article[@comment.article_id]
       end
-      redirect request.env[&quot;HTTP_REFERER&quot;]
+      redirect @article.nil? ? request.env[&quot;HTTP_REFERER&quot;] : @article.permalink
     end
   end
 end
\ No newline at end of file</diff>
      <filename>app/plugins/feather-comments/controllers/comments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,16 @@
+$:.unshift(File.join(File.dirname(__FILE__), &quot;vendor&quot;, &quot;splam&quot;, &quot;lib&quot;))
+require 'splam'
+require 'splam/rule'
+require 'splam/rules'
+
 require File.join(File.dirname(__FILE__), &quot;controllers&quot;, &quot;admin&quot;, &quot;comments&quot;)
-require File.join(File.dirname(__FILE__), &quot;controllers&quot;, &quot;admin&quot;, &quot;comment_settings&quot;)
 require File.join(File.dirname(__FILE__), &quot;controllers&quot;, &quot;comments&quot;)
-require File.join(File.dirname(__FILE__), &quot;mailers&quot;, &quot;comment_mailer&quot;)
 require File.join(File.dirname(__FILE__), &quot;models&quot;, &quot;feather&quot;, &quot;comment&quot;)
-require File.join(File.dirname(__FILE__), &quot;models&quot;, &quot;feather&quot;, &quot;comment_setting&quot;)
 
 Feather::Hooks::Routing.register_route do |r|
   r.resources :comments, :controller =&gt; &quot;comments&quot;
   r.namespace &quot;feather/admin&quot;, :path =&gt; &quot;admin&quot;, :name_prefix =&gt; &quot;admin&quot; do
     r.resources :comments, :path =&gt; &quot;admin/comments&quot;, :name_prefix =&gt; &quot;admin&quot;, :controller =&gt; &quot;admin/comments&quot;
-    r.resource :comment_setting, :path =&gt; &quot;admin/comment_setting&quot;, :name_prefix =&gt; &quot;admin&quot;, :controller =&gt; &quot;admin/comment_settings&quot;
   end
 end
 </diff>
      <filename>app/plugins/feather-comments/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1 @@
-Feather::Database::migrate(Feather::Comment)
-Feather::Database::migrate(Feather::CommentSetting)
\ No newline at end of file
+Feather::Database::migrate(Feather::Comment)
\ No newline at end of file</diff>
      <filename>app/plugins/feather-comments/install.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,12 @@
 module Feather
   class Comment
     include DataMapper::Resource
+
+    include Splam
+    splammable :comment do |splam|
+      splam.threshold  = 40
+      splam.rules     = [:bad_words, :html, :bbcode, :href]
+    end
     
     is_paginated
   
@@ -13,21 +19,33 @@ module Feather
     property :email_address, String
     property :formatter, String, :default =&gt; &quot;default&quot;
     property :ip_address, String, :default =&gt; &quot;127.0.0.1&quot;
-    property :published, Boolean, :default =&gt; true
-    # Gotta have this lame dummy property for the negative captcha
-    property :notes, String
   
     belongs_to :article
 
     validates_present :name, :comment, :article_id
 
+    before :save, :check_for_spam
+    def check_for_spam
+      throw :halt if self.splam?
+    end
+
     before :save, :prepend_http_if_needed
     belongs_to :article  
     after :save, :fire_after_comment_event
     after :create, :set_create_activity
+    after :save, :expire_cache
+    after :destroy, :expire_cache
+    
+    # Dummy honeypot propery
+    attr_accessor :title
+    
+    # This expires the article page that the comment belongs to
+    def expire_cache
+      Feather::Article.expire_article_page(self.article_id)
+    end
 
     def self.all_for_post(article_id, method = :all)
-      self.send(method, {:article_id =&gt; article_id, :published =&gt; true, :order =&gt; [:created_at.asc]})
+      self.send(method, {:article_id =&gt; article_id, :order =&gt; [:created_at.asc]})
     end
 
     ##</diff>
      <filename>app/plugins/feather-comments/models/feather/comment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,11 +3,10 @@
 &lt;/h5&gt;
 &lt;p&gt;&lt;a href=&quot;#comment-form&quot;&gt;Leave a response&lt;/a&gt;&lt;/p&gt;
 &lt;ol class=&quot;comments&quot; id=&quot;comments&quot;&gt;
-&lt;!-- Put this in a partial. Actually I think we should reopen the article model, and stick in has_many :comments. do that. --&gt;
 &lt;% Feather::Comment.all_for_post(@article.id).each do |comment| %&gt;
   &lt;li id=&quot;comment-&lt;%= comment.id %&gt;&quot; class=&quot;comment&quot;&gt;
     &lt;div class=&quot;author&quot;&gt;
-      &lt;cite&gt;&lt;span class=&quot;author&quot;&gt;&lt;span&gt;&lt;%= comment.website.blank? ? h(comment.name) : link_to(h(comment.name), comment.website) %&gt;&lt;/span&gt;&lt;/span&gt;&lt;/cite&gt; &#8211; 
+      &lt;cite&gt;&lt;span class=&quot;author&quot;&gt;&lt;span&gt;&lt;%= comment.website.blank? ? h(comment.name) : link_to(h(comment.name), comment.website, :rel =&gt; &quot;nofollow&quot;) %&gt;&lt;/span&gt;&lt;/span&gt;&lt;/cite&gt; &#8211; 
       &lt;abbr title=&quot;&lt;%= comment.created_at %&gt;&quot;&gt;&lt;span class=&quot;date&quot;&gt;&lt;%= TZInfo::Timezone.get(@article.user.time_zone).utc_to_local(comment.created_at).strftime(&quot;%b %d %y @ %I:%M%p&quot;) %&gt;&lt;/span&gt;&lt;/abbr&gt;
     &lt;/div&gt;
     &lt;div class=&quot;content&quot;&gt;
@@ -18,23 +17,13 @@
 &lt;/ol&gt;
 &lt;div&gt;
   &lt;%= form_for :comment, :action =&gt; url(:comments), :id =&gt; 'comment-form' do %&gt;
-    &lt;% if session[:comment_error] %&gt;
-      &lt;ul id=&quot;comment-errors&quot;&gt;
-      	&lt;% session[:comment_error].each do |err| %&gt;
-          &lt;li&gt;&lt;%= err %&gt;&lt;/li&gt;
-      	&lt;% end %&gt;
-      &lt;/ul&gt;
-    	&lt;% session[:comment_error] = nil %&gt;
-    &lt;% end %&gt;
     &lt;fieldset&gt;
       &lt;legend&gt;Comment&lt;/legend&gt;
       &lt;%= hidden_field :name =&gt; &quot;comment[article_id]&quot;, :value =&gt; @article.id %&gt;
-	  &lt;% if Feather::CommentSetting.current.negative_captcha %&gt;
-	  	&lt;%= text_field :name =&gt; &quot;comment[notes]&quot;, :id =&gt; &quot;comment_notes&quot; %&gt;
-	  	&lt;script type=&quot;text/javascript&quot;&gt;
-			document.getElementById('comment_notes').style.display = &quot;none&quot;;
-	  	&lt;/script&gt;
-	  &lt;% end %&gt;
+      &lt;p class=&quot;comment_title&quot;&gt;
+        &lt;label for=&quot;comment_title&quot; class=&quot;text&quot;&gt;Title:&lt;/label&gt;
+        &lt;%= text_field :name =&gt; 'comment[title]', :size =&gt; 30, :id =&gt; 'comment_title' %&gt;
+      &lt;/p&gt;
       &lt;p&gt;
         &lt;label for=&quot;comment_name&quot; class=&quot;text&quot;&gt;Name:&lt;/label&gt;
         &lt;%= text_field :name =&gt; 'comment[name]', :size =&gt; 30, :id =&gt; 'comment_name' %&gt;
@@ -61,3 +50,6 @@
     &lt;/fieldset&gt;
   &lt;% end =%&gt;
 &lt;/div&gt;
+&lt;style&gt;
+  p.comment_title { display: none; }
+&lt;/style&gt;
\ No newline at end of file</diff>
      <filename>app/plugins/feather-comments/views/after_article/_comments.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -3,5 +3,6 @@
 	&lt;td&gt;&lt;%= comment.website %&gt;&lt;/td&gt;
 	&lt;td&gt;&lt;%= comment.email_address %&gt;&lt;/td&gt;
 	&lt;td&gt;&lt;%= comment.ip_address %&gt;&lt;/td&gt;
-	&lt;td&gt;&lt;%= link_to 'Delete', url(:delete_admin_comment, comment), {:method =&gt; :delete, :onclick =&gt; &quot;return confirm('Are you sure?')&quot;} %&gt;&lt;/td&gt;
+	&lt;td&gt;&lt;%= link_to 'Delete', url(:delete_admin_comment, comment), {:method =&gt; :delete, :onclick =&gt; &quot;return confirm('Are you sure you want to delete this comment?')&quot;} %&gt;&lt;/td&gt;
+	&lt;td&gt;&lt;%= link_to 'SPAM', url(:delete_admin_comment, comment, :spam =&gt; true), {:method =&gt; :delete, :onclick =&gt; &quot;return confirm('Are you sure you want to delete this comment and any others like it?')&quot;} %&gt;&lt;/td&gt;
 &lt;/tr&gt;
\ No newline at end of file</diff>
      <filename>app/plugins/feather-comments/views/feather/admin/comments/_comment.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -2,15 +2,9 @@
   &lt;h4&gt;View Comments&lt;/h4&gt;
   &lt;p&gt;
 	Comments are left on your blog by visitors.
-	&lt;br /&gt;
-	&lt;%= link_to &quot;View comment settings&quot;, url(:admin_comment_setting) %&gt;
   &lt;/p&gt;
 &lt;% end %&gt;
 
-&lt;div id=&quot;action&quot;&gt;
-  &lt;%= link_to &quot;View comment settings&quot;, url(:admin_comment_setting) %&gt;
-&lt;/div&gt;
-
 &lt;h1&gt;View Comments&lt;/h1&gt;
 
 &lt;table class='tabular'&gt;
@@ -21,7 +15,17 @@
   	&lt;th&gt;E-mail address&lt;/th&gt;
   	&lt;th&gt;IP address&lt;/th&gt;
   	&lt;th&gt;&amp;nbsp;&lt;/th&gt;
+  	&lt;th&gt;&amp;nbsp;&lt;/th&gt;
   &lt;/tr&gt;
   &lt;/thead&gt;
   &lt;%= partial('feather/admin/comments/comment', :with =&gt; @comments) %&gt;
-&lt;/table&gt;
\ No newline at end of file
+&lt;/table&gt;
+
+&lt;% 1.upto(@page_count) do |page| %&gt;
+  &lt;% if page.to_i == (params[:page] || 1).to_i %&gt;
+    &lt;%= page %&gt;
+  &lt;% else %&gt;
+    &lt;%= link_to page, url(:admin_comments, :page =&gt; page) %&gt;
+  &lt;% end %&gt;
+  &lt;%= ' |' unless page == @page_count %&gt;
+&lt;% end %&gt;
\ No newline at end of file</diff>
      <filename>app/plugins/feather-comments/views/feather/admin/comments/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -5,36 +5,6 @@
   &lt;/p&gt;
 &lt;% end %&gt;
 
-&lt;script lang=&quot;text/javascript&quot;&gt;
-var Comments = {
-	publish: function(id) {
-		new Ajax.Request(&quot;/admin/comments/&quot; + id + &quot;?published=true&quot;, {
-          asynchronous:'true', 
-          evalScripts:'true',
-          method:'put',
-          onLoading: function() {
-			$('comment-published').hide();
-			$('comment-display').innerText = &quot;Saving...&quot;
-          },
-          onFailure: function() { alert('Something went wrong...') },
-      });
-	},
-
-	unpublish: function(id) {
-		new Ajax.Request(&quot;/admin/comments/&quot; + id + &quot;?published=false&quot;, {
-          asynchronous:'true', 
-          evalScripts:'true',
-          method:'put',
-          onLoading: function() {
-			$('comment-unpublished').hide();
-			$('comment-display').innerText = &quot;Saving...&quot;
-          },
-          onFailure: function() { alert('Something went wrong...') },
-      });
-	}
-}
-&lt;/script&gt;
-
 &lt;h1&gt;View Comment&lt;/h1&gt;
 
 &lt;p&gt;
@@ -55,16 +25,4 @@ var Comments = {
 	&lt;%= render_text(@comment.formatter, @comment.comment) %&gt;
 &lt;/p&gt;
 
-&lt;p&gt;
-	&lt;div id=&quot;comment_published&quot; style=&quot;display: &lt;%= @comment.published ? 'block' : 'none' %&gt;;&quot;&gt;
-		Published
-		&lt;a href=&quot;#&quot; id=&quot;comment_unpublish&quot; onclick=&quot;Comments.unpublish(&lt;%= @comment.id %&gt;);&quot;&gt;Click to unpublish&lt;/a&gt;
-	&lt;/div&gt;
-	&lt;div id=&quot;comment_unpublished&quot; style=&quot;display:  &lt;%= @comment.published ? 'none' : 'block' %&gt;;&quot;&gt;
-		Isn't published
-		&lt;a href=&quot;#&quot; id=&quot;comment_publish&quot; onclick=&quot;Comments.publish(&lt;%= @comment.id %&gt;);&quot;&gt;Click to publish&lt;/a&gt;
-	&lt;/div&gt;
-	&lt;div id=&quot;comment_display&quot;&gt;&lt;/div&gt;
-&lt;/p&gt;
-
 &lt;%= link_to &quot;Back to comments&quot;, url(:admin_comments) %&gt;
\ No newline at end of file</diff>
      <filename>app/plugins/feather-comments/views/feather/admin/comments/show.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;feed xmlns=&quot;http://www.w3.org/2005/Atom&quot;&gt;
-  &lt;title&gt;&lt;%= Feather::Configuration.current.title %&gt;&lt;/title&gt;
-  &lt;% if Feather::Configuration.current.tag_line %&gt;
-    &lt;subtitle&gt;&lt;%= Feather::Configuration.current.tag_line %&gt;&lt;/subtitle&gt;
+  &lt;title&gt;&lt;%= Feather::Configuration.current[:title] %&gt;&lt;/title&gt;
+  &lt;% if Feather::Configuration.current[:tag_line] %&gt;
+    &lt;subtitle&gt;&lt;%= Feather::Configuration.current[:tag_line] %&gt;&lt;/subtitle&gt;
   &lt;% end %&gt;
   &lt;link rel=&quot;self&quot; href=&quot;&lt;%= &quot;http://#{request.host}#{request.uri}&quot; %&gt;&quot;/&gt;
   &lt;link href=&quot;&lt;%= &quot;http://#{request.host}&quot; %&gt;&quot;/&gt;</diff>
      <filename>app/plugins/feather-feeds/views/feather/feeds/articles.atom.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,13 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;rss xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot; version=&quot;2.0&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;&gt;
   &lt;channel&gt;
-    &lt;title&gt;&lt;%= Feather::Configuration.current.title %&gt;&lt;/title&gt;
+    &lt;title&gt;&lt;%= Feather::Configuration.current[:title] %&gt;&lt;/title&gt;
     &lt;atom:link rel=&quot;self&quot; href=&quot;&lt;%= &quot;http://#{request.host}#{request.uri}&quot; %&gt;&quot;/&gt;
     &lt;link&gt;&lt;%= &quot;http://#{request.host}#{request.uri}&quot; %&gt;&lt;/link&gt;
     &lt;% if @articles.length &gt; 0 %&gt;
       &lt;pubDate&gt;&lt;%= rfc822(@articles.first.published_at) %&gt;&lt;/pubDate&gt;
     &lt;% end %&gt;
-    &lt;description&gt;&lt;%= Feather::Configuration.current.tag_line %&gt;&lt;/description&gt;
+    &lt;description&gt;&lt;%= Feather::Configuration.current[:tag_line] %&gt;&lt;/description&gt;
     &lt;% @articles.each do |article| %&gt;
     &lt;item&gt;
       &lt;title&gt;&lt;%= article.title %&gt;&lt;/title&gt;</diff>
      <filename>app/plugins/feather-feeds/views/feather/feeds/articles.rss.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;feed xmlns=&quot;http://www.w3.org/2005/Atom&quot;&gt;
-  &lt;title&gt;&lt;%= Feather::Configuration.current.title %&gt;&lt;/title&gt;
-  &lt;% if Feather::Configuration.current.tag_line %&gt;
-    &lt;subtitle&gt;&lt;%= Feather::Configuration.current.tag_line %&gt;&lt;/subtitle&gt;
+  &lt;title&gt;&lt;%= Feather::Configuration.current[:title] %&gt;&lt;/title&gt;
+  &lt;% if Feather::Configuration.current[:tag_line] %&gt;
+    &lt;subtitle&gt;&lt;%= Feather::Configuration.current[:tag_line] %&gt;&lt;/subtitle&gt;
   &lt;% end %&gt;
   &lt;link rel=&quot;self&quot; href=&quot;&lt;%= &quot;http://#{request.host}#{request.uri}&quot; %&gt;&quot;/&gt;
   &lt;link href=&quot;&lt;%= &quot;http://#{request.host}&quot; %&gt;&quot;/&gt;</diff>
      <filename>app/plugins/feather-feeds/views/feather/feeds/comments.atom.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,13 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;rss xmlns:atom=&quot;http://www.w3.org/2005/Atom&quot; version=&quot;2.0&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;&gt;
   &lt;channel&gt;
-    &lt;title&gt;&lt;%= &quot;#{Feather::Configuration.current.title}: comments&quot; %&gt;&lt;/title&gt;
+    &lt;title&gt;&lt;%= &quot;#{Feather::Configuration.current[:title]}: comments&quot; %&gt;&lt;/title&gt;
     &lt;atom:link rel=&quot;self&quot; href=&quot;&lt;%= &quot;http://#{request.host}#{request.uri}&quot; %&gt;&quot;/&gt;
     &lt;link&gt;&lt;%= &quot;http://#{request.host}#{request.uri}&quot; %&gt;&lt;/link&gt;
     &lt;% if @comments.length &gt; 0 %&gt;
       &lt;pubDate&gt;&lt;%= rfc822(@comments.first.created_at) %&gt;&lt;/pubDate&gt;
     &lt;% end %&gt;
-    &lt;description&gt;&lt;%= Feather::Configuration.current.tag_line %&gt;&lt;/description&gt;
+    &lt;description&gt;&lt;%= Feather::Configuration.current[:tag_line] %&gt;&lt;/description&gt;
     &lt;% @comments.each do |comment| %&gt;
       &lt;% article = Feather::Article[comment.article_id] %&gt;
       &lt;% if article %&gt;</diff>
      <filename>app/plugins/feather-feeds/views/feather/feeds/comments.rss.erb</filename>
    </modified>
    <modified>
      <diff>@@ -3,13 +3,11 @@ module Feather
     include_plugin_views __FILE__
 
     def show(id)
-      @tag = Tag.get(id)
-      @tag = Tag.first(:conditions =&gt; {:name =&gt; id}) if @tag.nil?
+      @tag = Tag.first(:conditions =&gt; {:name =&gt; id})
       display @tag
     end
 
     def index
-      @tags = Tag.all
       display @tags
     end
   end</diff>
      <filename>app/plugins/feather-tagging/controllers/tags.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,6 +10,38 @@ end
 Feather::Article.class_eval do
   include DataMapper::Tags
   has_tags
+  
+  after :save, :update_tags
+  after :destroy, :update_tags
+  
+  def update_tags
+    Merb::Cache[:feather].delete &quot;#{Tag.name}&quot;
+    Merb::Cache[:feather].delete &quot;#{Tagging.name}&quot;
+  end
+end
+
+Feather::Application.class_eval do
+  before :grab_tags
+  
+  def grab_tags
+    @tags = Merb::Cache[:feather].fetch &quot;#{Tag.name}&quot; do
+      Tag.all.collect { |t| t.attributes.merge(:display_name =&gt; t.display_name) }
+    end
+    @taggings = Merb::Cache[:feather].fetch &quot;#{Tagging.name}&quot; do
+      Tagging.all.collect { |t| t.attributes }
+    end
+  end
+end
+
+Tag.class_eval do
+  before :save, :no_spaces
+  def no_spaces
+    self.name.gsub!(&quot; &quot;, &quot;-&quot;)
+  end
+  
+  def display_name
+    self.name.gsub(&quot;-&quot;, &quot; &quot;)
+  end
 end
 
 Feather::Hooks::Routing.register_route do |r|</diff>
      <filename>app/plugins/feather-tagging/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,16 +1,20 @@
 module Merb
   module GlobalHelpers    
-    def tag_cloud(tags, classes)
+    def tag_cloud(tags, taggings, classes)
       return &quot;&quot; if tags.nil? || tags.empty?
       max, min = 0, 0
+      counter = {}
+      taggings.each do |t|
+        counter[t[:tag_id]].nil? ? counter[t[:tag_id]] = 1 : counter[t[:tag_id]] += 1
+      end
       tags.each do |t|
-        count = ::Feather::Article.tagged_with(t.name).size.to_i
+        count = counter[t[:id]] || 0
         max = count if count &gt; max
         min = count if count &lt; min
       end
       divisor = ((max - min) / classes.size) + 1
       tags.each do |t|
-        count = ::Feather::Article.tagged_with(t.name).size.to_i
+        count = counter[t[:id]] || 0
         yield t, classes[count / divisor] unless count == 0
       end
     end</diff>
      <filename>app/plugins/feather-tagging/lib/global_helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,9 @@
 &lt;% unless @tags.empty? %&gt;
 &lt;ul&gt;
   &lt;% @tags.each do |tag| %&gt;
-    &lt;li&gt;&lt;%= tag.name %&gt;&lt;/li&gt;
+    &lt;li&gt;&lt;%= tag[:display_name] %&gt;&lt;/li&gt;
     &lt;ul&gt;
-    &lt;% Feather::Article.tagged_with(tag.name).each do |a| %&gt;
+    &lt;% Feather::Article.tagged_with(tag[:name]).each do |a| %&gt;
       &lt;li&gt;&lt;%= link_to(a.title, a.permalink) %&gt;&lt;/li&gt;
     &lt;% end %&gt;
     &lt;/ul&gt;</diff>
      <filename>app/plugins/feather-tagging/views/feather/tags/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,19 @@
 &lt;% throw_content :title do %&gt;
-	Articles tagged with &lt;%= @tag.name %&gt;
+  &lt;% if @tag.nil? %&gt;
+    Unable to find tag '&lt;%= params[:id] %&gt;'.
+  &lt;% else %&gt;
+	  Articles tagged with &lt;%= @tag[:display_name] %&gt;
+	&lt;% end %&gt;
 &lt;% end %&gt;
 
-&lt;h1&gt;Articles Tagged with '&lt;%= @tag.name %&gt;'&lt;/h1&gt;
-
-&lt;%= error_messages_for @tag %&gt;
+&lt;% if @tag.nil? %&gt;
+  Unable to find tag '&lt;%= params[:id] %&gt;'.
+&lt;% else %&gt;
+  &lt;h1&gt;Articles Tagged with '&lt;%= @tag[:display_name] %&gt;'&lt;/h1&gt;
 
-&lt;% unless @tag.nil? %&gt;
   &lt;ul&gt;
-  &lt;% Feather::Article.tagged_with(@tag.name).each do |a| %&gt;
+  &lt;% Feather::Article.tagged_with(@tag[:name]).each do |a| %&gt;
     &lt;li&gt;&lt;%= link_to(a.title, a.permalink) %&gt;&lt;/li&gt;
   &lt;% end %&gt;
   &lt;/ul&gt;
-&lt;% else %&gt;
-  No articles found for &lt;%= @tag.name %&gt;.
-&lt;% end %&gt;
+&lt;% end %&gt;
\ No newline at end of file</diff>
      <filename>app/plugins/feather-tagging/views/feather/tags/show.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 &lt;% unless article.tag_list.empty? %&gt;
-  | tagged with: &lt;% article.tags.each_with_index do |t, i| %&gt;&lt;%= link_to(t.name, &quot;/tags/#{t.id}&quot;) %&gt;&lt;%= i == (article.tag_list.length - 1) ? &quot;&quot; : &quot;, &quot; %&gt;&lt;% end %&gt;
+  | tagged with: &lt;% article.tags.each_with_index do |t, i| %&gt;&lt;%= link_to(t.display_name, &quot;/tags/#{t.id}&quot;) %&gt;&lt;%= i == (article.tag_list.length - 1) ? &quot;&quot; : &quot;, &quot; %&gt;&lt;% end %&gt;
 &lt;% end %&gt;</diff>
      <filename>app/plugins/feather-tagging/views/meta_section/_tag_list.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,8 @@
 &lt;% unless @tags.empty? %&gt;
   &lt;div style=&quot;margin-top: 20px&quot;&gt;
     &lt;h3&gt;Tags&lt;/h3&gt;
-    &lt;% tag_cloud @tags, %w(tag1 tag2 tag3 tag4 tag5) do |tag, css_class| %&gt;
-      &lt;%= link_to(tag.name, url(:tag, tag), :class =&gt; css_class) %&gt;
+    &lt;% tag_cloud @tags, @tagging, %w(tag1 tag2 tag3 tag4 tag5) do |tag, css_class| %&gt;
+      &lt;%= link_to(tag[:display_name], url(:tag, tag), :class =&gt; css_class) %&gt;
     &lt;% end %&gt;
   &lt;/div&gt;
 &lt;% end %&gt;</diff>
      <filename>app/plugins/feather-tagging/views/sidebar/_tag_cloud.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,9 @@ module Feather
       def set_default
         if params[:default_theme] &amp;&amp; Feather::Theme.get(params[:default_theme])
           Feather::PluginSetting.write('theme', params[:default_theme])
+          # Expire all pages as the theme has changed
+          Feather::Article.expire_article_index_page
+          Feather::Article.expire_article_pages
         end
         redirect url(:admin_themes)
       end</diff>
      <filename>app/plugins/feather-themes/controllers/admin/themes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,8 +20,12 @@ module Feather
         end
         
         def _theme_template_location(action, type = nil, controller = controller_name)
-          theme = Feather::PluginSetting.read('theme')
-          template = &quot;#{theme}/views/#{controller}/#{action}.#{type}&quot;
+          if Feather::Plugin.get(&quot;feather-themes&quot;).active
+            theme = Feather::PluginSetting.read('theme')
+            template = &quot;#{theme}/views/#{controller}/#{action}.#{type}&quot;
+          else
+            template = &quot;views/#{controller}/#{action}.#{type}&quot;
+          end
         end
       end
     end</diff>
      <filename>app/plugins/feather-themes/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;p&gt;
-  &lt;b&gt;&lt;%= article.title %&gt;&lt;/b&gt;
+  &lt;b&gt;&lt;%= link_to_article(article.title, article) %&gt;&lt;/b&gt;
 &lt;/p&gt;
 
 &lt;p&gt;</diff>
      <filename>app/themes/override/views/feather/articles/_article.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -8,13 +8,13 @@
   &lt;/head&gt;
   &lt;body&gt;
     &lt;%#= message[:notice] %&gt;
-    &lt;h1&gt;&lt;%= @settings.title %&gt;&lt;/h1&gt;
-    &lt;h3&gt;&lt;%= @settings.tag_line %&gt;&lt;/h3&gt;
+    &lt;h1&gt;&lt;%= @settings[:title] %&gt;&lt;/h1&gt;
+    &lt;h3&gt;&lt;%= @settings[:tag_line] %&gt;&lt;/h3&gt;
     Click &lt;%= link_to &quot;here&quot;, &quot;/&quot; %&gt; to return to the host app. Click &lt;%= link_to &quot;here&quot;, &quot;/blog/admin&quot; %&gt; for the blog admin.
     &lt;br /&gt;&lt;br /&gt;
     &lt;%= catch_content :for_layout %&gt;
     &lt;br /&gt;&lt;br /&gt;
-    &lt;b&gt;About this blog: &lt;%= @settings.about %&gt;&lt;/b&gt;
+    &lt;b&gt;About this blog: &lt;%= @settings[:about] %&gt;&lt;/b&gt;
     &lt;br /&gt;
     Articles: (&lt;%= link_to &quot;RSS&quot;, url(:feeds, :action =&gt; :articles, :format =&gt; :rss) %&gt;|&lt;%= link_to &quot;Atom&quot;, url(:feeds, :action =&gt; :articles, :format =&gt; :atom) %&gt;)
   &lt;/body&gt;</diff>
      <filename>app/themes/override/views/layout/application.html.erb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>db/feather_development.db</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aa219f5d31c8a2b0f8854db03188f9a920f18603</id>
    </parent>
  </parents>
  <author>
    <name>El Draper</name>
    <email>el@eldiablo.co.uk</email>
  </author>
  <url>http://github.com/edraper/feather-sample-slice-host/commit/62d363cef0f000ed8e0461129b0c71edb0407d6e</url>
  <id>62d363cef0f000ed8e0461129b0c71edb0407d6e</id>
  <committed-date>2009-03-23T16:15:55-07:00</committed-date>
  <authored-date>2009-03-23T16:15:55-07:00</authored-date>
  <message>updating the slice example app inline with recent changes to core code and plugins</message>
  <tree>e36cb5c282c6bf312d46ba1323f350a4834bb23f</tree>
  <committer>
    <name>El Draper</name>
    <email>el@eldiablo.co.uk</email>
  </committer>
</commit>
