forked from seblucas/cops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.php
38 lines (34 loc) · 1.05 KB
/
feed.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* COPS (Calibre OPDS PHP Server) main script
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <[email protected]>
*
*/
require_once ("config.php");
require_once ("base.php");
require_once ("author.php");
require_once ("serie.php");
require_once ("tag.php");
require_once ("book.php");
require_once ("OPDS_renderer.php");
header ("Content-Type:application/xml");
$page = getURLParam ("page", Base::PAGE_INDEX);
$query = getURLParam ("query");
$n = getURLParam ("n", "1");
if ($query)
$page = Base::PAGE_OPENSEARCH_QUERY;
$qid = getURLParam ("id");
$OPDSRender = new OPDSRenderer ();
switch ($page) {
case Base::PAGE_OPENSEARCH :
echo $OPDSRender->getOpenSearch ();
return;
default:
$currentPage = Page::getPage ($page, $qid, $query, $n);
$currentPage->InitializeContent ();
echo $OPDSRender->render ($currentPage);
return;
break;
}