최신코멘트 new 표시를 좀더 길게하려면.. 정보
최신코멘트 new 표시를 좀더 길게하려면..
본문
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=84959
위스킨을 사용중인데요..^^
new 표시를 좀더 길게 하려면(1주일정도..) 어느 부분을 어떻게 고쳐야할까요??^^;;;
이것저것 조금씩 손보느라 정신이없네요.. 쌩초보라 더더욱;;
편안한밤 되세요~
/////////////////
*my_new.php
////////////////
<?php
/*
사용 예) <?php echo my_new(20, 40, "120px");
*/
function get_new($rowCnt, $maxStr)
{
global $g4, $gr_id, $config;
$maxRow = 100;
$s = "
select
a.*, b.bo_subject, c.gr_subject, c.gr_id
from
$g4[board_new_table] a,
$g4[board_table] b,
$g4[group_table] c
where
a.bo_table<>'memo' and a.bo_table<>'story' and a.bo_table = b.bo_table and b.gr_id = c.gr_id and b.bo_use_search = '1'
order by a.bn_id desc
limit $maxRow
";
$i = 0;
$res = mysql_query($s);
while ($row = mysql_fetch_array($res))
{
if ($i >= $rowCnt) break;
if ($row[wr_id] == $row[wr_parent]) // 원글이라면
{
$s = "
select wr_id, wr_subject, wr_comment, wr_datetime
from $g4[write_prefix]$row[bo_table]
where wr_id = '$row[wr_id]'
";
$list[$i] = mysql_fetch_array(mysql_query($s));
$list[$i][commentCnt] = $list[$i][wr_comment];
$list[$i][subject] = cut_str(get_text($list[$i][wr_subject]), $maxStr);
$list[$i][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id={$list[$i][wr_id]}";
$list[$i][title] = addslashes(get_text($list[$i][wr_subject])." / ".$list[$i][wr_datetime]);
$i++;
}
}
return $list;
}
function my_new($rowCnt = 10, $maxStr = 20, $maxWidth = "100%") { global $g4; $list = get_new($rowCnt, $maxStr); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="DDDDDD">
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="4" bgcolor="F5F5F5">
<tr>
<td valign="top" bgcolor="FFFFFF" style="padding:0px">
<table width=100% cellpadding=0 cellspacing=0>
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor=#F5F5F5>
<td width="10"></td>
<td height="23"><strong><a href="<?=$g4['bbs_path']?>/new.php">최근 게시물</a></strong></td>
<td width="5"></td>
</tr>
<tr>
<td colspan=4 height="1" bgcolor=#ececec></td>
</tr>
</table>
</td></tr>
<?php $n = count($list); for ($i = 0; $i < $n; $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=19>
<nobr style='display:block; overflow:hidden; width:160;'>
<span style="font-weight:normal;">
<!-- 코멘트 수 -->
<?php if ($list[$i][commentCnt]) { ?>
<font color="tomato">(<?php echo $list[$i][commentCnt]; ?>)</font>
<?php } ?>
<!-- // 코멘트 수 -->
<!-- 제목 -->
<a href="<?php echo $list[$i][href]; ?>" title="<?php echo $list[$i][title]; ?>">
<?php echo $list[$i][subject]; ?>
<!-- // 제목 -->
</span>
</a>
</nobr>
</td></tr>
</table></td>
</tr>
<?php } ?>
</table>
</td></tr>
</table>
</td></tr>
</table>
<table width="100%" cellpadding=0 cellspacing=0>
<tr><td height=5></td></tr>
</table>
<?php } ?>
댓글 전체
// 최근 코멘트 추출
function newcomment($title="New Comment", $skin_dir="basic", $rows=10, $subject_len=40, $options="")
내용 중에
if ($row['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($board['bo_new'] * 3600)))
$comment[$num]['icon_new'] = "<img src='$comment_skin_path/img/icon_new.gif' align='absmiddle'>";
가 있는데
결국 게시판 설정에 보면
"new 이미지" 항목이 있습니다. 이걸 조정해 보세요.