_plugins/related_posts.rb
# Sort the related posts in order of their score and date
# and return just the posts
Sort the related posts in order of their score and date
and return just the posts
Sort the related posts in order of their score and date and return just the posts
def sort_related_posts(related_scores)
      related_scores.sort do |a,b|
        if a[1] < b[1]
          1
        elsif a[1] > b[1]
          -1
        else
          b[0].date <=> a[0].date
        end
      end.collect {|post,freq| post}
    end
def sort_related_posts ( related_scores ) related_scores . sort do | a , b | if a [ 1 ] < b [ 1 ] 1 elsif a [ 1 ] > b [ 1 ] - 1 else b [ 0 ] . date <=> a [ 0 ] . date end end . collect { | post , freq | post } end
Sort the related posts in order of their score and date
and return just the posts
Sort the related posts in order of their score and date and return just the posts
related_scores
<not_specific>