adding user attribution when using a different user_id

This commit is contained in:
Andrew Davidson 2009-11-01 00:12:40 -07:00
parent 53b67f7ac3
commit b9e0066810
2 changed files with 17 additions and 0 deletions

View file

@ -1,2 +1,16 @@
module FlickrHelper
def user_is_andrew
if params and params[:user_id] and params[:user_id] != "13827925@N00"
return false
else
return true
end
end
def get_username (user_id)
return flickr.people.getInfo(:user_id => user_id).username
end
end

View file

@ -12,6 +12,9 @@
<% end %>
<%= yield %>
<div id="header">
<% unless user_is_andrew %>
<p>photos by flickr user <a href="http://flickr.com/photos/<%= params[:user_id] %>"><%= get_username(params[:user_id]) %></a>.</p>
<% end %>
<h1>photogriffy.net</h1>
<p>
<%= link_to "about", {:controller => "info", :action => "about"}, :alt => "about" %> |