connect($dbHost,$dbId,$dbPassword,$dbName); $sql="SELECT SUBSTR(entryDay, 1, 4) AS entryYear, COUNT(*) AS entryCount FROM ".$topicTb. " WHERE replace(entryDay,'/','')*1 <= $today*1 GROUP BY entryYear ORDER BY entryYear DESC;"; $yearArray=$db->getArray($sql,'ASSOC'); //表示年 if(isset($_GET['year']) && is_numeric($_GET['year'])){ $year = $_GET['year']; }else{ $year = $yearArray[0]['entryYear']; } //ページ if(isset($_GET['page']) && is_numeric($_GET['page'])){ $page = $_GET['page']; }else{ $page = 1; } //最大ページ foreach($yearArray as $line){ $yearCountArray[$line['entryYear']] = $line['entryCount']; } $maxPageNum = floor($yearCountArray[$year]/$entryListNum)+1; //記事の取得 $db->connect($dbHost,$dbId,$dbPassword,$dbName); $sql="SELECT *, SUBSTR(entryDay, 1, 4) AS entryYear FROM ".$topicTb ." WHERE replace(entryDay,'/','')*1 <= $today*1 AND entryYear = '$year' ORDER BY entryDay DESC LIMIT " .($page-1)*$entryListNum.", $entryListNum;"; $dataArray=$db->getArray($sql,'ASSOC'); //------------------------------------------------------------------ //HTMLの作成 $html=""; foreach($dataArray as $line){ $viewDate = changeDateJP($line['entryDay']); //new $html.='
'.$viewDate.' 
'."\n"; if( !$line['topicURL'] && (!$line['topicComment'] && !$line['filePath']) ){ $html.='
'.$line['topicTitle'].'
'."\n"; }else if($line['topicComment'] || $line['filePath']){ $html.='
'.$line['topicTitle'].'
'."\n"; }else{ $html.='
'.$line['topicTitle'].'
'."\n"; } } $nextlink=""; if($page < ($maxPageNum-1)){ $nextlink = '次へ'; } //------------------------------------------------------------------ //ローカルメニュー if(is_array($yearArray)){ $localmenu = ""; foreach($yearArray as $key => $line){ $val = $line['entryYear']; $class = ($year == $val) ? ' class="current"' : ''; $localmenu .= '
  • ' .$val.'年
  • '."\n"; } } //------------------------------------------------------------------ ?> 新着情報 | DPI・NGO 国連クラシックライブ協会

    新着情報 | DPI・NGO 国連クラシックライブ協会

    新着情報一覧