게시판의 원하는 분류한개만 이미지와 제목을 최신글로 뽑아놓은 스킨없나요>? > 그누4 질문답변

그누4 질문답변

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

게시판의 원하는 분류한개만 이미지와 제목을 최신글로 뽑아놓은 스킨없나요>? 정보

게시판의 원하는 분류한개만 이미지와 제목을 최신글로 뽑아놓은 스킨없나요>?

본문

 
게시판의 원하는 분류한개만 이미지와 제목을 최신글로 뽑아놓은 스킨없나요>?  
 
알려주세요 ^^
  • 복사

댓글 전체

하나의 게시판에서 이미지와 제목을 최신글로 뽑아놓은 스킨을 찾거나 만드신후..
조회 쿼리 조건에 다음 내용을 추가해보세요.

and ca_name = '원하는분류명'
<?
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

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

<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='left'>
<tr><td align='center'>

<table width='100%' border='0' cellspacing='0' cellpadding='0' align='left'>
  <tr>
      <td width='226'>&nbsp;<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></td>
        <!--
      <td width='49'><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='#DDDDDD'></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?>' align='center'>
<div 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>
</div>
    </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>

원하는 스킨인데 어디에 어떻게 넣어야 하는지좀 알려주세요 ^^;;
위의 스킨은 화면을 처리하는것이고.
위의 스킨으로 화면을 처리하기전에 데이타를 가져오는 latest() 함수가 있습니다.
latest() 기본 함수는 lib/latest.lib.php에 정의 되어있으며 기본으로 사용하는것이므로 이놈을 수정할겨우 모든 최신글이 바뀝니다.
lib/latest.lib.php를  extend 디렉토리로 이동하시고
extend/latest.lib.php에서 상단에 latest() 라는 부분은 latest_new()라고 변경하십시오.

그리고 최신글 호출하는부분은 latest()로 하지 말고 latest_new()를 사용하시고.
extend/latest.lib.php 에서 다음 부분을 수정하십시오.

수정전
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
수정후
$sql = " select * from $tmp_write_table where wr_is_comment = 0  and ca_name = '분류명' order by wr_num limit 0, $rows ";
© SIRSOFT
현재 페이지 제일 처음으로