코멘트관련.. 약간만 고쳐주시면 돼요 부탁드립니당 > 그누4 질문답변

그누4 질문답변

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

코멘트관련.. 약간만 고쳐주시면 돼요 부탁드립니당 정보

코멘트관련.. 약간만 고쳐주시면 돼요 부탁드립니당

본문

목록에서 코멘트 갯수 불러오는 코드가 {$list[$i][wr_comment]} 잖아요.
갯수 옆에 가장 최근 댓글작성자 닉네임까지 뽑아내려고요.
[15:최고관리자] <- 이런식으로.

<?
$tbl = "{$g4[write_prefix]}{$bo_table}";
$sql = " select *
from $tbl where wr_parent ='{$list[$i][wr_id]}' and wr_is_comment = '1'
order by wr_datetime desc";
$result = sql_query($sql);
for ($c = 0; $row = mysql_fetch_array($result); $c++) {
echo "<b>$row[wr_name]</b>";
if($c == '0')
break;
}
?>

위 소스가 최근 댓글작성자 닉네임을 불러오는 소스인데요.
이게 너무 길어서 제목 옆에 넣으면 복잡해지니까..

list.skin 파일에서
{$list[$i][wr_comment]} 이 함수 안에 최근댓글작성자 닉네임을 불러오는 소스를 포함시켜서 상단에서 정리를 하고
중간쯤 제목 옆에 {$list[$i][wr_comment]} 이것만 넣어도 [15:최고관리자] 이런식으로 출력이 되게끔 수정해주시면 감사하겠습니다.

댓글 전체

<?
$tbl = "{$g4[write_prefix]}{$bo_table}";
$sql = " select *
from $tbl where wr_parent ='{$list[$i][wr_id]}' and wr_is_comment = '1'
order by wr_datetime desc";
$result = sql_query($sql);
for ($c = 0; $row = mysql_fetch_array($result); $c++) {

// 넥네임 땡겨오기
$sql_nick = "select mb_name, mb_nick from g4_member where mb_id = '$row[mb_id]'";
$nick = sql_fetch($sql_nick);

echo "<b>$nick[mb_name]</b>"."$nick[mb_nick]";
if($c == '0')
break;
}
?>

이렇게 해보세요
$sql_nick = "select mb_name, mb_nick from g4_member where mb_id = '{$row[mb_id]}'";
$nick = sql_fetch($sql_nick);

echo "<b>{$nick[mb_name]}</b>".$nick[mb_nick];

이렇게 해보세여
아래처럼 해보세요..
                  if ($list[$i][wr_comment]>0) {                       
                      $tbl = "{$g4[write_prefix]}{$bo_table}";
                      $sql = " select * from $tbl where wr_parent ='{$list[$i][wr_id]}' and wr_is_comment = '1' order by wr_datetime desc";
                      $result = sql_query($sql);

                      $row = mysql_fetch_array($result);
                      $sql_nick = "select mb_name, mb_nick from g4_member where mb_id = '$row[mb_id]'";
                      $nick = sql_fetch($sql_nick);
                      echo "{$list[$i]['subject']}({$list[$i][wr_comment]}:$nick[mb_nick])";
                  }else{
                      echo "{$list[$i]['subject']}";
                  }
아 그런데 이렇게 출력을 하면 댓글 새창띄우기는 못하는건가요? ㅠㅠ

배추베이직인데요. 어디에 넣어야 하는지 한번 봐주세요.

        // 제목스타일
        if ($mw_basic[cf_subject_style])
            $style .= " style='font-family:{$list[$i][wr_subject_font]}; color:{$list[$i][wr_subject_color]}'";

        echo "<span{$style}>{$list[$i][subject]}</span></a>";

        if ($list[$i][comment_cnt])
            //echo " <span class=mw_basic_list_comment_count>{$list[$i][comment_cnt]}</span>";
            //echo " <a href=\"{$list[$i][comment_href]}\" class=mw_basic_list_comment_count>{$list[$i][comment_cnt]}</a>";
            echo " <a href=\"{$list[$i][comment_href]}\" class=mw_basic_list_comment_count>+{$list[$i][wr_comment]}</a>";
전체 26 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT