From bf0bb3170d8e3b0f4ff4a4237ab67c47ad0fc4bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 13 Sep 2013 09:54:19 +0200 Subject: [PATCH] Handle when $config['cops_recentbooks_limit'] is <= 0. fix #94 --- book.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/book.php b/book.php index cc2c5b6..b06a567 100644 --- a/book.php +++ b/book.php @@ -462,11 +462,13 @@ class Book extends Base { str_format (localize ("allbooks.alphabetical", $nBooks), $nBooks), "text", array ( new LinkNavigation ("?page=".parent::PAGE_ALL_BOOKS))); array_push ($result, $entry); - $entry = new Entry (localize ("recent.title"), - self::ALL_RECENT_BOOKS_ID, - str_format (localize ("recent.list"), $config['cops_recentbooks_limit']), "text", - array ( new LinkNavigation ("?page=".parent::PAGE_ALL_RECENT_BOOKS))); - array_push ($result, $entry); + if ($config['cops_recentbooks_limit'] > 0) { + $entry = new Entry (localize ("recent.title"), + self::ALL_RECENT_BOOKS_ID, + str_format (localize ("recent.list"), $config['cops_recentbooks_limit']), "text", + array ( new LinkNavigation ("?page=".parent::PAGE_ALL_RECENT_BOOKS))); + array_push ($result, $entry); + } return $result; }