Fixed front page author display.

This commit is contained in:
2022-10-18 06:26:44 -05:00
parent 34d918d49e
commit fb7c360c9d

View File

@ -3,7 +3,15 @@
$db = new SQLite3('metadata.sqlite');
$feature = $db->query('SELECT id, title, author_sort FROM books limit 4');
$feature = $db->query('SELECT
books.id AS id,
books.title AS title,
authors.name AS author
FROM books
INNER JOIN books_authors_link ON books.id = books_authors_link.book
INNER JOIN authors on authors.id = books_authors_link.author
ORDER BY books.id DESC
LIMIT 4');
?>
@ -137,14 +145,14 @@ $feature = $db->query('SELECT id, title, author_sort FROM books limit 4');
while ($row = $feature->fetchArray()) {
$row_id = $row['id'];
$row_title = $row['title'];
$row_author_sort = $row['author_sort'];
$row_author = $row['author'];
echo '<article class="col-lg-3 col-md-3 col-sm-3 col-xs-6 col-xxs-12 animate-box">';
echo '<figure>';
echo '<a href="itemrecord.php?itemid='.$row_id.'"><img src="images/'.$row_id.'.jpg" title="'.$row_title.'" class="img-responsive"></a>';
echo '</figure>';
echo '<h2 class="fh5co-article-title"><a href="single.html">'.$row_title.'</a></h2>';
echo '<span class="fh5co-meta fh5co-date">'.$row_author_sort.'</span>';
echo '<span class="fh5co-meta fh5co-date">'.$row_author.'</span>';
echo '</article>';
}
?>