+ elsif params[:language]
+ @title = t 'diary_entry.list.in_language_title', :language => Language.find(params[:language]).english_name
+ @entry_pages, @entries = paginate(:diary_entries, :include => :user,
+ :conditions => {
+ :users => { :status => ["active", "confirmed"] },
+ :visible => true,
+ :language_code => params[:language]
+ },
+ :order => 'created_at DESC',
+ :per_page => 20)
+ elsif params[:friends]
+ if @user
+ @title = t 'diary_entry.list.title_friends'
+ @entry_pages, @entries = paginate(:diary_entries, :include => :user,
+ :conditions => {
+ :user_id => @user.friend_users,
+ :visible => true
+ },
+ :order => 'created_at DESC',
+ :per_page => 20)
+ else
+ require_user
+ return
+ end
+ elsif params[:nearby]
+ if @user
+ @title = t 'diary_entry.list.title_nearby'
+ @entry_pages, @entries = paginate(:diary_entries, :include => :user,
+ :conditions => {
+ :user_id => @user.nearby,
+ :visible => true
+ },
+ :order => 'created_at DESC',
+ :per_page => 20)
+ else
+ require_user
+ return
+ end