cops/feed.php
Sébastien Lucas 4c9e8c67d0 First attempt to add paging in the OPDS side.
Need more polishing before being used everywhere.

--HG--
extra : rebase_source : 0fb3a4b12cf83d4b450a1fca81f82addd8d58c14
2012-09-18 15:39:22 +02:00

40 lines
1.1 KiB
PHP

<?php
/**
* COPS (Calibre OPDS PHP Server) main script
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <sebastien@slucas.fr>
*
*/
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;
}
?>