View Single Post
Old 01-07-2013, 06:45 PM   #220
nicholbb
Junior Member
nicholbb began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jun 2010
Device: Sony 505
Hi,
Wonderful and easy software, worked like a dream.

Quick question/request, does anyone know a way to exclude particular books based on their tags, I'm guessing code. Below is the restriction (saved Search) I use for calibre:
not(tags: "=toedit")

Thanks in advance for any help (and software).

***EDIT***
Not a ideal solution but I didn't have hundreds so I renamed them to start with toedit then altered the SQL query in book.php section below with a where clause of: books.title not like 'toedit%'

You can see see the books in the different categories but don't show in the list when you drill down (think this would require a rewrite of each page and I wasn't that fussed)

Quote:
// Silly thing because PHP forbid string concatenation in class const
define ('SQL_BOOKS_LEFT_JOIN', "left outer join comments on comments.book = books.id
left outer join books_ratings_link on books_ratings_link.book = books.id
left outer join ratings on books_ratings_link.rating = ratings.id
");
define ('SQL_BOOKS_BY_FIRST_LETTER', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where upper (books.sort) like ? and books.title not like 'toedit%'");
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 = ? and books.title not like 'toedit%' order by pubdate");
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 = ? and books.title not like 'toedit%' order by series_index");
define ('SQL_BOOKS_BY_TAG', "select {0} from books_tags_link, books " . SQL_BOOKS_LEFT_JOIN . "
where books_tags_link.book = books.id and tag = ? and books.title not like 'toedit%' order by sort");
define ('SQL_BOOKS_QUERY', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where exists (select null from authors, books_authors_link where book = books.id and author = authors.id and authors.name like ? and books.title like not 'toedit%') or title like ? and books.title not like 'toedit%'");
define ('SQL_BOOKS_RECENT', "select {0} from books " . SQL_BOOKS_LEFT_JOIN . "
where books.title not like 'toedit%' order by timestamp desc limit ");
Any better solutions (apart from using a parameter in this, which I may well do at some stage)?

Last edited by nicholbb; 01-07-2013 at 09:39 PM. Reason: own stopgap solution
nicholbb is offline   Reply With Quote