liquid_feedback_frontend
diff app/main/member_image/show.lua @ 4:80c215dbf076
Version alpha5
Many optical changes and improved usability
Support for different wiki-formatting-engines
Help system
Many optical changes and improved usability
Support for different wiki-formatting-engines
Help system
author | bsw/jbe |
---|---|
date | Thu Dec 10 12:00:00 2009 +0100 (2009-12-10) |
parents | |
children | 88ac7798b562 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/member_image/show.lua Thu Dec 10 12:00:00 2009 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +local image_type = param.get("image_type") 1.5 +local record = MemberImage:by_pk(param.get_id(), image_type, true) 1.6 + 1.7 +if record == nil then 1.8 + local default_file = config.member_image_default_file[image_type] 1.9 + if default_file then 1.10 + print('Location: ' .. encode.url{ static = default_file } .. '\n\n') 1.11 + else 1.12 + print('Location: ' .. encode.url{ static = 'icons/16/lightning.png' } .. '\n\n') 1.13 + end 1.14 + exit() 1.15 +end 1.16 + 1.17 +print('Content-type: ' .. record.content_type .. '\n') 1.18 + 1.19 +if record then 1.20 + io.stdout:write(record.data) 1.21 +else 1.22 +end 1.23 + 1.24 +exit()