헐랭이님의 나의 최신글에.. 날짜와 글쓴이를 표현하려면?? > 그누4 질문답변

그누4 질문답변

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

헐랭이님의 나의 최신글에.. 날짜와 글쓴이를 표현하려면?? 정보

헐랭이님의 나의 최신글에.. 날짜와 글쓴이를 표현하려면??

본문

그누로 사이트를 제작중에.. 계속 난관이네요..
그누 고수님들의 지도를 부탁드립니다.
 
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=44287&sca=%C3%D6%BD%C5%B1%DB&sfl=wr_subject%7C%7Cwr_content&stx=%B3%AA%C0%C7&sop=and
 
헐랭이님의 나의 최신글을 고치고 있는데...
 
이 소스에서 제목은 지금 잘 나옵니다..
 
그런데 날짜와 글쓴이를 출력해줘야 하는데..
 
<td width="100" align="center"><?=$list[$i][datetime2]?></td>
      <td width="200" align="center"><?=$list[$i][wr_5]?>~<?=$list[$i][wr_6]?></td>
   <td width="130" align="center"><?=$list[$i][wr_name]?></td>
   <td width="4"></td>
 
echo안에 위의 소스를 붙였는데...
 
도통 나타나질 않네요;;;
 
방법을 좀 알려주시기 바랍니다.
 
부탁드립니다.(__)
  • 복사

댓글 전체

원하는 필드값을 출력 시키기 위해선 아래의 코드 부분을 수정해야 합니다.


  $list = array();
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
    {
        if (!$row[bo_table])
        {
            continue;
        }
        $tmp_table = $g4[write_prefix].$row[bo_table];
        $sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
        $row2 = sql_fetch($sql2);
    $list[$i] = $row2;
        $subj = get_text($list[$i][wr_subject]);
        $subj = cut_str($subj, $subjc);
        $comment = "";
        if ($list[$i][wr_comment])
            $comment = "<span class=small>({$list[$i][wr_comment]})</span>";
        echo "<tr height=23><td class=bg_menu2 title='$subj'>";
        echo "<nobr style='display:block;overflow:hidden;width:160px;'>";
        echo "<img src='$new_my_skin_path/img/list_icon2.gif'>&nbsp;<a href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>";
        echo "<span style='color:#666666;'>$comment $subj</span></a>";
        echo "</nobr></td></tr>";
    }


위의 코드부분을 수정하는 방법을 알려 드리므로 참조 바랍니다.

1,

$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' "; <- 이라인에서 출력코자 하는 필드명을 아래처럼 추가 하거나

$sql2 = " select 필드1, 필드2, 필드3, wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";

또는 전체 필드값을 가져오도록 수정합니다.아래처럼 (이경우 부하가 조금 발생합니다.)

$sql2 = " select * from $tmp_table where wr_id = '$row[wr_parent]' ";


2,

위처럼 수정한후 출력코자 하는 필드값을 불러 냅니다.

$list[$i][출력할 필드명]
© SIRSOFT
현재 페이지 제일 처음으로