diff options
author | John Ankarström <john@ankarstrom.se> | 2021-09-17 23:47:58 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-09-17 23:47:58 +0200 |
commit | 7d65ce8c8e304dc8367f4492948514f2acc07a3b (patch) | |
tree | 1d1e8584ad326cf3ea7701e2a726a0f0ae1cb6cf /t/front.tc | |
parent | 56509ab16c8d2225182eb0400e5c6a4900870391 (diff) | |
download | cforum-7d65ce8c8e304dc8367f4492948514f2acc07a3b.tar.gz |
Whatever
Diffstat (limited to 't/front.tc')
-rw-r--r-- | t/front.tc | 34 |
1 files changed, 23 insertions, 11 deletions
@@ -1,17 +1,29 @@ -printf("<h1>"); +#include "head.tc" +printf("\n<h1>"); printf("%s", site.name ); printf("</h1>\n<p>Thanks for the "); printf("%s", getenv("REQUEST_METHOD") ); -printf(" request!</p>\n<table border=\"1\">\n <tr style=\"font-weight: bold;\">\n <td style=\"width: 60px;\">Key</td>\n <td style=\"width: 140px;\">Value</td>\n </tr>\n "); - char *p, *v; - while(p = nextparam(GET, 512)){ - v = split(p); +printf(" request!</p>\n<table border=\"1\">\n "); + struct post *post; + struct user *user; -printf("\n <tr>\n <td>"); -printf("%s", p ); -printf("</td>\n <td>"); -printf("%s", v ); -printf("</td>\n </tr>\n "); + while(post = getpost(stmt, 0)){ + user = getuser(byid("users", post->user), 1); + +printf("\n <tr>\n <td><a href=\"?user="); +printf("%d", post->user); +printf("\">"); +printf("%s", + user->name + ); +printf("</a></td>\n <td><a href=\"?post="); +printf("%d", post->id); +printf("\">"); +printf("%s", + post->subject + ); +printf("</a></td>\n </tr>\n "); } -printf("\n</table>"); +printf("\n</table>\n"); +#include "foot.tc" |