From 07a85406fb4c5d90cbd69eb76aa32c6a02d16b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Mon, 29 Dec 2014 06:20:57 +0100 Subject: [PATCH] Change the default sort of books by author to have books in a series first. --- book.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/book.php b/book.php index 7d2dd4a..a8cf6b7 100644 --- a/book.php +++ b/book.php @@ -27,7 +27,8 @@ define ('SQL_BOOKS_BY_PUBLISHER', "select {0} from books_publishers_link, books define ('SQL_BOOKS_BY_FIRST_LETTER', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . " where upper (books.sort) like ? order by books.sort"); define ('SQL_BOOKS_BY_AUTHOR', "select {0} from books_authors_link, books " . SQL_BOOKS_LEFT_JOIN . " - where books_authors_link.book = books.id and author = ? {1} order by pubdate"); + left outer join books_series_link on books_series_link.book = books.id + where books_authors_link.book = books.id and author = ? {1} order by series desc, series_index asc, pubdate asc"); define ('SQL_BOOKS_BY_SERIE', "select {0} from books_series_link, books " . SQL_BOOKS_LEFT_JOIN . " where books_series_link.book = books.id and series = ? {1} order by series_index"); define ('SQL_BOOKS_BY_TAG', "select {0} from books_tags_link, books " . SQL_BOOKS_LEFT_JOIN . "