날짜,시간 표시때문에 문제가 좀 있어서... 정보
날짜,시간 표시때문에 문제가 좀 있어서...본문
오늘 작성한 글도 날짜로 표시되게 하려고 이곳에서 본 팁으로
lib -> common.lib.php 의 301줄
// 당일인 경우 시간으로 표시함
//$list['datetime'] = substr($list['wr_datetime'],0,10); <-이줄 주석처리
$list['datetime2'] = $list['wr_datetime'];
if ($list['datetime'] == $g4['time_ymd'])
$list['datetime2'] = substr($list['datetime2'],11,5);
//$list['datetime'] = substr($list['wr_datetime'],0,10); <-이줄 주석처리
$list['datetime2'] = $list['wr_datetime'];
if ($list['datetime'] == $g4['time_ymd'])
$list['datetime2'] = substr($list['datetime2'],11,5);
이렇게 한뒤로 게시판에서 정상적으로 날짜로 출력되고있는데요..
최신글에서는 날짜가 표시가 안되는 문제가 생기고있어서요..
최신글에서 날짜표시부분을 어떻게 수정해야 날짜가 정상적으로 나올지 궁금합니다..
그리고 덧붙여서 게시판에서 글 작성했을시 날짜는 제대로 나오는데요
시간이 전부 00:00시로 나옵니다... 이건 또 무슨 문제일지요... -_-;;
제가 게시판 스킨을 수정하다가 잘못된 부분이 있는건지...
이것도 잘 모르겠습니다...ㅠㅠ 그래서 게시판 스킨소스도 같이 올려볼께요...
아시는분 답변 주시면 감사드리겠습니다..
항상 이곳에서 친절한 답변 얻어가서 정말 감사하게 생각하고있습니다..
덕분에 무사히 홈페이지도 오픈했구요...^^;; 암튼 또 한번 부탁드릴께요...(__)
최신글 스킨
<?
if (!defined("_GNUBOARD_")) exit; // °³º° ÆäÀÌÁö Á¢±Ù ºÒ°¡
?>
<table width="273" cellpadding="0" cellspacing="0" border="0">
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=1 align=left>
<table width=100% border="0" cellpadding="0" cellspacing="0">
<tr>
<td height=15><img src='<?=$latest_skin_path?>/img/latest_icon.png' align=absmiddle>
<?
//³¯Â¥Ç¥½Ã
$date1 = substr($list[$i][datetime],0,10); //³¯Â¥Ç¥½ÃÇü½Äº¯°æ
$date = explode("-", $date1);
$year = $date[0];
$month = $date[1];
$day = $date[2];
$latest_date = $month."/".$day."";
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:µ¸¿ò; font-size:9pt; LINE-HEIGHT: 0pt; color:#ffffff;'><strong>{$list[$i]['subject']} [{$latest_date}]</strong></font>";
else
echo "<font style='font-family:µ¸¿ò; font-size:9pt; LINE-HEIGHT: 0pt; color:#ffffff;'>{$list[$i]['subject']} [{$latest_date}]</font>";
echo "</a>";
?></td>
</tr>
<!-- <tr><td></td></tr> -->
</table></td>
</tr>
</div>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=1 align=center height=1> </td>
</tr><? } ?>
</table>
게시판 view스킨
<?
if (!defined("_GNUBOARD_")) exit;
$this_homepage = set_http($view[wr_homepage]);
?>
<link rel="stylesheet" href="<?=$board_skin_path?>/style.css" type="text/css">
if (!defined("_GNUBOARD_")) exit;
$this_homepage = set_http($view[wr_homepage]);
?>
<link rel="stylesheet" href="<?=$board_skin_path?>/style.css" type="text/css">
<table width="<?=$width?>" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="320" height="18">
<!-- 링크 버튼 -->
<? ob_start(); ?>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?></td>
</tr>
<tr>
<td><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="65" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td height="32" background="http://lusoj.x-y.net/images/boardd2.gif" class="title" align="center"><? if ($this_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?><?=$view[subject]?></td>
</tr>
<tr>
<td height="24">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="25" align="left"> 조회:<font class="tma8"><?=$view[wr_hit]?> 작성자:
<?=$view[name]?>
<font class="tma8">
<? if ($this_ip_view) { echo " ($ip)"; } ?>
</font> </font></td>
<td align="right">날짜: <font class="tma8">
<? if ($admin_href) {
echo substr($view[wr_datetime],2,14);
} else {
echo substr($view[wr_datetime],2,8);
}?>
</font> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="1" background="<?=$board_skin_path?>/img/dot_bg.gif"><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<?
// 첨부파일 (![view])
for ($i=0; $i<count($view[file]); $i++) {
if ($view[file][$i][source] && !$view[file][$i][view]) {
?>
<tr>
<td height="30" align="right"><img src="<?=$board_skin_path?>/img/disk.gif" width="14" height="13" align="absmiddle"> <a href="<?=$view[file][$i][href]?>" title="<?=$view[file][$i][content]?>"><font class="num3"><?=$view[file][$i][source]?> (<?=$view[file][$i][size]?>), Down:<?=$view[file][$i][download]?></font></a> </td>
</tr>
<? } } ?>
<tr>
<td width="320" height="18">
<!-- 링크 버튼 -->
<? ob_start(); ?>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?></td>
</tr>
<tr>
<td><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="65" align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td height="32" background="http://lusoj.x-y.net/images/boardd2.gif" class="title" align="center"><? if ($this_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?><?=$view[subject]?></td>
</tr>
<tr>
<td height="24">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="25" align="left"> 조회:<font class="tma8"><?=$view[wr_hit]?> 작성자:
<?=$view[name]?>
<font class="tma8">
<? if ($this_ip_view) { echo " ($ip)"; } ?>
</font> </font></td>
<td align="right">날짜: <font class="tma8">
<? if ($admin_href) {
echo substr($view[wr_datetime],2,14);
} else {
echo substr($view[wr_datetime],2,8);
}?>
</font> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="1" background="<?=$board_skin_path?>/img/dot_bg.gif"><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<?
// 첨부파일 (![view])
for ($i=0; $i<count($view[file]); $i++) {
if ($view[file][$i][source] && !$view[file][$i][view]) {
?>
<tr>
<td height="30" align="right"><img src="<?=$board_skin_path?>/img/disk.gif" width="14" height="13" align="absmiddle"> <a href="<?=$view[file][$i][href]?>" title="<?=$view[file][$i][content]?>"><font class="num3"><?=$view[file][$i][source]?> (<?=$view[file][$i][size]?>), Down:<?=$view[file][$i][download]?></font></a> </td>
</tr>
<? } } ?>
<?
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++) {
if ($view[link][$i]) {
$cnt++;
$link = cut_str($view[link][$i], 70);
?>
<tr>
<td height="30" align="right">링크#<?=$cnt?> <a href="<?=$view[link_href][$i]?>" target="_blank"><font class="num"><u><?=$link?></u> (<?=$view[link_hit][$i]?>)</font></a> </td>
</tr>
<? } } ?>
<tr>
<td height="18"><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="120" valign="top">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" STYLE="font-size:12px; text-align:left;line-height: 155%; margin: 0 0 0 5;">
<?
// 파일 출력([view])
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<br>";
}
?>
<?=$view[content];?><br>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="1" background="<?=$board_skin_path?>/img/dot_bg.gif"><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<tr>
<td>
<table width='100%' cellpadding=0 cellspacing=0>
<tr>
<td width=75% height=35>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
function clipboard_trackback(str) {
if (g4_is_gecko)
prompt("이 글의 고유주소입니다. Ctrl+C를 눌러 복사하세요.", str);
else if (g4_is_ie) {
window.clipboardData.setData("Text", str);
alert("트랙백 주소가 복사되었습니다.\n\n<?=$trackback_url?>");
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++) {
if ($view[link][$i]) {
$cnt++;
$link = cut_str($view[link][$i], 70);
?>
<tr>
<td height="30" align="right">링크#<?=$cnt?> <a href="<?=$view[link_href][$i]?>" target="_blank"><font class="num"><u><?=$link?></u> (<?=$view[link_hit][$i]?>)</font></a> </td>
</tr>
<? } } ?>
<tr>
<td height="18"><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="120" valign="top">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" STYLE="font-size:12px; text-align:left;line-height: 155%; margin: 0 0 0 5;">
<?
// 파일 출력([view])
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<br>";
}
?>
<?=$view[content];?><br>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="1" background="<?=$board_skin_path?>/img/dot_bg.gif"><img src="<?=$board_skin_path?>/img/t.gif" width="1" height="1"></td>
</tr>
<tr>
<td>
<table width='100%' cellpadding=0 cellspacing=0>
<tr>
<td width=75% height=35>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
function clipboard_trackback(str) {
if (g4_is_gecko)
prompt("이 글의 고유주소입니다. Ctrl+C를 눌러 복사하세요.", str);
else if (g4_is_ie) {
window.clipboardData.setData("Text", str);
alert("트랙백 주소가 복사되었습니다.\n\n<?=$trackback_url?>");
}
}
</script>
}
</script>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;
</script>
</script>
댓글 전체
최신글 스킨에서
$date1 = substr($list[$i][datetime],0,10);
이걸
$date1 = substr($list[$i][wr_datetime],0,10);
이렇게 고치삼
$date1 = substr($list[$i][datetime],0,10);
이걸
$date1 = substr($list[$i][wr_datetime],0,10);
이렇게 고치삼
아 감사합니다..^^ 잘 나오네요..
죄송하지만 00:00시로 나오는건 왜인지 아시나요??;;
이것도 해결해야할틴데..에궁..
죄송하지만 00:00시로 나오는건 왜인지 아시나요??;;
이것도 해결해야할틴데..에궁..
차라리 시간이 안나오는것도 좋은데... 어떻게해야할지 혹시 아실지요..(__)
2006-06-30 11:30:05
datetime형식은 이렇게 문자열 길이가 19개입니다.
substr($바꿀변수, 시작, 시작부터 몇번째까지의 글자); 의 함수를 활용하시면 됩니다.
substr($list[$i][wr_datetime],0,10); 하면 날짜만 나오게 됩니다. 2006-06-30
substr($바꿀문자,11,5); 즉 11:30 이란 문자를 리턴합니다.
이부분은 시간을 출력목적으로 만들어진 부분입니다. 수정하신 곳 자세히 보시면 이런 구문이 보일겁니다.
주석처리 해주시면 됩니다.
datetime형식은 이렇게 문자열 길이가 19개입니다.
substr($바꿀변수, 시작, 시작부터 몇번째까지의 글자); 의 함수를 활용하시면 됩니다.
substr($list[$i][wr_datetime],0,10); 하면 날짜만 나오게 됩니다. 2006-06-30
substr($바꿀문자,11,5); 즉 11:30 이란 문자를 리턴합니다.
이부분은 시간을 출력목적으로 만들어진 부분입니다. 수정하신 곳 자세히 보시면 이런 구문이 보일겁니다.
주석처리 해주시면 됩니다.
감사합니다... 해결했습니다..
두분다 채택 못해드려서 죄송합니다..ㅠㅠ
답변 정말 감사드립니다..(__)행복한 하루 보내세요..
두분다 채택 못해드려서 죄송합니다..ㅠㅠ
답변 정말 감사드립니다..(__)행복한 하루 보내세요..