Пример #1
0
}
if (empty($_GET['page'])) {
    $intPage = 1;
} else {
    $intPage = intval($_GET['page']);
}
$strWhere = implode(' AND ', $arrWhere);
$strWhere = 'where ' . $strWhere;
$arrInfoList = $objWebInit->getInfoList($strWhere, '  ORDER BY topflag DESC,submit_date DESC', ($intPage - 1) * $arrGPage['page_size'], $arrGPage['page_size']);
$intRows = $arrInfoList['COUNT_ROWS'];
unset($arrInfoList['COUNT_ROWS']);
// 输出到模板
if ($intRows == '1') {
    //有单条记录
    $strUrl = $arrGWeb['WEB_ROOT_pre'] . '/' . $arrGWeb['module_id'] . '/detail.php?id=' . $arrInfoList[0]['id'];
    header("Location: {$strUrl}");
    exit;
}
//翻页跳转link
$strPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = $arrGWeb['URL_static'], '4');
// 输出到模板
$arrMOutput["smarty_assign"]['arrInfoList'] = $arrInfoList;
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['page'] = $intPage;
$arrMOutput["smarty_assign"]['arrMType'] = $arrMType;
$arrMOutput["smarty_assign"]['strSearchTitle'] = $strKeywords . "搜索结果";
$arrMOutput['smarty_assign']['Title'] = $strKeywords . '搜索结果 - ' . $arrGWeb['name'];
$arrMOutput['smarty_assign']['Description'] = $strKeywords . '搜索结果 - ' . $arrGWeb['name'];
$arrMOutput['smarty_assign']['Keywords'] = $strKeywords . '搜索结果 - ' . $arrGWeb['name'];
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'] . 'list.html';
$objWebInit->output($arrMOutput);
Пример #2
0
} elseif ($_GET['sort'] == 3) {
    $strOrder = ' ORDER BY ID DESC';
} elseif ($_GET['sort'] == 4) {
    $strOrder = ' ORDER BY ID ASC';
}
$arrLink[] = 'sort=' . $_GET['sort'];
if (!isset($_GET['page']) || $_GET['page'] == '') {
    $_GET['page'] = $arrGPage['page'];
}
$arrData = $objWebInit->getInfoList($strWhere, $strOrder, ($_GET['page'] - 1) * $arrGPage['page_size'], $arrGPage['page_size'], true);
//翻页跳转link
$strLink = '';
if (!empty($arrLink)) {
    $strLink = implode('&', $arrLink);
}
$strPage = $objWebInit->makeInfoListPage($arrData['COUNT_ROWS'], $strLink);
unset($arrData['COUNT_ROWS']);
$arrMType = $objWebInit->getTypeList();
// 取类别标题
if (is_array($arrMType) && !empty($arrMType)) {
    $objWebInit->makeTypeCache($arrGWeb['module_id']);
    foreach ($arrData as $k => $data) {
        foreach ($arrMType as $k1 => $type) {
            if ($data['type_id'] == $type['type_id']) {
                $arrData[$k]['type_title'] = $type['type_title'];
            }
        }
    }
}
// 输出到模板
$arrMOutput["template_file"] = "admin.html";