photo url for facebook app to missing image

master
andrew 2008-11-23 01:43:00 -06:00
parent dec7581cec
commit 3b4bc95f54
1 changed files with 7 additions and 3 deletions

View File

@ -9,10 +9,14 @@ module Merb
end end
def photo_url(photo, w = nil, h = nil) def photo_url(photo, w = nil, h = nil)
if photo.facebook_id
'/images/image-missing.png'
else
w = photo.width if w.nil? or w.to_i > photo.width w = photo.width if w.nil? or w.to_i > photo.width
h = photo.height if h.nil? or h.to_i > photo.height h = photo.height if h.nil? or h.to_i > photo.height
url :thumbnail_photo, photo, :width => w, :height => h url :thumbnail_photo, photo, :width => w, :height => h
end end
end
def indicator def indicator
"<img src='/images/ajax-loader.gif' id='indicator' style='display: none; vertical-align: middle' />" "<img src='/images/ajax-loader.gif' id='indicator' style='display: none; vertical-align: middle' />"