setFetchMode(DB_FETCHMODE_ASSOC); #設定取得 $sql="SELECT * FROM whatsnew_conf"; $resConf=$db->query($sql); if (DB::isError($resConf)){ die ($sql."
".$resConf->getMessage()); } while($rowConf=$resConf->fetchRow()){ $CONF[$rowConf['key']]=$rowConf['value']; } #データ取得 $sNowDate=date("Y/n/j"); $sql="SELECT * FROM whatsnew WHERE start_date <= '$sNowDate' AND (end_date>='$sNowDate' OR limit_flg=1) ORDER BY update_date DESC"; $resData=$db->query($sql); if (DB::isError($resData)){ die ($sql."
".$resData->getMessage()); } $nDataRows=$resData->NumRows(); ?> 新着情報 新着情報はありません HTML; }else{ print << HTML; while($rowData=$resData->fetchRow()){ $nDateDiff=(strtotime($sNowDate)-strtotime($rowData['update_date']))/60/60/24; if($nDateDiff<$CONF['new_expire']){ $bNew=1; }else{ $bNew=0; } $sUpdateDate=date("Y/m/d",strtotime($rowData['update_date'])); $sContent=nl2br(htmlspecialchars($rowData['content'])); $sLink=htmlspecialchars($rowData['link']); print << $sUpdateDate  HTML; if($bNew){ print << NEW HTML; } print <<
HTML; if($sLink==""){ print $sContent; }else{ print <<$sContent HTML; } print <<
HTML; } } ?>