썸네일 사이즈 고정하는 방법이 궁금합니다. 정보
썸네일 사이즈 고정하는 방법이 궁금합니다.본문
<?
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 (!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>
상단부분에서 수정하면 될거 같은데 고정하는 방법을 모르겠어요 ㅜ
도와주세요.
댓글 전체
<img src=".$thumb." class=\"thumb\" /> 이부분에 width 와 height 를 넣어서 고정하시면 됩니다
<img src=".$thumb." class=\"thumb\" width=100 height=100/>
<img src=".$thumb." class=\"thumb\" width=100 height=100/>
그렇게 넣어봤는데 적용이 안되더라고요.
그리고 드림위버상에서는 소스가 오류라고 나왔습니다 ㅜ
도와주세요.
그리고 드림위버상에서는 소스가 오류라고 나왔습니다 ㅜ
도와주세요.
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\" />";
}
여기보면 이미지 출력되는 부분이 두군데가 있습니다(한군데는 노이미지 이므로 빼고)
위 두군데에 사이즈를 원하는 사이즈로 지정하시면 됩니다.
$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\" />";
}
여기보면 이미지 출력되는 부분이 두군데가 있습니다(한군데는 노이미지 이므로 빼고)
위 두군데에 사이즈를 원하는 사이즈로 지정하시면 됩니다.
사이즈 부분은 역시 넣어봤는데 오류가 나옵니다.
너무 어렵네요. ㅜㅜ
너무 어렵네요. ㅜㅜ