# HG changeset patch # User Daniel Poelzleithner # Date 1286544310 -7200 # Node ID 6b6c82f9ca9ffcbb4522d554a1768ca3e2fe6e89 # Parent 17c3a3e36356f74e74bc00bf612a46cf2aaa8187 speedup member image loading when non set we can add the location of the default file directy instead of going through another slow request diff -r 17c3a3e36356 -r 6b6c82f9ca9f app/main/member_image/_show.lua --- a/app/main/member_image/_show.lua Fri Oct 08 14:25:27 2010 +0200 +++ b/app/main/member_image/_show.lua Fri Oct 08 15:25:10 2010 +0200 @@ -6,6 +6,7 @@ :add_where{ "image_type = ?", image_type } :optional_object_mode() :exec() + if image or show_dummy then if config.fastpath_url_func then ui.image{ @@ -13,15 +14,22 @@ external = config.fastpath_url_func(member.id, image_type) } else - ui.image{ - attr = { class = "member_image member_image_" .. image_type }, - module = "member_image", - view = "show", - extension = "jpg", - id = member.id, - params = { - image_type = image_type + if not image then + ui.image{ + attr = { class = "member_image member_image_" .. image_type }, + external = encode.url{ static = (config.member_image_default_file[image_type] or 'icons/16/lightning.png')}, } - } + else + ui.image{ + attr = { class = "member_image member_image_" .. image_type }, + module = "member_image", + view = "show", + extension = "jpg", + id = member.id, + params = { + image_type = image_type + } + } + end end end