<?
//파일 뽑기
$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result = sql_query($sql);
$cnt = 10;
for ($i=0; $row = sql_fetch_array($result); $i++) {
//썸네일 코드 시작
$data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조
$thumb_path = $data_path . '/thumbOpen';
$view_w = 90; //썸네일 가로사이즈
$view_h = 70; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $row[bf_file]; //파일명
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb))
{
$file = $data_path.'/'.$filename; //원본
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $view_h)
$dst = imagecreatetruecolor($view_w, $height);
else
$dst = imagecreatetruecolor($view_w, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
?>
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>')" onMouseOver="bgChange('view_img<?=$i?>');" onMouseOut="bgChange('view_img<?=$i?>');"><img src='<?=$thumb?>' border=1 width=90 height=70 style="border-color:#d5d5d5;"></a> <?
//onMouseOut="bgChange('clear');"
}
}
?>
제가사용중인 갤러리스킨 입니다 지금은 업로드시 메인사진과 함께 첨부한사진이 아래쪽으로
10장이 뿌려지는데 그것을 10장이아닌 20장으로 늘리고싶습니다.
limit 0, 10 <<이부분을 20으로고쳐보니 20장으로 늘어나긴했는데 가로로 쭉늘어나더군요.
10장씩끊어서 10장이넘어가면 아래쪽줄로 내려서 보여주고싶은데 도통모르겠습니다.ㅠㅠ
수정해야하는곳과 수정방법을 자세히알려주시면 정말 감사하겠습니다 ㅠㅠ
제가 초보라서 부탁드려요
//파일 뽑기
$sql = " select bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 10 ";
$result = sql_query($sql);
$cnt = 10;
for ($i=0; $row = sql_fetch_array($result); $i++) {
//썸네일 코드 시작
$data_path = $g4['path'] . "/data/file/{$bo_table}";//라이브러리 파일 참조
$thumb_path = $data_path . '/thumbOpen';
$view_w = 90; //썸네일 가로사이즈
$view_h = 70; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $row[bf_file]; //파일명
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb))
{
$file = $data_path.'/'.$filename; //원본
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $view_h)
$dst = imagecreatetruecolor($view_w, $height);
else
$dst = imagecreatetruecolor($view_w, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $sch_q);
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
?>
<a href="javascript:void(0);" onClick="View_Open('<?=$data_path?>/<?=$filename?>')" onMouseOver="bgChange('view_img<?=$i?>');" onMouseOut="bgChange('view_img<?=$i?>');"><img src='<?=$thumb?>' border=1 width=90 height=70 style="border-color:#d5d5d5;"></a> <?
//onMouseOut="bgChange('clear');"
}
}
?>
제가사용중인 갤러리스킨 입니다 지금은 업로드시 메인사진과 함께 첨부한사진이 아래쪽으로
10장이 뿌려지는데 그것을 10장이아닌 20장으로 늘리고싶습니다.
limit 0, 10 <<이부분을 20으로고쳐보니 20장으로 늘어나긴했는데 가로로 쭉늘어나더군요.
10장씩끊어서 10장이넘어가면 아래쪽줄로 내려서 보여주고싶은데 도통모르겠습니다.ㅠㅠ
수정해야하는곳과 수정방법을 자세히알려주시면 정말 감사하겠습니다 ㅠㅠ
제가 초보라서 부탁드려요
댓글 2개
게시글 목록
| 번호 | 제목 |
|---|---|
| 284255 | |
| 284248 | |
| 284247 | |
| 284246 | |
| 284242 | |
| 284238 | |
| 284234 | |
| 284233 | |
| 284229 | |
| 284224 | |
| 284222 | |
| 284215 | |
| 284213 | |
| 284212 | |
| 284209 | |
| 284208 | |
| 284201 | |
| 284193 | |
| 284192 | |
| 284174 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기