本文整理汇总了PHP中Books::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP Books::GetList方法的具体用法?PHP Books::GetList怎么用?PHP Books::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Books
的用法示例。
在下文中一共展示了Books::GetList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Books
//功能部分
include $moduleRoot . 'model/' . 'books.class.php';
include $moduleRoot . 'model/' . 'books_class.class.php';
$books = new Books();
$books_class = new Books_class();
switch ($a) {
case 'list':
default:
//list
$pageListNum = 12;
//每页显示
$totalPage = 0;
//总页数
$page = isset($page) ? (int) $page : 1;
$start = ($page - 1) * $pageListNum;
$List = $books->GetList(array('id', 'classid', 'title', 'addtime', 'isok'), $start, $pageListNum, '', 'id desc');
include WEB_INC . "page.class.php";
$sqlNum = "select id from {tablepre}books";
$db->Execute($sqlNum);
$pageNum = $db->GetRsNum();
$totalPage = ceil($pageNum / $pageListNum);
//总页数
$pages = new PageClass($page, $totalPage);
$showpage = $pages->showPage();
if (is_file(WEB_TPL . 'books_list.tpl.php')) {
$templatefile = 'books_list.tpl.php';
} else {
$tpl_in_module = 1;
$templatefile = $moduleRoot . WEB_APP . 'templates/' . 'books_list.tpl.php';
}
break;
示例2: isset
if (empty($classid)) {
$topTitle = '列表';
}
//列表
if (empty($classid)) {
$where = ' isplay = 1 ';
} else {
$where = " classid = '" . $classid . "' and isplay = 1 ";
}
$pageListNum = 12;
//每页显示
$totalPage = 0;
//总页数
$page = isset($page) ? (int) $page : 1;
$start = ($page - 1) * $pageListNum;
$List = $books->GetList(array('id', 'classid', 'title', 'content', 'backcontent', 'niname', 'addtime'), $start, $pageListNum, $where, 'id desc');
include WEB_INC . "page.class.php";
$sqlNum = "select id from {tablepre}books where " . $where;
$db->Execute($sqlNum);
$pageNum = $db->GetRsNum();
$totalPage = ceil($pageNum / $pageListNum);
//总页数
$pages = new PageClass($page, $totalPage);
$showpage = $pages->showPage();
if (is_file(WEB_TPL . 'books_list.tpl.php')) {
$templatefile = 'books_list.tpl.php';
} else {
$tpl_in_module = 1;
$templatefile = $moduleRoot . 'templates/' . 'books_list.tpl.php';
}
if ($config['customtemplatemode'] == 1) {