<?php
$g4_path = '..';
include_once("{$g4_path}/common.php");

$i = 0;
$sql = " select * from {$g4['board_file_table']}";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
	$no = $row['bf_no'];
	$board['bo_table'] = $row['bo_table'];
	$file['path'] = "{$g4['path']}/data/file/{$row['bo_table']}";
	$file['size'] = filesize("{$file['path']}/{$row['bf_file']}");
	$file['datetime'] = date("Y-m-d H:i:s", @filemtime("{$g4['path']}/data/file/{$row['bo_table']}/{$row['bf_file']}"));
	$file['imgsize'] = @getimagesize("{$file['path']}/{$row['bf_file']}");
	$file_sql = " update `{$g4['board_file_table']}` set `bf_filesize` = '{$file['size']}', `bf_datetime` = '{$file['datetime']}', `bf_width` = '{$file['imgsize'][0]}', `bf_height` = '{$file['imgsize'][1]}', `bf_type` = '{$file['imgsize'][2]}' where `bo_table` = '{$row['bo_table']}' and `wr_id` = '{$row['wr_id']}' and `bf_no` = '{$row['bf_no']}' ";
	sql_query($file_sql);
}
?>