COPS config: Add author name, uri and email

This commit is contained in:
Marsender 2013-10-10 05:25:04 +01:00
parent 35bbf55e19
commit 701cb291a8
3 changed files with 138 additions and 118 deletions

View file

@ -113,13 +113,13 @@ class OPDSRenderer
self::getXmlStream ()->endElement (); self::getXmlStream ()->endElement ();
self::getXmlStream ()->startElement ("author"); self::getXmlStream ()->startElement ("author");
self::getXmlStream ()->startElement ("name"); self::getXmlStream ()->startElement ("name");
self::getXmlStream ()->text (utf8_encode ("Sébastien Lucas")); self::getXmlStream ()->text ($page->authorName);
self::getXmlStream ()->endElement (); self::getXmlStream ()->endElement ();
self::getXmlStream ()->startElement ("uri"); self::getXmlStream ()->startElement ("uri");
self::getXmlStream ()->text ("http://blog.slucas.fr"); self::getXmlStream ()->text ($page->authorUri);
self::getXmlStream ()->endElement (); self::getXmlStream ()->endElement ();
self::getXmlStream ()->startElement ("email"); self::getXmlStream ()->startElement ("email");
self::getXmlStream ()->text ("sebastien@slucas.fr"); self::getXmlStream ()->text ($page->authorEmail);
self::getXmlStream ()->endElement (); self::getXmlStream ()->endElement ();
self::getXmlStream ()->endElement (); self::getXmlStream ()->endElement ();
$link = new LinkNavigation ("", "start", "Home"); $link = new LinkNavigation ("", "start", "Home");

View file

@ -360,6 +360,9 @@ class Page
{ {
public $title; public $title;
public $subtitle = ""; public $subtitle = "";
public $authorName = "";
public $authorUri = "";
public $authorEmail = "";
public $idPage; public $idPage;
public $idGet; public $idGet;
public $query; public $query;
@ -429,6 +432,9 @@ class Page
global $config; global $config;
$this->title = $config['cops_title_default']; $this->title = $config['cops_title_default'];
$this->subtitle = $config['cops_subtitle_default']; $this->subtitle = $config['cops_subtitle_default'];
$this->authorName = isset($config['cops_author_name']) ? $config['cops_author_name'] : utf8_encode('Sébastien Lucas');
$this->authorUri = isset($config['cops_author_uri']) ? $config['cops_author_uri'] : 'http://blog.slucas.fr';
$this->authorEmail = isset($config['cops_author_email']) ? $config['cops_author_email'] : 'sebastien@slucas.fr';
$database = GetUrlParam (DB); $database = GetUrlParam (DB);
if (is_array ($config['calibre_directory']) && is_null ($database)) { if (is_array ($config['calibre_directory']) && is_null ($database)) {
$i = 0; $i = 0;

View file

@ -3,7 +3,7 @@
* COPS (Calibre OPDS PHP Server) class file * COPS (Calibre OPDS PHP Server) class file
* *
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <sebastien@slucas.fr> * @author Sébastien Lucas <sebastien@slucas.fr>
*/ */
if (!isset($config)) if (!isset($config))
@ -37,6 +37,21 @@
*/ */
$config['cops_recentbooks_limit'] = '50'; $config['cops_recentbooks_limit'] = '50';
/*
* Catalog's author name
*/
$config['cops_author_name'] = "Sébastien Lucas";
/*
* Catalog's author uri
*/
$config['cops_author_uri'] = "http://blog.slucas.fr";
/*
* Catalog's author email
*/
$config['cops_author_email'] = "sebastien@slucas.fr";
/* /*
* Catalog's title * Catalog's title
*/ */
@ -212,4 +227,3 @@
* This item is used as regular expression so "." will force server side rendering for all devices * This item is used as regular expression so "." will force server side rendering for all devices
*/ */
$config['cops_server_side_render'] = "Kindle|EBRD1101|EBRD1201|cybook"; $config['cops_server_side_render'] = "Kindle|EBRD1101|EBRD1201|cybook";