diff options
author | John Ankarström <john@ankarstrom.se> | 2021-09-18 01:52:04 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-09-18 01:52:04 +0200 |
commit | 24bf14f6653ebf1c1ba79b9f212d35417bb6acbf (patch) | |
tree | 913a0f1bebf835a1109652b1c61d363972ee9a28 /t/front.tc | |
parent | e25f56cbe86041d4ab19e474e38032fa7e681ac7 (diff) | |
download | cforum-24bf14f6653ebf1c1ba79b9f212d35417bb6acbf.tar.gz |
Implement attachments
Diffstat (limited to 't/front.tc')
-rw-r--r-- | t/front.tc | 24 |
1 files changed, 10 insertions, 14 deletions
@@ -1,28 +1,24 @@ #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 "); +printf("</h1>\n<h3>Latest posts</h3>\n<table border=\"1\">\n "); struct post *post; struct user *user; 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("\n <tr>\n <td><a href=\"?post="); printf("%d", post->id); printf("\">"); -printf("%s", - post->subject - ); -printf("</a></td>\n </tr>\n "); +printf("%s", post->subject ); +printf("</a></td>\n <td><a href=\"?user="); +printf("%d", post->user); +printf("\">"); +printf("%s", user->name ); +printf("</a></td>\n <td>"); +printdate(post->created); +printf("</td>\n </tr>\n "); } printf("\n</table>\n"); |