Beispiel #1
0
         }
         if (!isset($terms) || empty($terms)) {
             if (!isset($_GET['author'])) {
                 exit;
             }
             $author = $_GET['author'];
             if (mb_check_encoding($author, $default_encoding) && !mb_check_encoding($author, 'UTF-8')) {
                 $author = mb_convert_encoding($author, 'UTF-8', $default_encoding);
             }
             if (!empty($author)) {
                 $books = $db->searchBooksByAuthor($author);
                 showBooks($opds, $books, $page, "Search results: " . $author);
                 exit;
             }
         } else {
             $books = $db->searchBooksByTitle($terms);
             showBooks($opds, $books, $page, "Search results: " . $terms);
             exit;
         }
     } elseif ($count > 1) {
         $lvl_parent = $levels[$count - 2];
         if ($lvl_parent === 'genres') {
             $books = $db->getBooksByGenre($lvl_last);
             showBooks($opds, $books, $page, "Genre: " . $lvl_last);
         }
         if ($lvl_parent === 'authors') {
             $books = $db->getBooksByAuthor($lvl_last);
             showBooks($opds, $books, $page, "Author: " . $lvl_last);
         }
     }
 } else {