getAll($strSQL, array(), DB_FETCHMODE_ASSOC ); if ( DB::isError($results) || is_null($results) || !is_array($results) || count($results) <= 0 ) { $results = array(); } foreach($results as $row) { if ( substr( $row['pub'], PUB_JIR - 1, 1 ) == '0' ) continue; $temp[$row['id']] = $row; $ii = count($temp); $row[0] = $ii--; $lists[$row['id']] = $row; } // ///////////////////////////////////////////////////////////////////////// // ■ HTMLファイル出力 ///////////////////////////////////////////////////// // テンプレートクラスを生成する $objTmpl = New Tmpl2('index_tpl.html'); // 各種インクルード設定 $objTmpl->assign ( "INC_HEADER", file_exists(INC_HEADER) ? file_get_contents(INC_HEADER) : '' ); $objTmpl->assign ( "INC_FOOTER", file_exists(INC_FOOTER) ? file_get_contents(INC_FOOTER) : '' ); $objTmpl->assign ( "INC_META", file_exists(INC_META) ? file_get_contents(INC_META) : '' ); // 最終更新日 $objTmpl->assign ( "UPDDATE", htmlspecialchars( $upddate ) ) ; $objTmpl->assign ( "COPY", sprintf( $topcopy ) ); $objTmpl->assign ( "CITEM1", sprintf( $citem1 ) ); $objTmpl->assign ( "CITEM2", sprintf( $citem2 ) ); $objTmpl->assign ( "CITEM3", sprintf( $citem3 ) ); $objTmpl->assign ( "CITEM4", sprintf( $citem4 ) ); // ページリスト作成 $cnt = count($lists); if ( $param->value["P"] == '' ) { $p = 1; } else { $p = intval($param->value["P"]); } $pttl = intval( ( $cnt - 1 ) / PAGE_MAX ) + 1; if ( $p > 1 ) { $objTmpl->assign_def ( "SHOW_PREV" ) ; $objTmpl->assign ( "PAGE_PREV", $p - 1 ) ; } if ( $p < $pttl ) { $objTmpl->assign_def ( "SHOW_NEXT" ) ; $objTmpl->assign ( "PAGE_NEXT", $p + 1 ) ; } if ( is_array( $lists ) ) { $objTmpl->loopset ( "ROWS_PAGE" ) ; for ( $ii = 1 ; $ii <= $pttl ; $ii++ ) { if ( $ii != $p ) { $objTmpl->assign ( "SHOW_LINK", "" ) ; } else { $objTmpl->assign ( "DISABLE_LINK", "" ) ; } $objTmpl->assign ( "PAGE_NUM", $ii ) ; $objTmpl->loopnext( "ROWS_PAGE" ) ; } $objTmpl->loopend ( "ROWS_PAGE" ) ; } $objTmpl->assign ( "PAGE", htmlspecialchars( $p ) ) ; // 事例一覧表示 if ( is_array( $lists ) ) { $objTmpl->loopset ( "JIREI_ROWS" ) ; $objTmpl->loopset ( "JIREI_COLS" ) ; $cc = 0; $stpos = ( PAGE_MAX * ( $p - 1 ) ) + 1; $edpos = ( PAGE_MAX * $p ); $ii = 0; foreach( $lists as $key => $row ){ if ( $stpos > ++$ii ) continue; if ( $edpos < $ii ) break; if ( ++$cc > LIST_COLS ) { $objTmpl->loopend ( "JIREI_COLS" ) ; $objTmpl->loopnext( "JIREI_ROWS" ) ; $objTmpl->loopset ( "JIREI_COLS" ) ; $cc = 1; } $objTmpl->assign ( "JIREI_ON", '' ) ; $objTmpl->assign ( "ID", htmlspecialchars( $key ) ) ; $objTmpl->assign ( "TITLE", htmlspecialchars( mb_strimwidth( $row['title'], 0, 100, '…' ) ) ); $objTmpl->assign ( "NAME", htmlspecialchars( $row['name'] ) ) ; $objTmpl->assign ( "CAT", ( isset($TBL_CAT[$row['cat']]) ) ? htmlspecialchars( $TBL_CAT[$row['cat']] ) : '' ); if ( $p > 1 ) { $objTmpl->assign ( "P_PAGE", '&P='.htmlspecialchars( $p ) ) ; } else { $objTmpl->assign ( "P_PAGE", '' ) ; } if ( file_exists(PATH_UPIMG.$row['mimg']) && $row['mimg'] != '' ) { list( $w, $h ) = getImageSizeXY( PATH_UPIMG.'jir_'.$row['mimg'], false, false ) ; } else { $w = SIZE_JIRIMG_W; $h = SIZE_JIRIMG_H; } $objTmpl->assign ( "IMG_W", htmlspecialchars( $w ) ) ; $objTmpl->assign ( "IMG_H", htmlspecialchars( $h ) ) ; $objTmpl->loopnext( "JIREI_COLS" ) ; } for ( ; $cc < LIST_COLS ; $cc++ ) { $objTmpl->loopnext ( "JIREI_COLS" ) ; } $objTmpl->loopend ( "JIREI_COLS" ) ; $objTmpl->loopnext( "JIREI_ROWS" ) ; $objTmpl->loopend ( "JIREI_ROWS" ) ; } // HTML出力 disableBrowsercache() ; $objTmpl->flush() ; ?>