썸네일 사이즈 고정하는 방법이 궁금합니다. > 그누4 질문답변

그누4 질문답변

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

썸네일 사이즈 고정하는 방법이 궁금합니다. 정보

썸네일 사이즈 고정하는 방법이 궁금합니다.

본문

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

$thumb_width = "150"; //썸네일 가로최대 크기
$thumb_height = "150"; //썸네일 세로최대 크기
include_once("$board_skin_path/thumb.lib.php");
?>
<link type="text/css" rel="stylesheet" href="<?=$board_skin_path?>/css/basic.css" />

<div class="title">

<div class="support">
<? if ($rss_href) { ?>
  <a href='<?=$rss_href?>'><img src='<?=$board_skin_path?>/img/btn_rss.gif' width="45" height="20" align="absmiddle"></a>
<? }?>
<? if ($admin_href) { ?>
  <a href="<?=$admin_href?>"><img src="<?=$board_skin_path?>/img/btn_admin.gif" width="47" height="20" align="absmiddle" title="관리자"></a>
<? }?>
</div>
</div><!-- //title -->

<!-- 게시판 목록 시작 -->
<form name="fboardlist" method="post">
<input type='hidden' name='bo_table' value='<?=$bo_table?>'>
<input type='hidden' name='sfl'  value='<?=$sfl?>'>
<input type='hidden' name='stx'  value='<?=$stx?>'>
<input type='hidden' name='spt'  value='<?=$spt?>'>
<input type='hidden' name='page' value='<?=$page?>'>
<input type='hidden' name='sw'  value=''>
<ul class="gallery_basic">
<?
for ($i=0; $i<count($list); $i++) {

$content = $list[$i][wr_content];
// 내용에서 <img.*> 태그의 전체 코드를 얻음
preg_match("/(<img[^>]+>)/i", $content, $matches);
$img = $matches[1];
// <img.*> 태그에서 src 의 코드만 얻음
preg_match("/src\=[\"\']?([^\"\'\s\>]+)/i", $img, $matches);
$src_editor = $matches[1];

$src_image = $g4[path]."/data/file/".$bo_table."/".$list[$i][file][0][file];

$thumb = $thumb_dir."/".$list[$i][file][0][file];
$thumb_editor = $thumb_dir."/".$list[$i][wr_id];

if (!file_exists($thumb)){ //업로드이미지 썸네일 생성
$thumb = create_thumb($src_image, $thumb_width, $thumb_height, $thumb);
} else if (!file_exists($thumb) && $src_editor ){ //업로드이미지가 없을시 에디터이미지 썸네일 생성
$thumb = create_thumb($real_img_url, $thumb_width, $thumb_height, $thumb_editor);
}

if ($list[$i][file][0][file]){
$print_thumb = "<a href=".$list[$i][href]."><img src=".$thumb." class=\"thumb\" /></a>";
} else  if ($src_editor){
$print_thumb = "<a href=".$list[$i][href]."><img src=".$thumb_editor." class=\"thumb\" /></a>";
} else {
$print_thumb = "<img src=\"{$board_skin_path}/img/noimage.jpg\" />";
}
?>
<li>
<?=$print_thumb?>
<p>
<? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? }?><a href="<?=$list[$i][href]?>" class="title"><?=$list[$i][subject]?></a><span class='comment'> <?=$list[$i][comment_cnt]?></span>
    </p>

</li>
<? }?>
</ul>
</form>


상단부분에서 수정하면 될거 같은데 고정하는 방법을 모르겠어요 ㅜ

도와주세요.

댓글 전체

if ($list[$i][file][0][file]){
$print_thumb = "<a href=".$list[$i][href]."><img src=".$thumb." class=\"thumb\" /></a>";
} else  if ($src_editor){
$print_thumb = "<a href=".$list[$i][href]."><img src=".$thumb_editor." class=\"thumb\" /></a>";
} else {
$print_thumb = "<img src=\"{$board_skin_path}/img/noimage.jpg\" />";
}

여기보면 이미지 출력되는 부분이 두군데가 있습니다(한군데는 노이미지 이므로 빼고)

위 두군데에 사이즈를 원하는 사이즈로 지정하시면 됩니다.
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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