최근게시물에서 썸네일 생성할경루 이미지 고정.. > 그누4 질문답변

그누4 질문답변

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

최근게시물에서 썸네일 생성할경루 이미지 고정.. 정보

최근게시물에서 썸네일 생성할경루 이미지 고정..

본문

최근게시물에서 썸네일이 보이게 될경우

가로세로 크기가 다를경우 이미지가 다르게 보이는데..

이미지를 고정시켜버리는 방법이 없나요?

$thumb_width=120;//섬네일 최대폭

이것 같은데..1번게시물하고 2번 게시물하고 가로세로 비율이 다르면

메인화면 디자인상 둘쑥날쑥 보이게 되어서요..

PHP 를 몰라 삽집을 계속 하는데..잘 안되네요?

고수님들의 조언 부탁드립니다..^^



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

for ($i=0; $i<count($list); $i++) {
$date = explode("-", $list[$i][date]);
$month = $date[1];
$day = $date[2];
$latest_date = $month."/".$day;
//섬네일 관련 설정
$thumb_width=120;//섬네일 최대폭
$thumb_height=120;//섬네일 최대높이
$image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
    if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
if(!is_file('$g4[path]/data/file/$bo_table/thumb_$image')){
include "$g4[path]/thumbEngine/dq_thumb_engine2.php";
$thumbsource="$g4[path]/data/file/$bo_table/" . $image;
$thumbimg="$g4[path]/data/file/$bo_table/thumb_" . $image;
make_thumb($thumb_width,$thumb_height,$thumbsource,$thumbimg);
chmod($thumbimg, 0606);
}
}
for ($i=0; $i<count($list); $i++) {
if($list[$i][comment_cnt]) {
$comment_cnt ="<a href=\"javascript:{$list[$i][comment_href]}\">{$list[$i][comment_cnt]}</a>";
}

if ($i==0) { //// 첫번째 글 (이미지 + 제목 + 쪽글)
if(!$list[$i][file][0][file]){
$image_file = "no-image.gif";
$image_url ="{$latest_skin_path}/img";
}else{
$image_file = "thumb_".$image;
$image_url = "$g4[path]/data/file/$bo_table";
}
$wr_content = "<a href='{$list[$i][href]}'>".Shorten_String(strip_tags($list[$i][wr_content]), 140, '......')."</a>";//본문 글 줄이는 함수
//$wr_content=get_text($wr_content);

echo <<<HEREDOC



<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td height="36" background="{$latest_skin_path}/img/c.gif" bgcolor="#CCCCCC"> <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr bgcolor="#FFFFFF">
          <td><img src="{$latest_skin_path}/img/titleicon.gif"  align="absmiddle"><font color="#666666">&nbsp;<strong><a href='{$g4[bbs_path]}/board.php?bo_table={$bo_table}'>
<font style='font-family:굴림; font-size:9pt; color:#696969;'><strong>{$board[bo_subject]}</strong></font></a></strong></font></td>
          <td width="36" align="right" valign="bottom">
 
  <a href='{$g4[bbs_path]}/board.php?bo_table={$bo_table}'>
  <img src="{$latest_skin_path}/img/more.gif" width="36" height="5" border="0">
  </a>
  </td>
       


</tr>
      </table>
     
    </td>
  </tr>
</table>







<TABLE WIDTH="100%"  BORDER="0" ALIGN="CENTER" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD ALIGN="CENTER" VALIGN="TOP"><TABLE WIDTH="100%"  BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR>
    <TD HEIGHT="8" COLSPAN="3"></TD>
    </TR>
    <TR>
    <TD WIDTH="8" VALIGN="TOP"></TD>
    <TD><a href="{$list[$i][href]}"><img src="$image_url/$image_file" hspace="0" VSPACE="0" border="0"></a></TD>
   
    </TR>
    <TR>
    <TD WIDTH="8" HEIGHT="8"></TD>
   
    </TR>
    </TABLE></TD>
<TD WIDTH="100%" ALIGN="LEFT" VALIGN="TOP"><TABLE WIDTH='100%'  BORDER='0' CELLSPACING='0' CELLPADDING='2'>
<TR>
<TD VALIGN="MIDDLE"><a href="{$list[$i][href]}" STYLE="font-family:굴림;font-size:12px;font-weight:bold;">{$list[$i][subject]}</a>{$list[$i][comment_cnt]} {$list[$i][icon_new]}
</TD>
</TR>

<TR>
<TD HEIGHT=1 BACKGROUND=" "
style="background-repeat:no-repeat;"></TD>
</TR>


<TR>
<TD VALIGN="TOP"><P STYLE="font-size:11px; text-align:left;line-height: 165%; margin: 0 5;} "> <a href="{$list[$i][href]}">$wr_content</a></P></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>
HEREDOC;




} else {//// 세번째 글 이후 (제목만)
echo <<<HEREDOC
<TABLE WIDTH="100%"  BORDER="0" CELLSPACING="3" CELLPADDING="0">
<TR>
<TD VALIGN="BOTTOM">

<img src="{$latest_skin_path}/img/dasom_bull_gold.gif" border="0">

<a href="{$list[$i][href]}" > {$list[$i][subject]} </a> {$list[$i][icon_new]}{$list[$i][comment_cnt]}</TD>
</TR>
<TR>
<TD colspan="2" BACKGROUND="{$latest_skin_path}/img/line_shadow01.gif"><IMG SRC="{$latest_skin_path}/img/line_shadow01.gif"></TD>
</TR>
</TABLE>

HEREDOC;
}

}
if (count($list) == 0) {
echo <<<HEREDOC
<TABLE WIDTH="100%"  BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD ALIGN="LEFT" VALIGN="TOP" height="25">
자료가 없습니다.
</TD>
</TR>
</TABLE>
HEREDOC;
}

} ?>

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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