liquid_feedback_frontend
changeset 154:6b6c82f9ca9f
speedup member image loading when non set
we can add the location of the default file directy instead of going through another slow request
we can add the location of the default file directy instead of going through another slow request
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Fri Oct 08 15:25:10 2010 +0200 (2010-10-08) |
parents | 17c3a3e36356 |
children | 329425e4128e |
files | app/main/member_image/_show.lua |
line diff
1.1 --- a/app/main/member_image/_show.lua Fri Oct 08 14:25:27 2010 +0200 1.2 +++ b/app/main/member_image/_show.lua Fri Oct 08 15:25:10 2010 +0200 1.3 @@ -6,6 +6,7 @@ 1.4 :add_where{ "image_type = ?", image_type } 1.5 :optional_object_mode() 1.6 :exec() 1.7 + 1.8 if image or show_dummy then 1.9 if config.fastpath_url_func then 1.10 ui.image{ 1.11 @@ -13,15 +14,22 @@ 1.12 external = config.fastpath_url_func(member.id, image_type) 1.13 } 1.14 else 1.15 - ui.image{ 1.16 - attr = { class = "member_image member_image_" .. image_type }, 1.17 - module = "member_image", 1.18 - view = "show", 1.19 - extension = "jpg", 1.20 - id = member.id, 1.21 - params = { 1.22 - image_type = image_type 1.23 + if not image then 1.24 + ui.image{ 1.25 + attr = { class = "member_image member_image_" .. image_type }, 1.26 + external = encode.url{ static = (config.member_image_default_file[image_type] or 'icons/16/lightning.png')}, 1.27 } 1.28 - } 1.29 + else 1.30 + ui.image{ 1.31 + attr = { class = "member_image member_image_" .. image_type }, 1.32 + module = "member_image", 1.33 + view = "show", 1.34 + extension = "jpg", 1.35 + id = member.id, 1.36 + params = { 1.37 + image_type = image_type 1.38 + } 1.39 + } 1.40 + end 1.41 end 1.42 end