aboutsummaryrefslogtreecommitdiff
path: root/t/front.t
diff options
context:
space:
mode:
Diffstat (limited to 't/front.t')
-rw-r--r--t/front.t24
1 files changed, 14 insertions, 10 deletions
diff --git a/t/front.t b/t/front.t
index a9badb0..86b8fb5 100644
--- a/t/front.t
+++ b/t/front.t
@@ -1,20 +1,24 @@
+<% #include "head.tc" %>
<h1><%= site.name %></h1>
<p>Thanks for the <%= getenv("REQUEST_METHOD") %> request!</p>
<table border="1">
- <tr style="font-weight: bold;">
- <td style="width: 60px;">Key</td>
- <td style="width: 140px;">Value</td>
- </tr>
<%
- char *p, *v;
- while(p = nextparam(GET, 512)){
- v = split(p);
+ struct post *post;
+ struct user *user;
+
+ while(post = getpost(stmt, 0)){
+ user = getuser(byid("users", post->user), 1);
%>
<tr>
- <td><%= p %></td>
- <td><%= v %></td>
+ <td><a href="?user=<% printf("%d", post->user); %>"><%=
+ user->name
+ %></a></td>
+ <td><a href="?post=<% printf("%d", post->id); %>"><%=
+ post->subject
+ %></a></td>
</tr>
<%
}
%>
-</table> \ No newline at end of file
+</table>
+<% #include "foot.tc" %> \ No newline at end of file