최신글 리스트에 안보이게 하기 > 그누4 질문답변

그누4 질문답변

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

최신글 리스트에 안보이게 하기 정보

최신글 리스트에 안보이게 하기

본문

게시판 리스트에 아래와 같이 있다고 했을 때

<!-- 목록 -->
...생략
<? for ($i=0; $i<count($list); $i++) { ?>
<?
$today = date("Ymd");  //오늘
$start = date("Ymd", strtotime($list[$i][wr_3])); //시작일
$end = date("Ymd", strtotime($list[$i][wr_4])); //종료일
?>

 <td width='250' align='left' style="color:#888;">if ($end >= $today) { echo"실행"; } else { echo"종료"; } if ($start > $today) { echo"대기"; } ?>
....중간생략
    </td>
    <td width=90 align=center style="color:#888;"><?=date("y-m-d", strtotime($list[$i][wr_3]))?></td>
    <td width=90 align=center style="color:#888;"><?=date("y-m-d", strtotime($list[$i][wr_4]))?></td>
 ...생략
<? if (count($list) == 0) { echo "<tr><td colspan='$colspan' height=100 align=center>게시물이 없습니다.</td></tr>"; } ?>
</table>
</form>


시작일 : <?=date("y-m-d", strtotime($list[$i][wr_3]))?>
종료일 : <?=date("y-m-d", strtotime($list[$i][wr_4]))?>
위와 같이 설정해서 글 작성하면 리스트에 해당날짜는 정상적이면 "실행" 아니면 "종료" 또는 "실행대기" 이렇게 보여집니다.

그럼 리스트에 "종료" 또는 "실행대기" 이렇게 나오면 최신글에는 보이지 않고 게시물 리스트에 "실행" 이렇게 나온것만 최신글에 보여주고자 합니다.

아래최신글에 넣었으면 합니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_skin_latest&wr_id=15304&sca=&sfl=wr_subject&stx=%B9%E8%B3%CA&sop=and

고수님 좀....

이것때문에 이틀이나...
  • 복사

댓글 전체

wr_3. wr_4에 날짜가 어떤 형태로 들어가는지 모르겠으나
년월일(2010-10-21) 형태로 날짜를 넣으면 리스트에서도 start = date(....) 이런 변환이 필요없을텐데요
위와 같이 날짜가 저장되었다면 최신글 함수 lib/latest.lib.php 를 수정하세요
원본
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";

수정
if($options=='ABC') $sch_qry=" and wr_3<='$g4[time_ymd]' and wr_4>='$g4[time_ymd]' ";
$sql = " select * from $tmp_write_table where wr_is_comment = 0 $sch_qry order by wr_num limit 0, $rows ";

마지막 인수에 옵션값을 넣어서 호출하세요
<?=latest(...................,'ABC');?>
© SIRSOFT
현재 페이지 제일 처음으로