최근게시글에 새글등록시 new아이콘을 출력하고 싶은데
최근게시물에 새글 등록시 new아이콘 출력소스가 있더군요
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=6403
에 보면 오달수님이 올려주신 게시글인데
적용을 해도 최근게시글에 new아이콘 출력이 안되거든요
++++++++++ 이하 소스입니다. ++++++++++++++
bbs/new.php 에 보시면 아래와 같은 구문이 2개 있습니다.
1-4 까지 추가하시면 됩니다.
// 당일인 경우 시간으로 표시함
$datetime = substr($row3[wr_datetime],0,10);
$datetime2 = $row3[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
//1,원글에 뉴 아이콘을 달려면 1줄 추가 합니다.
$list[$i][wr_date]=$row2[wr_datetime];
// 당일인 경우 시간으로 표시함
$datetime = substr($row3[wr_datetime],0,10);
$datetime2 = $row3[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
//2,코맨트에 뉴 아이콘을 달려면 마찬가지로 추가합니다.
$list[$i][wr_date]=$row3[wr_datetime];
그다음 skin/basic/new.skin.php 로 넘어가서
베이직 스킨을 쓴다면
<?
for ($i=0; $i<count($list); $i++)
{
/*
admin-게시판관리
new 이미지 글 입력후 new 이미지를 출력하는 시간 --> 48은 2일
1시간은 3600 하루는 3600*24
*/
//3, 3줄 추가합니다.
$list[$i][icon_new] = "";
if($list[$i][wr_date] >= date("Y-m-d H:i:s", $g4[server_time] -(3600*24*2)))
$list[$i][icon_new] = "<img src='$new_skin_path/img/today_new.gif' align='absmiddle'>";
//echo"{$list[$i][wr_date]}{$list[$i][icon_new]}";
.
.
.
(중략)
.
.
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a>
{$list[$i][icon_new]}
<!-- //4,마지막으로 위처럼 제목옆에 그림 써주죠.-->
$new_skin_path/img/today_new.gif 은 하나 만드셔서 저장을 하시든지
올려드린 빨강색 이미지를 쓰시던지.. 하십시요.
그러면
최근게시물에서도 new icon 이 나옵니다.
++++++++++++++ 이상 소스끝입니다. +++++++++++++++++++
어느 부분에 이상이 있어서 new아이콘 출력이 안되는지 제 실력으로는 해결이 안됩니다.
고수님들의 도움을 요청합니다.
최근게시물에 새글 등록시 new아이콘 출력소스가 있더군요
http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=6403
에 보면 오달수님이 올려주신 게시글인데
적용을 해도 최근게시글에 new아이콘 출력이 안되거든요
++++++++++ 이하 소스입니다. ++++++++++++++
bbs/new.php 에 보시면 아래와 같은 구문이 2개 있습니다.
1-4 까지 추가하시면 됩니다.
// 당일인 경우 시간으로 표시함
$datetime = substr($row3[wr_datetime],0,10);
$datetime2 = $row3[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
//1,원글에 뉴 아이콘을 달려면 1줄 추가 합니다.
$list[$i][wr_date]=$row2[wr_datetime];
// 당일인 경우 시간으로 표시함
$datetime = substr($row3[wr_datetime],0,10);
$datetime2 = $row3[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
//2,코맨트에 뉴 아이콘을 달려면 마찬가지로 추가합니다.
$list[$i][wr_date]=$row3[wr_datetime];
그다음 skin/basic/new.skin.php 로 넘어가서
베이직 스킨을 쓴다면
<?
for ($i=0; $i<count($list); $i++)
{
/*
admin-게시판관리
new 이미지 글 입력후 new 이미지를 출력하는 시간 --> 48은 2일
1시간은 3600 하루는 3600*24
*/
//3, 3줄 추가합니다.
$list[$i][icon_new] = "";
if($list[$i][wr_date] >= date("Y-m-d H:i:s", $g4[server_time] -(3600*24*2)))
$list[$i][icon_new] = "<img src='$new_skin_path/img/today_new.gif' align='absmiddle'>";
//echo"{$list[$i][wr_date]}{$list[$i][icon_new]}";
.
.
.
(중략)
.
.
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a>
{$list[$i][icon_new]}
<!-- //4,마지막으로 위처럼 제목옆에 그림 써주죠.-->
$new_skin_path/img/today_new.gif 은 하나 만드셔서 저장을 하시든지
올려드린 빨강색 이미지를 쓰시던지.. 하십시요.
그러면
최근게시물에서도 new icon 이 나옵니다.
++++++++++++++ 이상 소스끝입니다. +++++++++++++++++++
어느 부분에 이상이 있어서 new아이콘 출력이 안되는지 제 실력으로는 해결이 안됩니다.
고수님들의 도움을 요청합니다.
댓글 5개
이하 제가 수정한것입니다.
1.bbs/new.php
// 당일인 경우 시간으로 표시함
$datetime = substr($row2[wr_datetime],0,10);
$datetime2 = $row2[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][wr_date]=$row2[wr_datetime];
+++++++++++++
// 당일인 경우 시간으로 표시함
$datetime = substr($row3[wr_datetime],0,10);
$datetime2 = $row3[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][wr_date]=$row3[wr_datetime];
2.skin/basic/new.skin.php
//3, 3줄 추가합니다.
$list[$i][icon_new] = "";
if($list[$i][wr_date] >= date("Y-m-d H:i:s", $g4[server_time] -(3600*24*2)))
$list[$i][icon_new] = "<img src='$new_skin_path/img/icon_new.gif' align='absmiddle'>";
//echo"{$list[$i][wr_date]}{$list[$i][icon_new]}";
$gr_subject = cut_str($list[$i][gr_subject], 10);
$bo_subject = cut_str($list[$i][bo_subject], 20);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 100));
echo <<<HEREDOC
<tr>
<td align="center" height='30' colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a> {$list[$i][icon_new]}</td>
<td></td>
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
이하 생략....
++++++++++++++
진단 부탁드립니다...';;
1.bbs/new.php
// 당일인 경우 시간으로 표시함
$datetime = substr($row2[wr_datetime],0,10);
$datetime2 = $row2[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][wr_date]=$row2[wr_datetime];
+++++++++++++
// 당일인 경우 시간으로 표시함
$datetime = substr($row3[wr_datetime],0,10);
$datetime2 = $row3[wr_datetime];
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][wr_date]=$row3[wr_datetime];
2.skin/basic/new.skin.php
//3, 3줄 추가합니다.
$list[$i][icon_new] = "";
if($list[$i][wr_date] >= date("Y-m-d H:i:s", $g4[server_time] -(3600*24*2)))
$list[$i][icon_new] = "<img src='$new_skin_path/img/icon_new.gif' align='absmiddle'>";
//echo"{$list[$i][wr_date]}{$list[$i][icon_new]}";
$gr_subject = cut_str($list[$i][gr_subject], 10);
$bo_subject = cut_str($list[$i][bo_subject], 20);
$wr_subject = get_text(cut_str($list[$i][wr_subject], 100));
echo <<<HEREDOC
<tr>
<td align="center" height='30' colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a> {$list[$i][icon_new]}</td>
<td></td>
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
이하 생략....
++++++++++++++
진단 부탁드립니다...';;
게시글 목록
| 번호 | 제목 |
|---|---|
| 284348 | |
| 284336 | |
| 284333 | |
| 284332 | |
| 284320 | |
| 284318 | |
| 284316 | |
| 284313 | |
| 284307 | |
| 284306 | |
| 284303 | |
| 284298 | |
| 284296 | |
| 284290 | |
| 284286 | |
| 284280 | |
| 284277 | |
| 284272 | |
| 284261 | |
| 284259 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기