Merge cadric fork

This commit is contained in:
Sébastien Lucas 2013-03-06 08:02:03 +01:00
commit 54e7300d75
12 changed files with 293 additions and 352 deletions

13
about.html Normal file
View file

@ -0,0 +1,13 @@
<h1>Authors</h1>
<h2>COPS is developped and maintained by Sébastien Lucas.</h2>
<p>See full history on <a href="https://github.com/seblucas">Github</a> to check all authors.<br />
COPS use some external librairies, check README for the details.</p>
<h2>Copyright</h2>
<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.<br />
The complete content of license is provided in file COPYING within distribution and also available <a href="http://www.gnu.org/licenses/gpl-2.0.html">online</a>.</p>
<h2>Contact</h2>
<p>For more info please visit <a href="http://blog.slucas.fr/en/oss/calibre-opds-php-server">COPS Home Page</a></p>
<p>You can also check <a href="http://www.mobileread.com/forums/showthread.php?t=170903">COPS's topic on MobileRead forum</a>.</p>

View file

@ -1,20 +0,0 @@
<div class="entryTitle">Authors</div>
<div class="content" style="max-width:700px;">
<p>COPS is developped and maintained by Sébastien Lucas.</p>
<p>See full history on <a href="https://github.com/seblucas">Github</a> to check all authors.</p>
<p>COPS use some external librairies, check README for the details.</p>
</div>
<div class="entryTitle">Copyright</div>
<div class="content" style="max-width:700px;">
<p>This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.</p>
<p>The complete content of license is provided in file COPYING within distribution and also available <a href="http://www.gnu.org/licenses/gpl-2.0.html">online</a>.</p>
</div>
<div class="entryTitle">Contact</div>
<div class="content" style="max-width:700px;">
<p>For more info please visit <a href="http://blog.slucas.fr/en/oss/calibre-opds-php-server">COPS Home Page</a></p>
<p>You can also check <a href="http://www.mobileread.com/forums/showthread.php?t=170903">COPS's topic on MobileRead forum</a>.</p>
</div>

View file

@ -165,15 +165,6 @@ class Entry
public $localUpdated;
private static $updated = NULL;
public static $icons = array(
Author::ALL_AUTHORS_ID => 'images/author.png',
Serie::ALL_SERIES_ID => 'images/serie.png',
Book::ALL_RECENT_BOOKS_ID => 'images/recent.png',
Tag::ALL_TAGS_ID => 'images/tag.png',
CustomColumn::ALL_CUSTOMS_ID => 'images/tag.png',
"calibre:books$" => 'images/allbook.png',
"calibre:books:letter" => 'images/allbook.png'
);
public function getUpdatedTime () {
if (!is_null ($this->localUpdated)) {
@ -193,16 +184,6 @@ class Entry
$this->contentType = $pcontentType;
$this->linkArray = $plinkArray;
if ($config['cops_show_icons'] == 1)
{
foreach (self::$icons as $reg => $image)
{
if (preg_match ("/" . $reg . "/", $pid)) {
array_push ($this->linkArray, new Link (getUrlWithVersion ($image), "image/png", Link::OPDS_THUMBNAIL_TYPE));
break;
}
}
}
}
}

View file

