diff options
Diffstat (limited to 'ctl.c')
-rw-r--r-- | ctl.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -19,6 +19,20 @@ printdate(int timestamp) } void +showattachment(id) +{ + struct attachment *attachment; + + if(!(attachment = getattachment(byid("attachments", id), 1))){ + srverr("Could not retrieve attachment"); + return; + } + + printf("Content-Type: %s\n\n", attachment->mime); + printf("%.*s", attachment->bytes, attachment->data); +} + +void showfront() { char *title; @@ -42,6 +56,7 @@ showpost(int id) char *title; struct post *post; struct user *user; + sqlite3_stmt *stmt; if(!(post = getpost(byid("posts", id), 1))){ srverr("Could not retrieve post"); @@ -53,6 +68,8 @@ showpost(int id) return; } + stmt = byid("attachments", id); + title = site.name; printf("Content-Type: text/html\n\n"); #include "t/post.tc" |