From 0292e86cf884a26108a59d81d69cee83b54f4c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 18 Sep 2021 10:38:09 +0200 Subject: Clean up database code --- t/front.t | 4 ++-- t/post.t | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/front.t b/t/front.t index fcdecdb..fd9f46c 100644 --- a/t/front.t +++ b/t/front.t @@ -2,8 +2,8 @@

<%= site.name %>

Latest posts

- <% while(post = getpost(stmt, 0)){ - user = getuser(byid("users", post->user), 1); %> + <% while(post = nextpost(stmt)){ + user = getuser(byid("users", post->user)); %> diff --git a/t/post.t b/t/post.t index 549b4ec..b1cbe99 100644 --- a/t/post.t +++ b/t/post.t @@ -13,16 +13,16 @@
 <%= post->text %>
 
-<% if(attachment = getattachment(stmt, 0)){ %> +<% if(att = nextatt(stmt)){ %>

Attachments

id); %>"><%= post->subject %> user); %>"><%= user->name %>
<% do{ %> - - - + + + - <% }while(attachment = getattachment(stmt, 0)); %> + <% }while(att = nextatt(stmt)); %>
id); %>"><%= attachment->name %><%= attachment->mime %><%= attachment->description %>id); %>"><%= att->name %><%= att->mime %><%= att->description %>
<% } %> <% #include "foot.tc" %> \ No newline at end of file -- cgit v1.2.3