날짜표기형식에 대해서 정보
날짜표기형식에 대해서본문
<?
//$rows = "10"; // 자료가 숫자보다 작으면 안됩니다. - 숫자변경은 10이상 5의 배수로 하세요
$sql = " select *
from {$g4[write_prefix]}{$bo_table}
where wr_comment >= 0
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
$i = 0;$j = 0;
while($row = mysql_fetch_array($result)) {
$list[i] = $row;
$list[i][subject]=stripslashes(cut_str($row[wr_subject], 30)); //제목 글자수자르기
if($row[wr_datetime] >= date("Y-m-d H:i:s", time() - 24 * 3600)) {//새글표시---제목색상변경
$subject = "{$list[i][subject]} {$list[$i][icon_new]}";
} else {
$subject = "{$list[i][subject]}"; //새글이 아닐경우 그냥 나타남
}
$date1 = substr($list[$i][datetime],0,10); //날짜표시형식변경
$date = explode("-", $date1);
$year = $date[0];
$month = $date[1];
$day = $date[2];
$latest_date = $month."월".$day."일";
if($i==0) {
echo "scroll_content[".$j."]=\"";
}
echo "<font color=#ff6633>[$latest_date]</font><a href='$g4[bbs_path]/board.php?bo_table=$board[bo_table]&wr_id=$row[wr_id]'> {$subject}</a>{$icon_new}<br>";
$i++;
if($i==1) {
echo "\";\n\t";
$i = 0; $j++;
}
}
?>
//-->
</script>
이렇게 할 경우 게시물 올린 날짜가 해당게시물을 올린날짜로 표기가 되어져야 하는데
최근에 올린 게시물 날짜로 전부 출력이 되네요
예로
2월 1일날 올린 게시물이 2월3일날 올린 날짜로 전체다 출력이 됩니다.
ㅠㅠ
//$rows = "10"; // 자료가 숫자보다 작으면 안됩니다. - 숫자변경은 10이상 5의 배수로 하세요
$sql = " select *
from {$g4[write_prefix]}{$bo_table}
where wr_comment >= 0
order by wr_id desc limit 0, $rows ";
$result = sql_query($sql);
$i = 0;$j = 0;
while($row = mysql_fetch_array($result)) {
$list[i] = $row;
$list[i][subject]=stripslashes(cut_str($row[wr_subject], 30)); //제목 글자수자르기
if($row[wr_datetime] >= date("Y-m-d H:i:s", time() - 24 * 3600)) {//새글표시---제목색상변경
$subject = "{$list[i][subject]} {$list[$i][icon_new]}";
} else {
$subject = "{$list[i][subject]}"; //새글이 아닐경우 그냥 나타남
}
$date1 = substr($list[$i][datetime],0,10); //날짜표시형식변경
$date = explode("-", $date1);
$year = $date[0];
$month = $date[1];
$day = $date[2];
$latest_date = $month."월".$day."일";
if($i==0) {
echo "scroll_content[".$j."]=\"";
}
echo "<font color=#ff6633>[$latest_date]</font><a href='$g4[bbs_path]/board.php?bo_table=$board[bo_table]&wr_id=$row[wr_id]'> {$subject}</a>{$icon_new}<br>";
$i++;
if($i==1) {
echo "\";\n\t";
$i = 0; $j++;
}
}
?>
//-->
</script>
이렇게 할 경우 게시물 올린 날짜가 해당게시물을 올린날짜로 표기가 되어져야 하는데
최근에 올린 게시물 날짜로 전부 출력이 되네요
예로
2월 1일날 올린 게시물이 2월3일날 올린 날짜로 전체다 출력이 됩니다.
ㅠㅠ
댓글 전체
$date1 = substr($list[$i][datetime],0,10); //날짜표시형식변경
위의 부분을 아래처럼 바꾸어 주면 될 것 같네요
$date1 = substr($row[wr_datetime],0,10); //날짜표시형식변경
위의 부분을 아래처럼 바꾸어 주면 될 것 같네요
$date1 = substr($row[wr_datetime],0,10); //날짜표시형식변경