1) Исправления в связи со сменой API MySQL
[openlib.git] / www / feed.php
1 <?php
2 /**
3  * COPS (Calibre OPDS PHP Server) main script
4  *
5  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6  * @author     Sébastien Lucas <sebastien@slucas.fr>
7  *
8  */
9
10     require_once ("config.php");
11     require_once ("base.php");
12     require_once ("author.php");
13     require_once ("serie.php");
14     require_once ("tag.php");
15     require_once ("book.php");
16     require_once ("OPDS_renderer.php");
17     
18     header ("Content-Type:application/xml");
19     $page = getURLParam ("page", Base::PAGE_INDEX);
20     $query = getURLParam ("query");
21     $n = getURLParam ("n", "1");
22     if ($query)
23         $page = Base::PAGE_OPENSEARCH_QUERY;
24     $qid = getURLParam ("id");
25     
26     $OPDSRender = new OPDSRenderer ();
27     
28     switch ($page) {
29         case Base::PAGE_OPENSEARCH :
30             echo $OPDSRender->getOpenSearch ();
31             return;
32         default:
33             $currentPage = Page::getPage ($page, $qid, $query, $n);
34             $currentPage->InitializeContent ();
35             echo $OPDSRender->render ($currentPage);
36             return;
37             break;
38     }