<<<최근 게시물에 나오는 코멘트>>> > 그누4 질문답변

그누4 질문답변

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

<<<최근 게시물에 나오는 코멘트>>> 정보

<<<최근 게시물에 나오는 코멘트>>>

본문

최근 게시물에 코멘트가 뜨질 않았는데 이젠 잘 보여서 참 좋습니다.
그런데 코멘트가 달린 원글의 제목이 보였으면 더 좋겠습니다.
현재는 코멘트의 내용이 뜨고 있어서 원글이 무엇인지 클릭 하기 전에는 모르니,
코멘트가 달린 원글의 제목이 보이게 할 수 있는 방법을 알려 주세요.

참고 사이트: www.jayu.or.kr 의 왼쪽 상단 최근게시물과 my_new.php소스입니다

<?php
function get_new2($rowCnt, $maxStr)
{
global $g4, $gr_id, $config;

$maxRow = 100;

$exc = "('f_bbs','f_pic','f_vod')";
$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 = b.bo_table
and b.bo_table not in {$exc}
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;
 

  $s = "
    select wr_id,wr_is_comment, wr_subject,wr_content, wr_comment, wr_datetime,  wr_name
    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][bo_subject] = $row[bo_subject];
  if($list[$i][wr_is_comment] == "1"){
  $list[$i][subject] = cut_str(get_text($list[$i][wr_content]), $maxStr);
  }else{
  $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]);
            $list[$i][title] = addslashes(get_text($list[$i][wr_subject])." / ".$list[$i][wr_datetime]);
            $list[$i]['icon_new'] = "";
            if ($list[$i][wr_datetime] >= date("Y-m-d H:i ", $g4['server_time'] - (1 * 24 * 3600))){ // 3은 날짜
            $list[$i][icon_new] = "<img src='$g4[path]/skin/latest/basic/img/icon_new.gif' align='absmiddle'>";}
  $i++;

 }
 
 return $list;
}
function my_new2($rowCnt = 10, $maxStr = 20, $maxWidth = "100%") { global $g4; $list = get_new2($rowCnt, $maxStr); ?>
<table width="95%" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
    </table></td>
  </tr>
  <?php $n = count($list); for ($i = 0; $i < $n; $i++) { ?>
  <tr>
    <td colspan="4"><table width="95%">
      <tr>
        <td height="19"><nobr style='display:block; overflow:hidden; width:210;'> <span style="font-weight:normal;">

                <a href="<?php echo $list[$i][href]; ?>" title="<?php echo $list[$i][title]; ?>"> [<?php echo $list[$i][wr_name]; ?>]
<?=$list[$i][icon_new]?> <?php echo $list[$i][subject]; ?>
                <?php if ($list[$i][commentCnt]) { ?>
                <font color="tomato">(<?php echo $list[$i][commentCnt]; ?>)</font>
                <?php } ?>
<br>
                <?=$list[$i][datetime]?>
                </span> </a> </nobr> </td>
      </tr>
    </table></td>
  </tr>
  <?php } ?>
</table>
<?php } ?>
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로