메인화면 최근 게시물좀 봐주세요... 정보
메인화면 최근 게시물좀 봐주세요...본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://cjns.co.kr
위 주소로 가보시면 갤러리 형식 최근 게시물이 다닥다닥 붙어 있습니다...
저기 사이 간격을 줄려면 어떻게 해야하죠???
소스는------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 4; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 10; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<style type="text/css">
<!--
.data { font-family:돋움; font-size:8pt; color:#999999; }
-->
</style>
<table border="0" cellspacing="0" cellpadding="0">
<!-- 최신글 제목 -->
<tr><td>
</td></tr>
<tr><td height='10'></td></tr>
<tr>
<td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
//섬네일 관련 설정
$thumb_width= 100;//섬네일 최대폭
$thumb_height= 85;//섬네일 최대높이
// 파일 출력
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image))
{
//DQ엔진 인클루드 2005-03-22 석훈
//// 이 스킨에서 DQ 가 작동하기 위해서는 입력하는 이미지보다는 작게 설정해야 됨
include_once "$g4[path]/thumbEngine/dq_thumb_engine2.php";
$dqEngine['using_usm'] = 1;
// 1또는 0 사용, 썸네일 이미지에 언샵마스크 필터를 적용한다. (샤픈필터의 한 종류)
// GD2.0 이상, PHP 4.3.2 이외의 버전일때 기본값 1, 그외 상황에서는 기본값 0 자동선택
// 1로 지정 하더라도 GD2.0이 아니거나 PHP 4.3.2 환경이면 자동으로 0으로 재설정 된다.
$dqEngine['usm_option1'] = 30; // USM 필터의 amount(강도) 수치, 기본값 : 60
$dqEngine['usm_option2'] = 0.2; // USM 필터의 radius(반경) 수치, 기본값 : 0.5
$dqEngine['usm_option3'] = 0; // USM 필터의 threshold(제외픽셀) 수치, 기본값 : 1
// USM 필터의 세부 설정은 포토샵의 그것과 사용법이 동일합니다.
$dqEngine['thumb_resize'] = 0;
// 0, 1, 2 사용
// 0: 원본 비율 대칭 리사이즈, 1: 비율유지 안함(찌그러짐), 2: 원본비율 리사이즈 + Center Crop
$thumbsource="$g4[path]/data/file/$bo_table/" . $image;
$thumb_path ="$g4[path]/data/file/$bo_table/" . 'dq_thumb';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$thumbimg="$thumb_path/thumb_morningDQ1_E_" . $image;
make_thumb($thumb_width,$thumb_height,$thumbsource,$thumbimg);
@chmod($thumbimg, 0707);
$wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = str_replace("//##", "", $wr_content);
$wr_content = cut_str(get_text($wr_content), 140, '…');//본문 글 줄이는 함수
$latest_subject = cut_str($list[$i][subject], 25, '..');
}
else if (eregi("<img [^<>]*>", $list[$i]['wr_content'], $regs)) {
$tmp_str = $regs[0];
eregi("[^= \"']*\.(gif|jpg|png|bmp)", $tmp_str, $regs1); // images/xxx.gif 까지 추출
$tmp1_str = $regs1[0];
eregi("[^= '/]*\.(gif|jpg|png|bmp)", $tmp1_str, $regs2); // xxx.gif 까지 추출
$filename = $regs2[0]; // 파일명
$thumb_date = date("Ym", strtotime($list[$i]['wr_datetime']));
$date_url = substr($thumb_date,2,5);
$data_path = "{$g4['path']}/data/geditor/{$date_url}";
$editor_img = $data_path.'/'.$filename;
if (file_exists($editor_img)) {
preg_match("`<\s*img\s+src\s*=\s*['|\"]?([^'|\"\s]+://[^'|\"\s]+\.(gif|jpe?g|png))['|\"]?\s*[^>]+`i", $list[$i]['wr_content'], $images);
// 날짜별 폴더 지정
//DQ엔진 인클루드 2005-03-22 석훈
//// 이 스킨에서 DQ 가 작동하기 위해서는 입력하는 이미지보다는 작게 설정해야 됨
include_once "$g4[path]/thumbEngine/dq_thumb_engine2.php";
$dqEngine['using_usm'] = 1;
// 1또는 0 사용, 썸네일 이미지에 언샵마스크 필터를 적용한다. (샤픈필터의 한 종류)
// GD2.0 이상, PHP 4.3.2 이외의 버전일때 기본값 1, 그외 상황에서는 기본값 0 자동선택
// 1로 지정 하더라도 GD2.0이 아니거나 PHP 4.3.2 환경이면 자동으로 0으로 재설정 된다.
$dqEngine['usm_option1'] = 60; // USM 필터의 amount(강도) 수치, 기본값 : 60
$dqEngine['usm_option2'] = 0.5; // USM 필터의 radius(반경) 수치, 기본값 : 0.5
$dqEngine['usm_option3'] = 1; // USM 필터의 threshold(제외픽셀) 수치, 기본값 : 1
// USM 필터의 세부 설정은 포토샵의 그것과 사용법이 동일합니다.
$dqEngine['thumb_resize'] = 0;
// 0, 1, 2 사용
// 0: 원본 비율 대칭 리사이즈, 1: 비율유지 안함(찌그러짐), 2: 원본비율 리사이즈 + Center Crop
$thumbsource= $data_path.'/'.$filename;
$thumb_path = "$g4[path]/data/file/$bo_table/" . 'dq_thumb';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$thumbimg="$thumb_path/thumb_morningDQ_E_" . $filename;
make_thumb($thumb_width,$thumb_height,$thumbsource,$thumbimg);
@chmod($thumbimg, 0707);
$wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = str_replace("//##", "", $wr_content);
$wr_content = cut_str(get_text($wr_content), 140, '…');//본문 글 줄이는 함수
$latest_subject = cut_str($list[$i][subject], 25, '..');
}
}
else {
$wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = str_replace("//##", "", $wr_content);
$wr_content = cut_str(get_text($wr_content), 190, '…');//본문 글 줄이는 함수
$latest_subject = cut_str($list[$i][subject], 30, '..');
}
if ( file_exists($thumbimg) )
$img = $thumbimg;
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],10)."</span>"; //제목 글자수 자르기
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table width='100' cellpadding='0' cellspacing='0' border='0'>";
echo " <tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='100' height='85' border='0'></a></td></tr>";
echo " <tr><td height='21' align='center'><a href='{$list[$i]['href']}'>{$subject}</a></td></tr></table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
-------------------------------------입니다...
어떤 코드를 추가해야 이미지 간격을 맞출수 있나요???
오류 주소 : http://cjns.co.kr
위 주소로 가보시면 갤러리 형식 최근 게시물이 다닥다닥 붙어 있습니다...
저기 사이 간격을 줄려면 어떻게 해야하죠???
소스는------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 4; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 10; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<style type="text/css">
<!--
.data { font-family:돋움; font-size:8pt; color:#999999; }
-->
</style>
<table border="0" cellspacing="0" cellpadding="0">
<!-- 최신글 제목 -->
<tr><td>
</td></tr>
<tr><td height='10'></td></tr>
<tr>
<td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
//섬네일 관련 설정
$thumb_width= 100;//섬네일 최대폭
$thumb_height= 85;//섬네일 최대높이
// 파일 출력
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
if (preg_match("/\.(gif|jpg|png)$/i", $image))
{
//DQ엔진 인클루드 2005-03-22 석훈
//// 이 스킨에서 DQ 가 작동하기 위해서는 입력하는 이미지보다는 작게 설정해야 됨
include_once "$g4[path]/thumbEngine/dq_thumb_engine2.php";
$dqEngine['using_usm'] = 1;
// 1또는 0 사용, 썸네일 이미지에 언샵마스크 필터를 적용한다. (샤픈필터의 한 종류)
// GD2.0 이상, PHP 4.3.2 이외의 버전일때 기본값 1, 그외 상황에서는 기본값 0 자동선택
// 1로 지정 하더라도 GD2.0이 아니거나 PHP 4.3.2 환경이면 자동으로 0으로 재설정 된다.
$dqEngine['usm_option1'] = 30; // USM 필터의 amount(강도) 수치, 기본값 : 60
$dqEngine['usm_option2'] = 0.2; // USM 필터의 radius(반경) 수치, 기본값 : 0.5
$dqEngine['usm_option3'] = 0; // USM 필터의 threshold(제외픽셀) 수치, 기본값 : 1
// USM 필터의 세부 설정은 포토샵의 그것과 사용법이 동일합니다.
$dqEngine['thumb_resize'] = 0;
// 0, 1, 2 사용
// 0: 원본 비율 대칭 리사이즈, 1: 비율유지 안함(찌그러짐), 2: 원본비율 리사이즈 + Center Crop
$thumbsource="$g4[path]/data/file/$bo_table/" . $image;
$thumb_path ="$g4[path]/data/file/$bo_table/" . 'dq_thumb';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$thumbimg="$thumb_path/thumb_morningDQ1_E_" . $image;
make_thumb($thumb_width,$thumb_height,$thumbsource,$thumbimg);
@chmod($thumbimg, 0707);
$wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = str_replace("//##", "", $wr_content);
$wr_content = cut_str(get_text($wr_content), 140, '…');//본문 글 줄이는 함수
$latest_subject = cut_str($list[$i][subject], 25, '..');
}
else if (eregi("<img [^<>]*>", $list[$i]['wr_content'], $regs)) {
$tmp_str = $regs[0];
eregi("[^= \"']*\.(gif|jpg|png|bmp)", $tmp_str, $regs1); // images/xxx.gif 까지 추출
$tmp1_str = $regs1[0];
eregi("[^= '/]*\.(gif|jpg|png|bmp)", $tmp1_str, $regs2); // xxx.gif 까지 추출
$filename = $regs2[0]; // 파일명
$thumb_date = date("Ym", strtotime($list[$i]['wr_datetime']));
$date_url = substr($thumb_date,2,5);
$data_path = "{$g4['path']}/data/geditor/{$date_url}";
$editor_img = $data_path.'/'.$filename;
if (file_exists($editor_img)) {
preg_match("`<\s*img\s+src\s*=\s*['|\"]?([^'|\"\s]+://[^'|\"\s]+\.(gif|jpe?g|png))['|\"]?\s*[^>]+`i", $list[$i]['wr_content'], $images);
// 날짜별 폴더 지정
//DQ엔진 인클루드 2005-03-22 석훈
//// 이 스킨에서 DQ 가 작동하기 위해서는 입력하는 이미지보다는 작게 설정해야 됨
include_once "$g4[path]/thumbEngine/dq_thumb_engine2.php";
$dqEngine['using_usm'] = 1;
// 1또는 0 사용, 썸네일 이미지에 언샵마스크 필터를 적용한다. (샤픈필터의 한 종류)
// GD2.0 이상, PHP 4.3.2 이외의 버전일때 기본값 1, 그외 상황에서는 기본값 0 자동선택
// 1로 지정 하더라도 GD2.0이 아니거나 PHP 4.3.2 환경이면 자동으로 0으로 재설정 된다.
$dqEngine['usm_option1'] = 60; // USM 필터의 amount(강도) 수치, 기본값 : 60
$dqEngine['usm_option2'] = 0.5; // USM 필터의 radius(반경) 수치, 기본값 : 0.5
$dqEngine['usm_option3'] = 1; // USM 필터의 threshold(제외픽셀) 수치, 기본값 : 1
// USM 필터의 세부 설정은 포토샵의 그것과 사용법이 동일합니다.
$dqEngine['thumb_resize'] = 0;
// 0, 1, 2 사용
// 0: 원본 비율 대칭 리사이즈, 1: 비율유지 안함(찌그러짐), 2: 원본비율 리사이즈 + Center Crop
$thumbsource= $data_path.'/'.$filename;
$thumb_path = "$g4[path]/data/file/$bo_table/" . 'dq_thumb';
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$thumbimg="$thumb_path/thumb_morningDQ_E_" . $filename;
make_thumb($thumb_width,$thumb_height,$thumbsource,$thumbimg);
@chmod($thumbimg, 0707);
$wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = str_replace("//##", "", $wr_content);
$wr_content = cut_str(get_text($wr_content), 140, '…');//본문 글 줄이는 함수
$latest_subject = cut_str($list[$i][subject], 25, '..');
}
}
else {
$wr_content = preg_replace("/<(.*?)\>/","",$list[$i][wr_content]);
$wr_content = preg_replace("/ /","",$wr_content);
$wr_content = str_replace("//##", "", $wr_content);
$wr_content = cut_str(get_text($wr_content), 190, '…');//본문 글 줄이는 함수
$latest_subject = cut_str($list[$i][subject], 30, '..');
}
if ( file_exists($thumbimg) )
$img = $thumbimg;
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],10)."</span>"; //제목 글자수 자르기
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table width='100' cellpadding='0' cellspacing='0' border='0'>";
echo " <tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='100' height='85' border='0'></a></td></tr>";
echo " <tr><td height='21' align='center'><a href='{$list[$i]['href']}'>{$subject}</a></td></tr></table>";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
-------------------------------------입니다...
어떤 코드를 추가해야 이미지 간격을 맞출수 있나요???
댓글 전체

이미지 크기를 조금 더 줄이시면 될거 같네요.
$thumb_width= 100;//섬네일 최대폭
$thumb_height= 85;//섬네일 최대높이
$thumb_width= 100;//섬네일 최대폭
$thumb_height= 85;//섬네일 최대높이