My inbox

You have <%=@user.get_new_messages.length %> new messages and <%=@user.get_all_messages.length - @user.get_new_messages.length %> old messages

<% if (params[:all] and @user.get_all_messages.length > 0) or (@user.get_new_messages.length > 0) %>
<% if params[:all] %> <% @user.get_all_messages.each do |message| %> <% if message.message_read = 0 %> <%else%> <%end%> <%end%> <%else%> <% @user.get_new_messages.each do |message| %> <% if message.message_read = 0 %> <%else%> <%end%> <%end%> <%end%>
from title received on
<%= link_to User.find(message.from_user_id).display_name , :controller => 'user', :action => User.find(message.from_user_id).display_name %> <%= link_to message.title , :controller => 'message', :action => 'read', :message_id => message.id %> <%= message.sent_on %><%= link_to 'mark as read', :controller => 'message', :action => 'mark', :message_id => message.id %> message read<%= link_to 'reply', :controller => 'message', :action => 'new', :user_id => message.from_user_id %>
<%= link_to User.find(message.from_user_id).display_name , :controller => 'user', :action => User.find(message.from_user_id).display_name %> <%= link_to message.title , :controller => 'message', :action => 'read', :message_id => message.id %> <%= message.sent_on %><%= link_to 'mark as read', :controller => 'message', :action => 'mark', :message_id => message.id %> message read
<%end%> <% if params[:all] %> <%= link_to 'show new messages', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %> <% else %> <%= link_to 'show all messages', :controller => 'message', :action => 'inbox', :display_name => @user.display_name, :all => true %> <% end %>