Add the number of book in each databases (multidatabase).
This commit is contained in:
parent
c937a29d6c
commit
c6e75b7258
6
base.php
6
base.php
|
@ -375,10 +375,12 @@ class Page
|
||||||
if (is_array ($config['calibre_directory']) && is_null ($database)) {
|
if (is_array ($config['calibre_directory']) && is_null ($database)) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($config['calibre_directory'] as $key => $value) {
|
foreach ($config['calibre_directory'] as $key => $value) {
|
||||||
array_push ($this->entryArray, new Entry ($key, "{$i}:cops:catalog",
|
$nBooks = Book::getBookCount ($i);
|
||||||
"", "text",
|
array_push ($this->entryArray, new Entry ($key . " " . $i, "{$i}:cops:catalog",
|
||||||
|
str_format (localize ("bookword", $nBooks), $nBooks), "text",
|
||||||
array ( new LinkNavigation ("?" . DB . "={$i}"))));
|
array ( new LinkNavigation ("?" . DB . "={$i}"))));
|
||||||
$i++;
|
$i++;
|
||||||
|
Base::clearDb ();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
array_push ($this->entryArray, Author::getCount());
|
array_push ($this->entryArray, Author::getCount());
|
||||||
|
|
6
book.php
6
book.php
|
@ -382,6 +382,12 @@ class Book extends Base {
|
||||||
$this->getComment (), "text/html",
|
$this->getComment (), "text/html",
|
||||||
$this->getLinkArray (), $this);
|
$this->getLinkArray (), $this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getBookCount($database = NULL) {
|
||||||
|
global $config;
|
||||||
|
$nBooks = parent::getDb ($database)->query('select count(*) from books')->fetchColumn();
|
||||||
|
return $nBooks;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getCount() {
|
public static function getCount() {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
Loading…
Reference in a new issue