本文整理汇总了PHP中Books::previousBook方法的典型用法代码示例。如果您正苦于以下问题:PHP Books::previousBook方法的具体用法?PHP Books::previousBook怎么用?PHP Books::previousBook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Books
的用法示例。
在下文中一共展示了Books::previousBook方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bookPage
function bookPage()
{
$books = new Books();
$id = (int) $_GET['book'] + 0;
if (!isset($books[$id])) {
notFound();
}
$book = $books[$id];
global $tpl;
$tpl->assign('page_title', $book['title']);
$tpl->assign('menu_links', Path::menu('book'));
$tpl->assign('menu_links_admin', Path::menuAdmin('book'));
$tpl->assign('book', $book);
$tpl->assign('id', $book['id']);
$tpl->assign('displayStatus', displayStatus($book['status']));
$tpl->assign('displayAuthors', displayAuthors($book['author']));
$tpl->assign('displayNote', displayNote($book['note']));
$tpl->assign('country', $book['country']);
$tpl->assign('displayGenres', displayGenres($book['genre']));
$tpl->assign('token', getToken());
$tpl->assign('books_count', $books->count());
$tpl->assign('book_next', $books->nextBook($book['id']));
$tpl->assign('book_previous', $books->previousBook($book['id']));
$social_url = str_replace('./', BASE_URL, Path::book($book['id']));
$tpl->assign('social', ['title' => $book['title'], 'description' => ($book['status'] == Book::SEEN ? displaySimpleNote($book['note']) . ' — ' : '') . str_replace('<br />', '', displaySummary($book['summary'], 250)), 'image' => Books::CompleteImageURI($book), 'twitter' => urlencode(($book['status'] == Book::SEEN ? 'I’ve rated ' . $book['note'] . ' ' . String::pluralize('star', $book['note']) : 'I want to read') . ' “' . $book['title'] . '” from ' . $book['author'] . ' ' . $social_url), 'url' => $social_url]);
$tpl->draw('book');
exit;
}