コード例 #1
0
ファイル: index.php プロジェクト: TiMoChao/lc_ad_first
}
$strWhere = implode(' AND ', $arrWhere);
$strWhere = " WHERE user_id='{$_SESSION['user_id']}'" . $strWhere;
if (!isset($_GET['page']) || $_GET['page'] == '') {
    $_GET['page'] = $arrGPage['page'];
}
$arrData = $objWebInit->getInfoList($strWhere, ' ORDER BY submit_date DESC', ($_GET['page'] - 1) * $arrGPage['page_size'], $arrGPage['page_size']);
if ($arrData == "") {
    $arrData = null;
}
//翻页跳转link
$strLink = '';
if (!empty($arrLink)) {
    $strLink = implode('&', $arrLink);
}
$strPage = $objWebInit->makeInfoListPage($arrData['COUNT_ROWS'], $strLink);
unset($arrData['COUNT_ROWS']);
// 取类别标题
if (is_array($arrMType) && !empty($arrMType)) {
    foreach ($arrData as $k => $data) {
        foreach ($arrMType as $k1 => $type) {
            if ($data['type_id'] == $k1) {
                $arrData[$k]['type_title'] = $type;
            }
        }
    }
} else {
    $arrType = $objWebInit->getTypeList();
    foreach ($arrData as $k => $data) {
        foreach ($arrType as $k1 => $type) {
            if ($data['type_id'] == $type['type_id']) {
コード例 #2
0
ファイル: list.inc.php プロジェクト: TiMoChao/lc_ad_first
$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'], true);
$intRows = $arrInfoList['COUNT_ROWS'];
unset($arrInfoList['COUNT_ROWS']);
//静态url处理
$strLink = '';
if ($arrGWeb['URL_static']) {
    if (!empty($arrLink)) {
        $strLink = str_replace('=', '-', implode('-', $arrLink));
    }
} else {
    if (!empty($arrLink)) {
        $strLink = implode('&', $arrLink);
    }
}
//翻页跳转link
$strPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = $arrGWeb['URL_static']);
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
// 输出到模板
$arrMOutput["smarty_assign"]['arrInfoList'] = $arrInfoList;
$arrMOutput["smarty_assign"]['strPage'] = $strPage;
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'] . 'list.html';
$arrMOutput["smarty_assign"]['FileCallPath'] = $arrGPic['FileCallPath'];
$arrMOutput['smarty_assign']['Title'] = $strTitle . '列表' . $intPage . ' - ' . $arrGWeb['name'];
$arrMOutput['smarty_assign']['Description'] = $arrMOutput['smarty_assign']['Title'];
$arrMOutput['smarty_assign']['Keywords'] = $arrMOutput['smarty_assign']['Title'];
$objWebInit->output($arrMOutput);