게시판 목록 수정
본문
위의.. (A)와 (B) 간격을 없애고, 사진이 정돈 되도록 할려면..
어떤 소스를 수정해야 되는지.. 알려주시면 감사해요..^^
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
?>
<style>
/* 리스트 효과 */
a{color:#666; text-decoration:none; outline:none;}
img,.searchtxt,.searchbtn,.pinglun input.submit{border:0;}
ol,ul,li{list-style:none;}
dl,dt,dd,ul,li{margin:0;padding:0;}
input,textarea{outline:none;}
html,body,form,p,div,h1,h2,h3,h4,h5,h6{-webkit-text-size-adjust:none; font-weight:normal;}
.common{margin:0 auto; width:850px; position:relative;}
.common ul li{margin-left:9px;}
.clear{clear:both;}
.summary{background:#333;}
.listbox{float:left; margin-bottom:20px; padding:10px; _padding:10px 10px 8px 10px ;background:#f6f6f6; width:180px; height:210px; position:relative;}
.listimg{float:left; width:180px; height:150px; position:relative; overflow:hidden;}
.listimg img{background:#333; width:180px; height:150px; top:0; left:0; position:absolute;}
.listinfo{_margin-bottom:3px; padding-left:10px; width:170px; line-height:18px; font-size:12px;}
.listinfo a{font-size:12px;}
.listtitle{float:left; margin-top:8px; _margin-top:-2px; width:170px; font-size:13px;}
.listtitle a{font-size:13px;}
.listtitle a:hover{color:#f55555;}
.listtag{float:left;padding-left:0px;background:url(<?=$board_skin_url?>/img/taglist.gif) 0 5px no-repeat;width:180px;color:#999;}
.listtag a{margin:0 8px 0 0;margin:2px 8px -2px 0\9;_margin:0 8px 0 0;color:#999;}
.listtag a:hover{color:#2ad2bb;}
.listdate{float:left;margin-right:13px;padding-left:0px;background:url(<?=$board_skin_url?>/img/time.gif) 0 5px no-repeat;color:#999;}
.listview{float:left;margin-right:13px;padding-left:24px;background:url(<?=$board_skin_url?>/img/view.gif) 0 5px no-repeat;color:#999;}
.listcomment{float:left;margin-right:13px;padding-left:20px;background:url(<?=$board_skin_url?>/img/comment.gif) 0 5px no-repeat;color:#999;}
.listdemo a{float:left;margin-top:0;margin-top:2px\9;_margin-top:0;color:#999;white-space:nowrap;}
.listdemo a:hover{color:#2ad2bb;}
</style>
<div id="bo_gall" style="width:<?php echo $width; ?>">
<?php if ($is_checkbox) { ?>
<?php } ?>
<table>
<tr>
<td width="5"></td>
<td>
<?php if ($is_category) { ?>
<nav id="bo_cate">
<h2><?php echo $board['bo_subject'] ?> 카테고리</h2>
<ul id="bo_cate_ul">
<?php echo $category_option ?>
</ul>
</nav>
</td></tr>
<table>
<?php } ?>
<table><tr><td>
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" onsubmit="return fboardlist_submit(this);" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="sw" value="">
<div class="common">
<ul>
<?php for ($i=0; $i<count($list); $i++) {
if($i>0 && ($i % $bo_gallery_cols == 0))
$style = 'clear:both;';
else
$style = '';
if ($i == 0) $k = 0;
$k += 1;
if ($k % $bo_gallery_cols == 0) $style .= "margin:0 !important;";
?>
<li class="listbox mr20">
<div class="listimg">
<a href="<?php echo $list[$i]['href'] ?>">
<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<strong style="width:<?php echo $board['bo_gallery_width'] ?>px;height:<?php echo $board['bo_gallery_height'] ?>px">공지</strong>
<?php } else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height']);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;height:'.$board['bo_gallery_height'].'px">no image</span>';
}
echo $img_content;
}
?>
</a>
</div>
<div class="listinfo">
<div class="listtitle"><a href="<?php echo $list[$i]['href'] ?>"><?php echo $list[$i]['subject'] ?></a></div>
<div class="listtag">
<?php if ($is_category && $list[$i]['ca_name']) {?>
<a href="<?php echo $list[$i]['ca_name_href'] ?>" class="bo_cate_link"><?php echo $list[$i]['ca_name'] ?></a>
<?php } ?>
<?php echo $list[$i]['name'] ?>
</div>
<div class="listdate"><?php echo $list[$i]['datetime'] ?></div>
<div class="listview"><?php echo $list[$i]['wr_hit']; ?></div>
<div class="listcomment"><?php echo $list[$i]['comment_cnt']; ?></div>
<div class="listdemo">
<?php if ($is_checkbox) { ?>
<label for="chk_wr_id_<?php echo $i ?>" class="sound_only"><?php echo $list[$i]['subject'] ?></label>
<input type="checkbox" name="chk_wr_id[]" value="<?php echo $list[$i]['wr_id'] ?>" id="chk_wr_id_<?php echo $i ?>">
<?php } ?>
</div>
</div>
</li>
<?php } ?>
<?php if (count($list) == 0) { echo "<li class=\"empty_list\">게시물이 없습니다.</li>"; } ?>
</ul>
</div>
</form>
</td></tr></table>
<table><tr><td>
<?php if ($list_href || $is_checkbox || $write_href) { ?>
<div class="common">
<?php if ($is_checkbox) { ?>
<?php } ?>
<?php if ($list_href || $write_href) { ?>
<ul class="btn_bo_user">
<?php if ($list_href) { ?><li><a href="<?php echo $list_href ?>" class="btn_b01">목록</a></li><?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02">글 작성하기</a></li><?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</td></tr></table>
</div>
<?php if($is_checkbox) { ?>
<noscript>
<p>자바스크립트를 사용하지 않는 경우<br>별도의 확인 절차 없이 바로 선택삭제 처리하므로 주의하시기 바랍니다.</p>
</noscript>
<?php } ?>
<!-- 페이지 -->
<?php echo $write_pages; ?>
<?php if ($is_checkbox) { ?>
<script>
function all_checked(sw) {
var f = document.fboardlist;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]")
f.elements[i].checked = sw;
}
}
function fboardlist_submit(f) {
var chk_count = 0;
for (var i=0; i<f.length; i++) {
if (f.elements[i].name == "chk_wr_id[]" && f.elements[i].checked)
chk_count++;
}
if (!chk_count) {
alert(document.pressed + "할 게시물을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택복사") {
select_copy("copy");
return;
}
if(document.pressed == "선택이동") {
select_copy("move");
return;
}
if(document.pressed == "선택삭제") {
if (!confirm("선택한 게시물을 정말 삭제하시겠습니까?\n\n한번 삭제한 자료는 복구할 수 없습니다\n\n답변글이 있는 게시글을 선택하신 경우\n답변글도 선택하셔야 게시글이 삭제됩니다."))
return false;
f.removeAttribute("target");
f.action = "./board_list_update.php";
}
return true;
}
// 선택한 게시물 복사 및 이동
function select_copy(sw) {
var f = document.fboardlist;
if (sw == 'copy')
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = "./move.php";
f.submit();
}
</script>
<?php } ?>
<!-- } 게시판 목록 끝 -->
답변 3
lib/thumbnail.lib.php 파일에서 $is_crop=true 로 수정
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
수정 후 환경설정 > 썸네일파일 일괄삭제
작은별님 말씀 대로 해도 되구 스킨섭네일 제작 하는 부분에서 true 로 넣어주셔도 됩니다.
- 게시판 관리페이지에서 설정
.listimg{float:left; width:180px; height:150px; position:relative; overflow:hidden;}
.listimg img{background:#333; width:180px; height:150px; top:0; left:0; position:absolute;}
위소스 height:150px; 높이를 이미지 높이에 맟춰서 수정해보세요