$where = " classid = '" . $classid . "' and isplay = 1 "; } if (isset($filename) && !empty($filename)) { $where = $where . " and `classid` = '" . $info['id'] . "' "; } $pageListNum = 12; //每页显示 //20120715 if (intval($info['listnum']) > 0) { $pageListNum = $info['listnum']; } $totalPage = 0; //总页数 $page = isset($page) ? (int) $page : 1; $start = ($page - 1) * $pageListNum; $List = $downloads->GetList(array('id', 'classid', 'title', 'filename', 'addtime', 'thumb', 'intro', 'titlecolor', 'author', 'clicks', 'istop'), $start, $pageListNum, $where, 'istop desc,addtime desc,id desc'); include WEB_INC . "page.class.php"; $sqlNum = "select id from {tablepre}downloads 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 . 'downloads_list.tpl.php')) { $templatefile = 'downloads_list.tpl.php'; } else { $tpl_in_module = 1; $templatefile = $moduleRoot . 'templates/' . 'downloads_list.tpl.php'; } if ($config['customtemplatemode'] == 1) {
case 'list': default: //list //列表 if (empty($classid)) { $where = ' 1 = 1 '; } else { $where = " classid = '" . $classid . "' "; } $pageListNum = 12; //每页显示 $totalPage = 0; //总页数 $page = isset($page) ? (int) $page : 1; $start = ($page - 1) * $pageListNum; $List = $downloads->GetList(array('id', 'classid', 'title', 'addtime'), $start, $pageListNum, $where, 'id desc'); include WEB_INC . "page.class.php"; $sqlNum = "select id from {tablepre}downloads 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 . 'downloads_list.tpl.php')) { $templatefile = 'downloads_list.tpl.php'; } else { $tpl_in_module = 1; $templatefile = $moduleRoot . WEB_APP . 'templates/' . 'downloads_list.tpl.php'; } break;