테스트 사이트 - 개발 중인 베타 버전입니다

썸네일 생성 어떻게 해야 되나요?;

<script src="<?=$g4[path]?>/js/b4.common.js"></script>
<?
include_once("./_common.php");

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가


////////////////basic cf control///////////
$g4[g4_board_file] = "g4_board_file";
$one_rows = "4"; // 출력수량

//jpg, jpeg, gif, png 파일만 검색한다.
$one_like = " bf_file LIKE '%jpg' or bf_file LIKE '%jpeg' or bf_file LIKE '%gif' or bf_file LIKE '%png' ";

$one_count_sql = " select count(*) as cnt from $g4[g4_board_file] where $one_like ";
$row = sql_fetch($one_count_sql);
$total_count = $row[cnt];


$one_sql = " select * from $g4[g4_board_file] where $one_like order by bf_datetime desc limit $from_record, $one_rows";
$one_result = sql_query($one_sql);
$cols = 4; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 0; // 이미지 상하 간격
$to_record = $from_record+25
?>
<!-----------기간별 출력시작--------->
<table width=100% cellpadding=0 cellspacing=0 style="border-top:1px solid #e7e7e7">
<tr><td height="10"></td></tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<?//출력
for ($i=0; $one_row = sql_fetch_array($one_result); $i++){
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }

?>

<!-- 내용 출력 -->

<td valign=top align="center" width="70">
<table width="80" height="70" border="0" cellpadding="0" cellspacing="0" bgcolor='#ECECEC' onMouseOver="bgColor='#71AEFE'" onMouseOut="bgColor='#ECECEC'">
<tr><td align="center"><table bgcolor="#FFFFFF" width="70" height="60" border="0" cellpadding="0" cellspacing="0">
<tr><td align="center"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$one_row[bo_table]?>&wr_id=<?=$one_row[wr_id]?>' onfocus='this.blur()'><img src="<?=$g4[path]?>/data/file/<?=$one_row[bo_table]?>/<?=$one_row[bf_file]?>" border="0" width='70' height='60'></a></td></tr>
</table></td></tr>
</table>
</td>
<? } ?>
</tr>
<tr><td width="150" height="0"></td><td width="150" height="0"></td><td width="150" height="0"></td><td width="150" height="0"></td><td width="150" height="0"></td></tr>

</table>
<br>

위 소스를 image_all.php 에 넣고 인클루드 해서 전체 이미지 불러오기 식으로 사용중인데요...
큰 이미지는 깨지고 그래서 출력 화면에 이상하게 나옵니다... 위 소스를 사용하고 싶은데 섬네일을 어떻게 사용해야 되나요?;

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 6개

불당썸을 사용하는것 같아서 thumb.lib.php라인 추가하였으며,
테스트는 해 보지 않았습니다 ^^

<script src="<?=$g4[path]?>/js/b4.common.js"></script>
<?
include_once("./_common.php");
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

include_once("$g4[path]/lib/thumb.lib.php");
////////////////basic cf control///////////
$g4[g4_board_file] = "g4_board_file";
$one_rows = "4"; // 출력수량

//jpg, jpeg, gif, png 파일만 검색한다.
$one_like = " bf_file LIKE '%jpg' or bf_file LIKE '%jpeg' or bf_file LIKE '%gif' or bf_file LIKE '%png' ";

$one_count_sql = " select count(*) as cnt from $g4[g4_board_file] where $one_like ";
$row = sql_fetch($one_count_sql);
$total_count = $row[cnt];


$one_sql = " select * from $g4[g4_board_file] where $one_like order by bf_datetime desc limit $from_record, $one_rows";
$one_result = sql_query($one_sql);
$cols = 4; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 0; // 이미지 상하 간격
$to_record = $from_record+25
?>
<!-----------기간별 출력시작--------->
<table width=100% cellpadding=0 cellspacing=0 style="border-top:1px solid #e7e7e7">
<tr><td height="10"></td></tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<?//출력
$thumb_width = "70";
$thumb_height = "60";
for ($i=0; $one_row = sql_fetch_array($one_result); $i++){
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
$file_path = $g4[path]."/data/file/".$one_row[bo_table];
$file_name = $file_path."/".$one_row[bf_file];
$img = thumbnail($file_name, $thumb_width, $thumb_height, false, 2, 100, false, "", "", $latest_skin_path."/img/no_image.gif");

$img_href = $g4[bbs_path]."/board.php?bo_table=".$one_row[bo_table]."&wr_id=".$one_row[wr_id];
$img = "<div style='width:{$thumb_width}px; height:{$thumb_height}px; background-color:#FFFFFF; text-align:center'>";
$img.= "<a href='$img_href' onfocus='this.blur()'><img src='$imgf_source' border="0" width='{$thumb_width}' height='{$thumb_height}'></a>";
$img.= "</div>";
?>

<!-- 내용 출력 -->

<td valign=top align="center" width="70">
<table width="80" height="70" border="0" cellpadding="0" cellspacing="0" bgcolor='#ECECEC' onMouseOver="bgColor='#71AEFE'" onMouseOut="bgColor='#ECECEC'">
<tr><td align="center"><?=$img?></td></tr>
</table>
</td>
<? } ?>
</tr>
<tr><td width="150" height="0"></td><td width="150" height="0"></td><td width="150" height="0"></td><td width="150" height="0"></td><td width="150" height="0"></td></tr>

</table>
<br>
허접제국님, 42라인에 오류가 나네요...
Parse error: syntax error, unexpected T_LNUMBER in
/home hosting_users/test/www/image_all.php on line 42
위처럼 오류가 납니다... 어떻게 해야 할까요?;;
$img.= "<a href='$img_href' onfocus='this.blur()'><img src='$imgf_source' border="0" width='{$thumb_width}' height='{$thumb_height}'></a>"; 이 줄인거 같은데...
border="0"이 잘못된것 같네요
border='0'
border='0' 로 수정후 오류는 안나는데 이미지가 ?로 되서 안나오네요... 플렉스로 만든 로컬 프로그램인데 거기서 image_all.php 파일을 인클루드 하였습니다.
$img = thumbnail($file_name, $thumb_width, $thumb_height, false, 2, 100, false, "", "", $latest_skin_path."/img/no_image.gif");

$img_source = thumbnail($file_name, $thumb_width, $thumb_height, false, 2, 100, false, "", "", $latest_skin_path."/img/no_image.gif");

그리고 잘못 적어드렸는데 $imgf_source가 아니라 $img_source 입니다. ^^
게시판의 우상단을 보면 스킨설정이 있습니다. 그 설정을 누르셔서 썸네일형을 선택하신후 썸네일의 크기를 수정해주면 됩니다.

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440