@ -20,16 +20,15 @@ $book->getLinkArray ();
<?php
if (isset ($page) && $page == Base::PAGE_BOOK_DETAIL) {
?>
<div class="bookdetail">
<div>
<?php
} else {
?>
<div class="bookpopup">
<article class="bookpopup">
<?php
}
?>
<div class="booke">
<div class="cover">
<span class="cover">
<?php
if ($book->hasCover) {
?>
@ -37,38 +36,34 @@ $book->getLinkArray ();
<?php
}
?>
</div>
<div class="download">
</span>
<?php
foreach ($book->getDatas() as $data)
{
?>
<div class="button buttonEffect"><a href="<?php echo $data->getHtmlLink () ?>"><?php echo $data->format ?></a></div>
<h2 class="download"><a href="<?php echo $data->getHtmlLink () ?>"><?php echo $data->format ?></a></h2>
<?php
}
?>
</div>
<div class="entryTitle"><a rel="bookmark" href="<?php echo 'index.php' . $book->getUri () ?>"><img src="<?php echo getUrlWithVersion("images/Link.png") ?>" alt="permalink" /></a><?php echo htmlspecialchars ($book->title) ?></div>
<div class="entrySection">
<span><?php echo localize("authors.title") ?></span>
<div class="buttonEffect pad6">
<h1><a rel="bookmark" href="<?php echo 'index.php' . $book->getUri () ?>"><img src="<?php echo getUrlWithVersion("images/Link.png") ?>" alt="permalink" /></a><?php echo htmlspecialchars ($book->title) ?></h1>
<h3><?php echo localize("authors.title") ?>: </h3>
<p class="popupless">
<?php
$i = 0;
foreach ($authors as $author) {
if ($i > 0) echo ", ";
?>
<a href="index.php<?php echo str_replace ("&", "&amp;", $author->getUri ()) ?>"><?php echo htmlspecialchars ($author->name) ?></a>
<a href="index.php<?php echo str_replace ("&", "&amp;", $author->getUri ()) ?>"><?php echo htmlspecialchars ($author->name) ?></a>
<?php
}
?>
</div>
</div>
</p><br />
<?php
if (count ($tags) > 0) {
?>
<div class="entrySection">
<span><?php echo localize("tags.title") ?></span>
<div class="buttonEffect pad6">
<h3><?php echo localize("tags.title") ?>: </h3>
<p class="popupless">
<?php
$i = 0;
foreach ($tags as $tag) {
@ -78,44 +73,36 @@ $book->getLinkArray ();
<?php
}
?>
</div>
</div>
</p><br />
<?php
}
if (!is_null ($serie))
{
?>
<div class="entrySection">
<div class="buttonEffect pad6">
<a href="index.php<?php echo str_replace ("&", "&amp;", $serie->getUri ()) ?>"><?php echo localize("series.title") ?></a>
</div>
<h3><a href="index.php<?php echo str_replace ("&", "&amp;", $serie->getUri ()) ?>"><?php echo localize("series.title") ?></a>: </h3>
<?php echo str_format (localize ("content.series.data"), $book->seriesIndex, htmlspecialchars ($serie->name)) ?>
</div>
<br />
<?php
}
if ($book->getPubDate() != "")
{
?>
<div class="entrySection">
<span><?php echo localize("pubdate.title") ?></span>
<h3><?php echo localize("pubdate.title") ?>: </h3>
<?php echo $book->getPubDate() ?>
</div>
<?php
}
if ($book->getLanguages () != "")
{
?>
<div class="entrySection">
<span><?php echo localize("config.Language.label") ?></span>
<br />
<h3><?php echo localize("config.Language.label") ?>: </h3>
<?php echo $book->getLanguages () ?>
</div>
<?php
<?php
}
?>
</div>
<div class="clearer" />
<hr />
<div><?php echo localize("content.summary") ?></div>
<div class="content" <?php if (!isset ($page)) echo 'style="max-width:700px;"' ?>><?php echo $book->getComment (false) ?></div>
<hr />
</div>
<br />
<p><h4><?php echo localize("content.summary") ?></h4>
<?php if (!isset ($page)) ?><?php echo $book->getComment (false) ?></p>
</article>

View file

