최신글 추출관련 문의 정보
최신글 추출관련 문의본문
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=131512&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%EC%9D%B4%EB%B2%A4%ED%8A%B8: 의 이벤트 게시판을 이용하고 있습니다.
그런데 위 게시판의 내용을 최신글로 추출 하고자 합니다.
<?
$wr_1 = strtotime($list[$i][wr_1]) + ($list[$i][wr_2] * 3600); // 시작날짜 + 시작시간 계산
$wr_3 = strtotime($list[$i][wr_3]) + ($list[$i][wr_4] * 3600); // 마감날짜 + 마감시간 계산
$wr_1_text = date("Y년 m월 d일", $wr_1);
$wr_3_text = date("Y년 m월 d일", $wr_3);
// 이벤트신청인원 체크
$wr_tmp = $list[$i][wr_id];
$sql_event_total = " select count(*) as cnt_total from g4_event_request where bo_table = '$bo_table' and wr_id = '$wr_tmp' ";
$row_event_total = sql_fetch($sql_event_total);
if($wr_1 < $current_time && $wr_3 > $current_time){ // 진행중 아이콘
if($list[$i][wr_5] == 0 ){ // 이벤트 진행중
$ico_state_img = "ico_state.png";
}else if( $row_event_total[cnt_total] >= $list[$i][wr_5] ){ // 이벤트 신청인원 마감
$ico_state_img = "ico_state_complete.png";
}else{
$ico_state_img = "ico_state.png"; // 이벤트 진행중
}
}else if($wr_3 < $current_time){ // 완료 아이콘
$ico_state_img = "ico_state_complete.png";
}else if($wr_1 > $current_time){ // 진행전 아이콘
$ico_state_img = "ico_state_before.png";
}
?>
<?
echo $nobr_begin;
echo "<li>제목 : <a href='{$list[$i][href]}'>{$list[$i][subject]}</a> ". $list[$i][icon_new] . "</li>";
echo "<li>기간 : $wr_1_text ~ $wr_3_text</li>";
echo "<li>진행상태 : <img src='{$board_skin_path}/img/{$ico_state_img}'></li>";
echo "<li><a href='{$list[$i][href]}'><img src='{$board_skin_path}/img/btn_event_view.gif'></a></li>";
echo $nobr_end;
?>
위 기간이 "1970년 01월 01일 ~ 1970년 01월 01일"로 추출되는데 사용해 보신분 답변 부탁 드립니다.
게시판의 리스트는 제대로 나오는데 메인 추출글에는 잘 않되서요
그런데 위 게시판의 내용을 최신글로 추출 하고자 합니다.
<?
$wr_1 = strtotime($list[$i][wr_1]) + ($list[$i][wr_2] * 3600); // 시작날짜 + 시작시간 계산
$wr_3 = strtotime($list[$i][wr_3]) + ($list[$i][wr_4] * 3600); // 마감날짜 + 마감시간 계산
$wr_1_text = date("Y년 m월 d일", $wr_1);
$wr_3_text = date("Y년 m월 d일", $wr_3);
// 이벤트신청인원 체크
$wr_tmp = $list[$i][wr_id];
$sql_event_total = " select count(*) as cnt_total from g4_event_request where bo_table = '$bo_table' and wr_id = '$wr_tmp' ";
$row_event_total = sql_fetch($sql_event_total);
if($wr_1 < $current_time && $wr_3 > $current_time){ // 진행중 아이콘
if($list[$i][wr_5] == 0 ){ // 이벤트 진행중
$ico_state_img = "ico_state.png";
}else if( $row_event_total[cnt_total] >= $list[$i][wr_5] ){ // 이벤트 신청인원 마감
$ico_state_img = "ico_state_complete.png";
}else{
$ico_state_img = "ico_state.png"; // 이벤트 진행중
}
}else if($wr_3 < $current_time){ // 완료 아이콘
$ico_state_img = "ico_state_complete.png";
}else if($wr_1 > $current_time){ // 진행전 아이콘
$ico_state_img = "ico_state_before.png";
}
?>
<?
echo $nobr_begin;
echo "<li>제목 : <a href='{$list[$i][href]}'>{$list[$i][subject]}</a> ". $list[$i][icon_new] . "</li>";
echo "<li>기간 : $wr_1_text ~ $wr_3_text</li>";
echo "<li>진행상태 : <img src='{$board_skin_path}/img/{$ico_state_img}'></li>";
echo "<li><a href='{$list[$i][href]}'><img src='{$board_skin_path}/img/btn_event_view.gif'></a></li>";
echo $nobr_end;
?>
위 기간이 "1970년 01월 01일 ~ 1970년 01월 01일"로 추출되는데 사용해 보신분 답변 부탁 드립니다.
게시판의 리스트는 제대로 나오는데 메인 추출글에는 잘 않되서요
댓글 전체
혹시...
for ($i=0; $i<count($list); $i++)
위 for문 안에 들어 있는거 맞으시죠??안될이유 없어 보이는데;;;
for ($i=0; $i<count($list); $i++)
위 for문 안에 들어 있는거 맞으시죠??안될이유 없어 보이는데;;;
네 for문 안에 있는데 않되네요^^;;
해결 했습니다.
IF문 안에
$wr_1 = strtotime($list[$i][wr_1]) + ($list[$i][wr_2] * 3600); // 시작날짜 + 시작시간 계산
$wr_3 = strtotime($list[$i][wr_3]) + ($list[$i][wr_4] * 3600); // 마감날짜 + 마감시간 계산
$wr_1_text = date("Y년 m월 d일", $wr_1);
$wr_3_text = date("Y년 m월 d일", $wr_3);
위 부분이 있어야 했는데 다른 곳에 있어 그렇게 되었군요
IF문 안에
$wr_1 = strtotime($list[$i][wr_1]) + ($list[$i][wr_2] * 3600); // 시작날짜 + 시작시간 계산
$wr_3 = strtotime($list[$i][wr_3]) + ($list[$i][wr_4] * 3600); // 마감날짜 + 마감시간 계산
$wr_1_text = date("Y년 m월 d일", $wr_1);
$wr_3_text = date("Y년 m월 d일", $wr_3);
위 부분이 있어야 했는데 다른 곳에 있어 그렇게 되었군요