当前位置: 首页>>代码示例>>PHP>>正文


PHP Book::getCount方法代码示例

本文整理汇总了PHP中Book::getCount方法的典型用法代码示例。如果您正苦于以下问题:PHP Book::getCount方法的具体用法?PHP Book::getCount怎么用?PHP Book::getCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Book的用法示例。


在下文中一共展示了Book::getCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetCountRecent

 public function testGetCountRecent()
 {
     global $config;
     $config['cops_recentbooks_limit'] = 0;
     $entryArray = Book::getCount();
     $this->assertEquals(1, count($entryArray));
     $config['cops_recentbooks_limit'] = 2;
     $entryArray = Book::getCount();
     $entryRecentBooks = $entryArray[1];
     $this->assertEquals("2 most recent books", $entryRecentBooks->content);
     $config['cops_recentbooks_limit'] = 50;
 }
开发者ID:horus68,项目名称:cops,代码行数:12,代码来源:bookTest.php

示例2: InitializeContent

 public function InitializeContent()
 {
     global $config;
     $this->title = $config['cops_title_default'];
     $this->subtitle = $config['cops_subtitle_default'];
     if (Base::noDatabaseSelected()) {
         $i = 0;
         foreach (Base::getDbNameList() as $key) {
             $nBooks = Book::getBookCount($i);
             array_push($this->entryArray, new Entry($key, "cops:{$i}:catalog", str_format(localize("bookword", $nBooks), $nBooks), "text", array(new LinkNavigation("?" . DB . "={$i}")), "", $nBooks));
             $i++;
             Base::clearDb();
         }
     } else {
         if (!in_array(PageQueryResult::SCOPE_AUTHOR, getCurrentOption('ignored_categories'))) {
             array_push($this->entryArray, Author::getCount());
         }
         if (!in_array(PageQueryResult::SCOPE_SERIES, getCurrentOption('ignored_categories'))) {
             $series = Serie::getCount();
             if (!is_null($series)) {
                 array_push($this->entryArray, $series);
             }
         }
         if (!in_array(PageQueryResult::SCOPE_PUBLISHER, getCurrentOption('ignored_categories'))) {
             $publisher = Publisher::getCount();
             if (!is_null($publisher)) {
                 array_push($this->entryArray, $publisher);
             }
         }
         if (!in_array(PageQueryResult::SCOPE_TAG, getCurrentOption('ignored_categories'))) {
             $tags = Tag::getCount();
             if (!is_null($tags)) {
                 array_push($this->entryArray, $tags);
             }
         }
         if (!in_array(PageQueryResult::SCOPE_RATING, getCurrentOption('ignored_categories'))) {
             $rating = Rating::getCount();
             if (!is_null($rating)) {
                 array_push($this->entryArray, $rating);
             }
         }
         if (!in_array("language", getCurrentOption('ignored_categories'))) {
             $languages = Language::getCount();
             if (!is_null($languages)) {
                 array_push($this->entryArray, $languages);
             }
         }
         foreach ($config['cops_calibre_custom_column'] as $lookup) {
             $customId = CustomColumn::getCustomId($lookup);
             if (!is_null($customId)) {
                 array_push($this->entryArray, CustomColumn::getCount($customId));
             }
         }
         $this->entryArray = array_merge($this->entryArray, Book::getCount());
         if (Base::isMultipleDatabaseEnabled()) {
             $this->title = Base::getDbName();
         }
     }
 }
开发者ID:Klemart3D,项目名称:COPS,代码行数:59,代码来源:base.php

示例3: AdminPage

<?php

require_once "config.php";
require_once WWW_DIR . "/lib/adminpage.php";
require_once WWW_DIR . "/lib/book.php";
$page = new AdminPage();
$book = new Book();
$page->title = "Book List";
$concount = $book->getCount();
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$page->smarty->assign('pagertotalitems', $concount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/book-list.php?offset=");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$booklist = $book->getRange($offset, ITEMS_PER_PAGE);
$page->smarty->assign('booklist', $booklist);
$page->content = $page->smarty->fetch('book-list.tpl');
$page->render();
开发者ID:scriptzteam,项目名称:newzNZB-premium-indexer,代码行数:20,代码来源:book-list.php


注:本文中的Book::getCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。