겔러리 최근 게시물 소스인데요...이미지를 2줄로 나오게 하고 싶어요... > 그누4 질문답변

그누4 질문답변

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

겔러리 최근 게시물 소스인데요...이미지를 2줄로 나오게 하고 싶어요... 정보

겔러리 최근 게시물 소스인데요...이미지를 2줄로 나오게 하고 싶어요...

본문

latest.skin.php 의 소스입니다.
겔러리 최신글 불러오기 소스인데...현재 구조는 1줄에 두개를 부르도록 되어있거던요,
근데, 저는 이것을 2줄로 3개씩 총 6개를 불러 들이고 싶은데...소스를 어떻게 고쳐야 할지를 모르겠어요...
 
참고로, 이것은 보짱님의 ver05 스킨 파일입니다....^^
고수님의 도움 부탁드려요...^^
 
이왕이면, 가로 세로 갯수를 메인에 불러들일때 지정할수 있으면 더 좋겠구요.
 
 
<?
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="#177300"><?=$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="#f3fff4">

<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='110' height='100' 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>
 
 

댓글 전체

// latest.skin.php ############################################
// 아래코드를 latest.skin.php 에 넣고 사용해보세요.  적용방법은 아래쪽에 언급되어있습니다.

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

/*
사용방법
<?=latest("happy_utf8_gallery2",  "테이블명",  전체갯수,  가로폭, "세로폭, row, 제목길이" );?>
<?=latest("happy_utf8_gallery2",  "test",  6,  100, "80, 2, 15" );?>
row를 2로 설정할 경우 6개를 2줄로 나눠서 한줄에 3개씩 보이게 됩니다.
*/

list($height, $row_cnt, $cut_len) = explode(",", $options);
$all_cnt = 0;
?>

<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width='230' cellpadding='0' cellspacing='0' border='0' align='left'>
<? /* ?>
  <tr>
    <td><table width='100%' border='0' cellspacing='0' cellpadding='0'>
      <tr>
        <td style="padding:3 0 3 3;"><strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
        <td align="right" style="padding:0 3 0 0;"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
      </tr>
      <tr>
        <td colspan=2 height=2 bgcolor='#cccccc'></td>
      </tr>
    </table></td>
  </tr>
<? */ ?>
  <tr>
    <td align='center'><table width='95%'>
    <? for ($k=0; $k<$row_cnt; $k++ ) { ?>
      <tr>
      <?
        for ($i=0; $i<count($list)/$row_cnt; $i++)  {
          if ($i > 0)
            echo '<td width=20>&nbsp;</td>';
          $title = get_text($list[$all_cnt][wr_subject]);
          $content = cut_str(get_text($list[$all_cnt][wr_content]), 80);
          $img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
          if (!file_exists($img) || !$list[$all_cnt][file][0][file])
            $img = "$latest_skin_path/img/no_image.gif";
            $href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
           
            $stitle = cut_str($list[$all_cnt][subject],$cut_len,"...");
             
            echo <<<HEREDOC
              <td width='<?=$subject_len?>' valign='top' align='center'><table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
                <tr>
                  <td width='<?=$subject_len?>' height='5' align='center'></td>
                </tr>
                <tr>
                  <td width='<?=$subject_len?>' height='<?=$height?>' style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #CCCCCC;padding:3px' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a></td>
                </tr>
                <tr>
                  <td width='<?=$subject_len?>' height='5' align='center'></td>
                </tr>
                <tr>
                  <td width='<?=$subject_len?>' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$stitle}</a></td>
                </tr>
              </table></td>
HEREDOC;
          $all_cnt++;
        }
      ?>
      </tr>
    <? } ?>

    <? if (count($list) == 0) { ?>
      <tr>
        <td colspan=2 align='center' height=25>게시물이 없습니다.</td>
      </tr>
    <? } ?>
    </table></td>
  </tr>
</table>
감사합니다..그런데 위 소스 내용중
<? /* ?>
  <tr>
    <td><table width='100%' border='0' cellspacing='0' cellpadding='0'>
      <tr>
        <td style="padding:3 0 3 3;"><strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
        <td align="right" style="padding:0 3 0 0;"><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
      </tr>
      <tr>
        <td colspan=2 height=2 bgcolor='#cccccc'></td>
      </tr>
    </table></td>
  </tr>
<? */ ?>
이부분은 주석으로 처리된건가요? 그럼 없어도 되는 부분?
삽입방법에서요...  최신게시물 스킨이름 혹시 잘못적으신것은 아닌가 싶은데요..
홈페이지 주소 알려주시면 확인해봐드릴께요...

위 주석된부분은  타이틀 보여주는 코드인데요.. 없어도 됩니다.
실제 사용되는 최신게시물 스킨인데.. 오류가 난다고 하니.. 이상하네요. 까우뚱...
이거 스킨 이름만 변경하면 다른 스킨에서도 사용가능 한건가요? 전 다음과 같이 에러메시지가 뜹니다.

Parse error: syntax error, unexpected T_SL, expecting ',' or ';' in /home/javast/html/skin/latest/photo/latest.skin.php on line 50

그래서 아직 썸네일 이미지는 추출못하고, 갤러리 게시글 제목만 추출해서 보여주고만 있네요.-_-;;;
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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