liquid_feedback_frontend
view app/main/member_image/_show.lua @ 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 | 80c215dbf076 |
| children | aec9df5b4cd3 |
line source
1 local member = param.get("member", "table")
2 local image_type = param.get("image_type")
3 local show_dummy = param.get("show_dummy", atom.boolean)
5 local image = member:get_reference_selector("images")
6 :add_where{ "image_type = ?", image_type }
7 :optional_object_mode()
8 :exec()
10 if image or show_dummy then
11 if config.fastpath_url_func then
12 ui.image{
13 attr = { class = "member_image member_image_" .. image_type },
14 external = config.fastpath_url_func(member.id, image_type)
15 }
16 else
17 if not image then
18 ui.image{
19 attr = { class = "member_image member_image_" .. image_type },
20 external = encode.url{ static = (config.member_image_default_file[image_type] or 'icons/16/lightning.png')},
21 }
22 else
23 ui.image{
24 attr = { class = "member_image member_image_" .. image_type },
25 module = "member_image",
26 view = "show",
27 extension = "jpg",
28 id = member.id,
29 params = {
30 image_type = image_type
31 }
32 }
33 end
34 end
35 end
