latest.skin.php 최신글 출력시 카테고리(분류) 별로 출력 하려면? 채택완료

안녕하세요

아래 최신글 소스 입니다. 

latest.skin.php 최신글 출력시  카테고리(분류) 별로 출력 하려면? 

이것을 이용해 카테고리(분류)​  별로 출력 하려면 어떻게 해야 하는지요?

[카테코리란 . 게시판 관리주에 분류를 말씀 드립니다.]

방법 설명 부탁드립니다.

 

감사합니다.

 

 

Copy
<?phpif (!defined("_GNUBOARD_"))    exit; // 개별 페이지 접근 불가/* * g4m gallery skin */ $list_count = count($list);?><div class="g4latest_gallery col-sm-6">    <div class="well well-sm">        <table class="table">            <tr>            <?php            for ($i = 0; $i < $list_count; $i++) {                //댓글수                $cmt_count = '';                if ($list[$i]['comment_cnt']) {                    $cmt_count = " <span class='lt_cmt'>{$list[$i]['comment_cnt']}</span>";                }                if($list[$i]['file']['0']['file'] && $list[$i]['file']['0']['image_type'] < 3){                    $img = get_thumb($board['bo_table'],$list[$i]['file']['0']['file'], 'list', 250, 200);                }else{                    $img = "<img src='{$latest_skin_path}/img/noimage.gif' width='100%' alt='no img'/>";                }                $td = round(100 / 3 , 1);            ?>               				<div class="row">            <div class="jumbotron"><a href='#' class="thumbnail">        	<div class="img"><?php echo $img?></div>            <div class="info">				<h2><?php echo cut_str($list[$i]['subject'], '21') ?> <?php echo $cmt_count ?></h2>				<h3>블랙박스 2CH , 네비게이션</h3>				<ul>            		<li><label>배기량</label> - CC</li>                	<li><label>연료</label> 휘발유</li>                	<li><label>차량가격</label> - 원</li>                	<li><label>승차인원</label> - 인승</li>            	</ul>            </div>          <!--  <p><a class="btn" href="<?php echo $g4['g4m_bbs_path'] ?>/board.php?bo_table=tips">Learn more &raquo;</a></p>-->           </div> </a>             <?php                if (($i + 1) % 1 == 0) {                    echo "</tr><tr>";                }            } ?>            </tr>        </table>        <?php if ($list_count == 0) { ?><p style="padding: 48px; text-align: center">게시물이 없습니다.</p><?php } ?>    </div></div>

답변 1개

채택된 답변
+20 포인트

음 일단 카테고리별 1개씩 출력하려면

즉 latest_caname("aaa","aaa",5,20,"카테고리이름");

뭐 이런식으로 카테고리를 지정해서 해당 카테고리만을 가져올때

function latest_caname($skin_dir='', $bo_table, $rows=10, $subject_len=40,$option="") 

뭐 이런식으로 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 = '$option' order by wr_num limit 0, {$rows} ";

이렇게 바꿔주면 해당카테고리의 글만을 뽑아 올 수가 있습니다

 

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고