@ -14,7 +14,7 @@
* containing all the formats.
* BEWARE : it has to end with a /
*/
$config['calibre_directory'] = './';
$config['calibre_directory'] = './feedbook/';
/*
* SPECIFIC TO NGINX

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

After

Width:  |  Height:  |  Size: 1.3 KiB

105
index.php
View file

@ -46,10 +46,9 @@
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no" />
<title><?php echo htmlspecialchars ($currentPage->title) ?></title>
@ -61,6 +60,8 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="<?php echo $currentPage->favicon ?>" />
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox.css?v=2.1.3" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("style.css") ?>" media="screen" />
<link rel="stylesheet" href="//normalize-css.googlecode.com/svn/trunk/normalize.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300italic,800,300,400italic,600,600italic,700,700italic,800italic' rel='stylesheet' type='text/css' />
<script type="text/javascript">
$(document).ready(function() {
// Handler for .ready() called.
@ -98,7 +99,7 @@
<?php if ($isEink) echo ", openEffect : 'none', closeEffect : 'none', helpers : {overlay : null}"; ?>
});
$("#settingsImage").click(function(){
$(".headright").click(function(){
if ($("#tool").is(":hidden")) {
$("#tool").slideDown("slow");
$.cookie('toolbar', '1');
@ -151,21 +152,14 @@
<p><img src="images/ajax-loader.gif" alt="waiting" /> Please Wait</p>
</div>
<div class="container">
<div class="head">
<div class="headleft">
<a href="<?php echo $_SERVER["SCRIPT_NAME"] ?>">
<header>
<a class="headleft" href="<?php echo $_SERVER["SCRIPT_NAME"] ?>">
<img src="<?php echo getUrlWithVersion("images/home.png") ?>" alt="Home" />
</a>
</div>
<div class="headright">
<img id="settingsImage" src="<?php echo getUrlWithVersion("images/setting64.png") ?>" alt="Settings and menu" />
</div>
<div class="headcenter">
<p><?php echo htmlspecialchars ($currentPage->title) ?></p>
</div>
</div>
<div class="clearer" />
<div id="tool" <?php if ($withToolbar) echo 'style="display: none"' ?>>
</a>
<img class="headright" id="searchImage" src="<?php echo getUrlWithVersion("images/setting64.png") ?>" alt="Settings and menu" />
<h1><?php echo htmlspecialchars ($currentPage->title) ?></h1>
</header>
<aside id="tool" <?php if ($withToolbar) echo 'style="display: none"' ?>>
<div style="float: left; width: 60%">
<form action="index.php?page=9" method="get">
<div style="float: right">
@ -196,10 +190,9 @@
</div>
</div>
<?php } ?>
</div>
<div class="clearer" />
</aside>
<div id="content" style="display: none;"></div>
<div class="entries">
<section>
<?php
if ($page == Base::PAGE_BOOK_DETAIL)
{
@ -208,33 +201,29 @@
foreach ($currentPage->entryArray as $entry) {
if (get_class ($entry) != "EntryBook") {
?>
<div class="entry">
<div class="entryTitle"><?php echo htmlspecialchars ($entry->title) ?></div>
<div class="entryContent"><?php echo htmlspecialchars ($entry->content) ?></div>
<?php
foreach ($entry->linkArray as $link) {
?>
<a href="<?php echo $link->hrefXhtml () ?>" class="navigation">nav</a>
<?php
}
?>
</div>
<article>
<div class="frontpage">
<?php foreach ($entry->linkArray as $link) {?> <a href="<?php echo $link->hrefXhtml () ?>">
<h2><?php echo htmlspecialchars ($entry->title) ?></h2>
<?php } ?>
<h4><?php echo htmlspecialchars ($entry->content) ?></h4>
</a>
</div>
</article>
<?php
}
else
{
?>
<div class="book">
<div class="cover">
<?php
<article class="books">
<?php
if ($entry->book->hasCover) {
?>
<a rel="group" class="fancycover" href="<?php echo $entry->getCover () ?>"><img src="<?php echo $entry->getCoverThumbnail () ?>" alt="<?php echo localize("i18n.coversection") ?>" /></a>
<span class="cover"><a rel="group" class="fancycover" href="<?php echo $entry->getCover () ?>"><img src="<?php echo $entry->getCoverThumbnail () ?>" alt="<?php echo localize("i18n.coversection") ?>" /></a></span>
<?php
}
?>
</div>
<div class="download">
<h2 class="download">
<?php
$i = 0;
foreach ($config['cops_prefered_format'] as $format)
@ -243,49 +232,45 @@
if ($data = $entry->book->getDataFormat ($format)) {
$i++;
?>
<div class="button buttonEffect"><a href="<?php echo $data->getHtmlLink () ?>"><?php echo $format ?></a></div>
<?php
<a href="<?php echo $data->getHtmlLink () ?>"><?php echo $format ?></a><br />
<?php
}
}
?>
</div>
<div class="bookdetail">
<a class="navigation" href="<?php echo $entry->book->getDetailUrl () ?>" />
<div class="entryTitle st"><?php echo htmlspecialchars ($entry->title) ?>
</h2>
<a class="fancyabout" href="<?php echo $entry->book->getDetailUrl () ?>">
<div class="fullclickpopup">
<h2><?php echo htmlspecialchars ($entry->title) ?>
<?php
if ($entry->book->getPubDate() != "")
{
?>
<span class="sp">(<?php echo $entry->book->getPubDate() ?>)</span>
(<?php echo $entry->book->getPubDate() ?>)
<?php
}
?>
<span class="sr"><?php echo $entry->book->getRating () ?></span>
</div>
<div class="entryContent sa"><?php echo localize("authors.title") . " : " . htmlspecialchars ($entry->book->getAuthorsName ()) ?></div>
<div class="entryContent"><?php echo localize("tags.title") . " : " . htmlspecialchars ($entry->book->getTagsName ()) ?></div>
<?php echo $entry->book->getRating () ?></h2>
<h4><?php echo localize("authors.title") . " : </h4>" . htmlspecialchars ($entry->book->getAuthorsName ()) ?><br />
<h4><?php echo localize("tags.title") . " : </h4>" . htmlspecialchars ($entry->book->getTagsName ()) ?><br />
<?php
$serie = $entry->book->getSerie ();
if (!is_null ($serie)) {
?>
<div class="entryContent ss"><?php echo localize("series.title") . " : " . htmlspecialchars ($serie->name) . " (" . $entry->book->seriesIndex . ")" ?></div>
<h4><?php echo localize("series.title") . " :</h4> " . htmlspecialchars ($serie->name) . " (" . $entry->book->seriesIndex . ")" ?><br />
<?php
}
?>
</div>
</div>
?></div></a>
</article>
<?php
}
?>
<div class="clearer" />
<?php
}
?>
</div>
<div class="foot">
<div class="footright">
<a class="fancyabout" href="about.xml"><img src="<?php echo getUrlWithVersion("images/info.png") ?>" alt="Home" /></a>
</div>
</section>
<footer>
<a class="fancyabout" href="about.html"><img src="<?php echo getUrlWithVersion("images/info.png") ?>" alt="Home" /></a>
<?php
if ($currentPage->isPaginated ()) {
?>
@ -310,7 +295,7 @@
<?php
}
?>
</div>
</footer>
</div>
</body>
</html>

413
style.css
View file

@ -1,50 +1,205 @@
html
{
font-family: sans-serif;
font-size: 1em;
padding:0px;
margin:0px;
background-color:lightgray;
/* Global Box Sizing and Font-Smoothing */
*, *:after, *:before {
box-sizing:border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-font-smoothing:antialiased;
-moz-font-smoothing:antialiased;
-o-font-smoothing:antialiased;
font-smoothing:antialiased;
text-rendering:optimizeLegibility;
}
body
{
margin-top:0px;
html { font-size: 100%; -webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%; }
body {
font-family: 'Open Sans', sans-serif;
line-height:18px;
color: #1c1c1c; /* Lighter on the eyes than #000 Black */
margin: 0px; background: #cccccc; background-size: cover;
}
.container
img {
border: 0px;
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
}
/* ==========================================================================
Typography stuff goes here
========================================================================== */
h1,h2,h3,h4,h5,h6 { font-weight: bold; margin:0; padding:0;}
/*h1 see mediaqueries*/
h2 {font-size: 1.2em;}
h3 {font-size: 1.1em;}
h4 {font-size: 1.0em; }
h5 {font-size: 0.83em;}
h6 {font-size: 0.75em;}
a:hover, a:active { outline: none; }
a { color: #000066; font-weight: 800; text-decoration: none;}
a:visited { color:#414141 ; }
a:hover { color:#000; text-decoration: none; }
.frontpage a:hover { display:inline-block; width: 100%; background-color: #778899; /*Dirty IE Hack*/ zoom: 1; *display: inline;}
.link a:hover { display:inline-block; width: 100%; background-color: #778899; /*Dirty IE Hack*/ zoom: 1; *display: inline;}
img
{
margin:auto;
width:100%;
margin:0;
padding:0;
border:0;
}
/* =============================================================================
Main container stuff goes here and other globals
========================================================================== */
.container{
background: #414141; border:1px solid #000; border-radius:10px;
max-width:800px;width:95%;margin:0 auto;position:relative; }
.fancyabout { font-weight:400; text-decoration: none; }
/* =============================================================================
Header stuff goes here
========================================================================== */
header {
clear:both;
color:white;
text-align:center;
text-transform:uppercase;
display:block;
box-shadow:inset 0px -5px 8px #000000;
min-height:70px;
border-radius: 10px 10px 0px 0px;
}
.headleft {
float: left;
}
header h1{
float:none;
padding-top:25px;
text-shadow: 0px 4px 3px rgba(0,0,0,0.4),
0px 8px 13px rgba(0,0,0,0.1),
0px 18px 23px rgba(0,0,0,0.1);
}
.headright {
float: right;
}
/* =============================================================================
Section and Article stuff goes here
========================================================================== */
section {
clear:both;
background-color: #fff;
}
article {
border-bottom: 1px solid black;
max-width:800px;
}
.head
{
color:white;
background-color:black;
width:100%;
height:64px;
/*-------------frontpage article-------------*/
.frontpage h2 {
padding: 5px 0 0 5px;
}
.foot
.frontpage h4 {
padding: 5px 0 5px 20px;
font-style: italic;
}
/*-------------books article-------------*/
.books {
clear: both;
padding: 10px;
min-height: 90px;
}
.cover {
float:left;
margin: 0 10px 0 0;
min-width: 56px;
min-height: 70px;
}
.download {
float: right;
line-height:40px;
text-align: right;
}
.download a {
border-radius: 6px;
box-shadow:0 0 10px #000;
background: darkgray;
background: radial-gradient(#666, black);
color: #EEE;
text-decoration : none;
font-weight: bold;
padding: 5px 10px 5px 10px;
}
.books h4{
display: inline;
font-style: italic;
}
/*-------------books popup article-------------*/
.bookpopup h2{
margin: 15px 15px;
}
.bookpopup h3{
display:inline; /*Dirty IE Hack*/ zoom: 1; *display: inline;
}
.bookpopup p{
display:inline; /*Dirty IE Hack*/ zoom: 1; *display: inline;
}
.bookpopup h4{
border-top: 1px solid black;
}
.fullclickpopup{
display: block;
}
/* =============================================================================
Footer stuff goes here
========================================================================== */
footer
{
color:white;
background-color:black;
width:100%;
clear:both;
box-shadow:inset 0px 5px 8px #000000;
border-radius: 0px 0px 10px 10px;
height:32px;
}
footer a{
float: right;
}
/* =============================================================================
Aside stuff goes here
========================================================================== */
#tool
{
margin-top: 5px;
color:white;
background-color:black;
background: #414141;
width:100%;
height:32px;
overflow: hidden;
}
/*-------------Search Aside-------------*/
#tool input[type=text]
{
vertical-align: middle;
@ -69,138 +224,6 @@ display: block;
overflow: hidden;
}
img
{
margin:0;
padding:0;
border:0;
}
.headleft
{
float:left;
height:64px;
}
.headright
{
float:right;
height:64px;
cursor:pointer;
}
.footright
{
float:right;
height:32px;
}
.headcenter
{
margin:auto;
text-align:center;
font-size: 1.5em;
font-weight:bold;
height:64px;
display:table;
}
.footcenter
{
margin:auto;
text-align:center;
font-size: 1.3em;
font-weight:bold;
height:32px;
display:table;
}
.headcenter p, .footcenter p, .footcenter a
{
display: table-cell;
vertical-align: middle;
text-align: center;
line-height: 100%;
}
.clearer
{
clear:both;
}
.entries
{
background-color:lightgray;
margin-top: 5px;
}
.entry
{
background-color:white;
border-bottom:1px double black;
display:block;
padding:2px;
cursor: pointer;
margin-bottom:5px;
}
.book
{
background-color:white;
border-bottom:1px double black;
min-height:80px;
margin-bottom:5px;
}
.navigation
{
display:none;
}
.entryTitle
{
font-weight:bold;
font-size: 1.1em;
}
.entryContent
{
font-style:italic;
font-size: 0.9em;
margin-left: 10px;
}
.cover
{
float:left;
padding:5px 10px;
min-width: 56px;
min-height: 70px;
}
.download
{
float:right;
}
.button
{
height:36px;
display: table;
width:80px;
margin:2px;
}
.button p, .button a
{
display: table-cell;
vertical-align: middle;
text-align: center;
}
#loading
{
display:none;
@ -216,62 +239,34 @@ text-align: center;
padding-top: 120px;
}
.entrySection
{
margin-top: 8px;
margin-bottom: 18px;
line-height: 1.5em;
/* =============================================================================
Mediaquerie stuff goes here
========================================================================== */
/* 100px and greater */
@media only screen and (min-width: 100px) {
h1 {font-size: 1em;}
.container { width:100%; }
}
.entrySection span
{
font-style:italic;
font-size: 1em;
/* 320px and greater */
@media only screen and (min-width: 320px) {
h1 {font-size: 1.2em;}
}
.buttonEffect a
{
border-radius: 6px;
background: darkgray;
background: -moz-radial-gradient(#666, black);
background: -webkit-radial-gradient(#666, black);
background: -ms-radial-gradient(#666, black);
background: radial-gradient(#666, black);
color: #EEE;
text-decoration : none;
font-weight: bold;
/* 480px and greater */
@media only screen and (min-width: 480px) {
h1 {font-size: 1.5em;}
body { font-size: 1em;/*12px/16px */
font-weight:450; /* Better supported than 'lighter' attribute */
}
}
.pad6 a
{
padding: 6px;
}
.pad6
{
display: inline;
}
.bookdetail
{
color:black;
}
.bookpopup
{
min-width: 400px;
color:black;
}
.entries > .bookpopup, .entries > .bookdetail
{
background-color: white;
margin-bottom: 5px;
padding: 6px;
}
.content
{
line-height: 110%;
/* 810px and greater */
@media only screen and (min-width: 768px) {
h1 {font-size: 2em;}
.container { box-shadow:0 0 20px #000; }
body { margin: 5px;
font-size: 0.85em;/*12px/16px */
font-weight:400; /* Better supported than 'lighter' attribute */
}
}