글쓴 시간 list에서 표시될때요 !

· 2012-07-06 (금) 11:20:18 · 1676 · 12
혹시
페이스북 같이
글쓴 시간이

몇초전 / 5분전 / 어제

이런식으로 표시될수도 있을까요 ?
고수님들 부탁드려요 !!
|

댓글 12개

네 가능합니다.
잠시만요 소스 만들고 올께요~ ㅎ
스킨 파일중 list.skin.php 부분에서 for문 안쪽에 날짜표시 바로 전에 넣으심 되요!~

$sWriteTime = strtotime($list[$i][wr_datetime]);
$sNowTime = time();
$sTimeGap = $sNowTime - $sWriteTime;
$sWriteTime = "";

if($sTimeGap < 60*60)
$sWriteTime = round($sTimeGap/60)."분전";
else if($sTimeGap < 60*60*24)
$sWriteTime = floor($sTimeGap/(60*60))."시간 전";
else
$sWriteTime = floor($sTimeGap/(60*60*24))."일 전";

echo "<!-- {$sWriteTime} -->";
2012-07-06 (금) 12:49:37
감사합니다 :-) !!
2012-07-06 (금) 12:59:48
좋은답변 감사합니다 !! 근데 제가 적용하면 1341469315 이런식으로 뜨네요~~
날짜가 나와야 할 부분에 $sWriteTime 이것을 사용하시면 되실껀되요... ^^
2012-07-06 (금) 14:52:04
기본게시판이 아니라서 for문안쪽에 어디써야하는지...초보라서...ㅠ_ㅜ 잘알려주신것같은데 적용을 못해서 죄송해요ㅜ_ㅜ
소스가 없으면 상세하게 알려드리기 힘이 듭니다.
2012-07-06 (금) 13:10:57
적용소스를 안오리셨네요
2012-07-06 (금) 16:19:59
<!-- 게시판 리스트 시작 -->
<form name="fboardlist" method="post" action="" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">

<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr><td style="padding:10;">





<? for ($i=0; $i<count($list); $i++) { ?>

<table width='100%' cellpadding=0 cellspacing=0 border=0 >
<tr><td height="10" colspan='5'></td></tr>
<tr>
<td width="120" rowspan='3' align=center class="f_14px"><? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?> <?=$list[$i][name]?>
</td>

<td width=11 height=11><img src='<?=$board_skin_path?>/img/box_1.gif' width=11 height=11 border=0></td>
<td background='<?=$board_skin_path?>/img/box_2.gif'></td>
<td width=11><img src='<?=$board_skin_path?>/img/box_3.gif' width=11 height=11 border=0></td>

<td width="75" rowspan='3' align=center class="l10 f_11px"><span class="no">
<?=$list[$i][wr_datetime]?> 여기가 날짜가 나오는곳이 되겠네요 !! </span>


<? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
<p class="t5">
<a href="<?=$write_href?>&w=u&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>">수정</a>
<a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}" >삭제</a>
</p>
<? } ?>
</td>
</tr>
<!-- 게시판 리스트 시작 -->
<form name="fboardlist" method="post" action="" style="margin:0px;">
<input type="hidden" name="bo_table" value="<?=$bo_table?>">
<input type="hidden" name="sfl" value="<?=$sfl?>">
<input type="hidden" name="stx" value="<?=$stx?>">
<input type="hidden" name="spt" value="<?=$spt?>">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="sw" value="">

<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr><td style="padding:10;">





<? for ($i=0; $i<count($list); $i++) { ?>

<table width='100%' cellpadding=0 cellspacing=0 border=0 >
<tr><td height="10" colspan='5'></td></tr>
<tr>
<td width="120" rowspan='3' align=center class="f_14px"><? if ($is_checkbox) { ?><input type=checkbox name=chk_wr_id[] value="<?=$list[$i][wr_id]?>"><? } ?> <?=$list[$i][name]?>
</td>

<td width=11 height=11><img src='<?=$board_skin_path?>/img/box_1.gif' width=11 height=11 border=0></td>
<td background='<?=$board_skin_path?>/img/box_2.gif'></td>
<td width=11><img src='<?=$board_skin_path?>/img/box_3.gif' width=11 height=11 border=0></td>

<td width="75" rowspan='3' align=center class="l10 f_11px"><span class="no">
<?
$sWriteTime = strtotime($list[$i][wr_datetime]);
$sNowTime = time();
$sTimeGap = $sNowTime - $sWriteTime;
$sWriteTime = "";

if($sTimeGap < 60*60)
$sWriteTime = round($sTimeGap/60)."분전";
else if($sTimeGap < 60*60*24)
$sWriteTime = floor($sTimeGap/(60*60))."시간 전";
else
$sWriteTime = floor($sTimeGap/(60*60*24))."일 전";

echo $sWriteTime;
?></span>


<? if (($member[mb_id] && ($member[mb_id] == $list[$i][mb_id])) || $is_admin) { ?>
<p class="t5">
<a href="<?=$write_href?>&w=u&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>">수정</a>
<a href="javascript:if (confirm('삭제하시겠습니까?')) { location='./delete.php?w=d&bo_table=<?=$bo_table?>&wr_id=<?=$list[$i][wr_id]?>&page=<?=$page?>';}" >삭제</a>
</p>
<? } ?>
</td>
</tr>
2012-07-06 (금) 17:41:38
너무감사합니다 ㅠ,ㅜ 포인트 어케 드리는질 모르겠네요.. 있는거 다드려도 모자랄거같아요 ...
아 정말정말 감사합니다. 즐거운 금요일되세요!!
한달전까지는 표시 못하나요?
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
12-07-06 조회 873
12-07-06 조회 1,650
12-07-06 조회 1,393
12-07-06 조회 1,033
12-07-06 조회 1,720
12-07-06 조회 1,701
12-07-06 조회 869
12-07-06 조회 3,299
12-07-06 조회 885
12-07-06 조회 1,079
12-07-06 조회 816
12-07-06 조회 913
12-07-06 조회 824
12-07-06 조회 1,677
12-07-06 조회 827
12-07-06 조회 1,703
12-07-06 조회 929
12-07-06 조회 8,303
12-07-06 조회 827
12-07-06 조회 1,073