썸네일 생성 어떻게 해야 되나요?; > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

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

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

본문

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

댓글 전체

불당썸을 사용하는것 같아서 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' 로 수정후 오류는 안나는데 이미지가 ?로 되서 안나오네요... 플렉스로 만든 로컬 프로그램인데 거기서 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 입니다. ^^
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT