$sql = "SELECT $cols FROM messages m JOIN issues i ON i.id = issue";
$sql .= " WHERE message IS NOT NULL";
$sql .= " ORDER BY m.created DESC LIMIT $limit";
-$sql = "SELECT * FROM ($sql) x ORDER BY updated DESC, created, id"; # grouped issues
$query = $Db->query($sql);
print '<dl class="replies">';
$group = NULL;
while ($row = $query->fetch()) {
- $rowuser = new User("profile/{$row->author}");
+ print '<dt>';
if ($group !== $row->issue) {
$group = $row->issue;
- print '<dt>';
printf('<a href="/%s">%s</a>', $row->page, $row->subject);
if ($row->closed) {
print ' <em>(opgelost)</em>';
}
- print '</dt>';
}
- print '<dd>';
- printf('<strong>%s</strong> <small class="date">%s</small>',
- $rowuser->html, showdate(preg_split('/\D/', $row->created))
+ print '<span class="right">';
+ if ($row->author and $rowuser = new User("profile/{$row->author}")) {
+ printf('<strong>%s</strong> ', $rowuser->html);
+ }
+ printf('<small class="date">%s</small>',
+ showdate(preg_split('/\D/', $row->created))
);
- printf("\n\t<blockquote>%s</blockquote>", $row->message);
+ print "</span>";
+ print '</dt>';
+ print '<dd>';
+ print $row->message;
print "</dd>\n";
}