최근갤러리에서 썸네일 불러오려면? > 그누4 질문답변

그누4 질문답변

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

최근갤러리에서 썸네일 불러오려면? 정보

최근갤러리에서 썸네일 불러오려면?

본문

보짱님의 최근갤러리 ver5입니다.
이 스킨에서 썸네일을 불러오도록 수정해 주십시오.
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<table width=100% cellpadding=0 cellspacing=0 style="table-layout: fixed;">
<tr height="35"><td width="15" background='<?=$latest_skin_path?>/img/tb01.gif'></td>
<td background='<?=$latest_skin_path?>/img/tb02.gif'>
<img src="<?=$latest_skin_path?>/img/icon_title.gif" align="absmiddle">
<b><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font style="font-size:10pt;"color="#00629b"><?=$board[bo_subject]?></a></b>
</td>
<td width="15" background='<?=$latest_skin_path?>/img/tb03.gif'></td></tr>
<tr><td width="15" background='<?=$latest_skin_path?>/img/tb04.gif'></td>
<td bgcolor="#f3f8ff">

<table width=100% cellpadding=0 cellspacing=0 style="table-layout: fixed;">
<tr>
    <td align=center>
  <table width=98% border=0>
        <tr>
<?
for ($i=0; $i<count($list); $i++)
{
    if ($i > 0)
        echo '<td width=20> </td>';
     $title = get_text($list[$i][wr_subject]);
    $content = cut_str(get_text($list[$i][wr_content]), 80);
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
    echo <<<HEREDOC
    <td width='110' valign='top' align='center'>
        <table width='110' border='0' cellpadding='0' cellspacing='0' align='center'>
 <tr>
            <td width='110' height='5' align='center'></td>
 </tr>
        <tr>
            <td width='110' height='100' align='center'>
  <div style='width:110px;height:100px;border:1px solid #CCCCCC;padding:3px' align='center'>
  <a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'><img src='{$img}' width='120' height='90' border='0' align='absmiddle' title='$title'></a>
  </div>
     </td>
        </tr>
 <tr>
            <td width='110' height='5' align='center'></td>
 </tr>
 <tr>
            <td width='110' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$i][wr_id]}'>{$list[$i][subject]}</a></td>
 </tr>
 </table>
    </td>
HEREDOC;
}
?> 
</tr></table>

<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
 
</td>
<td width="15" background='<?=$latest_skin_path?>/img/tb05.gif'></td></tr>

<tr height="15"><td width="15" background='<?=$latest_skin_path?>/img/tb06.gif'></td>
<td background='<?=$latest_skin_path?>/img/tb07.gif'></td>
<td width="15" background='<?=$latest_skin_path?>/img/tb08.gif'></td></tr>
</table>
 
 

댓글 전체

최근 게시물에서 썸네일을 만드실건가요?
아님 게시판에서 이미 썸네일이 만들어져 있는걸 불러오실건가요?

이미 관련 최근 게시물이 스킨란에 많습니다.
썸네일 등으로 검색해보세요.
스킨란을 찾아보시고 이미지 불러오는 부분 소스를 비교해보시면 차이점을 어느정도 인지 하실 수 있으실 겁니다.
직접 적용해보시고 잘안되시면 질문해보세요.

작성하신 글은 질문보다는 의뢰에 가깝게 느껴집니다.
'이 스킨에서 썸네일을 불러오도록 수정해 주십시오.' 라고 하시니.. ^^;
질문과 의뢰는 확연히 다릅니다.
$img 부분을 찾아서 바꿔보기를 몇 번 했는데
자꾸만 에러가 나니까 두 손 들었습니다.
게시판에서 이미 썸네일이 만들어져 있습니다.
치에님 말씀대로 다시 해보겠습니다.
이미 만들어진 썸네일을 불러오시는거라면..
list.skin.php 파일에 보시면 게시판에서 생성하는 썸네일의 경로 및 파일명이 있습니다.

이부분을 $img = " 경로 및 파일명" 으로 적으시면 될 듯합니다.
썸네일 경로와 썸네일 이미지 지정까지 했는데
스킨에서는 경로까지만 나와 이미지가 표시되지 않네요.

$thumb_path = $data_path.'/thumb120';
$thumb = $thumb_path.'/'.$list[$i][wr_id];

    if (file_exists($thumb))
    $img = "<img src='$thumb' border=0>";

이게 썸네일 경로와 이미지 지정하는 것이라 생각되고


<'{$img}' width='120' height='90' border='0' align='absmiddle' title='$title'>

이것이 썸네일 이미지 불러오는 명령이라고 생각되는데

왜 안 될까요?
그대로 쓰셨을때..
$thumb_path = $data_path.'/thumb120';  이부분에서..
$data_path 의 경로가 없습니다. 이부분까지 복사해 오셔야 합니다.
아마도 이것은 list.skin.php 파일에..
$data_path = $g4[path]."/data/file/".$bo_table";
이런식으로 정의되어 있을 겁니다.

또한 아래쪽에..
    $img = "<img src='$thumb' border=0>"; 라고 $img를 정의하셨는데..
이것을 아래 소스에 그대로 적용하면..

적용된 부분을 소스보기하시면..
<'<img src='$thumb' border=0>' width='120' height='90' border='0' align='absmiddle' title='$title'>
이런 식으로 나올겁니다.


그러므로..
$thumb_path = $data_path.'/thumb120';
$img = $thumb_path.'/'.$list[$i][wr_id];
이런식으로 위에 적어놓으신 최근게시물 소스처럼 작성하세요.

아래이미지 보이는 부분역시 최근 게시물에 쓰인대로 적용하시면 됩니다.
아.. 설명이 막 이상하긴한데...
다시 정리해서..

<?
for ($i=0; $i<count($list); $i++)
{
    if ($i > 0)
        echo '<td width=20>&nbsp;</td>';
    $title = get_text($list[$i][wr_subject]);
    $content = cut_str(get_text($list[$i][wr_content]), 80);
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
    if (!file_exists($img) || !$list[$i][file][0][file])
        $img = "$latest_skin_path/img/no_image.gif";
    $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";


이부분 중에...
    $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
이것을...
    $img = $g4[path]."/data/file/".$bo_table."/thumb120/".$list[$i][wr_id];
이렇게만 바꿔주세요...;;
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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