'; $gazo = '画像ファイル'; $xls = 'エクセルデータ'; $doc = 'ワードデータ'; $sonota = 'その他のファイル'; // 日本語の日付へ $news['date_jp'] = date('Y年m月d日', strtotime($news['date'])); // 添付ファイルカスタマイズ for ($i = 1; $i <= 3; $i++){ $file_col = 'file'.$i; $name_col = 'name'.$i; $down_col = 'down'.$i; $file_path = $_SERVER['DOCUMENT_ROOT'] . $news[$file_col]; $news[$down_col] = null; if ($news[$name_col] == '') $news[$name_col] = $news[$file_col]; if ($news[$file_col]){ //if ($news[$file_col] && file_exists($file_path)){ // $size = number_format((filesize($file_path))/1024,1); // file size $finfo = pathinfo($news[$file_col]); switch ($finfo["extension"]){ case "pdf": $icon = $pdf; break ; case "PDF": $icon = $pdf; break ; case "jpg": $icon = $gazo; break ; case "JPG": $icon = $gazo; break ; case "gif": $icon = $gazo; break ; case "GIF": $icon = $gazo; break ; case "xls": $icon = $xls; break ; case "XLS": $icon = $xls; break ; case "doc": $icon = $doc; break ; case "DOC": $icon = $doc; break ; default: $icon = $sonota; } // $news[$down_col] = sprintf('

%s %s (%sKB)

', $icon, $news[$file_col], $news[$name_col], $size); $news[$down_col] = sprintf('

%s %s

', $icon, $news[$file_col], $news[$name_col]); } } ?> <?php echo $news['title']; ?> | 花園中央公園駐車場

ページトップへ