- @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit=>20)
-
- rss = OSM::GeoRSS.new('OpenStreetMap diary entries', 'Recent diary entries from users of OpenStreetMap', 'http://www.openstreetmap.org/diary')
+ if params[:display_name]
+ @this_user = User.find_by_display_name(params[:display_name])
+ @entries=DiaryEntry.find(:all, :conditions => ['user_id = ?', @this_user.id], :order => 'created_at DESC', :limit => 20)
+ rss = OSM::GeoRSS.new("OpenStreetMap diary entries for #{@this_user.display_name}", "Recent OpenStreetmap diary entries from #{@this_user.display_name}", "http://www.openstreetmap.org/user/#{@this_user.display_name}/diary")
+ else
+ @entries=DiaryEntry.find(:all, :order => 'created_at DESC', :limit => 20)
+ rss = OSM::GeoRSS.new('OpenStreetMap diary entries', 'Recent diary entries from users of OpenStreetMap', 'http://www.openstreetmap.org/diary')
+ end