示例#1
0
文件: index.php 项目: xnynx/inpx2opds
             $terms = $_GET['title'];
             if (mb_check_encoding($terms, $default_encoding) && !mb_check_encoding($terms, 'UTF-8')) {
                 $terms = mb_convert_encoding($terms, 'UTF-8', $default_encoding);
             }
         }
     }
     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') {