cops/index.php

96 lines
4.4 KiB
PHP
Raw Normal View History

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
2012-06-02 09:48:07 +03:00
<?php
/**
* COPS (Calibre OPDS PHP Server) HTML main script
2012-06-02 09:48:07 +03:00
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author S<EFBFBD>bastien Lucas <sebastien@slucas.fr>
2012-06-02 09:48:07 +03:00
*
*/
require_once ("config.php");
require_once ("base.php");
require_once ("author.php");
require_once ("serie.php");
require_once ("tag.php");
2013-05-21 20:49:21 +03:00
require_once ("language.php");
require_once ("customcolumn.php");
2012-06-02 09:48:07 +03:00
require_once ("book.php");
// If we detect that an OPDS reader try to connect try to redirect to feed.php
if (preg_match("/(MantanoReader|FBReader|Stanza|Aldiko|Moon+ Reader)/", $_SERVER['HTTP_USER_AGENT'])) {
header("location: feed.php");
2013-03-01 18:48:25 +02:00
exit ();
}
2013-06-25 09:40:08 +03:00
header ("Content-Type:text/html;charset=utf-8");
2012-06-02 09:48:07 +03:00
$page = getURLParam ("page", Base::PAGE_INDEX);
$query = getURLParam ("query");
$qid = getURLParam ("id");
$n = getURLParam ("n", "1");
$database = GetUrlParam (DB);
2012-06-02 09:48:07 +03:00
?>
<head>
2013-05-16 18:12:19 +03:00
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>COPS</title>
2013-07-21 23:14:24 +03:00
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/jQuery/jquery-1.10.2.min.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/jquery-cookie/jquery.cookies.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/Magnific-Popup/jquery.magnific-popup.min.js") ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/Magnific-Popup/magnific-popup.css") ?>" media="screen" />
2012-06-20 23:01:19 +03:00
<script type="text/javascript" src="<?php echo getUrlWithVersion("js/jquery.sortElements.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/doT/doT.min.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("resources/lru/lru.js") ?>"></script>
<script type="text/javascript" src="<?php echo getUrlWithVersion("util.js") ?>"></script>
2013-03-08 10:43:37 +02:00
<link rel="related" href="<?php echo $config['cops_full_url'] ?>feed.php" type="application/atom+xml;profile=opds-catalog" title="<?php echo $config['cops_title_default']; ?>" />
<link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" />
2013-05-17 09:22:52 +03:00
<link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:400,300italic,800,300,400italic,600,600italic,700,700italic,800italic' />
2013-05-17 07:36:38 +03:00
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("resources/normalize/normalize.css") ?>" />
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("styles/font-awesome.css") ?>" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss ()) ?>" media="screen" />
2012-06-02 09:48:07 +03:00
<script type="text/javascript">
2012-06-02 09:48:07 +03:00
$(document).ready(function() {
// Handler for .ready() called.
2013-06-25 09:40:08 +03:00
var url = "<?php echo "getJSON.php?" . addURLParameter ($_SERVER["QUERY_STRING"], "complete", 1); ?>";
$.when($.get('templates/default/header.html'),
$.get('templates/default/footer.html'),
$.get('templates/default/bookdetail.html'),
$.get('templates/default/main.html'),
$.get('templates/default/page.html'),
$.getJSON(url)).done(function(header, footer, bookdetail, main, page, data){
templateBookDetail = doT.template (bookdetail [0]);
var defMain = {
bookdetail: bookdetail [0]
};
templateMain = doT.template (main [0], undefined, defMain);
var defPage = {
header: header [0],
footer: footer [0],
main : main [0],
bookdetail: bookdetail [0]
};
templatePage = doT.template (page [0], undefined, defPage);
currentData = data [0];
updatePage (data [0]);
cache.put (url, data [0]);
history.replaceState(url, "", window.location);
2013-07-16 22:56:55 +03:00
handleLinks ();
});
2012-06-02 09:48:07 +03:00
});
2012-06-02 09:48:07 +03:00
</script>
</head>
<body>
</body>
</html>