최근글 new아이콘이 안나와요...

최근글 new아이콘이 안나와요...

QA

최근글 new아이콘이 안나와요...

본문

wr_3에 입력되있는 db만 추출하는 최근글 게시판인데요,,,
new아이콘이 나오게하려는데 잘 안되네요...

어떻게 고쳐야할지 알려주실 분 계신가요?

 


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$list=array();
$sql=" select * from g5_write_$bo_table where wr_3!='' order by wr_datetime desc limit $rows";
$res = sql_query($sql);
 
for ($i=0; $row = sql_fetch_array($res); $i++) {
    $list[$i]=$row;
    $list[$i]['subject']=cut_str($row['wr_subject'],$board['bo_subject_len'],"...");
    $list[$i]['href']=G5_BBS_URL."/board.php?bo_table=$bo_table&wr_id={$list[$i]['wr_id']}";
    $list[$i]['icon_new']='';
    if ($board['bo_new'] && $list['wr_datetime'] >= date("Y-m-d H:i:s", G5_SERVER_TIME - ($board['bo_new'] * 3600)));
    
    
    if($list[$i]['wr_3']){
        $list[$i]['wr_datetime'] = $list[$i]['wr_3'];
        $list[$i]['datetime'] = substr($list[$i]['wr_3'],0,10);
        if ($list[$i]['datetime'] == G5_TIME_YMD)
            $list[$i]['datetime2'] = substr($list[$i]['wr_datetime'],11,5);
        else
            $list[$i]['datetime2'] = substr($list[$i]['wr_datetime'],5,5);
    }
}

?>
    <div class="ntc_box">
        <!--div class="ntc_hd">
            <div class="ntc_title"><div></div><?php echo $bo_subject; ?></div>
            <div class="ntc_more">
                <a class="la_more" href='<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>' title="<?php echo $bo_subject; ?> 전체 보기 ">+</a>
            </div>
        </div-->
        
        <ul class="ntc_list">
        <?php for ($i=0; $i<count($list); $i++) {  ?>
            <li>
                <?php
                    echo "<a href=\"".$list[$i]['href']."\" title=\"".$list[$i]['wr_subject']." 게시글 바로가기\">";
                //if ($list[$i]['is_notice'])
                    //echo "<span class='tooltip-top' title=' 공지사항 '><i class='fa fa-microphone' title='notice/공지사항'></i> ".$list[$i]['subject']."</span>";
                    //elsed
                    echo "<div class='ntc_sbj'>".$list[$i]['subject']."</div>";
if ($list[$i]['icon_new']) {
                    $new_cmt = sql_fetch("select wr_datetime from {$write_table} where wr_num = '{$list[$i]['wr_num']}' and wr_is_comment = 1 order by wr_id desc limit 1 ");
                    if ($new_cmt['wr_datetime'] >= date("Y-m-d H:i:s", G5_SERVER_TIME - (24 * 3600)))
                        echo "<span class=\"new_icon\">NEW<span class=\"sound_only\">새글</span></span>";
                }
                //if ($list[$i]['icon_new']) echo "<span class=\"new_icon\">NEW<span class=\"sound_only\">새글</span></span>";
                    echo "<div class='ntc_time'>".$list[$i]['datetime2']."</div>";
                echo "</a>";
                
    
               
                 ?>
            </li>
        <?php }  ?>
        <?php if (count($list) == 0) { //게시물이 없을 때  ?>
        <li>게시물이 없습니다.</li>
        <?php }  ?>
        </ul>
    </div>

이 질문에 댓글 쓰기 :

답변 2

$new_cmt['wr_datetime'] >= date("Y-m-d H:i:s", G5_SERVER_TIME - (24 * 3600)

위 부분을 비교해서 처리해 주는듯 한데 위 데이터가 제대로 비교 하고 있는지 체크해 보셔야 할듯 합니다.

new 아이콘은  g5_board_new 테이블에 근거해서 표시됩니다.

여기에 남아있는 게시글이 아니면 표시되지 않습니다.

new 테이블은 환경설정 > 최근게시글삭제 에 지정된 시간이 지나면 자동 삭제됩니다.

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

회원로그인

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