diff options
Diffstat (limited to 't')
-rw-r--r-- | t/err.tc | 2 | ||||
-rw-r--r-- | t/front.tc | 6 | ||||
-rw-r--r-- | t/post.t | 12 | ||||
-rw-r--r-- | t/post.tc | 18 |
4 files changed, 28 insertions, 10 deletions
@@ -2,4 +2,4 @@ printf("<h1>"); printf("%s", title ); printf("</h1>\n<p>"); printf("%s", err ); -printf("</p>\n"); +printf("</p>"); @@ -6,10 +6,12 @@ printf(" request!</p>\n<table border=\"1\">\n <tr style=\"font-weight: bold;\">\ char *p, *v; while(p = nextparam(GET, 512)){ v = split(p); - printf("\n <tr>\n <td>"); + +printf("\n <tr>\n <td>"); printf("%s", p ); printf("</td>\n <td>"); printf("%s", v ); printf("</td>\n </tr>\n "); } - printf("\n</table>"); + +printf("\n</table>"); @@ -1,7 +1,13 @@ <h1>Post <% printf("%d", id); %>: <%= post->subject %></h1> -<p>From: <%= user->full %> -<<a href="?user=<% printf("%d", user->id); %>"><%= user->name %></a>> -<br>Date: <% PFREE(date(post->created)); %> +<p>From: <%= user->full? user->full: "" %> <% +if(user->full) printf("<"); +%><a href="?user=<% printf("%d", user->id); %>"><%= user->name %></a><% +if(user->full) printf(">"); %> +<br>Date: <% printdate(post->created); %> +<% if(post->edited){ + printf("<br>Edited: "); + printdate(post->edited); +} %> <pre> <%= post->text %> </pre>
\ No newline at end of file @@ -3,13 +3,23 @@ printf("%d", id); printf(": "); printf("%s", post->subject ); printf("</h1>\n<p>From: "); -printf("%s", user->full ); -printf("\n<<a href=\"?user="); +printf("%s", user->full? user->full: "" ); +printf(" "); +if(user->full) printf("<"); + +printf("<a href=\"?user="); printf("%d", user->id); printf("\">"); printf("%s", user->name ); -printf("</a>>\n<br>Date: "); -PFREE(date(post->created)); +printf("</a>"); +if(user->full) printf(">"); +printf("\n<br>Date: "); +printdate(post->created); +printf("\n"); +if(post->edited){ + printf("<br>Edited: "); + printdate(post->edited); +} printf("\n<pre>\n"); printf("%s", post->text ); printf("\n</pre>"); |