메인페이지 최신글 중복 출력되네요ㅠㅠ

메인페이지 최신글 중복 출력되네요ㅠㅠ

QA

메인페이지 최신글 중복 출력되네요ㅠㅠ

본문

http://www.epohang.net/ 

메인페이지 최신글 세개가 하나만 출력 되어야 하는데 6개가 출력되네요. 도대체 어디를 손봐야 할까요. ㅠㅠ

 

이 질문에 댓글 쓰기 :

답변 4

답변감사합니다.제가 어려워서 이해를 못했습니다

 

현재최신글 코딩은 이렇습니다.

 

<!-- 최신글 시작 { -->
<?php
//  최신글
# 그룹 기준
$gr_where_sql =  "a.bo_device <> 'mobile' ";
$gr_where_sql .= "and a.bo_list_level <= '{$member['mb_level']}' "; # 회원레벨에 따른 출력제한
// $gr_where_sql .= "and a.bo_order != '0' "; # 게시판 출력순서 0  제외
$gr_where_sql .= "and a.bo_use_search != '0' "; # 검색 미사용 제외
$gr_where_sql .= "and b.gr_id not in ('admin','03','05') "; # 그룹 제외 '05', '06'...
$gr_where_sql .= "and a.bo_table not in ('notice') "; #  테이블 제외 'notice', 'tbname'
$gr_order .= " b.gr_order, "; # 그룹 출력순서에 따른 정렬 우선
$sql = " select bo_table from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)  where $gr_where_sql order by $gr_order a.bo_order ";

// 테이블 기준
/*
$tb_where_sql =  "bo_device <> 'mobile' ";
$tb_where_sql .= "and bo_list_level <= '{$member['mb_level']}' "; # 회원레벨에 따른 출력제한
$tb_where_sql .= "and bo_order != '0' "; # 게시판 출력순서 0 출력 제외
$tb_where_sql .= "and bo_table not in ('notice') "; # 제외 테이블  'notice', 'tbname'
$sql = " select bo_table, bo_subject from {$g5[board_table]} where $tb_where_sql order by bo_order ";
*/
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
    if ($i%2==1) $lt_style = "margin-left:20px";
    else $lt_style = "";
?>
<table width="900" border="0" align="center">
  <tr>
    <th><?php echo latest("basic", "002", 5, 30); ?></th>
    <th><?php echo latest("basic", "000", 5, 30); ?></th>
    <th><?php echo latest("basic", "005", 5, 30); ?></th>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
</table>
<?php
}
?>
<!-- } 최신글 끝 -->​

 

어렵네요 ㅠㅠ

    <th><?php echo latest("basic", "002", 5, 30); ?></th>

    <th><?php echo latest("basic", "000", 5, 30); ?></th>
    <th><?php echo latest("basic", "005", 5, 30); ?></th>

002, 000, 005 이렇게 최신글 불러올 게시판을 지정하실 것이므로..

아래 부분은 필요가 없습니다. 지워주시면 됩니다.

 

<?php

//  최신글
# 그룹 기준 
$gr_where_sql =  "a.bo_device <> 'mobile' "; 
$gr_where_sql .= "and a.bo_list_level <= '{$member['mb_level']}' "; # 회원레벨에 따른 출력제한 
// $gr_where_sql .= "and a.bo_order != '0' "; # 게시판 출력순서 0  제외 
$gr_where_sql .= "and a.bo_use_search != '0' "; # 검색 미사용 제외 
$gr_where_sql .= "and b.gr_id not in ('admin','03','05') "; # 그룹 제외 '05', '06'... 
$gr_where_sql .= "and a.bo_table not in ('notice') "; #  테이블 제외 'notice', 'tbname' 
$gr_order .= " b.gr_order, "; # 그룹 출력순서에 따른 정렬 우선 
$sql = " select bo_table from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)  where $gr_where_sql order by $gr_order a.bo_order ";

// 테이블 기준 
/* 
$tb_where_sql =  "bo_device <> 'mobile' "; 
$tb_where_sql .= "and bo_list_level <= '{$member['mb_level']}' "; # 회원레벨에 따른 출력제한 
$tb_where_sql .= "and bo_order != '0' "; # 게시판 출력순서 0 출력 제외 
$tb_where_sql .= "and bo_table not in ('notice') "; # 제외 테이블  'notice', 'tbname' 
$sql = " select bo_table, bo_subject from {$g5[board_table]} where $tb_where_sql order by bo_order "; 
*/ 
$result = sql_query($sql); 
for ($i=0; $row=sql_fetch_array($result); $i++) { 
    if ($i%2==1) $lt_style = "margin-left:20px"; 
    else $lt_style = "";  

?> 

 

젤 아래의 아래 코드도 지워주시구요.

<?php

}

?>

답변을 작성하시기 전에 로그인 해주세요.
전체 59,635
QA 내용 검색

회원로그인

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