aboutsummaryrefslogtreecommitdiff
path: root/cforum.c
diff options
context:
space:
mode:
Diffstat (limited to 'cforum.c')
-rw-r--r--cforum.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/cforum.c b/cforum.c
index 2997ced..dbf320c 100644
--- a/cforum.c
+++ b/cforum.c
@@ -15,7 +15,7 @@ int
main(int argc, char *argv[])
{
char err[MAXERR], *p, *qs, *v;
- int postid, userid;
+ int attachmentid, postid, userid;
sqlite3_stmt *stmt;
/*
@@ -70,15 +70,21 @@ main(int argc, char *argv[])
}
/* Parse query string. */
- postid = userid = 0;
+ attachmentid = postid = userid = 0;
while(p = nextparam(GET, 128)){
v = split(p);
- if(!postid && strcmp(p, "post") == 0) postid = atoi(v);
- else if(!userid && strcmp(p, "user") == 0) userid = atoi(v);
+ if(!attachmentid && strcmp(p, "attachment") == 0)
+ attachmentid = atoi(v);
+ else if(!postid && strcmp(p, "post") == 0)
+ postid = atoi(v);
+ else if(!userid && strcmp(p, "user") == 0)
+ userid = atoi(v);
}
/* Handle request. */
- if(postid)
+ if(attachmentid)
+ showattachment(attachmentid);
+ else if(postid)
showpost(postid);
else if(userid)
showuser(userid);