From 973edb08ed5ff35644328c244d5d584f44a70591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 18 Sep 2021 11:58:56 +0200 Subject: Implement `add' functions --- t/front.t | 18 +++++++++++++++--- t/user.t | 10 ++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/front.t b/t/front.t index a12d712..9d39469 100644 --- a/t/front.t +++ b/t/front.t @@ -2,14 +2,26 @@

<%= site.name %>

Latest posts

- <% while(post = nextpost(stmt)){ - user = getuser(byid("users", post->user)); %> + <% while(post = nextpost(pstmt)){ + user = getuser(selectbyint("users", "oid", post->user)); %> - <% free(post); + <% free(user); + free(post); + } %> +
id); %>"><%= post->subject %> user); %>"><%= user->name %> <% printdate(post->created); %>
+

Latest users

+ + <% while(user = nextuser(ustmt)){ %> + + + + + + <% free(user); } %>
id); %>"><%= user->name %><%= user->full %><% printdate(user->created); %>
<% #include "foot.tc" %> \ No newline at end of file diff --git a/t/user.t b/t/user.t index af7c8cd..b69633a 100644 --- a/t/user.t +++ b/t/user.t @@ -1,3 +1,13 @@ <% #include "head.tc" %>

User <% printf("%d", id); %>: <%= user->name %>

+

Latest posts

+ + <% while(post = nextpost(stmt)){ %> + + + + + <% free(post); + } %> +
id); %>"><%= post->subject %><% printdate(post->created); %>
<% #include "foot.tc" %> \ No newline at end of file -- cgit v1.2.3